diff --git a/packages/genodelabs/depot-targets.nix b/packages/genodelabs/depot-targets.nix index e4ddcdc..9e9f6d6 100644 --- a/packages/genodelabs/depot-targets.nix +++ b/packages/genodelabs/depot-targets.nix @@ -127,7 +127,11 @@ in { vfs_ttf.portInputs = [ libc stb ]; virtdev_rom = { }; - virtio_nic_drv = { }; + + virtio_nic_drv = { + patches = [ ./virtio_net.patch ]; + postInstall = "mv $out/bin/virtio_*_nic $out/bin/$pname"; + }; wifi_drv.portInputs = [ dde_linux libc openssl ]; diff --git a/packages/genodelabs/virtio_net.patch b/packages/genodelabs/virtio_net.patch new file mode 100644 index 0000000..6c5987b --- /dev/null +++ b/packages/genodelabs/virtio_net.patch @@ -0,0 +1,28 @@ +From 9ed1198edd840a1bae24411e86e3ef0e6cab9340 Mon Sep 17 00:00:00 2001 +From: Emery Hemingway +Date: Tue, 10 Nov 2020 14:21:12 +0100 +Subject: [PATCH] drivers/nic/virtio/pci: log error before exit + +--- + repos/os/src/drivers/nic/virtio/pci_device.cc | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/repos/os/src/drivers/nic/virtio/pci_device.cc b/repos/os/src/drivers/nic/virtio/pci_device.cc +index abef1ca5ea..56d2bf6c92 100644 +--- a/repos/os/src/drivers/nic/virtio/pci_device.cc ++++ b/repos/os/src/drivers/nic/virtio/pci_device.cc +@@ -50,7 +50,10 @@ struct Virtio_pci_nic::Main + log("--- VirtIO PCI driver started ---"); + env.parent().announce(env.ep().manage(root)); + } +- catch (...) { env.parent().exit(-1); } ++ catch (Device_not_found) { ++ error("device not found"); ++ env.parent().exit(-1); ++ } + }; + + +-- +2.28.0 +