From b49c2631b6bc48ead4d352e2bd00cdfbca7af5e8 Mon Sep 17 00:00:00 2001 From: Anton Gerasimov Date: Mon, 3 Apr 2017 12:05:53 +0200 Subject: Replace sdcard_image* classes with wic --- conf/distro/sota.conf.inc | 48 ++++++++++++----------------------------------- 1 file changed, 12 insertions(+), 36 deletions(-) (limited to 'conf') diff --git a/conf/distro/sota.conf.inc b/conf/distro/sota.conf.inc index 23e5a43..c8b4388 100644 --- a/conf/distro/sota.conf.inc +++ b/conf/distro/sota.conf.inc @@ -1,8 +1,17 @@ -IMAGE_INSTALL_append = " ostree rvi-sota-client" +DISTRO_FEATURES_append = " sota" +OVERRIDES .= ":sota" + +IMAGE_INSTALL_append = " ostree" # live image for OSTree-enabled systems -IMAGE_CLASSES_append = " image_types_ostree image_types_ota" -IMAGE_FSTYPES += "ostreepush otaimg" +IMAGE_CLASSES += "image_types_ostree image_types_ota" +IMAGE_FSTYPES += "ostreepush otaimg wic" +WKS_FILE = "sdimage-sota.wks" +do_image_wic[depends] += "${IMAGE_BASENAME}:do_image_otaimg" + +# No working WKS for Raspberry Pi yet +IMAGE_FSTYPES_remove_raspberrypi3 = "wic" +IMAGE_FSTYPES_remove_raspberrypi2 = "wic" # Please redefine OSTREE_REPO in order to have a persistent OSTree repo OSTREE_REPO ?= "${DEPLOY_DIR_IMAGE}/ostree_repo" @@ -10,36 +19,3 @@ OSTREE_BRANCHNAME ?= "ota-${MACHINE}" OSTREE_OSNAME ?= "poky" OSTREE_INITRAMFS_IMAGE ?= "initramfs-ostree-image" -# Platform-specific configurations - -## RaspberryPi -IMAGE_CLASSES_append_raspberrypi2 = " image_types_uboot sdcard_image-rpi-ota" -IMAGE_CLASSES_append_raspberrypi3 = " image_types_uboot sdcard_image-rpi-ota" -IMAGE_FSTYPES += "${@'rpi-sdimg-ota' if d.getVar('MACHINE', True).startswith('raspberrypi') else ''}" -IMAGE_FSTYPES_remove = "rpi-sdimg" - -KERNEL_IMAGETYPE_raspberrypi2 = "uImage" -KERNEL_IMAGETYPE_raspberrypi3 = "uImage" - -UBOOT_MACHINE_raspberrypi2 = "rpi_2_defconfig" -UBOOT_MACHINE_raspberrypi3 = "rpi_3_32b_defconfig" -PREFERRED_PROVIDER_virtual/bootloader_raspberrypi2 = "u-boot" -PREFERRED_PROVIDER_virtual/bootloader_raspberrypi3 = "u-boot" - -# Some BSPs (e.g. meta-raspberrypi) use this variable to turn debug on/off -DISTRO_TYPE ?= "${@bb.utils.contains("IMAGE_FEATURES", "debug-tweaks", "debug", "release",d)}" - -## Minnowboard -PREFERRED_PROVIDER_virtual/bootloader_intel-corei7-64 = "u-boot-ota" -UBOOT_MACHINE_intel-corei7-64 = "minnowmax_defconfig" -IMAGE_CLASSES_append_intel-corei7-64 = " sdcard_image-minnowboard-ota" -IMAGE_FSTYPES += "${@'minnowboard-sdimg-ota' if d.getVar('MACHINE', True).startswith('intel-corei7-64') else ''}" - -## QEMU -PREFERRED_PROVIDER_virtual/bootloader_qemux86 = "u-boot-ota" -UBOOT_MACHINE_qemux86 = "qemu-x86_defconfig" -PREFERRED_PROVIDER_virtual/bootloader_qemux86-64= "u-boot-ota" -UBOOT_MACHINE_qemux86-64 = "qemu-x86_defconfig" - -DISTROOVERRIDES_append = ":sota" -DISTRO_FEATURES_append = " sota" -- cgit v1.2.3-54-g00ecf From 82a3c13a0b0c9979fa0812143d619748aa89c85d Mon Sep 17 00:00:00 2001 From: Anton Gerasimov Date: Mon, 3 Apr 2017 12:08:39 +0200 Subject: Replace TEMPLATECONF with agl-like config snippets --- conf/distro/sota.conf.inc | 5 ++- conf/include/bblayers/sota.inc | 5 +++ conf/include/bblayers/sota_minnowboard.inc | 2 ++ conf/include/bblayers/sota_porter.inc | 2 ++ conf/include/bblayers/sota_qemux86-64.inc | 2 ++ conf/include/bblayers/sota_raspberrypi.inc | 2 ++ conf/include/local/sota_minnowboard.inc | 6 ++++ conf/include/local/sota_porter.inc | 11 +++++++ conf/include/local/sota_qemux86-64.inc | 12 +++++++ conf/include/local/sota_raspberrypi.inc | 16 +++++++++ scripts/envsetup.sh | 53 ++++++++++++++++++++++++++++++ 11 files changed, 115 insertions(+), 1 deletion(-) create mode 100644 conf/include/bblayers/sota.inc create mode 100644 conf/include/bblayers/sota_minnowboard.inc create mode 100644 conf/include/bblayers/sota_porter.inc create mode 100644 conf/include/bblayers/sota_qemux86-64.inc create mode 100644 conf/include/bblayers/sota_raspberrypi.inc create mode 100644 conf/include/local/sota_minnowboard.inc create mode 100644 conf/include/local/sota_porter.inc create mode 100644 conf/include/local/sota_qemux86-64.inc create mode 100644 conf/include/local/sota_raspberrypi.inc create mode 100755 scripts/envsetup.sh (limited to 'conf') 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 @@ DISTRO_FEATURES_append = " sota" OVERRIDES .= ":sota" -IMAGE_INSTALL_append = " ostree" +IMAGE_INSTALL_append = " ostree os-release" # live image for OSTree-enabled systems IMAGE_CLASSES += "image_types_ostree image_types_ota" @@ -13,6 +13,9 @@ do_image_wic[depends] += "${IMAGE_BASENAME}:do_image_otaimg" IMAGE_FSTYPES_remove_raspberrypi3 = "wic" IMAGE_FSTYPES_remove_raspberrypi2 = "wic" +# QEMU emulation uses plain otaimg, no wic needed +IMAGE_FSTYPES_remove_qemux86-64 = "wic" + # Please redefine OSTREE_REPO in order to have a persistent OSTree repo OSTREE_REPO ?= "${DEPLOY_DIR_IMAGE}/ostree_repo" 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 @@ + +BBLAYERS += "${METADIR}/meta-updater" +BBLAYERS += "${METADIR}/meta-openembedded/meta-filesystems" +BBLAYERS += "${METADIR}/meta-openembedded/meta-oe" +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 @@ + +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 @@ + +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 @@ + +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 @@ + +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 @@ +MACHINE = "intel-corei7-64" + +PREFERRED_PROVIDER_virtual/bootloader = "u-boot-ota" +UBOOT_MACHINE = "minnowmax_defconfig" +IMAGE_CLASSES_append = " sdcard_image-minnowboard-ota" +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 @@ +MACHINE = "porter" + +# Commit united image to OSTree, not just uImage +OSTREE_KERNEL = "uImage+dtb" + +IMAGE_CLASSES_append = " image_types_uboot " +IMAGE_BOOT_FILES = "porter-bootfiles/*" + +OSTREE_BOOTLOADER ?= "u-boot" +UBOOT_MACHINE = "porter_vin_config" + 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 @@ +MACHINE = "qemux86-64" + +PREFERRED_VERSION_gcc-cross-${TARGET_ARCH} ?= "5.4%" +PREFERRED_VERSION_libgcc ?= "5.4%" +PREFERRED_VERSION_gcc-runtime ?= "5.4%" + +# U-Boot support for SOTA +PREFERRED_PROVIDER_virtual/bootloader_sota = "u-boot-ota" +UBOOT_MACHINE = "qemu-x86_defconfig" +OSTREE_BOOTLOADER ?= "u-boot" + +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 @@ +MACHINE ?= "raspberrypi3" + +# normal image class is sdcard_image-rpi-gdp, for sota it is image_types_uboot & sdcard_image-rpi-ota +IMAGE_CLASSES += "image_types_uboot sdcard_image-rpi-ota" + +# normal image is rpi-sdimg, for sota it is rpi-sdimg-ota +IMAGE_FSTYPES += "rpi-sdimg-ota" +### both rpi-sdimg and rpi-sdimg-ota broken +IMAGE_FSTYPES += "ext4.xz ext4.bmap tar.xz" + +KERNEL_IMAGETYPE_sota = "uImage" +PREFERRED_PROVIDER_virtual/bootloader = "u-boot" +UBOOT_MACHINE_raspberrypi2 = "rpi_2_defconfig" +UBOOT_MACHINE_raspberrypi3 = "rpi_3_32b_defconfig" + +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 @@ +#!/bin/sh + +SCRIPT="envsetup.sh" + +MACHINE=$1 + +if [ "$#" -lt 1 ]; then + echo "Usage: ${SCRIPT} [builddir]" + return -1 +elif [ "$#" -eq 2 ]; then + BUILDDIR=$2 +else + BUILDDIR=build +fi +BULDDIR=$2 + +# detect if this script is sourced: see http://stackoverflow.com/a/38128348/6255594 +SOURCED=0 +if [ -n "$ZSH_EVAL_CONTEXT" ]; then + [[ $ZSH_EVAL_CONTEXT =~ :file$ ]] && { SOURCED=1; SOURCEDIR=$(cd $(dirname -- $0) && pwd -P); } +elif [ -n "$KSH_VERSION" ]; then + [[ "$(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); } +elif [ -n "$BASH_VERSION" ]; then + [[ $0 != "$BASH_SOURCE" ]] && { SOURCED=1; SOURCEDIR=$(cd $(dirname -- $BASH_SOURCE) && pwd -P); } +fi + +if [ $SOURCED -ne 1 ]; then + unset SOURCED + unset SOURCEDIR + echo "Error: this script needs to be sourced in a supported shell" >&2 + echo "Please check that the current shell is bash, zsh or ksh and run this script as '. $0 '" >&2 + exit -1 +fi + +SCRIPTDIR=$(cd $(dirname $BASH_SOURCE) && pwd -P) +METADIR=$(cd $(dirname $BASH_SOURCE)/../.. && pwd -P) + +if ! [[ -e ${SCRIPTDIR}/../conf/include/local/sota_${MACHINE}.inc && -e ${SCRIPTDIR}/../conf/include/bblayers/sota_${MACHINE}.inc ]]; then + echo "Error: invalid machine: ${MACHINE}" >&2 + return -1 +fi + +if [ -e ${BUILDDIR}/conf/local.conf ]; then + source $METADIR/poky/oe-init-build-env ${BUILDDIR} +else + 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 + echo "include conf/include/local/sota_${MACHINE}.inc" >> conf/local.conf + echo "include conf/distro/sota.conf.inc" >> conf/local.conf +fi + -- cgit v1.2.3-54-g00ecf