diff options
Diffstat (limited to 'classes')
| -rw-r--r-- | classes/image_types_ostree.bbclass | 26 | ||||
| -rw-r--r-- | classes/sota_raspberrypi.bbclass | 17 |
2 files changed, 33 insertions, 10 deletions
diff --git a/classes/image_types_ostree.bbclass b/classes/image_types_ostree.bbclass index 5893e8d..e6d6fe0 100644 --- a/classes/image_types_ostree.bbclass +++ b/classes/image_types_ostree.bbclass | |||
| @@ -9,9 +9,9 @@ do_image_ostree[depends] += "ostree-native:do_populate_sysroot \ | |||
| 9 | 9 | ||
| 10 | export OSTREE_REPO | 10 | export OSTREE_REPO |
| 11 | export OSTREE_BRANCHNAME | 11 | export OSTREE_BRANCHNAME |
| 12 | export GARAGE_TARGET_NAME | ||
| 12 | 13 | ||
| 13 | RAMDISK_EXT ?= ".${OSTREE_INITRAMFS_FSTYPES}" | 14 | RAMDISK_EXT ?= ".${OSTREE_INITRAMFS_FSTYPES}" |
| 14 | export GARAGE_TARGET_NAME | ||
| 15 | 15 | ||
| 16 | OSTREE_KERNEL ??= "${KERNEL_IMAGETYPE}" | 16 | OSTREE_KERNEL ??= "${KERNEL_IMAGETYPE}" |
| 17 | 17 | ||
| @@ -194,7 +194,9 @@ IMAGE_CMD_garagesign () { | |||
| 194 | fi | 194 | fi |
| 195 | 195 | ||
| 196 | rm -rf ${GARAGE_SIGN_REPO} | 196 | rm -rf ${GARAGE_SIGN_REPO} |
| 197 | garage-sign init --repo tufrepo --home-dir ${GARAGE_SIGN_REPO} --credentials ${SOTA_PACKED_CREDENTIALS} | 197 | garage-sign init --repo tufrepo \ |
| 198 | --home-dir ${GARAGE_SIGN_REPO} \ | ||
| 199 | --credentials ${SOTA_PACKED_CREDENTIALS} | ||
| 198 | 200 | ||
| 199 | ostree_target_hash=$(cat ${OSTREE_REPO}/refs/heads/${OSTREE_BRANCHNAME}) | 201 | ostree_target_hash=$(cat ${OSTREE_REPO}/refs/heads/${OSTREE_BRANCHNAME}) |
| 200 | 202 | ||
| @@ -202,11 +204,23 @@ IMAGE_CMD_garagesign () { | |||
| 202 | # in which case targets.json should be pulled again and the whole procedure repeated | 204 | # in which case targets.json should be pulled again and the whole procedure repeated |
| 203 | push_success=0 | 205 | push_success=0 |
| 204 | for push_retries in $( seq 3 ); do | 206 | for push_retries in $( seq 3 ); do |
| 205 | garage-sign targets pull --repo tufrepo --home-dir ${GARAGE_SIGN_REPO} | 207 | garage-sign targets pull --repo tufrepo \ |
| 206 | garage-sign targets add --repo tufrepo --home-dir ${GARAGE_SIGN_REPO} --name ${GARAGE_TARGET_NAME} --format OSTREE --version ${ostree_target_hash} --length 0 --url "https://example.com/" --sha256 ${ostree_target_hash} --hardwareids ${MACHINE} | 208 | --home-dir ${GARAGE_SIGN_REPO} |
| 207 | garage-sign targets sign --repo tufrepo --home-dir ${GARAGE_SIGN_REPO} --key-name=targets | 209 | garage-sign targets add --repo tufrepo \ |
| 210 | --home-dir ${GARAGE_SIGN_REPO} \ | ||
| 211 | --name ${GARAGE_TARGET_NAME} \ | ||
| 212 | --format OSTREE \ | ||
| 213 | --version ${ostree_target_hash} \ | ||
| 214 | --length 0 \ | ||
| 215 | --url "https://example.com/" \ | ||
| 216 | --sha256 ${ostree_target_hash} \ | ||
| 217 | --hardwareids ${MACHINE} | ||
| 218 | garage-sign targets sign --repo tufrepo \ | ||
| 219 | --home-dir ${GARAGE_SIGN_REPO} \ | ||
| 220 | --key-name=targets | ||
| 208 | errcode=0 | 221 | errcode=0 |
| 209 | garage-sign targets push --repo tufrepo --home-dir ${GARAGE_SIGN_REPO} || errcode=$? | 222 | garage-sign targets push --repo tufrepo \ |
| 223 | --home-dir ${GARAGE_SIGN_REPO} || errcode=$? | ||
| 210 | if [ "$errcode" -eq "0" ]; then | 224 | if [ "$errcode" -eq "0" ]; then |
| 211 | push_success=1 | 225 | push_success=1 |
| 212 | break | 226 | break |
diff --git a/classes/sota_raspberrypi.bbclass b/classes/sota_raspberrypi.bbclass index 2c69ea0..a5558b4 100644 --- a/classes/sota_raspberrypi.bbclass +++ b/classes/sota_raspberrypi.bbclass | |||
| @@ -1,11 +1,20 @@ | |||
| 1 | RPI_USE_U_BOOT_sota = "1" | 1 | RPI_USE_U_BOOT_sota = "1" |
| 2 | KERNEL_IMAGETYPE_sota = "uImage" | 2 | |
| 3 | KERNEL_CLASSES_append_sota = " kernel-fitimage" | ||
| 4 | KERNEL_IMAGETYPE_sota = "fitImage" | ||
| 5 | |||
| 3 | PREFERRED_PROVIDER_virtual/bootloader_sota ?= "u-boot" | 6 | PREFERRED_PROVIDER_virtual/bootloader_sota ?= "u-boot" |
| 4 | UBOOT_MACHINE_raspberrypi2_sota ?= "rpi_2_defconfig" | 7 | UBOOT_ENTRYPOINT_sota ?= "0x00008000" |
| 5 | UBOOT_MACHINE_raspberrypi3_sota ?= "rpi_3_32b_defconfig" | ||
| 6 | 8 | ||
| 7 | IMAGE_FSTYPES_remove_sota = "rpi-sdimg" | 9 | IMAGE_FSTYPES_remove_sota = "rpi-sdimg" |
| 8 | OSTREE_BOOTLOADER ?= "u-boot" | 10 | OSTREE_BOOTLOADER ?= "u-boot" |
| 9 | 11 | ||
| 10 | # OSTree puts its own boot.scr to bcm2835-bootfiles | 12 | # OSTree puts its own boot.scr to bcm2835-bootfiles |
| 11 | IMAGE_BOOT_FILES_remove_sota += "boot.scr" | 13 | IMAGE_BOOT_FILES_sota = "bcm2835-bootfiles/* u-boot.bin;${SDIMG_KERNELIMAGE}" |
| 14 | |||
| 15 | # Just the overlays that will be used should be listed | ||
| 16 | KERNEL_DEVICETREE_raspberrypi2_sota ?= " bcm2709-rpi-2-b.dtb " | ||
| 17 | KERNEL_DEVICETREE_raspberrypi3_sota ?= " bcm2710-rpi-3-b.dtb overlays/vc4-kms-v3d.dtbo overlays/rpi-ft5406.dtbo" | ||
| 18 | |||
| 19 | # Kernel args normally provided by RPi's internal bootloader. Non-updateable | ||
| 20 | OSTREE_KERNEL_ARGS_sota ?= " 8250.nr_uarts=1 bcm2708_fb.fbwidth=720 bcm2708_fb.fbheight=480 bcm2708_fb.fbswap=1 vc_mem.mem_base=0x3ec00000 vc_mem.mem_size=0x40000000 dwc_otg.lpm_enable=0 console=ttyS0,115200 usbhid.mousepoll=0 " | ||
