summaryrefslogtreecommitdiff
path: root/helpers/lh_binary_chroot
diff options
context:
space:
mode:
authorDaniel Baumann <daniel@debian.org>2007-11-10 18:39:49 +0100
committerDaniel Baumann <daniel@debian.org>2011-03-09 18:22:28 +0100
commitba83790488c83520e656a71003147bda45a8c6f5 (patch)
tree3bf6760140cc4af0264925a1d865a7025392692d /helpers/lh_binary_chroot
parentee91e98161fcd14e1c28f659357d33e9fda7019b (diff)
downloadvyos-live-build-ba83790488c83520e656a71003147bda45a8c6f5.tar.gz
vyos-live-build-ba83790488c83520e656a71003147bda45a8c6f5.zip
Adding option to allow building in fakeroot/fakechroot environment, thanks to An-Cheng Huang <ancheng@vyatta.com>.
Diffstat (limited to 'helpers/lh_binary_chroot')
-rwxr-xr-xhelpers/lh_binary_chroot23
1 files changed, 21 insertions, 2 deletions
diff --git a/helpers/lh_binary_chroot b/helpers/lh_binary_chroot
index 50d3d675d..c0727e06a 100755
--- a/helpers/lh_binary_chroot
+++ b/helpers/lh_binary_chroot
@@ -50,12 +50,31 @@ Create_lockfile .lock
# Normally, virtual filesystems are not mounted here, but people tend to be lazy
if [ -f chroot/proc/version ]
then
- ${LH_ROOT_COMMAND} umount chroot/proc
+ if [ "${LH_USE_FAKEROOT}" != "enabled" ]
+then
+ ${LH_ROOT_COMMAND} umount chroot/proc
+ else
+ rm -rf chroot/proc
+ mkdir -p chroot/proc
+ fi
fi
if [ -d chroot/sys/kernel ]
then
- ${LH_ROOT_COMMAND} umount chroot/sys
+ if [ "${LH_USE_FAKEROOT}" != "enabled" ]
+ then
+ ${LH_ROOT_COMMAND} umount chroot/sys
+ else
+ rm -rf chroot/sys
+ mkdir -p chroot/sys
+ fi
+fi
+
+# Copying /dev if using fakeroot
+if [ "${LH_USE_FAKEROOT}" = "enabled" ]
+then
+ rm -rf chroot/dev
+ find /dev | cpio -dmpu chroot
fi
if [ "${LH_CHROOT_BUILD}" = "disabled" ]