From 38de2f4eeb74281784defe0ff6d9e3638e8fd583 Mon Sep 17 00:00:00 2001 From: Anton Gerasimov Date: Wed, 21 Feb 2018 16:54:09 +0100 Subject: Use FIT image on RPi --- classes/sota_raspberrypi.bbclass | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'classes') 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 @@ RPI_USE_U_BOOT_sota = "1" -KERNEL_IMAGETYPE_sota = "uImage" + +KERNEL_CLASSES_append_sota = " kernel-fitimage" +KERNEL_IMAGETYPE_sota = "fitImage" + PREFERRED_PROVIDER_virtual/bootloader_sota ?= "u-boot" -UBOOT_MACHINE_raspberrypi2_sota ?= "rpi_2_defconfig" -UBOOT_MACHINE_raspberrypi3_sota ?= "rpi_3_32b_defconfig" +UBOOT_ENTRYPOINT_sota ?= "0x00008000" IMAGE_FSTYPES_remove_sota = "rpi-sdimg" OSTREE_BOOTLOADER ?= "u-boot" # OSTree puts its own boot.scr to bcm2835-bootfiles -IMAGE_BOOT_FILES_remove_sota += "boot.scr" +IMAGE_BOOT_FILES_sota = "bcm2835-bootfiles/* u-boot.bin;${SDIMG_KERNELIMAGE}" + +# Just the overlays that will be used should be listed +KERNEL_DEVICETREE_raspberrypi2_sota ?= " bcm2709-rpi-2-b.dtb " +KERNEL_DEVICETREE_raspberrypi3_sota ?= " bcm2710-rpi-3-b.dtb overlays/vc4-kms-v3d.dtbo overlays/rpi-ft5406.dtbo" + +# Kernel args normally provided by RPi's internal bootloader. Non-updateable +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 " -- cgit v1.2.3-54-g00ecf From 3d77f5a4ef4e312c07ddb513ff1e21c6b2fb1d42 Mon Sep 17 00:00:00 2001 From: Matthias Andreas Benkard Date: Tue, 5 Dec 2017 13:53:29 +0100 Subject: Fix calculate_size in case $SIZE < $MIN calculate_size had a typo that made one of the cases fail. This patch fixes it. --- classes/image_types_ota.bbclass | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'classes') diff --git a/classes/image_types_ota.bbclass b/classes/image_types_ota.bbclass index e753e0e..d21441d 100644 --- a/classes/image_types_ota.bbclass +++ b/classes/image_types_ota.bbclass @@ -32,7 +32,7 @@ calculate_size () { fi if [ "$SIZE" -lt "$MIN" ]; then - $SIZE=$MIN + SIZE=$MIN fi SIZE=`expr $SIZE \+ $EXTRA` -- cgit v1.2.3-54-g00ecf From 71c528ab616a707f4125727c8c5a4e4da5a36c94 Mon Sep 17 00:00:00 2001 From: Patrick Vacek Date: Thu, 29 Mar 2018 13:51:03 +0200 Subject: Assorted minor cleanup and formatting. Includes the suggestion for using /etc/sota/sota.env if it exists as recommended by the discussion here: https://github.com/advancedtelematic/meta-updater/pull/275 --- classes/image_types_ostree.bbclass | 25 +++++++++++++++++++------ recipes-sota/aktualizr/aktualizr_git.bb | 3 ++- recipes-sota/aktualizr/environment.inc | 2 +- recipes-sota/aktualizr/files/aktualizr.service | 1 + recipes-test/images/primary-image.bb | 2 ++ recipes-test/images/secondary-image.bb | 2 ++ 6 files changed, 27 insertions(+), 8 deletions(-) (limited to 'classes') diff --git a/classes/image_types_ostree.bbclass b/classes/image_types_ostree.bbclass index 5ebed81..dc14e4a 100644 --- a/classes/image_types_ostree.bbclass +++ b/classes/image_types_ostree.bbclass @@ -11,7 +11,6 @@ do_image_ostree[depends] += "ostree-native:do_populate_sysroot \ export OSTREE_REPO export OSTREE_BRANCHNAME - export GARAGE_TARGET_NAME RAMDISK_EXT ?= ".ext4.gz" @@ -198,7 +197,9 @@ IMAGE_CMD_garagesign () { fi rm -rf ${GARAGE_SIGN_REPO} - garage-sign init --repo tufrepo --home-dir ${GARAGE_SIGN_REPO} --credentials ${SOTA_PACKED_CREDENTIALS} + garage-sign init --repo tufrepo \ + --home-dir ${GARAGE_SIGN_REPO} \ + --credentials ${SOTA_PACKED_CREDENTIALS} ostree_target_hash=$(cat ${OSTREE_REPO}/refs/heads/${OSTREE_BRANCHNAME}) @@ -206,11 +207,23 @@ IMAGE_CMD_garagesign () { # in which case targets.json should be pulled again and the whole procedure repeated push_success=0 for push_retries in $( seq 3 ); do - garage-sign targets pull --repo tufrepo --home-dir ${GARAGE_SIGN_REPO} - 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} - garage-sign targets sign --repo tufrepo --home-dir ${GARAGE_SIGN_REPO} --key-name=targets + garage-sign targets pull --repo tufrepo \ + --home-dir ${GARAGE_SIGN_REPO} + 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} + garage-sign targets sign --repo tufrepo \ + --home-dir ${GARAGE_SIGN_REPO} \ + --key-name=targets errcode=0 - garage-sign targets push --repo tufrepo --home-dir ${GARAGE_SIGN_REPO} || errcode=$? + garage-sign targets push --repo tufrepo \ + --home-dir ${GARAGE_SIGN_REPO} || errcode=$? if [ "$errcode" -eq "0" ]; then push_success=1 break diff --git a/recipes-sota/aktualizr/aktualizr_git.bb b/recipes-sota/aktualizr/aktualizr_git.bb index 26ccd72..2a803a8 100644 --- a/recipes-sota/aktualizr/aktualizr_git.bb +++ b/recipes-sota/aktualizr/aktualizr_git.bb @@ -22,7 +22,7 @@ SRC_URI = " \ file://aktualizr-secondary.socket \ file://aktualizr-serialcan.service \ " -SRCREV = "178ba9985e23d9c3938d87dd5f2cb39f48f61de6" +SRCREV = "930d8eef6eb584686654601c056d7c9c6fca3048" BRANCH ?= "master" S = "${WORKDIR}/git" @@ -50,6 +50,7 @@ do_install_append () { install -m 0644 ${WORKDIR}/aktualizr-secondary.socket ${D}${systemd_unitdir}/system/aktualizr-secondary.socket install -m 0644 ${WORKDIR}/aktualizr-secondary.service ${D}${systemd_unitdir}/system/aktualizr-secondary.service } + do_install_append_class-target () { install -d ${D}${systemd_unitdir}/system aktualizr_service=${@bb.utils.contains('SOTA_CLIENT_FEATURES', 'serialcan', '${WORKDIR}/aktualizr-serialcan.service', '${WORKDIR}/aktualizr.service', d)} diff --git a/recipes-sota/aktualizr/environment.inc b/recipes-sota/aktualizr/environment.inc index cba77e7..09da6b7 100644 --- a/recipes-sota/aktualizr/environment.inc +++ b/recipes-sota/aktualizr/environment.inc @@ -3,7 +3,7 @@ export SOTA_VIRTUAL_SECONDARIES do_install_append() { if [ -n "${SOTA_LEGACY_SECONDARY_INTERFACE}" ]; then - AKTUALIZR_PARAMETERS_LEGACYSEC="--legacy-interface ${SOTA_LEGACY_SECONDARY_INTERFACE}"; + AKTUALIZR_PARAMETERS_LEGACYSEC="--legacy-interface ${SOTA_LEGACY_SECONDARY_INTERFACE}" fi AKTUALIZR_PARAMETERS_CONFIGFILE="--config /usr/lib/sota/sota.toml" diff --git a/recipes-sota/aktualizr/files/aktualizr.service b/recipes-sota/aktualizr/files/aktualizr.service index b6df9d7..1c2e1df 100644 --- a/recipes-sota/aktualizr/files/aktualizr.service +++ b/recipes-sota/aktualizr/files/aktualizr.service @@ -8,6 +8,7 @@ Requires=network-online.target RestartSec=10 Restart=always EnvironmentFile=/usr/lib/sota/sota.env +EnvironmentFile=-/etc/sota/sota.env ExecStart=/usr/bin/aktualizr $AKTUALIZR_CMDLINE_PARAMETERS [Install] diff --git a/recipes-test/images/primary-image.bb b/recipes-test/images/primary-image.bb index 6c06527..6d2df94 100644 --- a/recipes-test/images/primary-image.bb +++ b/recipes-test/images/primary-image.bb @@ -10,3 +10,5 @@ IMAGE_INSTALL_remove = " \ IMAGE_INSTALL_append = " \ primary-network-config \ " + +# vim:set ts=4 sw=4 sts=4 expandtab: diff --git a/recipes-test/images/secondary-image.bb b/recipes-test/images/secondary-image.bb index 02153d0..9adbdc5 100644 --- a/recipes-test/images/secondary-image.bb +++ b/recipes-test/images/secondary-image.bb @@ -21,3 +21,5 @@ IMAGE_INSTALL_append = " \ aktualizr-secondary \ secondary-network-config \ " + +# vim:set ts=4 sw=4 sts=4 expandtab: -- cgit v1.2.3-54-g00ecf