From 83e834567264d2e38ea6e184a809159e5a13f5a8 Mon Sep 17 00:00:00 2001 From: Anton Gerasimov Date: Thu, 27 Apr 2017 11:56:14 +0200 Subject: Make layer inclusion a neutral operation Classes are and bbappends are reworked so that mere inclusion of this layer to bbappends.conf doesn't change anything. In addition class behavior can now be controlled by both inheriting sota.bblcass and enabling "sota" DISTRO_FEATURE. --- classes/sota.bbclass | 38 ++++++++++------------ classes/sota_minnowboard.bbclass | 6 ++-- classes/sota_minnowboard_uboot.inc | 8 ++--- classes/sota_none.bbclass | 3 ++ conf/distro/poky-sota-systemd.conf | 6 +++- conf/distro/poky-sota.conf | 3 ++ conf/include/bblayers/sota_porter.inc | 2 +- recipes-bsp/grub/grub-efi_%.bbappend | 2 +- recipes-support/fuse/fuse_%.bbappend | 4 +-- .../glib-networking/glib-networking_%.bbappend | 2 +- recipes-support/gpgme/gpgme_%.bbappend | 2 +- recipes-support/libsoup/libsoup-2.4_%.bbappend | 4 +-- recipes-support/libssh2/libssh2_%.bbappend | 2 +- recipes-support/util-linux/util-linux_%.bbappend | 11 ++----- 14 files changed, 47 insertions(+), 46 deletions(-) diff --git a/classes/sota.bbclass b/classes/sota.bbclass index 0697932..ab9611a 100644 --- a/classes/sota.bbclass +++ b/classes/sota.bbclass @@ -1,19 +1,19 @@ -DISTRO_FEATURES_append = " sota" -OVERRIDES .= ":sota" +python __anonymous() { + if bb.utils.contains('DISTRO_FEATURES', 'sota', True, False, d): + d.appendVar("OVERRIDES", ":sota") + #d.appendVar("IMAGE_INSTALL", " ostree os-release") -IMAGE_INSTALL_append = " ostree os-release" + d.appendVarFlag("do_image_wic", "depends", " %s:do_image_otaimg" % d.getVar("IMAGE_BASENAME", True)) + #d.appendVar("EXTRA_IMAGEDEPENDS", " parted-native mtools-native dosfstools-native") +} -# live image for OSTree-enabled systems -IMAGE_CLASSES += "image_types_ostree image_types_ota" -IMAGE_FSTYPES += "ostreepush otaimg" +IMAGE_INSTALL_append_sota = " ostree os-release" +IMAGE_CLASSES += " image_types_ostree image_types_ota" +IMAGE_FSTYPES += "${@bb.utils.contains('DISTRO_FEATURES', 'sota', 'ostreepush otaimg wic', ' ', d)}" -# if don't build wic image unless IMAGE_BOOT_FILES is set. Prevents build from failing -# on machines that don't support updater yet -IMAGE_FSTYPES += "${@' wic' if (d.getVar("IMAGE_BOOT_FILES", True)) else ''}" -WKS_FILE ?= "sdimage-sota.wks" -do_image_wic[depends] += "${IMAGE_BASENAME}:do_image_otaimg" +WKS_FILE_sota ?= "sdimage-sota.wks" -EXTRA_IMAGEDEPENDS += " parted-native mtools-native dosfstools-native" +EXTRA_IMAGEDEPENDS_append_sota = " parted-native mtools-native dosfstools-native" # Please redefine OSTREE_REPO in order to have a persistent OSTree repo OSTREE_REPO ?= "${DEPLOY_DIR_IMAGE}/ostree_repo" @@ -21,13 +21,11 @@ OSTREE_BRANCHNAME ?= "ota-${MACHINE}" OSTREE_OSNAME ?= "poky" OSTREE_INITRAMFS_IMAGE ?= "initramfs-ostree-image" -# Prelinking increases the size of downloads and causes build errors -USER_CLASSES_remove = "image-prelink" +SOTA_MACHINE ??="none" +SOTA_MACHINE_raspberrypi2 ?= "raspberrypi" +SOTA_MACHINE_rarpberrypi3 ?= "raspberrypi" +SOTA_MACHINE_porter ?= "porter" +SOTA_MACHINE_intel-corei7-64 ?= "minnowboard" +SOTA_MACHINE_qemux86-64 ?= "qemux86-64" -SOTA_MACHINE ?= "none" -SOTA_MACHINE_raspberrypi = "raspberrypi" -SOTA_MACHINE_raspberrypi3 = "raspberrypi" -SOTA_MACHINE_porter = "porter" -SOTA_MACHINE_intel-corei7-64 = "minnowboard" -SOTA_MACHINE_qemux86-64 = "qemux86-64" inherit sota_${SOTA_MACHINE} diff --git a/classes/sota_minnowboard.bbclass b/classes/sota_minnowboard.bbclass index 970bd6a..8417348 100644 --- a/classes/sota_minnowboard.bbclass +++ b/classes/sota_minnowboard.bbclass @@ -1,7 +1,7 @@ OSTREE_BOOTLOADER ?= "grub" -EFI_PROVIDER = "grub-efi" +EFI_PROVIDER_sota = "grub-efi" -WKS_FILE = "efiimage-sota.wks" -IMAGE_BOOT_FILES = "" +WKS_FILE_sota = "efiimage-sota.wks" +IMAGE_BOOT_FILES_sota = "" OSTREE_KERNEL_ARGS ?= "ramdisk_size=16384 rw rootfstype=ext4 rootwait rootdelay=2 console=ttyS0,115200 console=tty0" diff --git a/classes/sota_minnowboard_uboot.inc b/classes/sota_minnowboard_uboot.inc index 5097e9d..85d6a60 100644 --- a/classes/sota_minnowboard_uboot.inc +++ b/classes/sota_minnowboard_uboot.inc @@ -1,8 +1,8 @@ -PREFERRED_PROVIDER_virtual/bootloader = "u-boot-ota" -UBOOT_MACHINE = "minnowmax_defconfig" +PREFERRED_PROVIDER_virtual/bootloader_sota ?= "u-boot-ota" +UBOOT_MACHINE_sota ?= "minnowmax_defconfig" -EXTRA_IMAGEDEPENDS_append = " minnowboard-bootfiles" -IMAGE_BOOT_FILES = "minnowboard-bootfiles/*" +EXTRA_IMAGEDEPENDS_append_sota = " minnowboard-bootfiles" +IMAGE_BOOT_FILES_sota ?= "minnowboard-bootfiles/*" OSTREE_KERNEL_ARGS ?= "ramdisk_size=16384 rw rootfstype=ext4 rootwait rootdelay=2 ostree_root=/dev/hda console=ttyS0,115200 console=tty0" diff --git a/classes/sota_none.bbclass b/classes/sota_none.bbclass index dc72a07..86eaf0b 100644 --- a/classes/sota_none.bbclass +++ b/classes/sota_none.bbclass @@ -1 +1,4 @@ # null machine it's here to make bitbake happy when SOTA_MACHINE is undefined +python __anonymous() { + bb.warn("SOTA functionality is not yet supported for your machine") +} diff --git a/conf/distro/poky-sota-systemd.conf b/conf/distro/poky-sota-systemd.conf index e6f43f7..78ca1e5 100644 --- a/conf/distro/poky-sota-systemd.conf +++ b/conf/distro/poky-sota-systemd.conf @@ -1,5 +1,7 @@ require conf/distro/poky.conf +DISTRO_FEATURES_append = " sota" + DISTRO = "poky-sota" DISTRO_NAME = "OTA-enabled Linux" DISTRO_VERSION = "1.0" @@ -8,5 +10,7 @@ DISTRO_CODENAME = "sota" DISTRO_FEATURES_append = " systemd" VIRTUAL-RUNTIME_init_manager = "systemd" -INHERIT += " sota" +INHERIT_prepend = " sota" IMAGE_INSTALL_append = " connman connman-client rvi-sota-client" + +USER_CLASSES_remove = "image-prelink" diff --git a/conf/distro/poky-sota.conf b/conf/distro/poky-sota.conf index 6972a94..c56695e 100644 --- a/conf/distro/poky-sota.conf +++ b/conf/distro/poky-sota.conf @@ -1,5 +1,7 @@ require conf/distro/poky.conf +DISTRO_FEATURES_append = " sota" + DISTRO = "poky-sota" DISTRO_NAME = "OTA-enabled Linux" DISTRO_VERSION = "1.0" @@ -7,3 +9,4 @@ DISTRO_CODENAME = "sota" INHERIT += " sota" IMAGE_INSTALL_append = " connman connman-client" +USER_CLASSES_remove = "image-prelink" diff --git a/conf/include/bblayers/sota_porter.inc b/conf/include/bblayers/sota_porter.inc index a0888d5..6964ef0 100644 --- a/conf/include/bblayers/sota_porter.inc +++ b/conf/include/bblayers/sota_porter.inc @@ -1,2 +1,2 @@ -BBLAYERS += " ${METADIR}/meta-updater-porter ${METADIR}/meta-renesas " +BBLAYERS += " ${METADIR}/meta-renesas ${METADIR}/meta-renesas/meta-rcar-gen2 ${METADIR}/meta-openembedded/meta-multimedia ${METADIR}/meta-updater-porter" diff --git a/recipes-bsp/grub/grub-efi_%.bbappend b/recipes-bsp/grub/grub-efi_%.bbappend index 545e806..bebb006 100644 --- a/recipes-bsp/grub/grub-efi_%.bbappend +++ b/recipes-bsp/grub/grub-efi_%.bbappend @@ -1,2 +1,2 @@ -GRUB_BUILDIN += "configfile" +GRUB_BUILDIN_append_sota = " configfile" diff --git a/recipes-support/fuse/fuse_%.bbappend b/recipes-support/fuse/fuse_%.bbappend index 4f23349..85bdf50 100644 --- a/recipes-support/fuse/fuse_%.bbappend +++ b/recipes-support/fuse/fuse_%.bbappend @@ -1,3 +1,3 @@ -BBCLASSEXTEND = "native" +BBCLASSEXTEND_append_sota = " native" -PACKAGES_append_class-native = "fuse-utils-dbg-native fuse-utils-native libulockmgr-native libulockmgr-dev-native libulockmgr-dbg-native" +PACKAGES_append_class-native_sota = "${@bb.utils.contains('DISTRO_FEATURES', 'sota', ' fuse-utils-dbg-native fuse-utils-native libulockmgr-native libulockmgr-dev-native libulockmgr-dbg-native', ' ', d)}" diff --git a/recipes-support/glib-networking/glib-networking_%.bbappend b/recipes-support/glib-networking/glib-networking_%.bbappend index d3267ac..fccb949 100644 --- a/recipes-support/glib-networking/glib-networking_%.bbappend +++ b/recipes-support/glib-networking/glib-networking_%.bbappend @@ -1 +1 @@ -BBCLASSEXTEND = "native" +BBCLASSEXTEND_append_sota = " native" diff --git a/recipes-support/gpgme/gpgme_%.bbappend b/recipes-support/gpgme/gpgme_%.bbappend index d3267ac..27f258e 100644 --- a/recipes-support/gpgme/gpgme_%.bbappend +++ b/recipes-support/gpgme/gpgme_%.bbappend @@ -1 +1 @@ -BBCLASSEXTEND = "native" +BBCLASSEXTEND_append_sota = "native" diff --git a/recipes-support/libsoup/libsoup-2.4_%.bbappend b/recipes-support/libsoup/libsoup-2.4_%.bbappend index ed24273..ce4df6d 100644 --- a/recipes-support/libsoup/libsoup-2.4_%.bbappend +++ b/recipes-support/libsoup/libsoup-2.4_%.bbappend @@ -1,3 +1,3 @@ -BBCLASSEXTEND = "native" +BBCLASSEXTEND_append_sota = " native" -DEPENDS_append_class-native = " glib-networking-native" +DEPENDS_append_class-native = "${@bb.utils.contains('DISTRO_FEATURES', 'sota', ' glib-networking-native', ' ', d)}" diff --git a/recipes-support/libssh2/libssh2_%.bbappend b/recipes-support/libssh2/libssh2_%.bbappend index ce4807e..bebaf84 100644 --- a/recipes-support/libssh2/libssh2_%.bbappend +++ b/recipes-support/libssh2/libssh2_%.bbappend @@ -1,2 +1,2 @@ # meta-oe/recipes-support/libssh2 -BBCLASSEXTEND = "native" +BBCLASSEXTEND_append_sota = " native" diff --git a/recipes-support/util-linux/util-linux_%.bbappend b/recipes-support/util-linux/util-linux_%.bbappend index bd3f686..d653bb2 100644 --- a/recipes-support/util-linux/util-linux_%.bbappend +++ b/recipes-support/util-linux/util-linux_%.bbappend @@ -1,10 +1,3 @@ -PACKAGES_append_class-native = "util-linux-agetty-native util-linux-fdisk-native util-linux-cfdisk-native util-linux-sfdisk-native \ - util-linux-swaponoff-native util-linux-losetup-native util-linux-umount-native \ - util-linux-mount-native util-linux-readprofile-native util-linux-uuidd-native \ - util-linux-uuidgen-native util-linux-lscpu-native util-linux-fsck-native util-linux-blkid \ - util-linux-mkfs-native util-linux-mcookie-native util-linux-reset-native \ - util-linux-mkfs.cramfs-native util-linux-fsck.cramfs-native util-linux-fstrim-native \ - util-linux-partx-native ${PN}-bash-completion-native util-linux-hwclock \ - util-linux-findfs-native util-linux-getopt-native util-linux-sulogin-native \ - ${@bb.utils.contains('PACKAGECONFIG', 'pylibmount', 'util-linux-pylibmount-native', '', d)}" +PACKAGES_append_class-native = "${@bb.utils.contains('DISTRO_FEATURES', 'sota', ' util-linux-agetty-native util-linux-fdisk-native util-linux-cfdisk-native util-linux-sfdisk-native util-linux-swaponoff-native util-linux-losetup-native util-linux-umount-native util-linux-mount-native util-linux-readprofile-native util-linux-uuidd-native util-linux-uuidgen-native util-linux-lscpu-native util-linux-fsck-native util-linux-blkid util-linux-mkfs-native util-linux-mcookie-native util-linux-reset-native util-linux-mkfs.cramfs-native util-linux-fsck.cramfs-native util-linux-fstrim-native util-linux-partx-native ${PN}-bash-completion-native util-linux-hwclock util-linux-findfs-native util-linux-getopt-native util-linux-sulogin-native', ' ', d)}" +PACKAGES_append_class-native = "${@' util-linux-pylibmount-native' if bb.utils.contains('DISTRO_FEATURES', 'sota', True, False, d) and bb.utils.contains('PACKAGECONFIG', 'pylibmount', True, False, d) else ' '}" -- cgit v1.2.3-54-g00ecf From c82a50cbd3814b3d779fdf7e5cb024e2db27e243 Mon Sep 17 00:00:00 2001 From: Anton Gerasimov Date: Tue, 16 May 2017 14:30:53 +0200 Subject: Don't build wic on qemu and rpi --- classes/sota_qemux86-64.bbclass | 2 ++ classes/sota_raspberrypi.bbclass | 2 ++ 2 files changed, 4 insertions(+) diff --git a/classes/sota_qemux86-64.bbclass b/classes/sota_qemux86-64.bbclass index 533c11c..5ec4f69 100644 --- a/classes/sota_qemux86-64.bbclass +++ b/classes/sota_qemux86-64.bbclass @@ -1,6 +1,8 @@ # See https://advancedtelematic.atlassian.net/browse/PRO-2693 PREFERRED_VERSION_linux-yocto_qemux86-64_sota = "4.4%" +IMAGE_FSTYPES_remove = "wic" + # U-Boot support for SOTA PREFERRED_PROVIDER_virtual/bootloader_sota = "u-boot-ota" UBOOT_MACHINE_sota = "qemu-x86_defconfig" diff --git a/classes/sota_raspberrypi.bbclass b/classes/sota_raspberrypi.bbclass index 1d23d1f..7b67c0f 100644 --- a/classes/sota_raspberrypi.bbclass +++ b/classes/sota_raspberrypi.bbclass @@ -4,6 +4,8 @@ IMAGE_FSTYPES += "${@bb.utils.contains('DISTRO_FEATURES', 'sota', 'rpi-sdimg-ota ### both rpi-sdimg and rpi-sdimg-ota broken IMAGE_FSTYPES += "ext4.xz ext4.bmap tar.xz" +IMAGE_FSTYPES_remove = "wic" + KERNEL_IMAGETYPE_sota = "uImage" PREFERRED_PROVIDER_virtual/bootloader_sota ?= "u-boot" UBOOT_MACHINE_raspberrypi2_sota ?= "rpi_2_defconfig" -- cgit v1.2.3-54-g00ecf