summaryrefslogtreecommitdiff
path: root/functions
diff options
context:
space:
mode:
authorLyndon Brown <jnqnfe@gmail.com>2020-03-28 02:21:36 +0000
committerLyndon Brown <jnqnfe@gmail.com>2020-04-23 11:52:04 +0100
commitf73797158e631d9fa2d4c9994e2feff542a7501b (patch)
treec977bc05f20d3ace1df3166fd904ac288f2c1611 /functions
parentae9143141d460ffbbe6084209977653cdc375bdb (diff)
downloadvyos-live-build-f73797158e631d9fa2d4c9994e2feff542a7501b.tar.gz
vyos-live-build-f73797158e631d9fa2d4c9994e2feff542a7501b.zip
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
Diffstat (limited to 'functions')
-rwxr-xr-xfunctions/bootloaders.sh4
-rwxr-xr-xfunctions/defaults.sh3
2 files changed, 2 insertions, 5 deletions
diff --git a/functions/bootloaders.sh b/functions/bootloaders.sh
index 14e50ac4c..a6883a67f 100755
--- a/functions/bootloaders.sh
+++ b/functions/bootloaders.sh
@@ -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
}
diff --git a/functions/defaults.sh b/functions/defaults.sh
index f1bb85dce..85efca7df 100755
--- a/functions/defaults.sh
+++ b/functions/defaults.sh
@@ -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}"