From 294ea175065bd8f42056094c2f2c2d5b538d8f18 Mon Sep 17 00:00:00 2001 From: Peter Hjalmarsson Date: Wed, 19 Jan 2011 23:49:24 +0100 Subject: [PATCH] Use devtpmfs when avaible --- defaults/initrd.scripts | 9 +++++++-- defaults/linuxrc | 2 ++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/defaults/initrd.scripts b/defaults/initrd.scripts index cfe3abd..034696b 100755 --- a/defaults/initrd.scripts +++ b/defaults/initrd.scripts @@ -307,8 +307,13 @@ run_shell() { } runmdev() { - # busybox udev replacement - mdev -s + # Use devtmpfs if enabled in kernel, + # else busybox udev replacement + if grep -qs devtmpfs /proc/filesystems ; then + mount -t devtmpfs devtmpfs /dev + else + mdev -s + fi } test_success() { diff --git a/defaults/linuxrc b/defaults/linuxrc index ecfb546..bbe397e 100755 --- a/defaults/linuxrc +++ b/defaults/linuxrc @@ -724,6 +724,8 @@ fi cd "${CHROOT}" mkdir "${CHROOT}/proc" "${CHROOT}/sys" 2>/dev/null echo -ne "${BOLD}.${NORMAL}" +# If devtmpfs is mounted assume genkernel mounted it at /dev and try unmounting it +grep -qs devtmpfs /proc/mounts && ( umount /dev || echo '*: Failed to unmount the devtmpfs /dev!' ) umount /sys || echo '*: Failed to unmount the ramdisk /sys!' umount /proc || echo '*: Failed to unmount the ramdisk /proc!' echo -e "${BOLD}.${NORMAL}"