summaryrefslogtreecommitdiffstats
path: root/classes
diff options
context:
space:
mode:
Diffstat (limited to 'classes')
-rw-r--r--classes/image_types_ostree.bbclass7
-rw-r--r--classes/sota.bbclass17
-rw-r--r--classes/sota_raspberrypi.bbclass8
3 files changed, 25 insertions, 7 deletions
diff --git a/classes/image_types_ostree.bbclass b/classes/image_types_ostree.bbclass
index 29da78e..a6c9155 100644
--- a/classes/image_types_ostree.bbclass
+++ b/classes/image_types_ostree.bbclass
@@ -112,7 +112,12 @@ IMAGE_CMD_ostree () {
112 touch boot/initramfs-${checksum} 112 touch boot/initramfs-${checksum}
113 else 113 else
114 if [ "${OSTREE_DEPLOY_DEVICETREE}" = "1" ] && [ -n "${KERNEL_DEVICETREE}" ]; then 114 if [ "${OSTREE_DEPLOY_DEVICETREE}" = "1" ] && [ -n "${KERNEL_DEVICETREE}" ]; then
115 checksum=$(cat ${DEPLOY_DIR_IMAGE}/${OSTREE_KERNEL} ${DEPLOY_DIR_IMAGE}/${INITRAMFS_IMAGE}-${MACHINE}.${INITRAMFS_FSTYPES} ${KERNEL_DEVICETREE} | sha256sum | cut -f 1 -d " ") 115 kernel_ostree_fullpath=""
116 for blob in ${KERNEL_DEVICETREE}; do
117 kernel_ostree_fullpath="$kernel_ostree_fullpath ${DEPLOY_DIR_IMAGE}/$blob"
118 done
119
120 checksum=$(cat ${DEPLOY_DIR_IMAGE}/${OSTREE_KERNEL} ${DEPLOY_DIR_IMAGE}/${INITRAMFS_IMAGE}-${MACHINE}.${INITRAMFS_FSTYPES} $kernel_ostree_fullpath | sha256sum | cut -f 1 -d " ")
116 for DTS_FILE in ${KERNEL_DEVICETREE}; do 121 for DTS_FILE in ${KERNEL_DEVICETREE}; do
117 DTS_FILE_BASENAME=$(basename ${DTS_FILE}) 122 DTS_FILE_BASENAME=$(basename ${DTS_FILE})
118 cp ${DEPLOY_DIR_IMAGE}/${DTS_FILE_BASENAME} boot/devicetree-${DTS_FILE_BASENAME}-${checksum} 123 cp ${DEPLOY_DIR_IMAGE}/${DTS_FILE_BASENAME} boot/devicetree-${DTS_FILE_BASENAME}-${checksum}
diff --git a/classes/sota.bbclass b/classes/sota.bbclass
index 92b4c43..236a3bb 100644
--- a/classes/sota.bbclass
+++ b/classes/sota.bbclass
@@ -21,7 +21,11 @@ WKS_FILE_sota ?= "sdimage-sota.wks"
21 21
22EXTRA_IMAGEDEPENDS_append_sota = " parted-native mtools-native dosfstools-native" 22EXTRA_IMAGEDEPENDS_append_sota = " parted-native mtools-native dosfstools-native"
23 23
24INITRAMFS_FSTYPES ?= "${@oe.utils.ifelse(d.getVar('OSTREE_BOOTLOADER') == 'u-boot', 'cpio.gz.u-boot', 'cpio.gz')}" 24# Has to be an override, because 'INITRAMFS_FSTYPES ?=' is not strong enough to override the default value
25INITRAMFS_FSTYPES_sota ?= "${@oe.utils.ifelse(d.getVar('OSTREE_BOOTLOADER') == 'u-boot' and d.getVar('KERNEL_IMAGETYPE') != 'fitImage', 'cpio.gz.u-boot', 'cpio.gz')}"
26
27# Deploy config fragment list to OSTree root fs
28IMAGE_INSTALL_append = "${@oe.utils.ifelse(d.getVar('KERNEL_IMAGETYPE') == 'fitImage', ' fit-conf', ' ')}"
25 29
26# 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
27export OSTREE_REPO ?= "${DEPLOY_DIR_IMAGE}/ostree_repo" 31export OSTREE_REPO ?= "${DEPLOY_DIR_IMAGE}/ostree_repo"
@@ -38,6 +42,15 @@ GARAGE_TARGET_NAME ?= "${OSTREE_BRANCHNAME}"
38GARAGE_TARGET_VERSION ?= "" 42GARAGE_TARGET_VERSION ?= ""
39GARAGE_TARGET_URL ?= "https://example.com/" 43GARAGE_TARGET_URL ?= "https://example.com/"
40 44
45SOTA_BOOTLOADER_EXTRA_PARAMS ??= ""
46SOTA_BOOTLOADER_BOOTCOMMAND ??= "bootm"
47SOTA_BOOTLOADER_KERNEL_ADDR ??= "0x02700000"
48SOTA_BOOTLOADER_RAMDISK_ADDR ??= ""
49SOTA_BOOTLOADER_FDT_ADDR ??= ""
50SOTA_BOOTLOADER_BOOT_PART ??= "mmc 0:1"
51SOTA_BOOTLOADER_MAIN_PART ??= "mmc 0:2"
52SOTA_BOOTLOADER_ROOT_DEVICE ??= "/dev/mmcblk0p2"
53
41SOTA_MACHINE ??="none" 54SOTA_MACHINE ??="none"
42SOTA_MACHINE_rpi ?= "raspberrypi" 55SOTA_MACHINE_rpi ?= "raspberrypi"
43SOTA_MACHINE_porter ?= "porter" 56SOTA_MACHINE_porter ?= "porter"
@@ -49,4 +62,6 @@ SOTA_MACHINE_am335x-evm ?= "am335x-evm-wifi"
49SOTA_OVERRIDES_BLACKLIST = "ostree ota" 62SOTA_OVERRIDES_BLACKLIST = "ostree ota"
50SOTA_REQUIRED_VARIABLES = "OSTREE_REPO OSTREE_BRANCHNAME OSTREE_OSNAME OSTREE_BOOTLOADER OSTREE_BOOT_PARTITION GARAGE_SIGN_REPO GARAGE_TARGET_NAME" 63SOTA_REQUIRED_VARIABLES = "OSTREE_REPO OSTREE_BRANCHNAME OSTREE_OSNAME OSTREE_BOOTLOADER OSTREE_BOOT_PARTITION GARAGE_SIGN_REPO GARAGE_TARGET_NAME"
51 64
65do_image_wic[depends] += " ota-u-boot-script:do_deploy "
66
52inherit sota_sanity sota_${SOTA_MACHINE} image_repo_manifest 67inherit sota_sanity sota_${SOTA_MACHINE} image_repo_manifest
diff --git a/classes/sota_raspberrypi.bbclass b/classes/sota_raspberrypi.bbclass
index e1c0054..88b5f21 100644
--- a/classes/sota_raspberrypi.bbclass
+++ b/classes/sota_raspberrypi.bbclass
@@ -2,16 +2,12 @@ RPI_USE_U_BOOT_sota = "1"
2 2
3KERNEL_CLASSES_append_sota = " kernel-fitimage" 3KERNEL_CLASSES_append_sota = " kernel-fitimage"
4KERNEL_IMAGETYPE_sota = "fitImage" 4KERNEL_IMAGETYPE_sota = "fitImage"
5INITRAMFS_FSTYPES = "cpio.gz"
6OSTREE_KERNEL = "${KERNEL_IMAGETYPE}-${INITRAMFS_IMAGE}-${MACHINE}-${KERNEL_FIT_LINK_NAME}" 5OSTREE_KERNEL = "${KERNEL_IMAGETYPE}-${INITRAMFS_IMAGE}-${MACHINE}-${KERNEL_FIT_LINK_NAME}"
7 6
8# DTB needs to be relocated to apply overlays 7# DTB needs to be relocated to apply overlays
9UBOOT_DTB_LOADADDRESS = "0x05000000" 8UBOOT_DTB_LOADADDRESS = "0x05000000"
10UBOOT_DTBO_LOADADDRESS = "0x06000000" 9UBOOT_DTBO_LOADADDRESS = "0x06000000"
11 10
12# Deploy config fragment list to OSTree root fs
13IMAGE_INSTALL_append = " fit-conf"
14
15PREFERRED_PROVIDER_virtual/bootloader_sota ?= "u-boot" 11PREFERRED_PROVIDER_virtual/bootloader_sota ?= "u-boot"
16UBOOT_ENTRYPOINT_sota ?= "0x00008000" 12UBOOT_ENTRYPOINT_sota ?= "0x00008000"
17 13
@@ -19,7 +15,7 @@ IMAGE_FSTYPES_remove_sota = "rpi-sdimg"
19OSTREE_BOOTLOADER ?= "u-boot" 15OSTREE_BOOTLOADER ?= "u-boot"
20 16
21# OSTree puts its own boot.scr to bcm2835-bootfiles 17# OSTree puts its own boot.scr to bcm2835-bootfiles
22IMAGE_BOOT_FILES_sota = "bcm2835-bootfiles/* u-boot.bin;${SDIMG_KERNELIMAGE}" 18IMAGE_BOOT_FILES_sota = "bcm2835-bootfiles/* uEnv.txt u-boot.bin;${SDIMG_KERNELIMAGE}"
23 19
24# Just the overlays that will be used should be listed 20# Just the overlays that will be used should be listed
25KERNEL_DEVICETREE_raspberrypi2_sota ?= " bcm2709-rpi-2-b.dtb " 21KERNEL_DEVICETREE_raspberrypi2_sota ?= " bcm2709-rpi-2-b.dtb "
@@ -35,3 +31,5 @@ OSTREE_KERNEL_ARGS_sota ?= " 8250.nr_uarts=1 bcm2708_fb.fbwidth=656 bcm2708_fb.f
35 31
36SOTA_CLIENT_FEATURES_append = " ubootenv" 32SOTA_CLIENT_FEATURES_append = " ubootenv"
37 33
34SOTA_ROLLBACK_MECHANISM = "file-env"
35