From 0fde8b59e2707f4ef51e6cfd8bc83d3df804d9bd Mon Sep 17 00:00:00 2001 From: Clifford Wolf Date: Sat, 14 Aug 2004 11:55:51 +0000 Subject: [PATCH] Clifford Wolf: Lets use 'umount -d' more often (Task #48) [2004080902260604613] (https://www.rocklinux.net/submaster) git-svn-id: http://www.rocklinux.org/svn/rock-linux/trunk@3868 c5f82cb5-29bc-0310-9cd0-bff59a50e3bc --- package/base/linux/mkinitrd.sh | 2 +- package/base/sysfiles/stone_mod_install.sh | 2 +- package/base/sysfiles/system.init | 8 ++++---- target/bootdisk/linuxrc2.sh | 2 +- target/bootdisk/shutdown | 2 +- target/livecd/fixedfiles/system | 4 ++-- target/lvp/build.sh | 2 +- target/router/build.sh | 2 +- 8 files changed, 12 insertions(+), 12 deletions(-) diff --git a/package/base/linux/mkinitrd.sh b/package/base/linux/mkinitrd.sh index ed8c10bff..bef23c6c2 100644 --- a/package/base/linux/mkinitrd.sh +++ b/package/base/linux/mkinitrd.sh @@ -76,7 +76,7 @@ else mount -o loop /boot/initrd-${kernel}.img.tmp $mntpoint rmdir $mntpoint/lost+found/ cp -a $tmpdir/* $mntpoint/ - umount $mntpoint + umount -d $mntpoint rmdir $mntpoint fi gzip < /boot/initrd-${kernel}.img.tmp > /boot/initrd-${kernel}.img diff --git a/package/base/sysfiles/stone_mod_install.sh b/package/base/sysfiles/stone_mod_install.sh index ec9e67894..09deb4f99 100644 --- a/package/base/sysfiles/stone_mod_install.sh +++ b/package/base/sysfiles/stone_mod_install.sh @@ -230,7 +230,7 @@ EOT echo "You might want to umount all filesystems now and reboot" echo "the system now using the commands:" echo - echo " umount -arv" + echo " umount -adrv" echo " reboot -f" echo echo "Or by executing 'shutdown -r now' which will run the above commands." diff --git a/package/base/sysfiles/system.init b/package/base/sysfiles/system.init index 5bc6905f6..a4fe3786f 100644 --- a/package/base/sysfiles/system.init +++ b/package/base/sysfiles/system.init @@ -57,14 +57,14 @@ dnl echo " ** Please repair the broken disk(s) manually." echo " **" sulogin -t 600 /dev/console - umount -arv ; /sbin/reboot -d -f + umount -adrv ; /sbin/reboot -d -f while true ; do sleep 1 ; done elif [ $(( $fsckrc & 2 )) != 0 ] ; then for x in 10 9 8 7 6 5 4 3 2 ; do echo -en "\rSystem reboot in $x seconds ... " sleep 1 done ; echo -e "\rSystem reboot now! " - umount -arv ; /sbin/reboot -d -f + umount -adrv ; /sbin/reboot -d -f while true ; do sleep 1 ; done fi dnl @@ -193,13 +193,13 @@ dnl echo "Umounting $dev on $dir ($fs)." mount -o remount,sync $dir mount -o remount,ro $dir - umount $dir + umount -d $dir done dnl block_split(`Unmounting remaining file systems.') grep -E -v '^none (/|[a-z]+:) ' /proc/mounts > /etc/mtab sync ; sleep 1 ; sync - umount -vnra -t nodevfs,proc,sysfs,shm + umount -vdnra -t nodevfs,proc,sysfs,shm mount -vn -o remount,sync / mount -vn -o remount,ro / sleep 1 ; sync ; sleep 1 diff --git a/target/bootdisk/linuxrc2.sh b/target/bootdisk/linuxrc2.sh index 2f4801fe5..cda8553a6 100644 --- a/target/bootdisk/linuxrc2.sh +++ b/target/bootdisk/linuxrc2.sh @@ -2,7 +2,7 @@ export PATH="/sbin:/bin:/usr/sbin:/usr/bin" if type -p gzip > /dev/null ; then - umount /old_root ; rmdir /old_root + umount -d /old_root ; rmdir /old_root else PATH="$PATH:/old_root/bin" for x in /old_root/* ; do diff --git a/target/bootdisk/shutdown b/target/bootdisk/shutdown index 8cf0b0b9c..ae045ae38 100644 --- a/target/bootdisk/shutdown +++ b/target/bootdisk/shutdown @@ -14,7 +14,7 @@ swapoff -a || error=$? sync ; sleep 1 echo "Unmounting filesystems." -umount -avf || error=$? +umount -advf || error=$? echo "Reboot ..." reboot -f diff --git a/target/livecd/fixedfiles/system b/target/livecd/fixedfiles/system index 9acb345a4..d3c5891f5 100644 --- a/target/livecd/fixedfiles/system +++ b/target/livecd/fixedfiles/system @@ -217,14 +217,14 @@ case "$1" in echo "Umounting $dev on $dir ($fs)." mount -o remount,sync $dir mount -o remount,ro $dir - umount $dir + umount -d $dir done status title "Unmounting remaining file systems." grep -E -v '^none (/|[a-z]+:) ' /proc/mounts > /etc/mtab sync ; sleep 1 ; sync - umount -vnra -t nodevfs,proc,sysfs,shm + umount -vdnra -t nodevfs,proc,sysfs,shm mount -vn -o remount,sync / mount -vn -o remount,ro / sleep 1 ; sync ; sleep 1 diff --git a/target/lvp/build.sh b/target/lvp/build.sh index 422b7d7d2..f3e38ca7c 100644 --- a/target/lvp/build.sh +++ b/target/lvp/build.sh @@ -175,7 +175,7 @@ else mkdir ${releasedir}/initrd.tmp.$$ mount -o loop ${releasedir}/isolinux/initrd ${releasedir}/initrd.tmp.$$ mv ${releasedir}/initrd/* ${releasedir}/initrd.tmp.$$ - umount ${releasedir}/initrd.tmp.$$ + umount -d ${releasedir}/initrd.tmp.$$ rm -rf ${releasedir}/initrd.tmp.$$ ${releasedir}/initrd echo_status "LVP v${lvp_ver} built for ${ROCKCFG_X86_OPT} is now ready in ${releasedir}." diff --git a/target/router/build.sh b/target/router/build.sh index 45e1da946..f8617f598 100644 --- a/target/router/build.sh +++ b/target/router/build.sh @@ -73,7 +73,7 @@ dd if=/dev/zero of=initrd.img count=16384 bs=1024 2>/dev/null mke2fs -qF initrd.img 2>/dev/null mount -o loop initrd.img initrd.mnt cp -a initrd/* initrd.mnt/ -umount initrd.mnt/ +umount -d initrd.mnt/ gzip -9 initrd.img mv initrd.img.gz initrd.img