bootloaders: improve bootloader list handling
two parts of the code worked with both comma and space separated lists, while two others only worked with comma separated. swapping out commas with spaces when we setup the var in Set_config_defaults() means that individual scripts no longer need to worry about it and everything supports both; and that we can avoid the IFS/OLDIFS mess. Gbp-Dch: Short
This commit is contained in:
parent
ae9143141d
commit
f73797158e
|
@ -10,16 +10,12 @@
|
|||
|
||||
Is_Requested_Bootloader ()
|
||||
{
|
||||
local OLDIFS="$IFS"
|
||||
local IFS=","
|
||||
local BOOTLOADER
|
||||
for BOOTLOADER in ${LB_BOOTLOADERS}; do
|
||||
if [ "${BOOTLOADER}" = "${1}" ]; then
|
||||
IFS="$OLDIFS"
|
||||
return 0
|
||||
fi
|
||||
done
|
||||
IFS="$OLDIFS"
|
||||
return 1
|
||||
}
|
||||
|
||||
|
|
|
@ -381,8 +381,9 @@ Set_config_defaults ()
|
|||
;;
|
||||
esac
|
||||
fi
|
||||
LB_BOOTLOADERS="$(echo "${LB_BOOTLOADERS}" | tr "," " ")"
|
||||
|
||||
LB_FIRST_BOOTLOADER=$(echo "${LB_BOOTLOADERS}" | awk -F, '{ print $1 }')
|
||||
LB_FIRST_BOOTLOADER=$(echo "${LB_BOOTLOADERS}" | awk '{ print $1 }')
|
||||
|
||||
# Setting checksums
|
||||
LB_CHECKSUMS="${LB_CHECKSUMS:-sha256}"
|
||||
|
|
|
@ -286,7 +286,7 @@ sets boot parameters specific to debian\-live. A complete list of boot parameter
|
|||
.IP "\fB\-\-bootappend\-live\-failsafe\fR \fIPARAMETER\fR|""\fIPARAMETERS\fR""" 4
|
||||
sets boot parameters specific to debian\-live failsafe boot entries. A complete list of boot parameters can be found in the \fIlive\-boot\fR(7) and \fIlive\-config\fR(7) manual pages.
|
||||
.IP "\fB\-\-bootloaders\fR grub-legacy|grub-pc|syslinux|grub-efi" 4
|
||||
defines which bootloaders to use in the generated image. This only has an effect if the selected binary image type lets you choose the bootloader. For example, if you build an ISO then syslinux (or more precise, isolinux) is always used. Also note that not all combinations of binary images types and bootloaders are supported (\fBlb config\fR will fail to create such an unsupported configuration and will give a explanation about it). For HDD images on amd64 and i386, the default is syslinux. This option supports more than one bootloader to be specified (comma separated) in order to allow for both BIOS and EFI bootloaders to be included, though note that only one of each type can be used (i.e. do not try to use two BIOS bootloaders).
|
||||
defines which bootloaders to use in the generated image. This only has an effect if the selected binary image type lets you choose the bootloader. For example, if you build an ISO then syslinux (or more precise, isolinux) is always used. Also note that not all combinations of binary images types and bootloaders are supported (\fBlb config\fR will fail to create such an unsupported configuration and will give a explanation about it). For HDD images on amd64 and i386, the default is syslinux. This option supports more than one bootloader to be specified (space or comma separated) in order to allow for both BIOS and EFI bootloaders to be included, though note that only one of each type can be used (i.e. do not try to use two BIOS bootloaders).
|
||||
.IP "\fB\-\-bootstrap\-qemu\-arch \fIARCH\fR" 4
|
||||
sets the architectures to use foreign bootstrap. Defaults to empty.
|
||||
.IP "\fB\-\-bootstrap\-qemu\-exclude \fIPACKAGES\fR" 4
|
||||
|
|
|
@ -53,7 +53,7 @@ Check_package chroot /sbin/parted parted
|
|||
Check_package host /sbin/fdisk fdisk
|
||||
Check_package host /sbin/losetup mount
|
||||
|
||||
for BOOTLOADER in $(echo "${LB_BOOTLOADERS}" | tr "," "\n"); do
|
||||
for BOOTLOADER in ${LB_BOOTLOADERS}; do
|
||||
case "${BOOTLOADER}" in
|
||||
grub-legacy)
|
||||
Check_package chroot /usr/sbin/grub grub
|
||||
|
|
|
@ -104,8 +104,6 @@ fi
|
|||
# Set an explicit modification date
|
||||
XORRISO_OPTIONS="${XORRISO_OPTIONS} --modification-date=$(date --utc --date="@${SOURCE_DATE_EPOCH:-$(date +%s)}" +%Y%m%d%H%m%S00)"
|
||||
|
||||
OLDIFS="$IFS"
|
||||
IFS=","
|
||||
BOOTLOADER_NUMBER=0
|
||||
for BOOTLOADER in ${LB_BOOTLOADERS}
|
||||
do
|
||||
|
@ -156,7 +154,6 @@ do
|
|||
esac
|
||||
|
||||
done
|
||||
IFS="$OLDIFS"
|
||||
|
||||
#if [ "${LB_DEBIAN_INSTALLER}" != "live" ]
|
||||
#then
|
||||
|
|
|
@ -54,7 +54,7 @@ Chroot chroot "sh source-selection.sh"
|
|||
rm -f chroot/source-selection.sh
|
||||
mv chroot/source-selection.txt ./
|
||||
|
||||
for BOOTLOADER in $(echo "${LB_BOOTLOADERS}" | tr "," "\n"); do
|
||||
for BOOTLOADER in ${LB_BOOTLOADERS}; do
|
||||
echo "${BOOTLOADER}" >> source-selection.txt
|
||||
done
|
||||
|
||||
|
|
Loading…
Reference in New Issue