From 2bb77315b00a4e31287cefd43c5ff42b0698f5b6 Mon Sep 17 00:00:00 2001 From: Ricardo Salveti Date: Tue, 20 Feb 2018 23:00:40 -0300 Subject: sota.bbclass: use common rpi override for raspberrypi sota_raspberrypi can handle the rpi differences if required. Signed-off-by: Ricardo Salveti --- classes/sota.bbclass | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'classes/sota.bbclass') diff --git a/classes/sota.bbclass b/classes/sota.bbclass index bbb9ac9..4e525e2 100644 --- a/classes/sota.bbclass +++ b/classes/sota.bbclass @@ -33,8 +33,7 @@ GARAGE_SIGN_KEYNAME ?= "garage-key" GARAGE_TARGET_NAME ?= "${OSTREE_BRANCHNAME}" SOTA_MACHINE ??="none" -SOTA_MACHINE_raspberrypi2 ?= "raspberrypi" -SOTA_MACHINE_raspberrypi3 ?= "raspberrypi" +SOTA_MACHINE_rpi ?= "raspberrypi" SOTA_MACHINE_porter ?= "porter" SOTA_MACHINE_m3ulcb = "m3ulcb" SOTA_MACHINE_intel-corei7-64 ?= "minnowboard" -- cgit v1.2.3-54-g00ecf From 9ef1f5b379e7b80d91f77ae99b6c07c07987f753 Mon Sep 17 00:00:00 2001 From: Ricardo Salveti Date: Wed, 11 Apr 2018 14:11:30 -0300 Subject: Add support for custom garage target version and url Both values can be defined by the user, allowing a custom version id and URL, which is specially useful for CI builds. Signed-off-by: Ricardo Salveti --- classes/image_types_ostree.bbclass | 10 ++++++++-- classes/sota.bbclass | 2 ++ 2 files changed, 10 insertions(+), 2 deletions(-) (limited to 'classes/sota.bbclass') diff --git a/classes/image_types_ostree.bbclass b/classes/image_types_ostree.bbclass index 46b31b5..bc27c09 100644 --- a/classes/image_types_ostree.bbclass +++ b/classes/image_types_ostree.bbclass @@ -201,6 +201,12 @@ IMAGE_CMD_garagesign () { ostree_target_hash=$(cat ${OSTREE_REPO}/refs/heads/${OSTREE_BRANCHNAME}) + # Use OSTree target hash as version if none was provided by the user + target_version=${ostree_target_hash} + if [ -n "${GARAGE_TARGET_VERSION}" ]; then + target_version=${GARAGE_TARGET_VERSION} + fi + # Push may fail due to race condition when multiple build machines try to push simultaneously # in which case targets.json should be pulled again and the whole procedure repeated push_success=0 @@ -211,9 +217,9 @@ IMAGE_CMD_garagesign () { --home-dir ${GARAGE_SIGN_REPO} \ --name ${GARAGE_TARGET_NAME} \ --format OSTREE \ - --version ${ostree_target_hash} \ + --version ${target_version} \ --length 0 \ - --url "https://example.com/" \ + --url "${GARAGE_TARGET_URL}" \ --sha256 ${ostree_target_hash} \ --hardwareids ${MACHINE} garage-sign targets sign --repo tufrepo \ diff --git a/classes/sota.bbclass b/classes/sota.bbclass index 4e525e2..1e765f0 100644 --- a/classes/sota.bbclass +++ b/classes/sota.bbclass @@ -31,6 +31,8 @@ OSTREE_INITRAMFS_IMAGE ?= "initramfs-ostree-image" GARAGE_SIGN_REPO ?= "${DEPLOY_DIR_IMAGE}/garage_sign_repo" GARAGE_SIGN_KEYNAME ?= "garage-key" GARAGE_TARGET_NAME ?= "${OSTREE_BRANCHNAME}" +GARAGE_TARGET_VERSION ?= "" +GARAGE_TARGET_URL ?= "https://example.com/" SOTA_MACHINE ??="none" SOTA_MACHINE_rpi ?= "raspberrypi" -- 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(-) (limited to 'classes/sota.bbclass') 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 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(-) (limited to 'classes/sota.bbclass') 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 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(-) (limited to 'classes/sota.bbclass') 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