summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Bächler <thomas@archlinux.org>2010-06-03 13:38:31 +0200
committerThomas Bächler <thomas@archlinux.org>2010-06-03 13:38:31 +0200
commit3bb6c683094490e88883b20b5c6cffc17df165e7 (patch)
tree452079196891fd634d36a34ec18c92c751a130e9
parent64c0a72e9fc0a83d4313f37e09b2fa5390f2d28d (diff)
downloadmkinitcpio-3bb6c683094490e88883b20b5c6cffc17df165e7.tar.gz
mkinitcpio-3bb6c683094490e88883b20b5c6cffc17df165e7.tar.xz
Mount tmpfs or (if supported) devtmpfs on /dev, move it into the real root before switch_root
-rw-r--r--init6
1 files changed, 6 insertions, 0 deletions
diff --git a/init b/init
index e543477..e58a587 100644
--- a/init
+++ b/init
@@ -7,6 +7,11 @@
msg ":: Loading Initramfs"
/bin/mount -t proc proc /proc
/bin/mount -t sysfs sys /sys
+if grep -q devtmpfs /proc/filesystems 2>/dev/null; then
+ /bin/mount -n -t devtmpfs udev /dev -o mode=0755,size=10M,nosuid
+else
+ /bin/mount -n -t tmpfs udev /dev -o mode=0755,size=10M,nosuid
+fi
read CMDLINE </proc/cmdline
export CMDLINE
@@ -143,4 +148,5 @@ fi
mount --move /proc /new_root/proc
mount --move /sys /new_root/sys
+mount --move /dev /new_root/dev
exec /sbin/switch_root -c /dev/console /new_root ${init} "$@"