diff --git a/functions/chroot.sh b/functions/chroot.sh index 3804bf88c..3022b2afa 100755 --- a/functions/chroot.sh +++ b/functions/chroot.sh @@ -35,10 +35,10 @@ Chroot () } Chroot_has_package() { - local PACKAGE="${1}"; shift - local CHROOT="${2:-chroot}"; shift + local PACKAGE="${1}" + local CHROOT="${2:-chroot}" - if dpkg-query --admindir=${CHROOT}/var/lib/dpkg -s ${PACKAGE} >/dev/null 2>&1 | grep -q "^Status: install" + if Chroot "${CHROOT}" dpkg-query -s ${PACKAGE} 2>/dev/null | grep -q "^Status: install" then return 0 fi @@ -46,9 +46,9 @@ Chroot_has_package() { } Chroot_package_list() { - local CHROOT="${1:-chroot}"; shift + local CHROOT="${1:-chroot}" - dpkg-query --admindir=${CHROOT}/var/lib/dpkg -W -f'${Package}\n' + Chroot "${CHROOT}" dpkg-query -W -f'${Package}\n' } Chroot_copy_dir() { diff --git a/scripts/build/binary_grub-efi b/scripts/build/binary_grub-efi index 41a8c526e..2faf0b5e0 100755 --- a/scripts/build/binary_grub-efi +++ b/scripts/build/binary_grub-efi @@ -213,14 +213,14 @@ gen_efi_boot_img(){ fi } -PRE_EFI_IMAGE_PATH="${PATH}" +PRE_EFI_IMAGE_PATH="\${PATH}" if [ ! -e "${LIVE_BUILD}" ] ; then LIVE_BUILD_PATH="/usr/lib/live/build" else LIVE_BUILD_PATH="${LIVE_BUILD}/scripts/build" fi -PATH="${PATH}:\${LIVE_BUILD_PATH}" # Make sure grub-cpmodules is used as if it was installed in the system +PATH="\${PATH}:\${LIVE_BUILD_PATH}" # Make sure grub-cpmodules is used as if it was installed in the system case "${LB_ARCHITECTURE}" in amd64) diff --git a/scripts/build/installer_debian-installer b/scripts/build/installer_debian-installer index 2e8d57c85..4393b0ca6 100755 --- a/scripts/build/installer_debian-installer +++ b/scripts/build/installer_debian-installer @@ -140,11 +140,13 @@ esac Install_file() { local FILE="${1}" + local DEST="${2}" + local CHROOT="${3:-chroot}" Echo_debug "Installing file %s" "${FILE}" local ARCHIVE_AREA - ARCHIVE_AREA="$(dpkg -I ${FILE} | awk '/^.*Section: / { print $2 }')" + ARCHIVE_AREA="$(Chroot "${CHROOT}" dpkg -f ${FILE} Section)" if echo "${ARCHIVE_AREA}" | grep -qs '/' then @@ -153,10 +155,10 @@ Install_file() { ARCHIVE_AREA="main" fi - local TARGET="${2}/${ARCHIVE_AREA}" + local TARGET="${DEST}/${ARCHIVE_AREA}" local SOURCE - SOURCE="$(dpkg -f ${FILE} Source | awk '{ print $1 }')" + SOURCE="$(Chroot "${CHROOT}" dpkg -f ${FILE} Source | awk '{ print $1 }')" if [ -z "${SOURCE}" ] then @@ -766,7 +768,7 @@ EOF do if [ -e "${FILE}" ] then - Install_file "${FILE}" "pool-udeb" + Install_file "${FILE}" "pool-udeb" "${OLDPWD}/chroot" # Prefer local udebs over downloaded udebs rm -f "$(basename ${FILE} | awk -F_ '{ print $1 }')"_*.udeb @@ -780,7 +782,7 @@ EOF do if [ -e "${FILE}" ] then - Install_file "${FILE}" "pool-udeb" + Install_file "${FILE}" "pool-udeb" "${OLDPWD}/chroot" # Prefer local udebs over downloaded udebs rm -f "$(basename ${FILE} | awk -F_ '{ print $1 }')"_*.udeb @@ -835,7 +837,7 @@ EOF for UDEB in ${UDEBS} ${UDEBS_DERIVED}; do _UDEB_FILENAME="$(basename ${UDEB})" if [ -f "${_UDEB_FILENAME}" ]; then - Install_file "${_UDEB_FILENAME}" "pool-udeb" + Install_file "${_UDEB_FILENAME}" "pool-udeb" "${OLDPWD}/chroot" rm "${_UDEB_FILENAME}" fi done