summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorRaphaël Hertzog <hertzog@debian.org>2018-07-27 09:46:55 +0200
committerRaphaël Hertzog <hertzog@debian.org>2018-07-27 10:51:49 +0200
commit52908422880f8d5cfa18c577d4138d5449af37f6 (patch)
tree6e434c9e7f45c58a8b4cfcf8c07c8329728107ef /scripts
parent332c170c3b8dc2449b348191562c784db68ed331 (diff)
downloadvyos-live-build-52908422880f8d5cfa18c577d4138d5449af37f6.tar.gz
vyos-live-build-52908422880f8d5cfa18c577d4138d5449af37f6.zip
Handle includes.chroot files installed over symlinked directories
With the merged /usr feature now enabled in debootstrap, we have /bin and /lib which are symlinks to /usr/bin and /usr/lib. If the live-build configuration provides files in config/includes.chroot/lib/ or config/includes.chroot/bin/ then lb chroot_includes will replace the /lib or /bin symlink with real directories having only the content provided in chroot.includes and problems will follow... the build will usually fail later with a cryptic error message (for example a hook failing to execute /usr/bin/env). Work around the issue by creating a tarball of the files to install and by unpacking that tarball from within the chroot with appropriate options.
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/build/chroot_includes6
1 files changed, 5 insertions, 1 deletions
diff --git a/scripts/build/chroot_includes b/scripts/build/chroot_includes
index 21c0e261b..6ab4e288d 100755
--- a/scripts/build/chroot_includes
+++ b/scripts/build/chroot_includes
@@ -42,8 +42,12 @@ if Find_files config/includes.chroot/
then
# Copying includes
cd config/includes.chroot
- find . | cpio -dmpu --no-preserve-owner "${OLDPWD}"/chroot
+ Echo_message "Creating a tarball with files from includes.chroot..."
+ tar cf "${OLDPWD}"/chroot/includes.chroot.tar .
cd "${OLDPWD}"
+ Echo_message "Extracting the tarball in the chroot..."
+ Chroot chroot "tar -xvf includes.chroot.tar --no-same-owner --keep-directory-symlink --overwrite"
+ rm chroot/includes.chroot.tar
# Creating stage file
Create_stagefile .build/includes.chroot