summaryrefslogtreecommitdiff
path: root/helpers/lh_binary_chroot
diff options
context:
space:
mode:
authorDaniel Baumann <daniel@debian.org>2007-09-23 10:04:51 +0200
committerDaniel Baumann <daniel@debian.org>2007-09-23 10:04:51 +0200
commit3de3c9914784e384c5747323bc18988601e137e6 (patch)
tree621dc56a00a65ab0eb1fd4e7d42ad4e45d718741 /helpers/lh_binary_chroot
parent2230835b694fef8f6f63992b373d06e6025917ce (diff)
downloadvyos-live-build-3de3c9914784e384c5747323bc18988601e137e6.tar.gz
vyos-live-build-3de3c9914784e384c5747323bc18988601e137e6.zip
Adding live-helper 1.0~a7-1.
Diffstat (limited to 'helpers/lh_binary_chroot')
-rwxr-xr-xhelpers/lh_binary_chroot19
1 files changed, 12 insertions, 7 deletions
diff --git a/helpers/lh_binary_chroot b/helpers/lh_binary_chroot
index 24ee5f88f..58835ad07 100755
--- a/helpers/lh_binary_chroot
+++ b/helpers/lh_binary_chroot
@@ -45,25 +45,30 @@ Check_lockfile .lock
# Creating lock file
Create_lockfile .lock
-# Normally, proc is not mounted here, but people tend to be lazy
+# Normally, virtual filesystems are not mounted here, but people tend to be lazy
if [ -f chroot/proc/version ]
then
- umount chroot/proc
+ ${LH_ROOT_COMMAND} umount chroot/proc
fi
if [ -d chroot/sys/kernel ]
then
- umount chroot/sys
+ ${LH_ROOT_COMMAND} umount chroot/sys
fi
# Removing old chroot
-rm -rf chroot/chroot
-rm -rf chroot.tmp
+${LH_ROOT_COMMAND} rm -rf chroot/chroot
+${LH_ROOT_COMMAND} rm -rf chroot.tmp
# Copying new chroot
Echo_message "Copying chroot, this can take a while."
-cp -a chroot chroot.tmp
-mv chroot.tmp chroot/chroot
+${LH_ROOT_COMMAND} cp -a chroot chroot.tmp
+${LH_ROOT_COMMAND} mv chroot.tmp chroot/chroot
+
+if [ -n "${LH_ROOT_COMMAND}" ]
+then
+ ${LH_ROOT_COMMAND} chown -R `whoami`:`whoami` chroot
+fi
# Creating stage file
Create_stagefile .stage/binary_chroot