Handle chroot_local-includes files installed over symlinked directories
I've cherry-picked this from newer live-build upstream and backported to our live-build 2.x fork.
We use this as a Git submodule so once merged, this will only impact Tails branches that bump the pointer, i.e. feature/bookworm
.
Original commit message:
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.
refs tails#19133 (closed)