summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--classes/image_types_ostree.bbclass13
-rw-r--r--classes/image_types_ota.bbclass10
-rw-r--r--classes/sota.bbclass11
3 files changed, 11 insertions, 23 deletions
diff --git a/classes/image_types_ostree.bbclass b/classes/image_types_ostree.bbclass
index 71cacc6..44a3aa4 100644
--- a/classes/image_types_ostree.bbclass
+++ b/classes/image_types_ostree.bbclass
@@ -7,17 +7,12 @@ do_image_ostree[depends] += "ostree-native:do_populate_sysroot \
7" 7"
8do_image_ostree[lockfiles] += "${OSTREE_REPO}/ostree.lock" 8do_image_ostree[lockfiles] += "${OSTREE_REPO}/ostree.lock"
9 9
10export OSTREE_REPO
11export OSTREE_BRANCHNAME
12export GARAGE_TARGET_NAME
13
14OSTREE_KERNEL ??= "${KERNEL_IMAGETYPE}" 10OSTREE_KERNEL ??= "${KERNEL_IMAGETYPE}"
15
16OSTREE_COMMIT_SUBJECT ??= "Commit-id: ${IMAGE_NAME}" 11OSTREE_COMMIT_SUBJECT ??= "Commit-id: ${IMAGE_NAME}"
17OSTREE_COMMIT_BODY ??= "" 12OSTREE_COMMIT_BODY ??= ""
18OSTREE_UPDATE_SUMMARY ??= "0" 13OSTREE_UPDATE_SUMMARY ??= "0"
19 14
20export SYSTEMD_USED = "${@oe.utils.ifelse(d.getVar('VIRTUAL-RUNTIME_init_manager', True) == 'systemd', 'true', '')}" 15SYSTEMD_USED = "${@oe.utils.ifelse(d.getVar('VIRTUAL-RUNTIME_init_manager', True) == 'systemd', 'true', '')}"
21 16
22IMAGE_CMD_ostree () { 17IMAGE_CMD_ostree () {
23 if [ -z "$OSTREE_REPO" ]; then 18 if [ -z "$OSTREE_REPO" ]; then
@@ -62,7 +57,7 @@ IMAGE_CMD_ostree () {
62 fi 57 fi
63 done 58 done
64 59
65 if [ -n "$SYSTEMD_USED" ]; then 60 if [ -n "${SYSTEMD_USED}" ]; then
66 mkdir -p usr/etc/tmpfiles.d 61 mkdir -p usr/etc/tmpfiles.d
67 tmpfiles_conf=usr/etc/tmpfiles.d/00ostree-tmpfiles.conf 62 tmpfiles_conf=usr/etc/tmpfiles.d/00ostree-tmpfiles.conf
68 echo "d /var/rootdirs 0755 root root -" >>${tmpfiles_conf} 63 echo "d /var/rootdirs 0755 root root -" >>${tmpfiles_conf}
@@ -98,7 +93,7 @@ IMAGE_CMD_ostree () {
98 bbwarn "Data in /$dir directory is not preserved by OSTree. Consider moving it under /usr" 93 bbwarn "Data in /$dir directory is not preserved by OSTree. Consider moving it under /usr"
99 fi 94 fi
100 95
101 if [ -n "$SYSTEMD_USED" ]; then 96 if [ -n "${SYSTEMD_USED}" ]; then
102 echo "d /var/rootdirs/${dir} 0755 root root -" >>${tmpfiles_conf} 97 echo "d /var/rootdirs/${dir} 0755 root root -" >>${tmpfiles_conf}
103 else 98 else
104 echo "mkdir -p /var/rootdirs/${dir}; chown 755 /var/rootdirs/${dir}" >>${tmpfiles_conf} 99 echo "mkdir -p /var/rootdirs/${dir}; chown 755 /var/rootdirs/${dir}" >>${tmpfiles_conf}
@@ -113,7 +108,7 @@ IMAGE_CMD_ostree () {
113 bbfatal "Data in /root directory is not preserved by OSTree." 108 bbfatal "Data in /root directory is not preserved by OSTree."
114 fi 109 fi
115 110
116 if [ -n "$SYSTEMD_USED" ]; then 111 if [ -n "${SYSTEMD_USED}" ]; then
117 echo "d /var/roothome 0755 root root -" >>${tmpfiles_conf} 112 echo "d /var/roothome 0755 root root -" >>${tmpfiles_conf}
118 else 113 else
119 echo "mkdir -p /var/roothome; chown 755 /var/roothome" >>${tmpfiles_conf} 114 echo "mkdir -p /var/roothome; chown 755 /var/roothome" >>${tmpfiles_conf}
diff --git a/classes/image_types_ota.bbclass b/classes/image_types_ota.bbclass
index 790ac31..79de909 100644
--- a/classes/image_types_ota.bbclass
+++ b/classes/image_types_ota.bbclass
@@ -43,14 +43,7 @@ calculate_size () {
43 echo "${SIZE}" 43 echo "${SIZE}"
44} 44}
45 45
46export OSTREE_OSNAME 46OTA_SYSROOT = "${WORKDIR}/ota-sysroot"
47export OSTREE_BRANCHNAME
48export OSTREE_REPO
49export OSTREE_BOOTLOADER
50
51export GARAGE_TARGET_NAME
52
53export OTA_SYSROOT="${WORKDIR}/ota-sysroot"
54 47
55## Common OTA image setup 48## Common OTA image setup
56fakeroot do_otasetup () { 49fakeroot do_otasetup () {
@@ -88,7 +81,6 @@ fakeroot do_otasetup () {
88 ostree_target_hash=$(cat ${OSTREE_REPO}/refs/heads/${OSTREE_BRANCHNAME}) 81 ostree_target_hash=$(cat ${OSTREE_REPO}/refs/heads/${OSTREE_BRANCHNAME})
89 82
90 ostree --repo=${OTA_SYSROOT}/ostree/repo pull-local --remote=${OSTREE_OSNAME} ${OSTREE_REPO} ${ostree_target_hash} 83 ostree --repo=${OTA_SYSROOT}/ostree/repo pull-local --remote=${OSTREE_OSNAME} ${OSTREE_REPO} ${ostree_target_hash}
91 export OSTREE_BOOT_PARTITION="/boot"
92 kargs_list="" 84 kargs_list=""
93 for arg in ${OSTREE_KERNEL_ARGS}; do 85 for arg in ${OSTREE_KERNEL_ARGS}; do
94 kargs_list="${kargs_list} --karg-append=$arg" 86 kargs_list="${kargs_list} --karg-append=$arg"
diff --git a/classes/sota.bbclass b/classes/sota.bbclass
index 7fb54dc..e654071 100644
--- a/classes/sota.bbclass
+++ b/classes/sota.bbclass
@@ -1,4 +1,3 @@
1export BUILD_OTA_TARBALL
2python __anonymous() { 1python __anonymous() {
3 if bb.utils.contains('DISTRO_FEATURES', 'sota', True, False, d): 2 if bb.utils.contains('DISTRO_FEATURES', 'sota', True, False, d):
4 d.appendVarFlag("do_image_wic", "depends", " %s:do_image_ota_ext4" % d.getVar("IMAGE_BASENAME", True)) 3 d.appendVarFlag("do_image_wic", "depends", " %s:do_image_ota_ext4" % d.getVar("IMAGE_BASENAME", True))
@@ -29,11 +28,13 @@ EXTRA_IMAGEDEPENDS_append_sota = " parted-native mtools-native dosfstools-native
29INITRAMFS_FSTYPES ??= "${@oe.utils.ifelse(d.getVar('OSTREE_BOOTLOADER', True) == 'u-boot', 'cpio.gz.u-boot', 'cpio.gz')}" 28INITRAMFS_FSTYPES ??= "${@oe.utils.ifelse(d.getVar('OSTREE_BOOTLOADER', True) == 'u-boot', 'cpio.gz.u-boot', 'cpio.gz')}"
30 29
31# Please redefine OSTREE_REPO in order to have a persistent OSTree repo 30# Please redefine OSTREE_REPO in order to have a persistent OSTree repo
32OSTREE_REPO ?= "${DEPLOY_DIR_IMAGE}/ostree_repo" 31export OSTREE_REPO ?= "${DEPLOY_DIR_IMAGE}/ostree_repo"
33OSTREE_BRANCHNAME ?= "${SOTA_HARDWARE_ID}" 32export OSTREE_BRANCHNAME ?= "${SOTA_HARDWARE_ID}"
34OSTREE_OSNAME ?= "poky" 33export OSTREE_OSNAME ?= "poky"
34export OSTREE_BOOTLOADER ??= 'u-boot'
35export OSTREE_BOOT_PARTITION ??= "/boot"
36
35INITRAMFS_IMAGE ?= "initramfs-ostree-image" 37INITRAMFS_IMAGE ?= "initramfs-ostree-image"
36OSTREE_BOOTLOADER ??= 'u-boot'
37 38
38GARAGE_SIGN_REPO ?= "${DEPLOY_DIR_IMAGE}/garage_sign_repo" 39GARAGE_SIGN_REPO ?= "${DEPLOY_DIR_IMAGE}/garage_sign_repo"
39GARAGE_SIGN_KEYNAME ?= "garage-key" 40GARAGE_SIGN_KEYNAME ?= "garage-key"