summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLyndon Brown <jnqnfe@gmail.com>2020-03-28 05:13:11 +0000
committerRaphaƫl Hertzog <hertzog@debian.org>2020-04-23 14:51:09 +0200
commit39e4d3e3cbcc8d37700cfe46a95f669b4d9479ea (patch)
treee30a4295f421d6386d16a310c58659a0058f93f7
parentcede584a5cece40511c94fcec31569218d00419c (diff)
downloadvyos-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
-rwxr-xr-xfunctions/defaults.sh16
-rw-r--r--manpages/en/lb_config.16
-rwxr-xr-xscripts/build/binary_disk10
-rwxr-xr-xscripts/build/binary_grub-efi2
-rwxr-xr-xscripts/build/binary_grub-legacy8
-rwxr-xr-xscripts/build/binary_grub-pc6
-rwxr-xr-xscripts/build/binary_hdd3
-rwxr-xr-xscripts/build/binary_includes8
-rwxr-xr-xscripts/build/binary_netboot3
-rwxr-xr-xscripts/build/binary_syslinux4
-rwxr-xr-xscripts/build/binary_tar3
-rwxr-xr-xscripts/build/binary_zsync2
-rwxr-xr-xscripts/build/config6
-rwxr-xr-xscripts/build/installer_debian-installer4
14 files changed, 38 insertions, 43 deletions
diff --git a/functions/defaults.sh b/functions/defaults.sh
index 73b90bed7..c52acb80a 100755
--- a/functions/defaults.sh
+++ b/functions/defaults.sh
@@ -374,7 +374,7 @@ Set_config_defaults ()
case "${LB_ARCHITECTURES}" in
amd64|i386)
case "${LIVE_IMAGE_TYPE}" in
- hdd*|netboot)
+ hdd|netboot)
LB_BOOTLOADERS="syslinux"
;;
*)
@@ -451,11 +451,11 @@ Set_config_defaults ()
if [ -n "${LB_DEBIAN_INSTALLER_PRESEEDFILE}" ]
then
case "${LIVE_IMAGE_TYPE}" in
- iso*)
+ iso|iso-hybrid)
_LB_BOOTAPPEND_PRESEED="file=/cdrom/install/${LB_DEBIAN_INSTALLER_PRESEEDFILE}"
;;
- hdd*)
+ hdd)
_LB_BOOTAPPEND_PRESEED="file=/hd-media/install/${LB_DEBIAN_INSTALLER_PRESEEDFILE}"
;;
@@ -470,6 +470,9 @@ Set_config_defaults ()
;;
esac
;;
+
+ tar)
+ ;;
esac
fi
@@ -618,8 +621,13 @@ Check_config_defaults ()
esac
fi
+ if ! In_list "${LIVE_IMAGE_TYPE}" iso iso-hybrid hdd tar netboot; then
+ Echo_error "You have specified an invalid value for --binary-image."
+ exit 1
+ fi
+
case "${LIVE_IMAGE_TYPE}" in
- hdd*)
+ hdd)
case "${LB_FIRST_BOOTLOADER}" in
grub-legacy)
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."
diff --git a/manpages/en/lb_config.1 b/manpages/en/lb_config.1
index e0b7d50c7..897a0db6c 100644
--- a/manpages/en/lb_config.1
+++ b/manpages/en/lb_config.1
@@ -36,7 +36,7 @@
.br
[\fB\-\-binary\-filesystem\fR fat16|fat32|ext2|ext3|ext4|ntfs]
.br
- [\-b|\fB\-\-binary\-images\fR iso|iso\-hybrid|netboot|tar|hdd]
+ [\-b|\fB\-\-binary\-image\fR iso|iso\-hybrid|netboot|tar|hdd]
.br
[\fB\-\-bootappend\-install\fR \fIPARAMETER\fR|"\fIPARAMETERS\fR"]
.br
@@ -276,8 +276,8 @@ defines which package archive areas (comma or space separated) of a debian packa
defines if debian backports package archives should be included in the image or not.
.IP "\fB\-\-binary\-filesystem\fR fat16|fat32|ext2|ext3|ext4|ntfs" 4
defines the filesystem to be used in the image type. This only has an effect if the selected binary image type lets you choose a filesystem. For example, when selection ISO the resulting CD/DVD has always the filesystem ISO9660. When building HDD images for USB sticks, this is active. Note that it defaults to fat16 on all architectures except sparc where it defaults to ext4. Also note that if you choose fat16 and your resulting binary image gets bigger than 2GB, the binary filesystem automatically gets switched to fat32.
-.IP "\-b|\fB\-\-binary\-images\fR iso|iso\-hybrid|netboot|tar|hdd" 4
-defines the image type to build. By default, for images using syslinux this is set to iso\-hybrid to build CD/DVD images that may also be used like HDD images, for non\-syslinux images, it defaults to ISO.
+.IP "\-b|\fB\-\-binary\-image\fR iso|iso\-hybrid|netboot|tar|hdd" 4
+defines the image type to build. By default, for images using syslinux this is set to 'iso\-hybrid' to build CD/DVD images that may also be used like HDD images, for non\-syslinux images, it defaults to 'iso'.
.IP "\fB\-\-bootappend\-install\fR \fIPARAMETER\fR|""\fIPARAMETERS\fR""" 4
sets boot parameters specific to debian\-installer, if included.
.IP "\fB\-\-bootappend\-live\fR \fIPARAMETER\fR|""\fIPARAMETERS\fR""" 4
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"
;;