From ad01ab114dd83edda61c06aa01fd899c80ee0a68 Mon Sep 17 00:00:00 2001 From: Kostiantyn Bushko Date: Fri, 17 Jan 2020 13:37:14 +0200 Subject: build and run image without ostree support for qemux86-64 Signed-off-by: Kostiantyn Bushko --- scripts/envsetup.sh | 33 +++++++++++++++++++++------------ 1 file changed, 21 insertions(+), 12 deletions(-) (limited to 'scripts/envsetup.sh') diff --git a/scripts/envsetup.sh b/scripts/envsetup.sh index 19a5c94..5b3b068 100755 --- a/scripts/envsetup.sh +++ b/scripts/envsetup.sh @@ -5,17 +5,24 @@ MACHINE="$1" BUILDDIR="build" DISTRO="poky-sota-systemd" BASE_CONF="local.conf.base.append" -declare -A supported_distros=( ["poky-sota-systemd"]="local.conf.systemd.append" ["poky-sota"]="local.conf.base.append" ) -[[ "$#" -lt 1 ]] && { echo "Usage: ${SCRIPT} [builddir] [distro=< poky-sota-systemd | poky-sota >]"; return 1; } +# 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" +) + +[[ "$#" -lt 1 ]] && { echo "Usage: ${SCRIPT} [builddir] [distro=< poky-sota-systemd | poky-sota | poky >]"; return 1; } [[ "$#" -ge 2 ]] && { BUILDDIR="$2"; } [[ "$#" -eq 3 ]] && { DISTRO="$3"; } # detect if this script is sourced: see http://stackoverflow.com/a/38128348/6255594 SOURCED=0 -if [ -n "$ZSH_EVAL_CONTEXT" ]; then +if [[ -n "$ZSH_EVAL_CONTEXT" ]]; then [[ "$ZSH_EVAL_CONTEXT" =~ :file$ ]] && { SOURCED=1; SOURCEDIR=$(cd "$(dirname -- "$0")" && pwd -P); } -elif [ -n "$BASH_VERSION" ]; then +elif [[ -n "$BASH_VERSION" ]]; then [[ "$0" != "${BASH_SOURCE[0]}" ]] && { SOURCED=1; SOURCEDIR=$(cd "$(dirname -- "${BASH_SOURCE[0]}")" && pwd -P); } fi @@ -26,23 +33,25 @@ if [[ $SOURCED -ne 1 ]]; then fi METADIR=${METADIR:-${SOURCEDIR}/../..} -DISTRO_CONF=${supported_distros[$DISTRO]} -[[ -n $DISTRO_CONF ]] && { echo "Using $DISTRO_CONF for the specified distro $DISTRO"; } || { echo "The specified distro $DISTRO is not supported"; return 1; } 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; } + 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 + "${METADIR}/meta-updater/conf/$BASE_CONF" >> conf/local.conf - if [ "$BASE_CONF" != "$DISTRO_CONF" ]; then - cat "${METADIR}/meta-updater/conf/$DISTRO_CONF" >> conf/local.conf - fi + for config in ${DISTRO_CONFIGS[@]}; 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 +fi \ No newline at end of file -- cgit v1.2.3-54-g00ecf From 52f60c0dd1948d197cc051baa1b828521679c174 Mon Sep 17 00:00:00 2001 From: Kostiantyn Bushko Date: Thu, 23 Jan 2020 10:54:45 +0200 Subject: Fix default uboot-enable variable in qemu command script Signed-off-by: Kostiantyn Bushko --- scripts/envsetup.sh | 2 +- scripts/qemucommand.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'scripts/envsetup.sh') diff --git a/scripts/envsetup.sh b/scripts/envsetup.sh index 5b3b068..a7ee877 100755 --- a/scripts/envsetup.sh +++ b/scripts/envsetup.sh @@ -45,7 +45,7 @@ if [[ ! -f "${BUILDDIR}/conf/local.conf" ]]; then 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 + "${METADIR}/meta-updater/conf/$BASE_CONF" >> conf/local.conf for config in ${DISTRO_CONFIGS[@]}; do if [[ "$BASE_CONF" != "$config" ]]; then diff --git a/scripts/qemucommand.py b/scripts/qemucommand.py index bd7b890..86b5b9f 100644 --- a/scripts/qemucommand.py +++ b/scripts/qemucommand.py @@ -41,7 +41,7 @@ def random_mac(): class QemuCommand(object): def __init__(self, args): print(args) - self.enable_u_boot = None + self.enable_u_boot = True self.dry_run = args.dry_run self.overlay = args.overlay self.host_fwd = None -- cgit v1.2.3-54-g00ecf