diff options
Diffstat (limited to 'external/meta-updater/scripts')
-rwxr-xr-x | external/meta-updater/scripts/envsetup.sh | 32 | ||||
-rwxr-xr-x | external/meta-updater/scripts/find_aktualizr_dependencies.sh | 9 |
2 files changed, 26 insertions, 15 deletions
diff --git a/external/meta-updater/scripts/envsetup.sh b/external/meta-updater/scripts/envsetup.sh index a7ee877d..c12f193b 100755 --- a/external/meta-updater/scripts/envsetup.sh +++ b/external/meta-updater/scripts/envsetup.sh @@ -6,15 +6,23 @@ BUILDDIR="build" DISTRO="poky-sota-systemd" BASE_CONF="local.conf.base.append" +if [ -n "$ZSH_VERSION" ]; then + # be more compatible with bash + setopt shwordsplit +fi + # A definition of a dictionary with a list of configuration files that must be appended # to resulting conf/local.conf file for each particular distribution. -declare -A supported_distros=( - ["poky-sota-systemd"]="local.conf.systemd.append" - ["poky-sota"]="local.conf.base.append" - ["poky"]="local.conf.systemd.append local.conf.nonostree.append" -) +declare -A supported_distros +supported_distros[poky-sota-systemd]="local.conf.systemd.append" +supported_distros[poky-sota]="local.conf.base.append" +supported_distros[poky]="local.conf.systemd.append local.conf.nonostree.append" + +usage () { + echo "Usage: ${SCRIPT} <machine> [builddir] [distro=< poky-sota-systemd | poky-sota | poky >]" +} -[[ "$#" -lt 1 ]] && { echo "Usage: ${SCRIPT} <machine> [builddir] [distro=< poky-sota-systemd | poky-sota | poky >]"; return 1; } +[[ "$#" -lt 1 ]] && { usage; return 1; } [[ "$#" -ge 2 ]] && { BUILDDIR="$2"; } [[ "$#" -eq 3 ]] && { DISTRO="$3"; } @@ -35,23 +43,27 @@ fi METADIR=${METADIR:-${SOURCEDIR}/../..} if [[ ! -f "${BUILDDIR}/conf/local.conf" ]]; then - declare -a DISTRO_CONFIGS=${supported_distros[$DISTRO]} - [[ -n ${DISTRO_CONFIGS[@]} ]] && { echo "Using (${DISTRO_CONFIGS[*]}) for the specified distro '$DISTRO'"; } || { echo "The specified distro $DISTRO is not supported"; return 1; } + if [ -z "${supported_distros[$DISTRO]}" ]; then + echo "The specified distro $DISTRO is not supported" + usage + return 1 + fi source "$METADIR/poky/oe-init-build-env" "$BUILDDIR" echo "METADIR := \"\${@os.path.abspath('${METADIR}')}\"" >> conf/bblayers.conf cat "${METADIR}/meta-updater/conf/include/bblayers/sota.inc" >> conf/bblayers.conf cat "${METADIR}/meta-updater/conf/include/bblayers/sota_${MACHINE}.inc" >> conf/bblayers.conf + sed -e "s/##MACHINE##/$MACHINE/g" \ -e "s/##DISTRO##/$DISTRO/g" \ "${METADIR}/meta-updater/conf/$BASE_CONF" >> conf/local.conf - for config in ${DISTRO_CONFIGS[@]}; do + for config in ${supported_distros[$DISTRO]}; do if [[ "$BASE_CONF" != "$config" ]]; then cat "${METADIR}/meta-updater/conf/$config" >> conf/local.conf fi done else source "$METADIR/poky/oe-init-build-env" "$BUILDDIR" -fi
\ No newline at end of file +fi diff --git a/external/meta-updater/scripts/find_aktualizr_dependencies.sh b/external/meta-updater/scripts/find_aktualizr_dependencies.sh index fcb2f97e..604cc9ac 100755 --- a/external/meta-updater/scripts/find_aktualizr_dependencies.sh +++ b/external/meta-updater/scripts/find_aktualizr_dependencies.sh @@ -5,10 +5,9 @@ parentdir="$(dirname "$0")" # Does NOT include garage-sign, anything used only for testing (i.e. strace and # gtest), any of the git submodules, all of which are also only used for -# testing (tuf-test-vectors, isotp-c, ostreesysroot, and HdrHistogram_c), or -# any other third party modules included directly into the source tree -# (jsoncpp, open62541, picojson). Also check libp11, dpkg, and systemd since -# those are common dependencies not enabled by default. +# testing (tuf-test-vectors, jsoncpp, and HdrHistogram_c), or any other third +# party modules included directly into the source tree. Also check libp11 and +# systemd since those are common dependencies not enabled by default. ${parentdir}/find_dependencies.py aktualizr ${parentdir}/find_dependencies.py aktualizr-shared-prov ${parentdir}/find_dependencies.py aktualizr-shared-prov-creds @@ -18,7 +17,7 @@ ${parentdir}/find_dependencies.py aktualizr-auto-reboot ${parentdir}/find_dependencies.py aktualizr-disable-send-ip ${parentdir}/find_dependencies.py aktualizr-log-debug ${parentdir}/find_dependencies.py aktualizr-polling-interval +${parentdir}/find_dependencies.py aktualizr-virtualsec ${parentdir}/find_dependencies.py libp11 -${parentdir}/find_dependencies.py dpkg ${parentdir}/find_dependencies.py systemd |