aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hjalmarsson <xake@rymdraket.net>2011-02-07 16:02:41 +0100
committerSebastian Pipping <sebastian@pipping.org>2011-02-07 19:44:43 +0100
commit398d7ba5acf5ca5d3c9777aff108b3897649822c (patch)
treeb91bc7a17924a294d2a4261be61f2b741d2002bd
parentExtend change log (diff)
downloadgenkernel-398d7ba5acf5ca5d3c9777aff108b3897649822c.tar.gz
genkernel-398d7ba5acf5ca5d3c9777aff108b3897649822c.tar.bz2
genkernel-398d7ba5acf5ca5d3c9777aff108b3897649822c.zip
Use tmpfs if devtmpfs is not available
This makes the ramdisk always mount some kind of /dev, and then try to move it to the new root. This unbreaks handling of nodes created pre-udev likefor example lvm does.
-rwxr-xr-xdefaults/initrd.scripts12
-rwxr-xr-xdefaults/linuxrc4
2 files changed, 9 insertions, 7 deletions
diff --git a/defaults/initrd.scripts b/defaults/initrd.scripts
index ee269188..1fda57d2 100755
--- a/defaults/initrd.scripts
+++ b/defaults/initrd.scripts
@@ -308,13 +308,15 @@ run_shell() {
runmdev() {
# Use devtmpfs if enabled in kernel,
- # else busybox udev replacement
+ # else tmpfs. Always run mdev just in case
+ devfs=tmpfs
if grep -qs devtmpfs /proc/filesystems ; then
- # Options copied from /etc/init.d/udev-mount, should probably be kept in sync
- mount -t devtmpfs -o "exec,nosuid,mode=0755,size=10M" udev /dev
- else
- mdev -s
+ devfs=devtmpfs
fi
+
+ # Options copied from /etc/init.d/udev-mount, should probably be kept in sync
+ mount -t $devfs -o "exec,nosuid,mode=0755,size=10M" udev /dev
+ mdev -s
}
test_success() {
diff --git a/defaults/linuxrc b/defaults/linuxrc
index b42070cb..f1e124b7 100755
--- a/defaults/linuxrc
+++ b/defaults/linuxrc
@@ -727,11 +727,11 @@ echo -ne "${BOLD}.${NORMAL}"
# If devtmpfs is mounted, try move it to the new root
# If that fails, try to unmount all possible mounts of devtmpfs as stuff breaks otherwise
-if grep -qs devtmpfs /proc/mounts
+if grep -qs "/dev " /proc/mounts
then
if ! mount --move /dev "${CHROOT}"/dev
then
- umount -t devtmpfs || echo '*: Failed to move and unmount the devtmpfs /dev!'
+ umount /dev || echo '*: Failed to move and unmount the ramdisk /dev!'
fi
fi