Making umount calls check if they are actually necessary.
This commit is contained in:
parent
30d76edc02
commit
be5c114a90
|
@ -30,7 +30,7 @@ Create_lockfile ()
|
||||||
mkdir -p "${DIRECTORY}"
|
mkdir -p "${DIRECTORY}"
|
||||||
|
|
||||||
# Creating lock trap
|
# 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
|
# Creating lock file
|
||||||
touch "${FILE}"
|
touch "${FILE}"
|
||||||
|
|
|
@ -70,7 +70,10 @@ case "${1}" in
|
||||||
Create_lockfile .lock
|
Create_lockfile .lock
|
||||||
|
|
||||||
# Unmounting /dev/pts
|
# 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
|
# Removing stage file
|
||||||
rm -f .stage/chroot_devpts
|
rm -f .stage/chroot_devpts
|
||||||
|
|
|
@ -85,7 +85,10 @@ case "${1}" in
|
||||||
|
|
||||||
# Unmounting /proc
|
# Unmounting /proc
|
||||||
#fuser -km chroot/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
|
else
|
||||||
rm -rf chroot/proc
|
rm -rf chroot/proc
|
||||||
mkdir -p chroot/proc
|
mkdir -p chroot/proc
|
||||||
|
|
|
@ -79,7 +79,10 @@ case "${1}" in
|
||||||
then
|
then
|
||||||
# Unmounting /sys
|
# Unmounting /sys
|
||||||
#fuser -km chroot/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
|
else
|
||||||
rm -rf chroot/sys
|
rm -rf chroot/sys
|
||||||
mkdir -p chroot/sys
|
mkdir -p chroot/sys
|
||||||
|
|
Loading…
Reference in New Issue