diff options
| -rw-r--r-- | classes/image_types_ostree.bbclass | 13 | ||||
| -rw-r--r-- | classes/image_types_ota.bbclass | 8 | ||||
| -rw-r--r-- | classes/sota.bbclass | 10 |
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" |
| 7 | do_image_ostree[lockfiles] += "${OSTREE_REPO}/ostree.lock" | 7 | do_image_ostree[lockfiles] += "${OSTREE_REPO}/ostree.lock" |
| 8 | 8 | ||
| 9 | export OSTREE_REPO | ||
| 10 | export OSTREE_BRANCHNAME | ||
| 11 | export GARAGE_TARGET_NAME | ||
| 12 | |||
| 13 | RAMDISK_EXT ?= ".${OSTREE_INITRAMFS_FSTYPES}" | 9 | RAMDISK_EXT ?= ".${OSTREE_INITRAMFS_FSTYPES}" |
| 14 | 10 | ||
| 15 | OSTREE_KERNEL ??= "${KERNEL_IMAGETYPE}" | 11 | OSTREE_KERNEL ??= "${KERNEL_IMAGETYPE}" |
| 16 | |||
| 17 | OSTREE_COMMIT_SUBJECT ??= "Commit-id: ${IMAGE_NAME}" | 12 | OSTREE_COMMIT_SUBJECT ??= "Commit-id: ${IMAGE_NAME}" |
| 18 | OSTREE_COMMIT_BODY ??= "" | 13 | OSTREE_COMMIT_BODY ??= "" |
| 19 | OSTREE_UPDATE_SUMMARY ??= "0" | 14 | OSTREE_UPDATE_SUMMARY ??= "0" |
| 20 | 15 | ||
| 21 | export SYSTEMD_USED = "${@oe.utils.ifelse(d.getVar('VIRTUAL-RUNTIME_init_manager', True) == 'systemd', 'true', '')}" | 16 | SYSTEMD_USED = "${@oe.utils.ifelse(d.getVar('VIRTUAL-RUNTIME_init_manager', True) == 'systemd', 'true', '')}" |
| 22 | 17 | ||
| 23 | IMAGE_CMD_ostree () { | 18 | IMAGE_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 | ||
| 47 | export OSTREE_OSNAME | ||
| 48 | export OSTREE_BRANCHNAME | ||
| 49 | export OSTREE_REPO | ||
| 50 | export OSTREE_BOOTLOADER | ||
| 51 | |||
| 52 | export GARAGE_TARGET_NAME | ||
| 53 | |||
| 54 | IMAGE_CMD_otaimg () { | 47 | IMAGE_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 | |||
| 26 | OSTREE_INITRAMFS_FSTYPES ??= "${@oe.utils.ifelse(d.getVar('OSTREE_BOOTLOADER', True) == 'u-boot', 'ext4.gz.u-boot', 'ext4.gz')}" | 26 | OSTREE_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 |
| 29 | OSTREE_REPO ?= "${DEPLOY_DIR_IMAGE}/ostree_repo" | 29 | export OSTREE_REPO ?= "${DEPLOY_DIR_IMAGE}/ostree_repo" |
| 30 | OSTREE_BRANCHNAME ?= "${SOTA_HARDWARE_ID}" | 30 | export OSTREE_BRANCHNAME ?= "${SOTA_HARDWARE_ID}" |
| 31 | OSTREE_OSNAME ?= "poky" | 31 | export OSTREE_OSNAME ?= "poky" |
| 32 | export OSTREE_BOOTLOADER ??= 'u-boot' | ||
| 33 | export OSTREE_BOOT_PARTITION ??= "/boot" | ||
| 34 | |||
| 32 | OSTREE_INITRAMFS_IMAGE ?= "initramfs-ostree-image" | 35 | OSTREE_INITRAMFS_IMAGE ?= "initramfs-ostree-image" |
| 33 | OSTREE_BOOTLOADER ??= 'u-boot' | ||
| 34 | 36 | ||
| 35 | GARAGE_SIGN_REPO ?= "${DEPLOY_DIR_IMAGE}/garage_sign_repo" | 37 | GARAGE_SIGN_REPO ?= "${DEPLOY_DIR_IMAGE}/garage_sign_repo" |
| 36 | GARAGE_SIGN_KEYNAME ?= "garage-key" | 38 | GARAGE_SIGN_KEYNAME ?= "garage-key" |
