[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Minios-devel] [UNIKRAFT PATCH 3/5] lib/ukboot: devfs automount option



Re-introduce mounting devfs to `/dev` automatically during boot.

Signed-off-by: Simon Kuenzer <simon.kuenzer@xxxxxxxxx>
---
 lib/ukboot/Config.uk |  6 ++++++
 lib/ukboot/boot.c    | 10 ++++++++++
 2 files changed, 16 insertions(+)

diff --git a/lib/ukboot/Config.uk b/lib/ukboot/Config.uk
index 6f86c7de..8420aae9 100644
--- a/lib/ukboot/Config.uk
+++ b/lib/ukboot/Config.uk
@@ -26,4 +26,10 @@ if LIBUKBOOT
        bool "Mount ramfs to /"
        default n
        select LIBRAMFS
+
+       config LIBUKBOOT_DEVFS
+       bool "Mount devfs to /dev"
+       default n
+       depends on LIBUKBOOT_VFSROOT
+       select LIBDEVFS
 endif
diff --git a/lib/ukboot/boot.c b/lib/ukboot/boot.c
index 15954205..5157bbbd 100644
--- a/lib/ukboot/boot.c
+++ b/lib/ukboot/boot.c
@@ -113,6 +113,16 @@ static void main_thread_func(void *arg)
         * found as initrd to '/'
         */
 
+#ifdef CONFIG_LIBUKBOOT_DEVFS
+       uk_pr_info("Mount '/dev'...\n");
+       ret =  mkdir("/dev", S_IRWXU);
+       if (ret != 0)
+               UK_CRASH("Failed to create directory '/dev'\n");
+
+       ret = mount("", "/dev", "devfs", 0, NULL);
+       if (ret != 0)
+               UK_CRASH("Failed to mount devfs to '/dev'\n");
+#endif /* CONFIG_LIBUKBOOT_DEVFS */
 #endif /* CONFIG_LIBUKBOOT_VFSROOT */
 
        /*
-- 
2.20.1


_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.