From b11ddfbc56721ccc2836c6994678acb3e1b5ca74 Mon Sep 17 00:00:00 2001 From: Ming Liu Date: Mon, 20 Nov 2017 15:37:31 +0800 Subject: image_types_ostree.bbclass: change the systemd detecting logic It can not determine the init manager is systemd by checking if DISTRO_FEATURES contains 'systemd', change it to check VIRTUAL-RUNTIME_init_manager instead. Signed-off-by: Ming Liu --- classes/image_types_ostree.bbclass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/classes/image_types_ostree.bbclass b/classes/image_types_ostree.bbclass index 9e3bc6f..777360f 100644 --- a/classes/image_types_ostree.bbclass +++ b/classes/image_types_ostree.bbclass @@ -16,7 +16,7 @@ RAMDISK_EXT_arm ?= ".ext4.gz.u-boot" OSTREE_KERNEL ??= "${KERNEL_IMAGETYPE}" -export SYSTEMD_USED = "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', '', d)}" +export SYSTEMD_USED = "${@oe.utils.ifelse(d.getVar('VIRTUAL-RUNTIME_init_manager', True) == 'systemd', 'true', '')}" IMAGE_CMD_ostree () { if [ -z "$OSTREE_REPO" ]; then -- cgit v1.2.3-54-g00ecf From 3af1b32743b245be8c4e199c6a3785bc92e93ab1 Mon Sep 17 00:00:00 2001 From: Ming Liu Date: Mon, 20 Nov 2017 16:45:32 +0800 Subject: sota: introduce INITRAMFS_FSTYPES RAMDISK_EXT and IMAGE_FSTYPES of initramfs-ostree-image should not be defined separately, because they are representing the same fstype of a same initramfs image, or else, they turn out to be inconsistent if the users change one of them. So we use INITRAMFS_FSTYPES already defined in bitbake.conf, to be able to set fstype for initramfs. And it should default to ext4.gz.u-boot or ext4.gz depending on what OSTREE_BOOTLOADER is being set. Signed-off-by: Ming Liu --- classes/image_types_ostree.bbclass | 3 +-- classes/image_types_ota.bbclass | 2 -- classes/sota.bbclass | 4 +++- recipes-core/images/initramfs-ostree-image.bb | 3 +-- 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/classes/image_types_ostree.bbclass b/classes/image_types_ostree.bbclass index 777360f..349d8fb 100644 --- a/classes/image_types_ostree.bbclass +++ b/classes/image_types_ostree.bbclass @@ -11,8 +11,7 @@ export OSTREE_REPO export OSTREE_BRANCHNAME export GARAGE_TARGET_NAME -RAMDISK_EXT ?= ".ext4.gz" -RAMDISK_EXT_arm ?= ".ext4.gz.u-boot" +RAMDISK_EXT ?= ".${INITRAMFS_FSTYPES}" OSTREE_KERNEL ??= "${KERNEL_IMAGETYPE}" diff --git a/classes/image_types_ota.bbclass b/classes/image_types_ota.bbclass index 17fe4e8..362c1bd 100644 --- a/classes/image_types_ota.bbclass +++ b/classes/image_types_ota.bbclass @@ -7,8 +7,6 @@ # boot scripts, kernel and initramfs images # -OSTREE_BOOTLOADER ??= 'u-boot' - do_image_otaimg[depends] += "e2fsprogs-native:do_populate_sysroot \ ${@'grub:do_populate_sysroot' if d.getVar('OSTREE_BOOTLOADER', True) == 'grub' else ''} \ ${@'virtual/bootloader:do_deploy' if d.getVar('OSTREE_BOOTLOADER', True) == 'u-boot' else ''}" diff --git a/classes/sota.bbclass b/classes/sota.bbclass index 1e765f0..7ff4bf1 100644 --- a/classes/sota.bbclass +++ b/classes/sota.bbclass @@ -20,13 +20,15 @@ WKS_FILE_sota ?= "sdimage-sota.wks" EXTRA_IMAGEDEPENDS_append_sota = " parted-native mtools-native dosfstools-native" +INITRAMFS_FSTYPES = "${@oe.utils.ifelse(d.getVar('OSTREE_BOOTLOADER', True) == 'u-boot', 'ext4.gz.u-boot', 'ext4.gz')}" + # Please redefine OSTREE_REPO in order to have a persistent OSTree repo OSTREE_REPO ?= "${DEPLOY_DIR_IMAGE}/ostree_repo" # For UPTANE operation, OSTREE_BRANCHNAME must start with "${MACHINE}-" OSTREE_BRANCHNAME ?= "${MACHINE}" OSTREE_OSNAME ?= "poky" OSTREE_INITRAMFS_IMAGE ?= "initramfs-ostree-image" - +OSTREE_BOOTLOADER ??= 'u-boot' GARAGE_SIGN_REPO ?= "${DEPLOY_DIR_IMAGE}/garage_sign_repo" GARAGE_SIGN_KEYNAME ?= "garage-key" diff --git a/recipes-core/images/initramfs-ostree-image.bb b/recipes-core/images/initramfs-ostree-image.bb index 4ab9da8..e77499e 100644 --- a/recipes-core/images/initramfs-ostree-image.bb +++ b/recipes-core/images/initramfs-ostree-image.bb @@ -13,8 +13,7 @@ IMAGE_LINGUAS = "" LICENSE = "MIT" -IMAGE_FSTYPES = "ext4.gz" -IMAGE_FSTYPES_append_arm = " ext4.gz.u-boot" +IMAGE_FSTYPES = "${INITRAMFS_FSTYPES}" inherit core-image -- cgit v1.2.3-54-g00ecf From 6ce668bc1ca33ae88ba6b51dee1e680212247539 Mon Sep 17 00:00:00 2001 From: Ricardo Salveti Date: Fri, 9 Feb 2018 00:54:15 -0200 Subject: ostree: fix systemd service files permission Fix the following boot warning: systemd[1]: Configuration file /usr/lib/systemd/system/ostree-remount.service is marked executable. Please remove executable permission bits. Proceeding anyway. Signed-off-by: Ricardo Salveti --- recipes-sota/ostree/ostree_git.bb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/recipes-sota/ostree/ostree_git.bb b/recipes-sota/ostree/ostree_git.bb index ad85775..2db96e4 100644 --- a/recipes-sota/ostree/ostree_git.bb +++ b/recipes-sota/ostree/ostree_git.bb @@ -63,8 +63,8 @@ export SYSTEMD_REQUIRED do_install_append() { if [ -n ${SYSTEMD_REQUIRED} ]; then - install -p -D ${S}/src/boot/ostree-prepare-root.service ${D}${systemd_unitdir}/system/ostree-prepare-root.service - install -p -D ${S}/src/boot/ostree-remount.service ${D}${systemd_unitdir}/system/ostree-remount.service + install -m 0644 -D ${S}/src/boot/ostree-prepare-root.service ${D}${systemd_unitdir}/system/ostree-prepare-root.service + install -m 0644 -D ${S}/src/boot/ostree-remount.service ${D}${systemd_unitdir}/system/ostree-remount.service fi } -- cgit v1.2.3-54-g00ecf From 340c0b07b79dce7bc3081f1212c3f82f660f6b81 Mon Sep 17 00:00:00 2001 From: Ricardo Salveti Date: Thu, 8 Feb 2018 18:47:27 -0200 Subject: Replace INITRAMFS_FSTYPES with OSTREE_INITRAMFS_FSTYPES User is able to customize the init script via OSTREE_INITRAMFS_IMAGE but there is no way to set INITRAMFS_FSTYPES as it gets defined by sota.bbclass. Create a new variable called OSTREE_INITRAMFS_IMAGE to handle the INITRAMFS_FSTYPES update, and also allow the user to override it. Signed-off-by: Ricardo Salveti --- classes/image_types_ostree.bbclass | 2 +- classes/sota.bbclass | 2 +- recipes-core/images/initramfs-ostree-image.bb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/classes/image_types_ostree.bbclass b/classes/image_types_ostree.bbclass index 349d8fb..bc44e33 100644 --- a/classes/image_types_ostree.bbclass +++ b/classes/image_types_ostree.bbclass @@ -11,7 +11,7 @@ export OSTREE_REPO export OSTREE_BRANCHNAME export GARAGE_TARGET_NAME -RAMDISK_EXT ?= ".${INITRAMFS_FSTYPES}" +RAMDISK_EXT ?= ".${OSTREE_INITRAMFS_FSTYPES}" OSTREE_KERNEL ??= "${KERNEL_IMAGETYPE}" diff --git a/classes/sota.bbclass b/classes/sota.bbclass index 7ff4bf1..621db24 100644 --- a/classes/sota.bbclass +++ b/classes/sota.bbclass @@ -20,7 +20,7 @@ WKS_FILE_sota ?= "sdimage-sota.wks" EXTRA_IMAGEDEPENDS_append_sota = " parted-native mtools-native dosfstools-native" -INITRAMFS_FSTYPES = "${@oe.utils.ifelse(d.getVar('OSTREE_BOOTLOADER', True) == 'u-boot', 'ext4.gz.u-boot', 'ext4.gz')}" +OSTREE_INITRAMFS_FSTYPES ?= "${@oe.utils.ifelse(d.getVar('OSTREE_BOOTLOADER', True) == 'u-boot', 'ext4.gz.u-boot', 'ext4.gz')}" # Please redefine OSTREE_REPO in order to have a persistent OSTree repo OSTREE_REPO ?= "${DEPLOY_DIR_IMAGE}/ostree_repo" diff --git a/recipes-core/images/initramfs-ostree-image.bb b/recipes-core/images/initramfs-ostree-image.bb index e77499e..b2d9e27 100644 --- a/recipes-core/images/initramfs-ostree-image.bb +++ b/recipes-core/images/initramfs-ostree-image.bb @@ -13,7 +13,7 @@ IMAGE_LINGUAS = "" LICENSE = "MIT" -IMAGE_FSTYPES = "${INITRAMFS_FSTYPES}" +IMAGE_FSTYPES = "${OSTREE_INITRAMFS_FSTYPES}" inherit core-image -- cgit v1.2.3-54-g00ecf From c7076bfe1e4fc7c134ffbc2f9d1ea800ac93b601 Mon Sep 17 00:00:00 2001 From: Ricardo Salveti Date: Fri, 9 Feb 2018 19:09:30 -0200 Subject: image_types_ota: make default grub.cfg a link to loader/grub.cfg /boot/grub2/grub.cfg should reflect the grub.cfg used by the boot process instead of being an empty file. Signed-off-by: Ricardo Salveti --- classes/image_types_ota.bbclass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/classes/image_types_ota.bbclass b/classes/image_types_ota.bbclass index 362c1bd..b2643a7 100644 --- a/classes/image_types_ota.bbclass +++ b/classes/image_types_ota.bbclass @@ -76,7 +76,7 @@ IMAGE_CMD_otaimg () { if [ "${OSTREE_BOOTLOADER}" = "grub" ]; then mkdir -p ${PHYS_SYSROOT}/boot/grub2 - touch ${PHYS_SYSROOT}/boot/grub2/grub.cfg + ln -s ../loader/grub.cfg ${PHYS_SYSROOT}/boot/grub2/grub.cfg elif [ "${OSTREE_BOOTLOADER}" = "u-boot" ]; then touch ${PHYS_SYSROOT}/boot/loader/uEnv.txt else -- cgit v1.2.3-54-g00ecf From 324fa1a4ae46561e19e787216927f8bf67a6a862 Mon Sep 17 00:00:00 2001 From: Ricardo Salveti Date: Thu, 22 Feb 2018 13:30:17 -0300 Subject: sdimage-sota.wks: remove label as it gets set by image_types_ota image_types_ota already defines the rootfs label when creating the ota image, so drop label overwrite when creating the sdcard partition. Signed-off-by: Ricardo Salveti --- scripts/lib/wic/canned-wks/sdimage-sota.wks | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/lib/wic/canned-wks/sdimage-sota.wks b/scripts/lib/wic/canned-wks/sdimage-sota.wks index c31c3a5..f396526 100644 --- a/scripts/lib/wic/canned-wks/sdimage-sota.wks +++ b/scripts/lib/wic/canned-wks/sdimage-sota.wks @@ -4,4 +4,4 @@ # first vfat partition. part /boot --source bootimg-partition --ondisk mmcblk --fstype=vfat --label boot --active --align 4096 --size 20 -part / --source otaimage --ondisk mmcblk --fstype=ext4 --label root --align 4096 +part / --source otaimage --ondisk mmcblk --fstype=ext4 --align 4096 -- cgit v1.2.3-54-g00ecf From 2d17b5661df26393654aee32b54e63cc0cf0a48e Mon Sep 17 00:00:00 2001 From: Ricardo Salveti Date: Tue, 17 Apr 2018 23:50:47 -0300 Subject: ostree: remove python from rdepends Python is not needed by ostree itself (no script or utility using python), so remove it from the rdepends list. Signed-off-by: Ricardo Salveti --- recipes-sota/ostree/ostree_git.bb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/recipes-sota/ostree/ostree_git.bb b/recipes-sota/ostree/ostree_git.bb index 2db96e4..cdcb485 100644 --- a/recipes-sota/ostree/ostree_git.bb +++ b/recipes-sota/ostree/ostree_git.bb @@ -21,8 +21,7 @@ DEPENDS += "attr libarchive glib-2.0 pkgconfig gpgme libgsystem fuse e2fsprogs g DEPENDS_append = "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', ' systemd', '', d)}" DEPENDS_remove_class-native = "systemd-native" -RDEPENDS_${PN} = "python util-linux-libuuid util-linux-libblkid util-linux-libmount libcap bash" -RDEPENDS_${PN}_remove_class-native = "python-native" +RDEPENDS_${PN} = "util-linux-libuuid util-linux-libblkid util-linux-libmount libcap bash" EXTRA_OECONF = "CFLAGS='-Wno-error=missing-prototypes' --with-libarchive --disable-gtk-doc --disable-gtk-doc-html --disable-gtk-doc-pdf --disable-man --with-smack --with-builtin-grub2-mkconfig --with-curl --without-soup" EXTRA_OECONF_append_class-native = " --enable-wrpseudo-compat" -- cgit v1.2.3-54-g00ecf From bbbf1fa8d4fb4c806f08ffc09c9b2c57053d456b Mon Sep 17 00:00:00 2001 From: Ricardo Salveti Date: Thu, 12 Apr 2018 15:31:24 -0300 Subject: Check for custom target version for installed_versions Make sure to use the custom target version when creating installed_versions if defined by the user. Signed-off-by: Ricardo Salveti --- classes/image_types_ota.bbclass | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/classes/image_types_ota.bbclass b/classes/image_types_ota.bbclass index b2643a7..9581971 100644 --- a/classes/image_types_ota.bbclass +++ b/classes/image_types_ota.bbclass @@ -107,7 +107,11 @@ IMAGE_CMD_otaimg () { # Ensure that /var/local exists (AGL symlinks /usr/local to /var/local) install -d ${PHYS_SYSROOT}/ostree/deploy/${OSTREE_OSNAME}/var/local # Set package version for the first deployment - echo "{\"${ostree_target_hash}\":\"${GARAGE_TARGET_NAME}-${ostree_target_hash}\"}" > ${PHYS_SYSROOT}/ostree/deploy/${OSTREE_OSNAME}/var/sota/installed_versions + target_version=${ostree_target_hash} + if [ -n "${GARAGE_TARGET_VERSION}" ]; then + target_version=${GARAGE_TARGET_VERSION} + fi + echo "{\"${ostree_target_hash}\":\"${GARAGE_TARGET_NAME}-${target_version}\"}" > ${PHYS_SYSROOT}/ostree/deploy/${OSTREE_OSNAME}/var/sota/installed_versions rm -rf ${HOME_TMP} -- cgit v1.2.3-54-g00ecf From 6cc92819f88ecf79fa9a54b3b21446da61dbab48 Mon Sep 17 00:00:00 2001 From: Laurent Bonnans Date: Wed, 16 May 2018 11:16:51 +0200 Subject: aktualizr_git: remove duplicate installs If it's in `do_install_append`, no need to also put it in `do_install_append_class-native` --- recipes-sota/aktualizr/aktualizr_git.bb | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/recipes-sota/aktualizr/aktualizr_git.bb b/recipes-sota/aktualizr/aktualizr_git.bb index 95c36fa..452a128 100755 --- a/recipes-sota/aktualizr/aktualizr_git.bb +++ b/recipes-sota/aktualizr/aktualizr_git.bb @@ -55,7 +55,7 @@ EXTRA_OECMAKE_append_class-native = " -DBUILD_SOTA_TOOLS=ON \ do_install_append () { rm -fr ${D}${libdir}/systemd rm -f ${D}${libdir}/sota/sota.toml # Only needed for the Debian package - install -m 0700 -d ${D}${libdir}/sota/conf.d + install -d ${D}${libdir}/sota install -m 0644 ${S}/config/sota_autoprov.toml ${D}/${libdir}/sota/sota_autoprov.toml install -m 0644 ${S}/config/sota_autoprov_primary.toml ${D}/${libdir}/sota/sota_autoprov_primary.toml install -m 0644 ${S}/config/sota_hsm_prov.toml ${D}/${libdir}/sota/sota_hsm_prov.toml @@ -65,6 +65,7 @@ do_install_append () { install -d ${D}${systemd_unitdir}/system install -m 0644 ${WORKDIR}/aktualizr-secondary.socket ${D}${systemd_unitdir}/system/aktualizr-secondary.socket install -m 0644 ${WORKDIR}/aktualizr-secondary.service ${D}${systemd_unitdir}/system/aktualizr-secondary.service + install -m 0700 -d ${D}${libdir}/sota/conf.d install -m 0700 -d ${D}${sysconfdir}/sota/conf.d } @@ -75,12 +76,6 @@ do_install_append_class-target () { } do_install_append_class-native () { - install -m 0644 ${S}/config/sota_autoprov.toml ${D}/${libdir}/sota/sota_autoprov.toml - install -m 0644 ${S}/config/sota_autoprov_primary.toml ${D}/${libdir}/sota/sota_autoprov_primary.toml - install -m 0644 ${S}/config/sota_hsm_prov.toml ${D}/${libdir}/sota/sota_hsm_prov.toml - install -m 0644 ${S}/config/sota_implicit_prov.toml ${D}/${libdir}/sota/sota_implicit_prov.toml - install -m 0644 ${S}/config/sota_implicit_prov_ca.toml ${D}/${libdir}/sota/sota_implicit_prov_ca.toml - install -m 0755 ${B}/src/sota_tools/garage-sign/bin/* ${D}${bindir} install -m 0644 ${B}/src/sota_tools/garage-sign/lib/* ${D}${libdir} } -- cgit v1.2.3-54-g00ecf From 7e6ffbce3f8717d91142d1e80d7cda279f24145a Mon Sep 17 00:00:00 2001 From: Laurent Bonnans Date: Tue, 15 May 2018 15:42:26 +0200 Subject: Fix boot on qemux86-64 It needs a plain compressed file system and not an u-boot legacy image --- classes/sota.bbclass | 2 +- classes/sota_qemux86-64.bbclass | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/classes/sota.bbclass b/classes/sota.bbclass index 621db24..38d4ce5 100644 --- a/classes/sota.bbclass +++ b/classes/sota.bbclass @@ -20,7 +20,7 @@ WKS_FILE_sota ?= "sdimage-sota.wks" EXTRA_IMAGEDEPENDS_append_sota = " parted-native mtools-native dosfstools-native" -OSTREE_INITRAMFS_FSTYPES ?= "${@oe.utils.ifelse(d.getVar('OSTREE_BOOTLOADER', True) == 'u-boot', 'ext4.gz.u-boot', 'ext4.gz')}" +OSTREE_INITRAMFS_FSTYPES ??= "${@oe.utils.ifelse(d.getVar('OSTREE_BOOTLOADER', True) == 'u-boot', 'ext4.gz.u-boot', 'ext4.gz')}" # Please redefine OSTREE_REPO in order to have a persistent OSTree repo OSTREE_REPO ?= "${DEPLOY_DIR_IMAGE}/ostree_repo" diff --git a/classes/sota_qemux86-64.bbclass b/classes/sota_qemux86-64.bbclass index a5fd6a4..15b2043 100644 --- a/classes/sota_qemux86-64.bbclass +++ b/classes/sota_qemux86-64.bbclass @@ -4,6 +4,7 @@ IMAGE_FSTYPES_remove = "wic" PREFERRED_PROVIDER_virtual/bootloader_sota = "u-boot" UBOOT_MACHINE_sota = "qemu-x86_defconfig" OSTREE_BOOTLOADER ?= "u-boot" +OSTREE_INITRAMFS_FSTYPES ?= "ext4.gz" OSTREE_KERNEL_ARGS ?= "ramdisk_size=16384 rw rootfstype=ext4 rootwait rootdelay=2 ostree_root=/dev/hda" -- cgit v1.2.3-54-g00ecf