summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Baumann <daniel@debian.org>2007-11-11 21:33:43 +0100
committerDaniel Baumann <daniel@debian.org>2011-03-09 18:22:29 +0100
commit2a9079644708eedd190b82675a76372f9c8abd7e (patch)
treed222e17f8924c7660e9d598e9ea52fe88e409765
parent7059380cd8e60e81c1c4c462471a291035c56ec2 (diff)
downloadlive-build-2a9079644708eedd190b82675a76372f9c8abd7e.zip
live-build-2a9079644708eedd190b82675a76372f9c8abd7e.tar.gz
Making umount calls check if they are actually necessary.
-rwxr-xr-xfunctions/lockfile.sh2
-rwxr-xr-xhelpers/lh_chroot_devpts5
-rwxr-xr-xhelpers/lh_chroot_proc5
-rwxr-xr-xhelpers/lh_chroot_sysfs5
4 files changed, 13 insertions, 4 deletions
diff --git a/functions/lockfile.sh b/functions/lockfile.sh
index 81fe559..8af6757 100755
--- a/functions/lockfile.sh
+++ b/functions/lockfile.sh
@@ -30,7 +30,7 @@ Create_lockfile ()
mkdir -p "${DIRECTORY}"
# Creating lock trap
- trap 'ret=${?}; '"rm -f \"${FILE}\"; "'for FILESYSTEM in devpts proc sysfs; do lh_chroot_${FILESYSTEM} remove || continue; done; exit ${ret}' EXIT
+ trap 'ret=${?}; '"rm -f \"${FILE}\"; "'for FILESYSTEM in devpts proc sysfs; do lh_chroot_${FILESYSTEM} remove; done; exit ${ret}' EXIT
# Creating lock file
touch "${FILE}"
diff --git a/helpers/lh_chroot_devpts b/helpers/lh_chroot_devpts
index 236777a..0024fb9 100755
--- a/helpers/lh_chroot_devpts
+++ b/helpers/lh_chroot_devpts
@@ -70,7 +70,10 @@ case "${1}" in
Create_lockfile .lock
# Unmounting /dev/pts
- ${LH_ROOT_COMMAND} umount chroot/dev/pts > /dev/null 2>&1
+ if [ -e chroot/dev/pts/0 ]
+ then
+ ${LH_ROOT_COMMAND} umount chroot/dev/pts
+ fi
# Removing stage file
rm -f .stage/chroot_devpts
diff --git a/helpers/lh_chroot_proc b/helpers/lh_chroot_proc
index 7d5688d..378703a 100755
--- a/helpers/lh_chroot_proc
+++ b/helpers/lh_chroot_proc
@@ -85,7 +85,10 @@ case "${1}" in
# Unmounting /proc
#fuser -km chroot/proc
- ${LH_ROOT_COMMAND} umount chroot/proc > /dev/null 2>&1
+ if [ -e chroot/proc/version ]
+ then
+ ${LH_ROOT_COMMAND} umount chroot/proc
+ fi
else
rm -rf chroot/proc
mkdir -p chroot/proc
diff --git a/helpers/lh_chroot_sysfs b/helpers/lh_chroot_sysfs
index fef710d..b7931ae 100755
--- a/helpers/lh_chroot_sysfs
+++ b/helpers/lh_chroot_sysfs
@@ -79,7 +79,10 @@ case "${1}" in
then
# Unmounting /sys
#fuser -km chroot/sys
- ${LH_ROOT_COMMAND} umount chroot/sys > /dev/null 2>&1
+ if [ -e chroot/sys/kernel ]
+ then
+ ${LH_ROOT_COMMAND} umount chroot/sys
+ fi
else
rm -rf chroot/sys
mkdir -p chroot/sys