summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Howard <ben.howard@canonical.com>2011-09-30 16:23:34 -0600
committerDaniel Baumann <daniel@debian.org>2011-10-01 08:04:57 +0200
commit0b654837bba8ddabde530d5c0b7d1efdb4139a32 (patch)
treeea86a09a6aac454d229ec741104cf3e500650ed7
parent7aec8962c34b2b9bb324bf6d457e779c9efdb393 (diff)
downloadvyos-live-build-0b654837bba8ddabde530d5c0b7d1efdb4139a32.tar.gz
vyos-live-build-0b654837bba8ddabde530d5c0b7d1efdb4139a32.zip
Adding check for missing mtab during chrooted binary rootfs stage.
-rwxr-xr-xscripts/build/lb_binary_rootfs12
1 files changed, 12 insertions, 0 deletions
diff --git a/scripts/build/lb_binary_rootfs b/scripts/build/lb_binary_rootfs
index 280cd1a54..96523a866 100755
--- a/scripts/build/lb_binary_rootfs
+++ b/scripts/build/lb_binary_rootfs
@@ -122,12 +122,24 @@ case "${LB_CHROOT_FILESYSTEM}" in
case "${LB_BUILD_WITH_CHROOT}" in
true)
dd if=/dev/zero of=chroot/filesystem.${LB_CHROOT_FILESYSTEM} bs=1024k count=0 seek=${REAL_DIM}
+
+ if ! Chroot chroot "test -s /etc/mtab"
+ then
+ Chroot chroot "ln -s /proc/mounts/mtab /etc/mtab"
+ FAKE_MTAB="true"
+ fi
+
Chroot chroot "mkfs.${LB_CHROOT_FILESYSTEM} -F -b 1024 -N ${REAL_INODES} -m 0 filesystem.${LB_CHROOT_FILESYSTEM}"
mkdir -p filesystem.tmp
${LB_ROOT_COMMAND} mount -o loop chroot/filesystem.${LB_CHROOT_FILESYSTEM} filesystem.tmp
cp -a chroot/chroot/* filesystem.tmp
+ if [ "${FAKE_MTAB}" = "true" ]
+ then
+ Chroot chroot "rm -f /etc/mtab"
+ fi
+
${LB_ROOT_COMMAND} umount filesystem.tmp
rmdir filesystem.tmp