diff options
author | Anton Gerasimov <anton@advancedtelematic.com> | 2017-04-03 12:08:39 +0200 |
---|---|---|
committer | Anton Gerasimov <anton@advancedtelematic.com> | 2017-04-04 12:01:58 +0200 |
commit | 82a3c13a0b0c9979fa0812143d619748aa89c85d (patch) | |
tree | bd18751638ce99904dcd68ad2eba6e6db7851f41 | |
parent | b49c2631b6bc48ead4d352e2bd00cdfbca7af5e8 (diff) | |
download | meta-updater-82a3c13a0b0c9979fa0812143d619748aa89c85d.tar.gz |
Replace TEMPLATECONF with agl-like config snippets
-rw-r--r-- | conf/distro/sota.conf.inc | 5 | ||||
-rw-r--r-- | conf/include/bblayers/sota.inc | 5 | ||||
-rw-r--r-- | conf/include/bblayers/sota_minnowboard.inc | 2 | ||||
-rw-r--r-- | conf/include/bblayers/sota_porter.inc | 2 | ||||
-rw-r--r-- | conf/include/bblayers/sota_qemux86-64.inc | 2 | ||||
-rw-r--r-- | conf/include/bblayers/sota_raspberrypi.inc | 2 | ||||
-rw-r--r-- | conf/include/local/sota_minnowboard.inc | 6 | ||||
-rw-r--r-- | conf/include/local/sota_porter.inc | 11 | ||||
-rw-r--r-- | conf/include/local/sota_qemux86-64.inc | 12 | ||||
-rw-r--r-- | conf/include/local/sota_raspberrypi.inc | 16 | ||||
-rwxr-xr-x | scripts/envsetup.sh | 53 |
11 files changed, 115 insertions, 1 deletions
diff --git a/conf/distro/sota.conf.inc b/conf/distro/sota.conf.inc index c8b4388..55e9cac 100644 --- a/conf/distro/sota.conf.inc +++ b/conf/distro/sota.conf.inc | |||
@@ -1,7 +1,7 @@ | |||
1 | DISTRO_FEATURES_append = " sota" | 1 | DISTRO_FEATURES_append = " sota" |
2 | OVERRIDES .= ":sota" | 2 | OVERRIDES .= ":sota" |
3 | 3 | ||
4 | IMAGE_INSTALL_append = " ostree" | 4 | IMAGE_INSTALL_append = " ostree os-release" |
5 | 5 | ||
6 | # live image for OSTree-enabled systems | 6 | # live image for OSTree-enabled systems |
7 | IMAGE_CLASSES += "image_types_ostree image_types_ota" | 7 | IMAGE_CLASSES += "image_types_ostree image_types_ota" |
@@ -13,6 +13,9 @@ do_image_wic[depends] += "${IMAGE_BASENAME}:do_image_otaimg" | |||
13 | IMAGE_FSTYPES_remove_raspberrypi3 = "wic" | 13 | IMAGE_FSTYPES_remove_raspberrypi3 = "wic" |
14 | IMAGE_FSTYPES_remove_raspberrypi2 = "wic" | 14 | IMAGE_FSTYPES_remove_raspberrypi2 = "wic" |
15 | 15 | ||
16 | # QEMU emulation uses plain otaimg, no wic needed | ||
17 | IMAGE_FSTYPES_remove_qemux86-64 = "wic" | ||
18 | |||
16 | # Please redefine OSTREE_REPO in order to have a persistent OSTree repo | 19 | # Please redefine OSTREE_REPO in order to have a persistent OSTree repo |
17 | OSTREE_REPO ?= "${DEPLOY_DIR_IMAGE}/ostree_repo" | 20 | OSTREE_REPO ?= "${DEPLOY_DIR_IMAGE}/ostree_repo" |
18 | OSTREE_BRANCHNAME ?= "ota-${MACHINE}" | 21 | OSTREE_BRANCHNAME ?= "ota-${MACHINE}" |
diff --git a/conf/include/bblayers/sota.inc b/conf/include/bblayers/sota.inc new file mode 100644 index 0000000..97edecb --- /dev/null +++ b/conf/include/bblayers/sota.inc | |||
@@ -0,0 +1,5 @@ | |||
1 | |||
2 | BBLAYERS += "${METADIR}/meta-updater" | ||
3 | BBLAYERS += "${METADIR}/meta-openembedded/meta-filesystems" | ||
4 | BBLAYERS += "${METADIR}/meta-openembedded/meta-oe" | ||
5 | BBLAYERS += "${METADIR}/meta-rust" | ||
diff --git a/conf/include/bblayers/sota_minnowboard.inc b/conf/include/bblayers/sota_minnowboard.inc new file mode 100644 index 0000000..1771e6c --- /dev/null +++ b/conf/include/bblayers/sota_minnowboard.inc | |||
@@ -0,0 +1,2 @@ | |||
1 | |||
2 | BBLAYERS += " ${METADIR}/meta-updater-minnowboard ${METADIR}/meta-intel " | ||
diff --git a/conf/include/bblayers/sota_porter.inc b/conf/include/bblayers/sota_porter.inc new file mode 100644 index 0000000..a0888d5 --- /dev/null +++ b/conf/include/bblayers/sota_porter.inc | |||
@@ -0,0 +1,2 @@ | |||
1 | |||
2 | BBLAYERS += " ${METADIR}/meta-updater-porter ${METADIR}/meta-renesas " | ||
diff --git a/conf/include/bblayers/sota_qemux86-64.inc b/conf/include/bblayers/sota_qemux86-64.inc new file mode 100644 index 0000000..22ace81 --- /dev/null +++ b/conf/include/bblayers/sota_qemux86-64.inc | |||
@@ -0,0 +1,2 @@ | |||
1 | |||
2 | BBLAYERS += " ${METADIR}/meta-updater-qemux86-64 " | ||
diff --git a/conf/include/bblayers/sota_raspberrypi.inc b/conf/include/bblayers/sota_raspberrypi.inc new file mode 100644 index 0000000..11ede20 --- /dev/null +++ b/conf/include/bblayers/sota_raspberrypi.inc | |||
@@ -0,0 +1,2 @@ | |||
1 | |||
2 | BBLAYERS += " ${METADIR}/meta-updater-raspberrypi ${METADIR}/meta-raspberrypi " | ||
diff --git a/conf/include/local/sota_minnowboard.inc b/conf/include/local/sota_minnowboard.inc new file mode 100644 index 0000000..b3702a2 --- /dev/null +++ b/conf/include/local/sota_minnowboard.inc | |||
@@ -0,0 +1,6 @@ | |||
1 | MACHINE = "intel-corei7-64" | ||
2 | |||
3 | PREFERRED_PROVIDER_virtual/bootloader = "u-boot-ota" | ||
4 | UBOOT_MACHINE = "minnowmax_defconfig" | ||
5 | IMAGE_CLASSES_append = " sdcard_image-minnowboard-ota" | ||
6 | IMAGE_FSTYPES += "minnowboard-sdimg-ota" | ||
diff --git a/conf/include/local/sota_porter.inc b/conf/include/local/sota_porter.inc new file mode 100644 index 0000000..e079e4d --- /dev/null +++ b/conf/include/local/sota_porter.inc | |||
@@ -0,0 +1,11 @@ | |||
1 | MACHINE = "porter" | ||
2 | |||
3 | # Commit united image to OSTree, not just uImage | ||
4 | OSTREE_KERNEL = "uImage+dtb" | ||
5 | |||
6 | IMAGE_CLASSES_append = " image_types_uboot " | ||
7 | IMAGE_BOOT_FILES = "porter-bootfiles/*" | ||
8 | |||
9 | OSTREE_BOOTLOADER ?= "u-boot" | ||
10 | UBOOT_MACHINE = "porter_vin_config" | ||
11 | |||
diff --git a/conf/include/local/sota_qemux86-64.inc b/conf/include/local/sota_qemux86-64.inc new file mode 100644 index 0000000..b72c29d --- /dev/null +++ b/conf/include/local/sota_qemux86-64.inc | |||
@@ -0,0 +1,12 @@ | |||
1 | MACHINE = "qemux86-64" | ||
2 | |||
3 | PREFERRED_VERSION_gcc-cross-${TARGET_ARCH} ?= "5.4%" | ||
4 | PREFERRED_VERSION_libgcc ?= "5.4%" | ||
5 | PREFERRED_VERSION_gcc-runtime ?= "5.4%" | ||
6 | |||
7 | # U-Boot support for SOTA | ||
8 | PREFERRED_PROVIDER_virtual/bootloader_sota = "u-boot-ota" | ||
9 | UBOOT_MACHINE = "qemu-x86_defconfig" | ||
10 | OSTREE_BOOTLOADER ?= "u-boot" | ||
11 | |||
12 | OSTREE_KERNEL_ARGS ?= "ramdisk_size=16384 rw rootfstype=ext4 rootwait rootdelay=2 ostree_root=/dev/hda" | ||
diff --git a/conf/include/local/sota_raspberrypi.inc b/conf/include/local/sota_raspberrypi.inc new file mode 100644 index 0000000..51919f0 --- /dev/null +++ b/conf/include/local/sota_raspberrypi.inc | |||
@@ -0,0 +1,16 @@ | |||
1 | MACHINE ?= "raspberrypi3" | ||
2 | |||
3 | # normal image class is sdcard_image-rpi-gdp, for sota it is image_types_uboot & sdcard_image-rpi-ota | ||
4 | IMAGE_CLASSES += "image_types_uboot sdcard_image-rpi-ota" | ||
5 | |||
6 | # normal image is rpi-sdimg, for sota it is rpi-sdimg-ota | ||
7 | IMAGE_FSTYPES += "rpi-sdimg-ota" | ||
8 | ### both rpi-sdimg and rpi-sdimg-ota broken | ||
9 | IMAGE_FSTYPES += "ext4.xz ext4.bmap tar.xz" | ||
10 | |||
11 | KERNEL_IMAGETYPE_sota = "uImage" | ||
12 | PREFERRED_PROVIDER_virtual/bootloader = "u-boot" | ||
13 | UBOOT_MACHINE_raspberrypi2 = "rpi_2_defconfig" | ||
14 | UBOOT_MACHINE_raspberrypi3 = "rpi_3_32b_defconfig" | ||
15 | |||
16 | OSTREE_BOOTLOADER ?= "u-boot" | ||
diff --git a/scripts/envsetup.sh b/scripts/envsetup.sh new file mode 100755 index 0000000..316a782 --- /dev/null +++ b/scripts/envsetup.sh | |||
@@ -0,0 +1,53 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | SCRIPT="envsetup.sh" | ||
4 | |||
5 | MACHINE=$1 | ||
6 | |||
7 | if [ "$#" -lt 1 ]; then | ||
8 | echo "Usage: ${SCRIPT} <machine> [builddir]" | ||
9 | return -1 | ||
10 | elif [ "$#" -eq 2 ]; then | ||
11 | BUILDDIR=$2 | ||
12 | else | ||
13 | BUILDDIR=build | ||
14 | fi | ||
15 | BULDDIR=$2 | ||
16 | |||
17 | # detect if this script is sourced: see http://stackoverflow.com/a/38128348/6255594 | ||
18 | SOURCED=0 | ||
19 | if [ -n "$ZSH_EVAL_CONTEXT" ]; then | ||
20 | [[ $ZSH_EVAL_CONTEXT =~ :file$ ]] && { SOURCED=1; SOURCEDIR=$(cd $(dirname -- $0) && pwd -P); } | ||
21 | elif [ -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); } | ||
23 | elif [ -n "$BASH_VERSION" ]; then | ||
24 | [[ $0 != "$BASH_SOURCE" ]] && { SOURCED=1; SOURCEDIR=$(cd $(dirname -- $BASH_SOURCE) && pwd -P); } | ||
25 | fi | ||
26 | |||
27 | if [ $SOURCED -ne 1 ]; then | ||
28 | unset SOURCED | ||
29 | unset SOURCEDIR | ||
30 | echo "Error: this script needs to be sourced in a supported shell" >&2 | ||
31 | echo "Please check that the current shell is bash, zsh or ksh and run this script as '. $0 <args>'" >&2 | ||
32 | exit -1 | ||
33 | fi | ||
34 | |||
35 | SCRIPTDIR=$(cd $(dirname $BASH_SOURCE) && pwd -P) | ||
36 | METADIR=$(cd $(dirname $BASH_SOURCE)/../.. && pwd -P) | ||
37 | |||
38 | if ! [[ -e ${SCRIPTDIR}/../conf/include/local/sota_${MACHINE}.inc && -e ${SCRIPTDIR}/../conf/include/bblayers/sota_${MACHINE}.inc ]]; then | ||
39 | echo "Error: invalid machine: ${MACHINE}" >&2 | ||
40 | return -1 | ||
41 | fi | ||
42 | |||
43 | if [ -e ${BUILDDIR}/conf/local.conf ]; then | ||
44 | source $METADIR/poky/oe-init-build-env ${BUILDDIR} | ||
45 | else | ||
46 | source $METADIR/poky/oe-init-build-env ${BUILDDIR} | ||
47 | echo "METADIR := \"\${@os.path.abspath('${METADIR}')}\"" >> conf/bblayers.conf | ||
48 | cat ${METADIR}/meta-updater/conf/include/bblayers/sota.inc >> conf/bblayers.conf | ||
49 | cat ${METADIR}/meta-updater/conf/include/bblayers/sota_${MACHINE}.inc >> conf/bblayers.conf | ||
50 | echo "include conf/include/local/sota_${MACHINE}.inc" >> conf/local.conf | ||
51 | echo "include conf/distro/sota.conf.inc" >> conf/local.conf | ||
52 | fi | ||
53 | |||