[arch-projects] [mkinitcpio] [PATCH] default_mount_handler: Only try to manually create the root device if devtmpfs is not used.

Thomas Bächler thomas at archlinux.org
Tue Jun 7 14:38:30 EDT 2011


---
 init           |    2 ++
 init_functions |    2 +-
 2 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/init b/init
index a1398b6..a5e6103 100644
--- a/init
+++ b/init
@@ -8,8 +8,10 @@
 /bin/mount -t sysfs sys /sys -o nosuid,noexec,nodev
 if grep -q devtmpfs /proc/filesystems 2>/dev/null; then
   /bin/mount -n -t devtmpfs udev /dev -o mode=0755,size=10M,nosuid
+  devtmpfs_mounted=1
 else
   /bin/mount -n -t tmpfs udev /dev -o mode=0755,size=10M,nosuid
+  devtmpfs_mounted=0
   # We don't have devtmpfs, so add the most important standard devices
   /bin/mknod /dev/null c 1 3
   /bin/mknod /dev/zero c 1 5
diff --git a/init_functions b/init_functions
index a94f525..ef938b4 100644
--- a/init_functions
+++ b/init_functions
@@ -86,7 +86,7 @@ default_mount_handler() {
         msg "Root device '${root}' doesn't exist. Attempting to create it."
         major=""
         minor=""
-        if [ ${root:0:5} = "/dev/" ]; then
+        if [ ${devtmpfs_mounted} -eq 0 -a ${root:0:5} = "/dev/" ]; then
             # It might be a block device (/dev/sda) -> /sys/class/block/sda/dev
             if [ -e /sys/class/block/${root:5}/dev ]; then
                 IFS=':' read major minor < "/sys/class/block/${root:5}/dev"
-- 
1.7.5.4



More information about the arch-projects mailing list