diff options
author | Anton Gerasimov <tossel@gmail.com> | 2019-02-06 13:13:21 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-02-06 13:13:21 +0100 |
commit | 3cb25f38e89d969c7894478014e221ba43b49890 (patch) | |
tree | 73d80a61f77a11da0e0ded192090c6b2ca3f9209 | |
parent | bf827e6261caa7e78a98e7448daa2afb3e8d4001 (diff) | |
parent | 495f5db09da6a1e5b7a16460d9f4bf26fbee2dff (diff) | |
download | meta-updater-3cb25f38e89d969c7894478014e221ba43b49890.tar.gz |
Merge pull request #474 from advancedtelematic/feat/fit-dtbo
Add support for device tree overlays in FIT images
-rw-r--r-- | README.adoc | 5 | ||||
-rw-r--r-- | classes/sota_raspberrypi.bbclass | 15 | ||||
-rw-r--r-- | recipes-sota/fit-conf/fit-conf.bb | 22 |
3 files changed, 40 insertions, 2 deletions
diff --git a/README.adoc b/README.adoc index ea9bb21..27ecabf 100644 --- a/README.adoc +++ b/README.adoc | |||
@@ -81,6 +81,7 @@ Although we have used U-Boot so far, other boot loaders can be configured work w | |||
81 | * `OSTREE_COMMIT_BODY` - Message attached to OSTree commit. Empty by default. | 81 | * `OSTREE_COMMIT_BODY` - Message attached to OSTree commit. Empty by default. |
82 | * `OSTREE_COMMIT_SUBJECT` - Commit subject used by OSTree. Defaults to `Commit-id: ${IMAGE_NAME}` | 82 | * `OSTREE_COMMIT_SUBJECT` - Commit subject used by OSTree. Defaults to `Commit-id: ${IMAGE_NAME}` |
83 | * `OSTREE_UPDATE_SUMMARY` - Set this to '1' to update summary of OSTree repository on each commit. '0' by default. | 83 | * `OSTREE_UPDATE_SUMMARY` - Set this to '1' to update summary of OSTree repository on each commit. '0' by default. |
84 | * `OSTREE_DEPLOY_DEVICETREE` - Set this to '1' to include devicetree(s) to boot | ||
84 | * `INITRAMFS_IMAGE` - initramfs/initrd image that is used as a proxy while booting into OSTree deployment. Do not change this setting unless you are sure that your initramfs can serve as such a proxy. | 85 | * `INITRAMFS_IMAGE` - initramfs/initrd image that is used as a proxy while booting into OSTree deployment. Do not change this setting unless you are sure that your initramfs can serve as such a proxy. |
85 | * `SOTA_PACKED_CREDENTIALS` - when set, your ostree commit will be pushed to a remote repo as a bitbake step. This should be the path to a zipped credentials file in https://github.com/advancedtelematic/aktualizr/blob/master/docs/credentials.adoc[the format accepted by garage-push]. | 86 | * `SOTA_PACKED_CREDENTIALS` - when set, your ostree commit will be pushed to a remote repo as a bitbake step. This should be the path to a zipped credentials file in https://github.com/advancedtelematic/aktualizr/blob/master/docs/credentials.adoc[the format accepted by garage-push]. |
86 | * `SOTA_DEPLOY_CREDENTIALS` - when set to '1' (default value), deploys credentials to the built image. Override it in `local.conf` to built a generic image that can be provisioned manually after the build. | 87 | * `SOTA_DEPLOY_CREDENTIALS` - when set to '1' (default value), deploys credentials to the built image. Override it in `local.conf` to built a generic image that can be provisioned manually after the build. |
@@ -88,7 +89,9 @@ Although we have used U-Boot so far, other boot loaders can be configured work w | |||
88 | * `SOTA_CLIENT_FEATURES` - extensions to aktualizr. The only valid options are `hsm` (to build with HSM support) and `secondary-network` (to set up a simulated 'in-vehicle' network with support for a primary node with a DHCP server and a secondary node with a DHCP client). | 89 | * `SOTA_CLIENT_FEATURES` - extensions to aktualizr. The only valid options are `hsm` (to build with HSM support) and `secondary-network` (to set up a simulated 'in-vehicle' network with support for a primary node with a DHCP server and a secondary node with a DHCP client). |
89 | * `SOTA_SECONDARY_CONFIG_DIR` - a directory containing JSON configuration files for virtual secondaries on the host. These will be installed into `/etc/sota/ecus` on the device and automatically provided to aktualizr. | 90 | * `SOTA_SECONDARY_CONFIG_DIR` - a directory containing JSON configuration files for virtual secondaries on the host. These will be installed into `/etc/sota/ecus` on the device and automatically provided to aktualizr. |
90 | * `SOTA_HARDWARE_ID` - a custom hardware ID that will be written to the aktualizr config. Defaults to MACHINE if not set. | 91 | * `SOTA_HARDWARE_ID` - a custom hardware ID that will be written to the aktualizr config. Defaults to MACHINE if not set. |
91 | * `OSTREE_DEPLOY_DEVICETREE` - Set this to '1' to include devicetree(s) to boot | 92 | * `SOTA_MAIN_DTB` - base device tree to use with the kernel. Used together with FIT images. You can change it, and the device tree will also be changed after the update. |
93 | * `SOTA_DT_OVERLAYS` - whitespace-separated list of used device tree overlays for FIT image. This list is OSTree-updateable as well. | ||
94 | * `SOTA_EXTRA_CONF_FRAGS` - extra https://lxr.missinglinkelectronics.com/uboot/doc/uImage.FIT/overlay-fdt-boot.txt[configuration fragments] for FIT image. | ||
92 | 95 | ||
93 | == Usage | 96 | == Usage |
94 | 97 | ||
diff --git a/classes/sota_raspberrypi.bbclass b/classes/sota_raspberrypi.bbclass index 600f9e9..e1c0054 100644 --- a/classes/sota_raspberrypi.bbclass +++ b/classes/sota_raspberrypi.bbclass | |||
@@ -5,6 +5,13 @@ KERNEL_IMAGETYPE_sota = "fitImage" | |||
5 | INITRAMFS_FSTYPES = "cpio.gz" | 5 | INITRAMFS_FSTYPES = "cpio.gz" |
6 | OSTREE_KERNEL = "${KERNEL_IMAGETYPE}-${INITRAMFS_IMAGE}-${MACHINE}-${KERNEL_FIT_LINK_NAME}" | 6 | OSTREE_KERNEL = "${KERNEL_IMAGETYPE}-${INITRAMFS_IMAGE}-${MACHINE}-${KERNEL_FIT_LINK_NAME}" |
7 | 7 | ||
8 | # DTB needs to be relocated to apply overlays | ||
9 | UBOOT_DTB_LOADADDRESS = "0x05000000" | ||
10 | UBOOT_DTBO_LOADADDRESS = "0x06000000" | ||
11 | |||
12 | # Deploy config fragment list to OSTree root fs | ||
13 | IMAGE_INSTALL_append = " fit-conf" | ||
14 | |||
8 | PREFERRED_PROVIDER_virtual/bootloader_sota ?= "u-boot" | 15 | PREFERRED_PROVIDER_virtual/bootloader_sota ?= "u-boot" |
9 | UBOOT_ENTRYPOINT_sota ?= "0x00008000" | 16 | UBOOT_ENTRYPOINT_sota ?= "0x00008000" |
10 | 17 | ||
@@ -18,7 +25,13 @@ IMAGE_BOOT_FILES_sota = "bcm2835-bootfiles/* u-boot.bin;${SDIMG_KERNELIMAGE}" | |||
18 | KERNEL_DEVICETREE_raspberrypi2_sota ?= " bcm2709-rpi-2-b.dtb " | 25 | KERNEL_DEVICETREE_raspberrypi2_sota ?= " bcm2709-rpi-2-b.dtb " |
19 | KERNEL_DEVICETREE_raspberrypi3_sota ?= " bcm2710-rpi-3-b.dtb overlays/vc4-kms-v3d.dtbo overlays/rpi-ft5406.dtbo" | 26 | KERNEL_DEVICETREE_raspberrypi3_sota ?= " bcm2710-rpi-3-b.dtb overlays/vc4-kms-v3d.dtbo overlays/rpi-ft5406.dtbo" |
20 | 27 | ||
28 | SOTA_MAIN_DTB_raspberrypi2 ?= "bcm2709-rpi-2-b.dtb" | ||
29 | SOTA_MAIN_DTB_raspberrypi3 ?= "bcm2710-rpi-3-b.dtb" | ||
30 | |||
31 | SOTA_DT_OVERLAYS_raspberrypi3 ?= "vc4-kms-v3d.dtbo rpi-ft5406.dtbo" | ||
32 | |||
21 | # Kernel args normally provided by RPi's internal bootloader. Non-updateable | 33 | # Kernel args normally provided by RPi's internal bootloader. Non-updateable |
22 | 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 " | 34 | OSTREE_KERNEL_ARGS_sota ?= " 8250.nr_uarts=1 bcm2708_fb.fbwidth=656 bcm2708_fb.fbheight=614 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 " |
23 | 35 | ||
24 | SOTA_CLIENT_FEATURES_append = " ubootenv" | 36 | SOTA_CLIENT_FEATURES_append = " ubootenv" |
37 | |||
diff --git a/recipes-sota/fit-conf/fit-conf.bb b/recipes-sota/fit-conf/fit-conf.bb new file mode 100644 index 0000000..c6cecec --- /dev/null +++ b/recipes-sota/fit-conf/fit-conf.bb | |||
@@ -0,0 +1,22 @@ | |||
1 | SUMMARY = "FIT image configuration for u-boot to use" | ||
2 | LICENSE = "MIT" | ||
3 | LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" | ||
4 | |||
5 | do_install() { | ||
6 | mkdir -p ${D}${libdir} | ||
7 | echo -n "fit_conf=" >${D}${libdir}/fit_conf | ||
8 | |||
9 | if [ -n ${SOTA_MAIN_DTB} ]; then | ||
10 | echo -n "#conf@${SOTA_MAIN_DTB}" >> ${D}${libdir}/fit_conf | ||
11 | fi | ||
12 | |||
13 | for ovrl in ${SOTA_DT_OVERLAYS}; do | ||
14 | echo -n "#conf@overlays_${ovrl}" >> ${D}${libdir}/fit_conf | ||
15 | done | ||
16 | |||
17 | for conf_frag in ${SOTA_EXTRA_CONF_FRAGS}; do | ||
18 | echo -n "#${conf_frag}" >> ${D}${libdir}/fit_conf | ||
19 | done | ||
20 | } | ||
21 | |||
22 | FILES_${PN} += "${libdir}/fit_conf" | ||