diff options
author | 2021-03-15 01:03:43 +0100 | |
---|---|---|
committer | 2021-03-15 01:03:43 +0100 | |
commit | 9722fb1b99011c720459fa5f11e9b78929b060ac (patch) | |
tree | 2d21dc16346b479261aebea5e6cec4edbf14b65c /gen_determineargs.sh | |
parent | linuxrc: Refactor switch_root error handling (diff) | |
download | genkernel-9722fb1b99011c720459fa5f11e9b78929b060ac.tar.gz genkernel-9722fb1b99011c720459fa5f11e9b78929b060ac.tar.bz2 genkernel-9722fb1b99011c720459fa5f11e9b78929b060ac.zip |
Change --firmware-files handling
- Move from space-separated list to comma-separated list
to add support for firmware files with spaces.
- Add support for firmware files with spaces.
- Check for specified firmware files in determine_real_args() which
will allow us to error out early.
- Clarify documentation.
Fixes: c576f99b0b ("Misc improvements for FIRMWARE* handling")
Bug: https://bugs.gentoo.org/775221
Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
Diffstat (limited to 'gen_determineargs.sh')
-rwxr-xr-x | gen_determineargs.sh | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/gen_determineargs.sh b/gen_determineargs.sh index 265c557..3e6e4dd 100755 --- a/gen_determineargs.sh +++ b/gen_determineargs.sh @@ -1240,10 +1240,14 @@ determine_real_args() { if isTrue "${FIRMWARE}" then - for ff in ${FIRMWARE_FILES}; do - [[ ${ff} = /* ]] && gen_die "FIRMWARE_FILES should list paths relative to FIRMWARE_DIR, not absolute." + IFS=',' read -r -a FIRMWARE_FILES <<< "${FIRMWARE_FILES}" + pushd "${FIRMWARE_DIR}" &>/dev/null || gen_die "Failed to chdir to '${FIRMWARE_DIR}'!" + local ff + for ff in "${FIRMWARE_FILES[@]}" + do + [[ ${ff} = /* ]] && gen_die "--firmware-files contains value '${ff}' which is not a relative path from '${FIRMWARE_DIR}'!" + [[ ! -e "${ff}" ]] && gen_die "--firmware-files contains value '${ff}' which was not found in '${FIRMWARE_DIR}'!" done - - [[ "${FIRMWARE_FILES}" = *,* ]] && gen_die "FIRMWARE_FILES should be a space-separated list." + popd &>/dev/null || gen_die "Failed to chdir!" fi } |