summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--classes/image_types_ostree.bbclass13
-rw-r--r--classes/image_types_ota.bbclass8
-rw-r--r--classes/sota.bbclass10
3 files changed, 10 insertions, 21 deletions
diff --git a/classes/image_types_ostree.bbclass b/classes/image_types_ostree.bbclass
index e3cfc9d..9574521 100644
--- a/classes/image_types_ostree.bbclass
+++ b/classes/image_types_ostree.bbclass
@@ -6,19 +6,14 @@ do_image_ostree[depends] += "ostree-native:do_populate_sysroot \
6 ${OSTREE_INITRAMFS_IMAGE}:do_image_complete" 6 ${OSTREE_INITRAMFS_IMAGE}:do_image_complete"
7do_image_ostree[lockfiles] += "${OSTREE_REPO}/ostree.lock" 7do_image_ostree[lockfiles] += "${OSTREE_REPO}/ostree.lock"
8 8
9export OSTREE_REPO
10export OSTREE_BRANCHNAME
11export GARAGE_TARGET_NAME
12
13RAMDISK_EXT ?= ".${OSTREE_INITRAMFS_FSTYPES}" 9RAMDISK_EXT ?= ".${OSTREE_INITRAMFS_FSTYPES}"
14 10
15OSTREE_KERNEL ??= "${KERNEL_IMAGETYPE}" 11OSTREE_KERNEL ??= "${KERNEL_IMAGETYPE}"
16
17OSTREE_COMMIT_SUBJECT ??= "Commit-id: ${IMAGE_NAME}" 12OSTREE_COMMIT_SUBJECT ??= "Commit-id: ${IMAGE_NAME}"
18OSTREE_COMMIT_BODY ??= "" 13OSTREE_COMMIT_BODY ??= ""
19OSTREE_UPDATE_SUMMARY ??= "0" 14OSTREE_UPDATE_SUMMARY ??= "0"
20 15
21export SYSTEMD_USED = "${@oe.utils.ifelse(d.getVar('VIRTUAL-RUNTIME_init_manager', True) == 'systemd', 'true', '')}" 16SYSTEMD_USED = "${@oe.utils.ifelse(d.getVar('VIRTUAL-RUNTIME_init_manager', True) == 'systemd', 'true', '')}"
22 17
23IMAGE_CMD_ostree () { 18IMAGE_CMD_ostree () {
24 if [ -z "$OSTREE_REPO" ]; then 19 if [ -z "$OSTREE_REPO" ]; then
@@ -63,7 +58,7 @@ IMAGE_CMD_ostree () {
63 fi 58 fi
64 done 59 done
65 60
66 if [ -n "$SYSTEMD_USED" ]; then 61 if [ -n "${SYSTEMD_USED}" ]; then
67 mkdir -p usr/etc/tmpfiles.d 62 mkdir -p usr/etc/tmpfiles.d
68 tmpfiles_conf=usr/etc/tmpfiles.d/00ostree-tmpfiles.conf 63 tmpfiles_conf=usr/etc/tmpfiles.d/00ostree-tmpfiles.conf
69 echo "d /var/rootdirs 0755 root root -" >>${tmpfiles_conf} 64 echo "d /var/rootdirs 0755 root root -" >>${tmpfiles_conf}
@@ -99,7 +94,7 @@ IMAGE_CMD_ostree () {
99 bbwarn "Data in /$dir directory is not preserved by OSTree. Consider moving it under /usr" 94 bbwarn "Data in /$dir directory is not preserved by OSTree. Consider moving it under /usr"
100 fi 95 fi
101 96
102 if [ -n "$SYSTEMD_USED" ]; then 97 if [ -n "${SYSTEMD_USED}" ]; then
103 echo "d /var/rootdirs/${dir} 0755 root root -" >>${tmpfiles_conf} 98 echo "d /var/rootdirs/${dir} 0755 root root -" >>${tmpfiles_conf}
104 else 99 else
105 echo "mkdir -p /var/rootdirs/${dir}; chown 755 /var/rootdirs/${dir}" >>${tmpfiles_conf} 100 echo "mkdir -p /var/rootdirs/${dir}; chown 755 /var/rootdirs/${dir}" >>${tmpfiles_conf}
@@ -114,7 +109,7 @@ IMAGE_CMD_ostree () {
114 bbfatal "Data in /root directory is not preserved by OSTree." 109 bbfatal "Data in /root directory is not preserved by OSTree."
115 fi 110 fi
116 111
117 if [ -n "$SYSTEMD_USED" ]; then 112 if [ -n "${SYSTEMD_USED}" ]; then
118 echo "d /var/roothome 0755 root root -" >>${tmpfiles_conf} 113 echo "d /var/roothome 0755 root root -" >>${tmpfiles_conf}
119 else 114 else
120 echo "mkdir -p /var/roothome; chown 755 /var/roothome" >>${tmpfiles_conf} 115 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 2aa4306..9eecd1b 100644
--- a/classes/image_types_ota.bbclass
+++ b/classes/image_types_ota.bbclass
@@ -44,13 +44,6 @@ calculate_size () {
44 echo "${SIZE}" 44 echo "${SIZE}"
45} 45}
46 46
47export OSTREE_OSNAME
48export OSTREE_BRANCHNAME
49export OSTREE_REPO
50export OSTREE_BOOTLOADER
51
52export GARAGE_TARGET_NAME
53
54IMAGE_CMD_otaimg () { 47IMAGE_CMD_otaimg () {
55 if ${@bb.utils.contains('IMAGE_FSTYPES', 'otaimg', 'true', 'false', d)}; then 48 if ${@bb.utils.contains('IMAGE_FSTYPES', 'otaimg', 'true', 'false', d)}; then
56 if [ -z "$OSTREE_REPO" ]; then 49 if [ -z "$OSTREE_REPO" ]; then
@@ -85,7 +78,6 @@ IMAGE_CMD_otaimg () {
85 ostree_target_hash=$(cat ${OSTREE_REPO}/refs/heads/${OSTREE_BRANCHNAME}) 78 ostree_target_hash=$(cat ${OSTREE_REPO}/refs/heads/${OSTREE_BRANCHNAME})
86 79
87 ostree --repo=${PHYS_SYSROOT}/ostree/repo pull-local --remote=${OSTREE_OSNAME} ${OSTREE_REPO} ${ostree_target_hash} 80 ostree --repo=${PHYS_SYSROOT}/ostree/repo pull-local --remote=${OSTREE_OSNAME} ${OSTREE_REPO} ${ostree_target_hash}
88 export OSTREE_BOOT_PARTITION="/boot"
89 kargs_list="" 81 kargs_list=""
90 for arg in ${OSTREE_KERNEL_ARGS}; do 82 for arg in ${OSTREE_KERNEL_ARGS}; do
91 kargs_list="${kargs_list} --karg-append=$arg" 83 kargs_list="${kargs_list} --karg-append=$arg"
diff --git a/classes/sota.bbclass b/classes/sota.bbclass
index 1e149ea..4ee4191 100644
--- a/classes/sota.bbclass
+++ b/classes/sota.bbclass
@@ -26,11 +26,13 @@ EXTRA_IMAGEDEPENDS_append_sota = " parted-native mtools-native dosfstools-native
26OSTREE_INITRAMFS_FSTYPES ??= "${@oe.utils.ifelse(d.getVar('OSTREE_BOOTLOADER', True) == 'u-boot', 'ext4.gz.u-boot', 'ext4.gz')}" 26OSTREE_INITRAMFS_FSTYPES ??= "${@oe.utils.ifelse(d.getVar('OSTREE_BOOTLOADER', True) == 'u-boot', 'ext4.gz.u-boot', 'ext4.gz')}"
27 27
28# Please redefine OSTREE_REPO in order to have a persistent OSTree repo 28# Please redefine OSTREE_REPO in order to have a persistent OSTree repo
29OSTREE_REPO ?= "${DEPLOY_DIR_IMAGE}/ostree_repo" 29export OSTREE_REPO ?= "${DEPLOY_DIR_IMAGE}/ostree_repo"
30OSTREE_BRANCHNAME ?= "${SOTA_HARDWARE_ID}" 30export OSTREE_BRANCHNAME ?= "${SOTA_HARDWARE_ID}"
31OSTREE_OSNAME ?= "poky" 31export OSTREE_OSNAME ?= "poky"
32export OSTREE_BOOTLOADER ??= 'u-boot'
33export OSTREE_BOOT_PARTITION ??= "/boot"
34
32OSTREE_INITRAMFS_IMAGE ?= "initramfs-ostree-image" 35OSTREE_INITRAMFS_IMAGE ?= "initramfs-ostree-image"
33OSTREE_BOOTLOADER ??= 'u-boot'
34 36
35GARAGE_SIGN_REPO ?= "${DEPLOY_DIR_IMAGE}/garage_sign_repo" 37GARAGE_SIGN_REPO ?= "${DEPLOY_DIR_IMAGE}/garage_sign_repo"
36GARAGE_SIGN_KEYNAME ?= "garage-key" 38GARAGE_SIGN_KEYNAME ?= "garage-key"