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.
cleanup-cruft
Peter Hjalmarsson 14 years ago committed by Sebastian Pipping
parent a9d1575e3c
commit 398d7ba5ac

@ -308,13 +308,15 @@ run_shell() {
runmdev() { runmdev() {
# Use devtmpfs if enabled in kernel, # 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 if grep -qs devtmpfs /proc/filesystems ; then
# Options copied from /etc/init.d/udev-mount, should probably be kept in sync devfs=devtmpfs
mount -t devtmpfs -o "exec,nosuid,mode=0755,size=10M" udev /dev
else
mdev -s
fi 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() { test_success() {

@ -727,11 +727,11 @@ echo -ne "${BOLD}.${NORMAL}"
# If devtmpfs is mounted, try move it to the new root # 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 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 then
if ! mount --move /dev "${CHROOT}"/dev if ! mount --move /dev "${CHROOT}"/dev
then 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
fi fi

Loading…
Cancel
Save