summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--recipes-core/images/initramfs-ostree-image.bb4
-rwxr-xr-xscripts/envsetup.sh53
2 files changed, 24 insertions, 33 deletions
diff --git a/recipes-core/images/initramfs-ostree-image.bb b/recipes-core/images/initramfs-ostree-image.bb
index 509b74d..cd872b8 100644
--- a/recipes-core/images/initramfs-ostree-image.bb
+++ b/recipes-core/images/initramfs-ostree-image.bb
@@ -21,6 +21,10 @@ inherit core-image
21 21
22IMAGE_ROOTFS_SIZE = "8192" 22IMAGE_ROOTFS_SIZE = "8192"
23 23
24# Users will often ask for extra space in their rootfs by setting this
25# globally. Since this is a initramfs, we don't want to make it bigger
26IMAGE_ROOTFS_EXTRA_SPACE = "0"
27
24BAD_RECOMMENDATIONS += "busybox-syslog" 28BAD_RECOMMENDATIONS += "busybox-syslog"
25 29
26 30
diff --git a/scripts/envsetup.sh b/scripts/envsetup.sh
index 5adf319..ff78681 100755
--- a/scripts/envsetup.sh
+++ b/scripts/envsetup.sh
@@ -1,48 +1,35 @@
1#!/bin/sh 1#!/bin/bash
2 2
3SCRIPT="envsetup.sh" 3SCRIPT="envsetup.sh"
4MACHINE="$1"
5BUILDDIR="build"
4 6
5MACHINE=$1 7[[ "$#" -lt 1 ]] && { echo "Usage: ${SCRIPT} <machine> [builddir]"; return 1; }
6 8[[ "$#" -eq 2 ]] && { BUILDDIR="$2"; }
7if [ "$#" -lt 1 ]; then
8 echo "Usage: ${SCRIPT} <machine> [builddir]"
9 return -1
10elif [ "$#" -eq 2 ]; then
11 BUILDDIR=$2
12else
13 BUILDDIR=build
14fi
15BULDDIR=$2
16 9
17# detect if this script is sourced: see http://stackoverflow.com/a/38128348/6255594 10# detect if this script is sourced: see http://stackoverflow.com/a/38128348/6255594
18SOURCED=0 11SOURCED=0
19if [ -n "$ZSH_EVAL_CONTEXT" ]; then 12if [ -n "$ZSH_EVAL_CONTEXT" ]; then
20 [[ $ZSH_EVAL_CONTEXT =~ :file$ ]] && { SOURCED=1; SOURCEDIR=$(cd $(dirname -- $0) && pwd -P); } 13 [[ "$ZSH_EVAL_CONTEXT" =~ :file$ ]] && { SOURCED=1; SOURCEDIR=$(cd "$(dirname -- "$0")" && pwd -P); }
21elif [ -n "$KSH_VERSION" ]; then
22 [[ "$(cd $(dirname -- $0) && pwd -P)/$(basename -- $0)" != "$(cd $(dirname -- ${.sh.file}) && pwd -P)/$(basename -- ${.sh.file})" ]] && { SOURCED=1; SOURCEDIR=$(cd $(dirname -- ${.sh.file}) && pwd -P); }
23elif [ -n "$BASH_VERSION" ]; then 14elif [ -n "$BASH_VERSION" ]; then
24 [[ $0 != "$BASH_SOURCE" ]] && { SOURCED=1; SOURCEDIR=$(cd $(dirname -- $BASH_SOURCE) && pwd -P); } 15 [[ "$0" != "${BASH_SOURCE[0]}" ]] && { SOURCED=1; SOURCEDIR=$(cd "$(dirname -- "${BASH_SOURCE[0]}")" && pwd -P); }
25fi 16fi
26 17
27if [ $SOURCED -ne 1 ]; then 18if [[ $SOURCED -ne 1 ]]; then
28 unset SOURCED 19 echo "Error: this script needs to be sourced in a supported shell" >&2
29 unset SOURCEDIR 20 echo "Please check that the current shell is bash or zsh and run this script as '. $0 <args>'" >&2
30 echo "Error: this script needs to be sourced in a supported shell" >&2 21 exit 1
31 echo "Please check that the current shell is bash, zsh or ksh and run this script as '. $0 <args>'" >&2
32 exit -1
33fi 22fi
34 23
35SCRIPTDIR=$(cd $(dirname $BASH_SOURCE) && pwd -P) 24METADIR="${SOURCEDIR}/../.."
36METADIR=$(cd $(dirname $BASH_SOURCE)/../.. && pwd -P)
37 25
38if [ -e ${BUILDDIR}/conf/local.conf ]; then 26if [[ ! -f "${BUILDDIR}/conf/local.conf" ]]; then
39 source $METADIR/poky/oe-init-build-env ${BUILDDIR} 27 source "$METADIR/poky/oe-init-build-env" "$BUILDDIR"
28 echo "METADIR := \"\${@os.path.abspath('${METADIR}')}\"" >> conf/bblayers.conf
29 cat "${METADIR}/meta-updater/conf/include/bblayers/sota.inc" >> conf/bblayers.conf
30 cat "${METADIR}/meta-updater/conf/include/bblayers/sota_${MACHINE}.inc" >> conf/bblayers.conf
31 echo "MACHINE = \"${MACHINE}\"" >> conf/local.conf
32 echo "DISTRO = \"poky-sota-systemd\"" >> conf/local.conf
40else 33else
41 source $METADIR/poky/oe-init-build-env ${BUILDDIR} 34 source "$METADIR/poky/oe-init-build-env" "$BUILDDIR"
42 echo "METADIR := \"\${@os.path.abspath('${METADIR}')}\"" >> conf/bblayers.conf
43 cat ${METADIR}/meta-updater/conf/include/bblayers/sota.inc >> conf/bblayers.conf
44 cat ${METADIR}/meta-updater/conf/include/bblayers/sota_${MACHINE}.inc >> conf/bblayers.conf
45 echo "MACHINE = \"${MACHINE}\"" >> conf/local.conf
46 echo "DISTRO = \"poky-sota-systemd\"" >> conf/local.conf
47fi 35fi
48