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.
This commit is contained in:
Raphaël Hertzog 2018-07-27 09:46:55 +02:00
parent 332c170c3b
commit 5290842288
1 changed files with 5 additions and 1 deletions

View File

@ -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