diff options
author | Lyndon Brown <jnqnfe@gmail.com> | 2020-03-28 05:13:11 +0000 |
---|---|---|
committer | Raphaƫl Hertzog <hertzog@debian.org> | 2020-04-23 14:51:09 +0200 |
commit | 39e4d3e3cbcc8d37700cfe46a95f669b4d9479ea (patch) | |
tree | e30a4295f421d6386d16a310c58659a0058f93f7 /scripts | |
parent | cede584a5cece40511c94fcec31569218d00419c (diff) | |
download | vyos-live-build-39e4d3e3cbcc8d37700cfe46a95f669b4d9479ea.tar.gz vyos-live-build-39e4d3e3cbcc8d37700cfe46a95f669b4d9479ea.zip |
--binary-images can support only a single type
whilst some parts of the codebase were set up to work with multiple types
specified, others did not work with it and would not necessarily be easy
to adjust. this thus makes some tweaks to adjust things accordingly.
- option renamed to singular form (maintaining backwards compatibility)
- a validation check has been added
- unnecessary glob style type references fixed
- checks with In_list changed to a direct singular comparison
- typo of type "netboot" written as just "net" fixed (though unreachable
so of no consequence; really the code could be removed but it's trivial)
Gbp-Dch: Short
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/build/binary_disk | 10 | ||||
-rwxr-xr-x | scripts/build/binary_grub-efi | 2 | ||||
-rwxr-xr-x | scripts/build/binary_grub-legacy | 8 | ||||
-rwxr-xr-x | scripts/build/binary_grub-pc | 6 | ||||
-rwxr-xr-x | scripts/build/binary_hdd | 3 | ||||
-rwxr-xr-x | scripts/build/binary_includes | 8 | ||||
-rwxr-xr-x | scripts/build/binary_netboot | 3 | ||||
-rwxr-xr-x | scripts/build/binary_syslinux | 4 | ||||
-rwxr-xr-x | scripts/build/binary_tar | 3 | ||||
-rwxr-xr-x | scripts/build/binary_zsync | 2 | ||||
-rwxr-xr-x | scripts/build/config | 6 | ||||
-rwxr-xr-x | scripts/build/installer_debian-installer | 4 |
12 files changed, 23 insertions, 36 deletions
diff --git a/scripts/build/binary_disk b/scripts/build/binary_disk index a2bdf9ad9..0e56eb8ef 100755 --- a/scripts/build/binary_disk +++ b/scripts/build/binary_disk @@ -21,13 +21,9 @@ USAGE="${PROGRAM} [--force]" # Processing arguments and configuration files Init_config_data "${@}" -case "${LIVE_IMAGE_TYPE}" in - iso*|hdd*) - ;; - *) - exit 0 - ;; -esac +if ! In_list "${LIVE_IMAGE_TYPE}" iso iso-hybrid hdd; then + exit 0 +fi Echo_message "Begin installing disk information..." diff --git a/scripts/build/binary_grub-efi b/scripts/build/binary_grub-efi index c234d3769..90e25e4fb 100755 --- a/scripts/build/binary_grub-efi +++ b/scripts/build/binary_grub-efi @@ -40,7 +40,7 @@ Check_crossarchitectures # Setting destination directory case "${LIVE_IMAGE_TYPE}" in - hdd*|netboot) + hdd|netboot) Echo_warning "Bootloader in this image type not yet supported by live-build." Echo_error "This would produce a not bootable image, aborting (FIXME)." exit 1 diff --git a/scripts/build/binary_grub-legacy b/scripts/build/binary_grub-legacy index 7d801b5fc..39e59d437 100755 --- a/scripts/build/binary_grub-legacy +++ b/scripts/build/binary_grub-legacy @@ -104,7 +104,7 @@ esac # Setting destination directory case "${LIVE_IMAGE_TYPE}" in - iso*|tar) + iso|iso-hybrid|tar) case "${LB_INITRAMFS}" in live-boot) DESTDIR_LIVE="binary/live" @@ -118,7 +118,7 @@ case "${LIVE_IMAGE_TYPE}" in DESTDIR_INSTALL="binary/install" ;; - hdd*|netboot) + hdd|netboot) Echo_warning "Bootloader in this image type not yet supported by live-build." Echo_error "This would produce a not bootable image, aborting (FIXME)." exit 1 @@ -214,11 +214,11 @@ mkdir -p binary/boot/grub cp -r "${_SOURCE}"/* binary/boot/grub case ${LIVE_IMAGE_TYPE} in - iso*) + iso|iso-hybrid) FILES="chroot/usr/lib/grub/*/stage2_eltorito" ;; - hdd*|tar) + hdd|tar) FILES="chroot/usr/lib/grub/*/stage1 chroot/usr/lib/grub/*/e2fs_stage1_5 chroot/usr/lib/grub/*/stage2" ;; esac diff --git a/scripts/build/binary_grub-pc b/scripts/build/binary_grub-pc index 462fd6286..4549d3b41 100755 --- a/scripts/build/binary_grub-pc +++ b/scripts/build/binary_grub-pc @@ -49,7 +49,7 @@ Install_package # Setting destination directory case "${LIVE_IMAGE_TYPE}" in - hdd*|netboot) + hdd|netboot) Echo_warning "Bootloader in this image type not yet supported by live-build." Echo_error "This would produce a not bootable image, aborting (FIXME)." exit 1 @@ -60,11 +60,11 @@ esac mkdir -p binary/boot/grub/i386-pc case ${LIVE_IMAGE_TYPE} in - iso*) + 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" ;; - hdd*|tar) + hdd|tar) FILES="chroot/usr/lib/grub/i386-pc/*" ;; esac diff --git a/scripts/build/binary_hdd b/scripts/build/binary_hdd index 437913929..19f7b23ae 100755 --- a/scripts/build/binary_hdd +++ b/scripts/build/binary_hdd @@ -21,8 +21,7 @@ USAGE="${PROGRAM} [--force]" # Processing arguments and configuration files Init_config_data "${@}" -if ! In_list hdd "${LIVE_IMAGE_TYPE}" -then +if [ "${LIVE_IMAGE_TYPE}" != "hdd" ]; then exit 0 fi diff --git a/scripts/build/binary_includes b/scripts/build/binary_includes index e8af34c63..b9482a552 100755 --- a/scripts/build/binary_includes +++ b/scripts/build/binary_includes @@ -40,11 +40,9 @@ then cd "${OLDPWD}" # Removing symlinks - case "${LIVE_IMAGE_TYPE}" in - hdd*) - find binary -type l | xargs rm -f - ;; - esac + if [ "${LIVE_IMAGE_TYPE}" = "hdd" ]; then + find binary -type l | xargs rm -f + fi fi # Creating stage file diff --git a/scripts/build/binary_netboot b/scripts/build/binary_netboot index cd91162c8..bb49bda85 100755 --- a/scripts/build/binary_netboot +++ b/scripts/build/binary_netboot @@ -21,8 +21,7 @@ USAGE="${PROGRAM} [--force]" # Processing arguments and configuration files Init_config_data "${@}" -if ! In_list netboot "${LIVE_IMAGE_TYPE}" -then +if [ "${LIVE_IMAGE_TYPE}" != "netboot" ]; then exit 0 fi diff --git a/scripts/build/binary_syslinux b/scripts/build/binary_syslinux index 52a92f191..86488fec4 100755 --- a/scripts/build/binary_syslinux +++ b/scripts/build/binary_syslinux @@ -49,7 +49,7 @@ esac # Assembling image specifics case "${LIVE_IMAGE_TYPE}" in - iso*) + iso|iso-hybrid) _BOOTLOADER="isolinux" _TARGET="binary/isolinux" ;; @@ -59,7 +59,7 @@ case "${LIVE_IMAGE_TYPE}" in _TARGET="tftpboot" ;; - hdd*|*) + hdd|tar) case ${LB_BINARY_FILESYSTEM} in fat*|ntfs) _BOOTLOADER="syslinux" diff --git a/scripts/build/binary_tar b/scripts/build/binary_tar index d6ae6e0f3..23bcbf6f0 100755 --- a/scripts/build/binary_tar +++ b/scripts/build/binary_tar @@ -21,8 +21,7 @@ USAGE="${PROGRAM} [--force]" # Processing arguments and configuration files Init_config_data "${@}" -if ! In_list tar "${LIVE_IMAGE_TYPE}" -then +if [ "${LIVE_IMAGE_TYPE}" != "tar" ]; then exit 0 fi diff --git a/scripts/build/binary_zsync b/scripts/build/binary_zsync index feca6c83a..ac5dd83c5 100755 --- a/scripts/build/binary_zsync +++ b/scripts/build/binary_zsync @@ -64,7 +64,7 @@ case "${LIVE_IMAGE_TYPE}" in _IMAGES="${LIVE_IMAGE_NAME}-${LB_ARCHITECTURES}.img" ;; - net) + netboot) _IMAGES="${LIVE_IMAGE_NAME}-${LB_ARCHITECTURES}.netboot.tar*" ;; diff --git a/scripts/build/config b/scripts/build/config index 705d8e180..3cb31f660 100755 --- a/scripts/build/config +++ b/scripts/build/config @@ -31,7 +31,7 @@ USAGE="${PROGRAM} [--apt apt|aptitude]\n\ \t [--archive-areas ARCHIVE_AREA|\"ARCHIVE_AREAS\"]\n\ \t [--backports true|false]\n\ \t [--binary-filesystem fat16|fat32|ext2|ext3|ext4|ntfs]\n\ -\t [-b|--binary-images iso|iso-hybrid|netboot|tar|hdd]\n\ +\t [-b|--binary-image iso|iso-hybrid|netboot|tar|hdd]\n\ \t [--bootappend-install PARAMETER|\"PARAMETERS\"]\n\ \t [--bootappend-live PARAMETER|\"PARAMETERS\"]\n\ \t [--bootappend-live-failsafe PARAMETER|\"PARAMETERS\"]\n\ @@ -151,7 +151,7 @@ Local_arguments () mirror-binary-security:,mirror-debian-installer:, archive-areas:,parent-archive-areas:,chroot-filesystem:, gzip-options:,image-name:,interactive:,keyring-packages:,linux-flavours:,linux-packages:, - security:,updates:,backports:,binary-filesystem:,binary-images:, + security:,updates:,backports:,binary-filesystem:,binary-image:,binary-images:, apt-indices:,bootappend-install:,bootappend-live:,bootappend-live-failsafe:,bootloader:,bootloaders:,checksums:,compression:,config:,zsync:,build-with-chroot:, debian-installer:,debian-installer-distribution:,debian-installer-preseedfile:,debian-installer-gui:, grub-splash:,isohybrid-options:,hdd-label:,hdd-size:,hdd-partition-start:,iso-application:,iso-preparer:,iso-publisher:, @@ -519,7 +519,7 @@ Local_arguments () shift 2 ;; - -b|--binary-images) + -b|--binary-image|--binary-images) LIVE_IMAGE_TYPE="${2}" shift 2 ;; diff --git a/scripts/build/installer_debian-installer b/scripts/build/installer_debian-installer index be596ed27..e91c65ad2 100755 --- a/scripts/build/installer_debian-installer +++ b/scripts/build/installer_debian-installer @@ -73,10 +73,6 @@ case "${LIVE_IMAGE_TYPE}" in DESTDIR="tftpboot/debian-install/${LB_ARCHITECTURES}" ;; - hdd*|tar) - DESTDIR="binary/install" - ;; - *) DESTDIR="binary/install" ;; |