From 36e019c38d62afb4ece4f51531310856b9e82ed4 Mon Sep 17 00:00:00 2001 From: Olivier BLIN Date: Fri, 22 Apr 2022 10:16:54 +0200 Subject: [PATCH] Add support for the new includes.chroot system to /etc/hosts file The new includes.chroot system implemented in !214 adds the option to include files in the chroot before and after package installation. chroot_hostname and chroot_resolv have been updated but not chroot_hosts. Gbp-Dch: Short --- scripts/build/chroot_hosts | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/scripts/build/chroot_hosts b/scripts/build/chroot_hosts index 299dfa548..f36cfae9c 100755 --- a/scripts/build/chroot_hosts +++ b/scripts/build/chroot_hosts @@ -70,10 +70,16 @@ EOF # Acquire lock file Acquire_lockfile - if [ -e config/includes.chroot/etc/hosts ] + # Copying hosts from includes, if existing + INCLUDE_DIR=$(select_includes_chroot) + # includes.chroot_before_packages takes the highest precedence + if [ -e config/includes.chroot_before_packages/etc/hosts ] then - # Copying local hosts - cp -a config/includes.chroot/etc/hosts chroot/etc/hosts + INCLUDE_DIR="includes.chroot_before_packages" + fi + if [ -n "${INCLUDE_DIR}" ] && [ -e config/"${INCLUDE_DIR}"/etc/hosts ] + then + cp -a config/"${INCLUDE_DIR}"/etc/hosts chroot/etc/hosts rm -f chroot/etc/hosts.orig elif [ -f chroot/etc/hosts.orig ] then