Add a board class for new target board in meta-updater
Adding a board class for a new target board in meta-updater involves two main steps:
-
Add a new
sota_{MACHINE}.bbclass
file for the boardUsing an NXP board as an example, we created the bbclass
classes/sota_ls1043ardb.bbclass
and added the following to the class file:KERNEL_IMAGETYPES = "fitImage" (1) OSTREE_KERNEL = "fitImage-${INITRAMFS_IMAGE}-${MACHINE}-${MACHINE}" OSTREE_KERNEL_ARGS = "console=ttyS0,115200 ramdisk_size=8192 root=/dev/ram0 rw rootfstype=ext4 ostree_root=/dev/mmcblk0p2" WKS_FILE_sota = "ls1043ardb-ota.wks" (2) IMAGE_BOOT_FILES = "ls1043ardb_boot.scr" (3)
1 For most boards, especially boards that use a device tree, we recommend you use a FIT (flattened image tree) image if possible. A FIT image includes all the components of an initial boot image—like the device tree, initramfs, and kernel—in a bundle. 2 Wic kickstart files tell Wic how to build and lay out an image that can be physically flashed onto the device initially. We generally need to modify the image layout for OTA; we’ll discuss how to write one in the following section. 3 This line adds the basic boot script to the files available to bitbake when constructing the physical image types. See Create U-Boot script for OSTree initialization for the script itself. -
Add that class to the top-level
sota.bbclass
file.Add a line to the file
classes/sota.bbclass
that points to the new class file as in the example below:SOTA_MACHINE_ls1043ardb ?= "ls1043ardb"
Examples of these class files can be found in the meta-updater-layer.
Once you have added a board class for your board in the meta-updater layer, you can set up a boot image layout for OSTree compatibility.