From 500f2050739e8cb902d710d1ae6b3f5de4d00dcd Mon Sep 17 00:00:00 2001 From: Lyndon Brown Date: Mon, 6 Apr 2020 18:46:47 +0100 Subject: [PATCH] config: s/LIVE_IMAGE_TYPE/LB_IMAGE_TYPE/ no backwards compatibility hack for reading the old var from existing saved config used because this was previously stored in the alternate format config/build file. Gbp-Dch: Short --- functions/configuration.sh | 20 +++++++++++--------- scripts/build/binary_disk | 2 +- scripts/build/binary_grub-efi | 2 +- scripts/build/binary_grub-legacy | 4 ++-- scripts/build/binary_grub-pc | 4 ++-- scripts/build/binary_hdd | 2 +- scripts/build/binary_includes | 2 +- scripts/build/binary_iso | 4 ++-- scripts/build/binary_netboot | 2 +- scripts/build/binary_onie | 2 +- scripts/build/binary_syslinux | 2 +- scripts/build/binary_tar | 2 +- scripts/build/binary_zsync | 4 ++-- scripts/build/chroot_hacks | 2 +- scripts/build/config | 6 +++--- scripts/build/installer_debian-installer | 6 +++--- 16 files changed, 34 insertions(+), 32 deletions(-) diff --git a/functions/configuration.sh b/functions/configuration.sh index 6bab8b2f7..ef34a990d 100755 --- a/functions/configuration.sh +++ b/functions/configuration.sh @@ -60,8 +60,10 @@ Prepare_config () LB_DISTRIBUTION_BINARY="${LB_DISTRIBUTION_BINARY:-${LB_DISTRIBUTION_CHROOT}}" LB_IMAGE_NAME="${LB_IMAGE_NAME:-live-image}" - LIVE_IMAGE_NAME="${LB_IMAGE_NAME}" #for backwards compatibility with hooks - LIVE_IMAGE_TYPE="${LIVE_IMAGE_TYPE:-iso-hybrid}" + LB_IMAGE_TYPE="${LB_IMAGE_TYPE:-iso-hybrid}" + #for backwards compatibility with hooks + LIVE_IMAGE_NAME="${LB_IMAGE_NAME}" + LIVE_IMAGE_TYPE="${LB_IMAGE_TYPE}" if [ -z "${LB_ARCHITECTURE}" ]; then if [ $(which dpkg) ]; then @@ -283,11 +285,11 @@ Prepare_config () case "${LB_ARCHITECTURE}" in amd64|i386) - LIVE_IMAGE_TYPE="${LIVE_IMAGE_TYPE:-iso-hybrid}" + LB_IMAGE_TYPE="${LB_IMAGE_TYPE:-iso-hybrid}" ;; *) - LIVE_IMAGE_TYPE="${LIVE_IMAGE_TYPE:-iso}" + LB_IMAGE_TYPE="${LB_IMAGE_TYPE:-iso}" ;; esac @@ -295,7 +297,7 @@ Prepare_config () then case "${LB_ARCHITECTURE}" in amd64|i386) - case "${LIVE_IMAGE_TYPE}" in + case "${LB_IMAGE_TYPE}" in hdd|netboot) LB_BOOTLOADERS="syslinux" ;; @@ -363,7 +365,7 @@ Prepare_config () local _LB_BOOTAPPEND_PRESEED if [ -n "${LB_DEBIAN_INSTALLER_PRESEEDFILE}" ] then - case "${LIVE_IMAGE_TYPE}" in + case "${LB_IMAGE_TYPE}" in iso|iso-hybrid) _LB_BOOTAPPEND_PRESEED="file=/cdrom/install/${LB_DEBIAN_INSTALLER_PRESEEDFILE}" ;; @@ -567,7 +569,7 @@ Validate_config_permitted_values () exit 1 fi - if ! In_list "${LIVE_IMAGE_TYPE}" iso iso-hybrid hdd tar netboot; then + if ! In_list "${LB_IMAGE_TYPE}" iso iso-hybrid hdd tar netboot; then Echo_error "You have specified an invalid value for --binary-image." exit 1 fi @@ -707,13 +709,13 @@ Validate_config_dependencies () fi if In_list "grub-pc" ${LB_BOOTLOADERS} || In_list "grub-efi" ${LB_BOOTLOADERS} || In_list "grub-legacy" ${LB_BOOTLOADERS}; then - if In_list "${LIVE_IMAGE_TYPE}" hdd netboot; then + if In_list "${LB_IMAGE_TYPE}" hdd netboot; then Echo_error "You have selected an invalid combination of bootloaders and live image type; the grub-* bootloaders are not compatible with hdd and netboot types." exit 1 fi fi - if [ "${LIVE_IMAGE_TYPE}" = "hdd" ] && [ "${LB_FIRST_BOOTLOADER}" = "grub-legacy" ]; then + if [ "${LB_IMAGE_TYPE}" = "hdd" ] && [ "${LB_FIRST_BOOTLOADER}" = "grub-legacy" ]; then Echo_error "You have selected a combination of bootloader and image type that is currently not supported by live-build. Please use either another bootloader or a different image type." exit 1 fi diff --git a/scripts/build/binary_disk b/scripts/build/binary_disk index ca89ba599..59bf5a42d 100755 --- a/scripts/build/binary_disk +++ b/scripts/build/binary_disk @@ -21,7 +21,7 @@ USAGE="${PROGRAM} [--force]" # Processing arguments and configuration files Init_config_data "${@}" -if ! In_list "${LIVE_IMAGE_TYPE}" iso iso-hybrid hdd; then +if ! In_list "${LB_IMAGE_TYPE}" iso iso-hybrid hdd; then exit 0 fi diff --git a/scripts/build/binary_grub-efi b/scripts/build/binary_grub-efi index d94f8bfd3..6b4101e8f 100755 --- a/scripts/build/binary_grub-efi +++ b/scripts/build/binary_grub-efi @@ -21,7 +21,7 @@ USAGE="${PROGRAM} [--force]" # Processing arguments and configuration files Init_config_data "${@}" -if In_list "${LIVE_IMAGE_TYPE}" hdd netboot; then +if In_list "${LB_IMAGE_TYPE}" hdd netboot; then exit 0 fi diff --git a/scripts/build/binary_grub-legacy b/scripts/build/binary_grub-legacy index 9f0078ba6..19b80e7bb 100755 --- a/scripts/build/binary_grub-legacy +++ b/scripts/build/binary_grub-legacy @@ -21,7 +21,7 @@ USAGE="${PROGRAM} [--force]" # Processing arguments and configuration files Init_config_data "${@}" -if In_list "${LIVE_IMAGE_TYPE}" hdd netboot; then +if In_list "${LB_IMAGE_TYPE}" hdd netboot; then exit 0 fi @@ -200,7 +200,7 @@ fi mkdir -p binary/boot/grub cp -r "${_SOURCE}"/* binary/boot/grub -case ${LIVE_IMAGE_TYPE} in +case ${LB_IMAGE_TYPE} in iso|iso-hybrid) FILES="chroot/usr/lib/grub/*/stage2_eltorito" ;; diff --git a/scripts/build/binary_grub-pc b/scripts/build/binary_grub-pc index 86e0ac431..cd385ead2 100755 --- a/scripts/build/binary_grub-pc +++ b/scripts/build/binary_grub-pc @@ -21,7 +21,7 @@ USAGE="${PROGRAM} [--force]" # Processing arguments and configuration files Init_config_data "${@}" -if In_list "${LIVE_IMAGE_TYPE}" hdd netboot; then +if In_list "${LB_IMAGE_TYPE}" hdd netboot; then exit 0 fi @@ -54,7 +54,7 @@ Install_package # Copying templates mkdir -p binary/boot/grub/i386-pc -case ${LIVE_IMAGE_TYPE} in +case ${LB_IMAGE_TYPE} in iso|iso-hybrid) FILES="chroot/usr/lib/grub/i386-pc/*.mod chroot/usr/lib/grub/i386-pc/*.lst chroot/usr/lib/grub/i386-pc/efiemu??.o chroot/usr/share/grub/*.pf2" ;; diff --git a/scripts/build/binary_hdd b/scripts/build/binary_hdd index a7979965d..8012c362c 100755 --- a/scripts/build/binary_hdd +++ b/scripts/build/binary_hdd @@ -21,7 +21,7 @@ USAGE="${PROGRAM} [--force]" # Processing arguments and configuration files Init_config_data "${@}" -if [ "${LIVE_IMAGE_TYPE}" != "hdd" ]; then +if [ "${LB_IMAGE_TYPE}" != "hdd" ]; then exit 0 fi diff --git a/scripts/build/binary_includes b/scripts/build/binary_includes index b9482a552..e5a3f4f92 100755 --- a/scripts/build/binary_includes +++ b/scripts/build/binary_includes @@ -40,7 +40,7 @@ then cd "${OLDPWD}" # Removing symlinks - if [ "${LIVE_IMAGE_TYPE}" = "hdd" ]; then + if [ "${LB_IMAGE_TYPE}" = "hdd" ]; then find binary -type l | xargs rm -f fi fi diff --git a/scripts/build/binary_iso b/scripts/build/binary_iso index c260bdbe8..4fdbfdc57 100755 --- a/scripts/build/binary_iso +++ b/scripts/build/binary_iso @@ -21,7 +21,7 @@ USAGE="${PROGRAM} [--force]" # Processing arguments and configuration files Init_config_data "${@}" -case "${LIVE_IMAGE_TYPE}" in +case "${LB_IMAGE_TYPE}" in iso) IMAGE="${LB_IMAGE_NAME}-${LB_ARCHITECTURE}.iso" ;; @@ -66,7 +66,7 @@ fi XORRISO_OPTIONS="-R -r -J -joliet-long -l -cache-inodes -iso-level 3" # Handle xorriso live-build specific options -if [ "${LIVE_IMAGE_TYPE}" = "iso-hybrid" ] +if [ "${LB_IMAGE_TYPE}" = "iso-hybrid" ] then XORRISO_OPTIONS="${XORRISO_OPTIONS} -isohybrid-mbr /usr/lib/ISOLINUX/isohdpfx.bin -partition_offset 16" fi diff --git a/scripts/build/binary_netboot b/scripts/build/binary_netboot index a324e7fc1..c88bc6296 100755 --- a/scripts/build/binary_netboot +++ b/scripts/build/binary_netboot @@ -21,7 +21,7 @@ USAGE="${PROGRAM} [--force]" # Processing arguments and configuration files Init_config_data "${@}" -if [ "${LIVE_IMAGE_TYPE}" != "netboot" ]; then +if [ "${LB_IMAGE_TYPE}" != "netboot" ]; then exit 0 fi diff --git a/scripts/build/binary_onie b/scripts/build/binary_onie index 356e2b6e2..c8fcbef8d 100755 --- a/scripts/build/binary_onie +++ b/scripts/build/binary_onie @@ -27,7 +27,7 @@ then exit 0 fi -case "${LIVE_IMAGE_TYPE}" in +case "${LB_IMAGE_TYPE}" in iso) IMAGE="${LB_IMAGE_NAME}-${LB_ARCHITECTURE}.iso" ;; diff --git a/scripts/build/binary_syslinux b/scripts/build/binary_syslinux index 84a32cd31..3df40d0d5 100755 --- a/scripts/build/binary_syslinux +++ b/scripts/build/binary_syslinux @@ -48,7 +48,7 @@ case "${LB_INITRAMFS}" in esac # Assembling image specifics -case "${LIVE_IMAGE_TYPE}" in +case "${LB_IMAGE_TYPE}" in iso|iso-hybrid) _BOOTLOADER="isolinux" _TARGET="binary/isolinux" diff --git a/scripts/build/binary_tar b/scripts/build/binary_tar index c6e074e34..4cac3aa35 100755 --- a/scripts/build/binary_tar +++ b/scripts/build/binary_tar @@ -21,7 +21,7 @@ USAGE="${PROGRAM} [--force]" # Processing arguments and configuration files Init_config_data "${@}" -if [ "${LIVE_IMAGE_TYPE}" != "tar" ]; then +if [ "${LB_IMAGE_TYPE}" != "tar" ]; then exit 0 fi diff --git a/scripts/build/binary_zsync b/scripts/build/binary_zsync index 499d7bead..937eedd4e 100755 --- a/scripts/build/binary_zsync +++ b/scripts/build/binary_zsync @@ -21,7 +21,7 @@ USAGE="${PROGRAM} [--force]" # Processing arguments and configuration files Init_config_data "${@}" -if [ "${LIVE_IMAGE_TYPE}" != "iso" ] && [ "${LIVE_IMAGE_TYPE}" != "iso-hybrid" ] +if [ "${LB_IMAGE_TYPE}" != "iso" ] && [ "${LB_IMAGE_TYPE}" != "iso-hybrid" ] then exit 0 fi @@ -51,7 +51,7 @@ Restore_package_cache binary # Installing depends Install_package -case "${LIVE_IMAGE_TYPE}" in +case "${LB_IMAGE_TYPE}" in iso) _IMAGES="${LB_IMAGE_NAME}-${LB_ARCHITECTURE}.iso" ;; diff --git a/scripts/build/chroot_hacks b/scripts/build/chroot_hacks index bd8a3e230..3f27ad8b0 100755 --- a/scripts/build/chroot_hacks +++ b/scripts/build/chroot_hacks @@ -32,7 +32,7 @@ Check_stagefile # Acquire lock file Acquire_lockfile -case "${LIVE_IMAGE_TYPE}" in +case "${LB_IMAGE_TYPE}" in netboot) if [ ! -f chroot/sbin/mount.cifs ] then diff --git a/scripts/build/config b/scripts/build/config index b78557476..4f7f5960f 100755 --- a/scripts/build/config +++ b/scripts/build/config @@ -378,7 +378,7 @@ Local_arguments () ;; -b|--binary-image|--binary-images) - LIVE_IMAGE_TYPE="${2}" + LB_IMAGE_TYPE="${2}" shift 2 ;; @@ -1205,8 +1205,8 @@ mkdir -p config/bootloaders cat > config/binary << EOF # config/binary - options for live-build(7), binary stage -# \$LIVE_IMAGE_TYPE: set image type -LIVE_IMAGE_TYPE="${LIVE_IMAGE_TYPE}" +# \$LB_IMAGE_TYPE: set image type +LB_IMAGE_TYPE="${LB_IMAGE_TYPE}" # \$LB_BINARY_FILESYSTEM: set image filesystem LB_BINARY_FILESYSTEM="${LB_BINARY_FILESYSTEM}" diff --git a/scripts/build/installer_debian-installer b/scripts/build/installer_debian-installer index 50ff5c980..97128fb35 100755 --- a/scripts/build/installer_debian-installer +++ b/scripts/build/installer_debian-installer @@ -60,7 +60,7 @@ else fi # Setting destination directory -case "${LIVE_IMAGE_TYPE}" in +case "${LB_IMAGE_TYPE}" in netboot) DESTDIR="tftpboot/debian-install/${LB_ARCHITECTURE}" ;; @@ -76,7 +76,7 @@ case "${LB_DEBIAN_INSTALLER}" in DI_IMAGE_TYPE="netboot" ;; *) - case "${LIVE_IMAGE_TYPE}" in + case "${LB_IMAGE_TYPE}" in netboot) DI_IMAGE_TYPE="netboot" ;; @@ -734,7 +734,7 @@ EOF DISTRIBUTIONS="${DISTRIBUTIONS} ${LB_PARENT_DISTRIBUTION_BINARY}" fi - case "${LIVE_IMAGE_TYPE}" in + case "${LB_IMAGE_TYPE}" in hdd) case "${LB_BINARY_FILESYSTEM}" in fat*|ntfs)