From 036b6161f250c0a798c987f0a6cf2ed9b987bd93 Mon Sep 17 00:00:00 2001 From: Matthijs Kooijman Date: Mon, 28 Aug 2017 11:29:54 +0200 Subject: Check all dependencies independent of LB_BUILD_WITH_CHROOT Since commit fdc9250bc (Changing package dependency checks within chroot to work outside as well), Check_package automatically checks for LB_BUILD_WITH_CHROOT and works inside as well as outside of the chroot, so no need to check LB_BUILD_WITH_CHROOT before calling them. Install_package and Remove_package are just a no-op when building without chroot, so they can also be called unconditionally. Restore_cache and Save_cache do not check LB_BUILD_WITH_CHROOT but it it should not hurt to call them when not needed (which already happened in some cases). This commit makes all Check_package calls unconditional on LB_BUILD_WITH_CHROOT. For binary_syslinux, this fixes the check (which used outdated paths outside the chroot since 7b6dfd9d1), for binary_grub-efi, binary_package-lists and chroot_package-lists this simplifies the code (but also causes the check to become package-based instead of file-based on apt-based systems), and for binary_loadlin and binary_win32-loader this adds the check outside the chroot which was previously missing. --- scripts/build/binary_grub-efi | 60 ++++++++----------------------------------- 1 file changed, 10 insertions(+), 50 deletions(-) (limited to 'scripts/build/binary_grub-efi') diff --git a/scripts/build/binary_grub-efi b/scripts/build/binary_grub-efi index 6d158cd4f..d24532d50 100755 --- a/scripts/build/binary_grub-efi +++ b/scripts/build/binary_grub-efi @@ -45,56 +45,11 @@ Check_architectures amd64 i386 Check_crossarchitectures # Checking depends -case "${LB_BUILD_WITH_CHROOT}" in - true) - _CHROOT_DIR="" - - Check_package chroot /usr/lib/grub/x86_64-efi/configfile.mod grub-efi-amd64-bin - Check_package chroot /usr/lib/grub/i386-efi/configfile.mod grub-efi-ia32-bin - Check_package chroot /usr/bin/grub-mkimage grub-common - Check_package chroot /usr/bin/mcopy mtools - Check_package chroot /sbin/mkfs.msdos dosfstools - ;; - - false) - _CHROOT_DIR="chroot" - - if [ ! -e /usr/lib/grub/x86_64-efi ] - then - # grub-efi-amd64-bin - Echo_error "/usr/lib/grub/x86_64-efi - no such directory" - exit 1 - fi - - if [ ! -e /usr/lib/grub/i386-efi ] - then - # grub-efi-ia32-bin - Echo_error "/usr/lib/grub/i386-efi - no such directory" - exit 1 - fi - - if [ ! -e /usr/bin/grub-mkimage ] - then - # grub-common - Echo_error "/usr/bin/grub-mkimage - no such file." - exit 1 - fi - - if [ ! -e /usr/bin/mcopy ] - then - # mtools - Echo_error "/usr/bin/mcopy - no such file." - exit 1 - fi - - if [ ! -e /sbin/mkfs.msdos ] - then - # dosfstools - Echo_error "/sbin/mkfs.msdos - no such file." - exit 1 - fi - ;; -esac +Check_package chroot /usr/lib/grub/x86_64-efi/configfile.mod grub-efi-amd64-bin +Check_package chroot /usr/lib/grub/i386-efi/configfile.mod grub-efi-ia32-bin +Check_package chroot /usr/bin/grub-mkimage grub-common +Check_package chroot /usr/bin/mcopy mtools +Check_package chroot /sbin/mkfs.msdos dosfstools # Setting destination directory case "${LIVE_IMAGE_TYPE}" in @@ -125,6 +80,11 @@ case "${LB_BUILD_WITH_CHROOT}" in mkdir -p chroot/${LIVE_BUILD_PATH} cp "${LIVE_BUILD_PATH}/efi-image" "chroot/${LIVE_BUILD_PATH}" cp "${LIVE_BUILD_PATH}/grub-cpmodules" "chroot/${LIVE_BUILD_PATH}" + + _CHROOT_DIR="" + ;; + false) + _CHROOT_DIR="chroot" ;; esac ##### -- cgit v1.2.3