diff options
| -rw-r--r-- | classes/image_types_ostree.bbclass | 13 | ||||
| -rw-r--r-- | classes/image_types_ota.bbclass | 10 | ||||
| -rw-r--r-- | classes/sota.bbclass | 11 |
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 | " |
| 8 | do_image_ostree[lockfiles] += "${OSTREE_REPO}/ostree.lock" | 8 | do_image_ostree[lockfiles] += "${OSTREE_REPO}/ostree.lock" |
| 9 | 9 | ||
| 10 | export OSTREE_REPO | ||
| 11 | export OSTREE_BRANCHNAME | ||
| 12 | export GARAGE_TARGET_NAME | ||
| 13 | |||
| 14 | OSTREE_KERNEL ??= "${KERNEL_IMAGETYPE}" | 10 | OSTREE_KERNEL ??= "${KERNEL_IMAGETYPE}" |
| 15 | |||
| 16 | OSTREE_COMMIT_SUBJECT ??= "Commit-id: ${IMAGE_NAME}" | 11 | OSTREE_COMMIT_SUBJECT ??= "Commit-id: ${IMAGE_NAME}" |
| 17 | OSTREE_COMMIT_BODY ??= "" | 12 | OSTREE_COMMIT_BODY ??= "" |
| 18 | OSTREE_UPDATE_SUMMARY ??= "0" | 13 | OSTREE_UPDATE_SUMMARY ??= "0" |
| 19 | 14 | ||
| 20 | export SYSTEMD_USED = "${@oe.utils.ifelse(d.getVar('VIRTUAL-RUNTIME_init_manager', True) == 'systemd', 'true', '')}" | 15 | SYSTEMD_USED = "${@oe.utils.ifelse(d.getVar('VIRTUAL-RUNTIME_init_manager', True) == 'systemd', 'true', '')}" |
| 21 | 16 | ||
| 22 | IMAGE_CMD_ostree () { | 17 | IMAGE_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 | ||
| 46 | export OSTREE_OSNAME | 46 | OTA_SYSROOT = "${WORKDIR}/ota-sysroot" |
| 47 | export OSTREE_BRANCHNAME | ||
| 48 | export OSTREE_REPO | ||
| 49 | export OSTREE_BOOTLOADER | ||
| 50 | |||
| 51 | export GARAGE_TARGET_NAME | ||
| 52 | |||
| 53 | export OTA_SYSROOT="${WORKDIR}/ota-sysroot" | ||
| 54 | 47 | ||
| 55 | ## Common OTA image setup | 48 | ## Common OTA image setup |
| 56 | fakeroot do_otasetup () { | 49 | fakeroot 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 @@ | |||
| 1 | export BUILD_OTA_TARBALL | ||
| 2 | python __anonymous() { | 1 | python __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 | |||
| 29 | INITRAMFS_FSTYPES ??= "${@oe.utils.ifelse(d.getVar('OSTREE_BOOTLOADER', True) == 'u-boot', 'cpio.gz.u-boot', 'cpio.gz')}" | 28 | INITRAMFS_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 |
| 32 | OSTREE_REPO ?= "${DEPLOY_DIR_IMAGE}/ostree_repo" | 31 | export OSTREE_REPO ?= "${DEPLOY_DIR_IMAGE}/ostree_repo" |
| 33 | OSTREE_BRANCHNAME ?= "${SOTA_HARDWARE_ID}" | 32 | export OSTREE_BRANCHNAME ?= "${SOTA_HARDWARE_ID}" |
| 34 | OSTREE_OSNAME ?= "poky" | 33 | export OSTREE_OSNAME ?= "poky" |
| 34 | export OSTREE_BOOTLOADER ??= 'u-boot' | ||
| 35 | export OSTREE_BOOT_PARTITION ??= "/boot" | ||
| 36 | |||
| 35 | INITRAMFS_IMAGE ?= "initramfs-ostree-image" | 37 | INITRAMFS_IMAGE ?= "initramfs-ostree-image" |
| 36 | OSTREE_BOOTLOADER ??= 'u-boot' | ||
| 37 | 38 | ||
| 38 | GARAGE_SIGN_REPO ?= "${DEPLOY_DIR_IMAGE}/garage_sign_repo" | 39 | GARAGE_SIGN_REPO ?= "${DEPLOY_DIR_IMAGE}/garage_sign_repo" |
| 39 | GARAGE_SIGN_KEYNAME ?= "garage-key" | 40 | GARAGE_SIGN_KEYNAME ?= "garage-key" |
