raspiblitz/ci/set_variables.sh
openoms 0d0e5581a5
ci: UEFI image generation and build updates (#4033)
* ci: use uefi for amd64 image, debian 12.1.0
* build: add amd64 legacyboot image action
* ci: store var values in config, update readme
* fix: add raspi repo on aarch64 only
fixes: https://github.com/raspiblitz/raspiblitz/issues/4029
* docs: guide to extend the root partition
2023-07-30 10:51:33 +02:00

71 lines
1.2 KiB
Bash
Executable file

#!/bin/bash
function set_variables() {
declare -A params
while (("$#")); do
case "$1" in
--pack)
params[pack]="$2"
shift 2
;;
--github_user)
params[github_user]="$2"
shift 2
;;
--branch)
params[branch]="$2"
shift 2
;;
# arm64-rpi
--image_link)
params[image_link]="$2"
shift 2
;;
# arm64-rpi
--image_checksum)
params[image_checksum]="$2"
shift 2
;;
# amd64
# preseed.cfg
--preseed_file)
params[preseed_file]="$2"
shift 2
;;
# amd64
# uefi | bios
--boot)
params[boot]="$2"
shift 2
;;
# amd64
# none | gnome
--desktop)
params[desktop]="$2"
shift 2
;;
--)
shift
break
;;
*)
echo "Error: Invalid argument"
exit 1
;;
esac
done
# Reset the global vars string
vars=""
# Iterate over all keys in the params array
for key in "${!params[@]}"; do
# If the value for this key is not empty, add it to vars
if [ -n "${params[$key]}" ]; then
vars="$vars -var $key=${params[$key]}"
fi
done
export vars
}