This dynamic layer provides an example implementation for Nvidia Jetson and swupdate.
The simplest way to use on tegra is to add to a forked copy of tegra-demo-distro which also contains relevant images and submodules used to build tegra images. However, this is not strictly required. The only dependency required is the meta-tegra layer.
The files under conf/kas support building with the kas.
The setups here represent the last configuration tested.
pip3 install kas
Start by cloning this repo with
git clone <url> --shallow-submodules
Then use the scripts at scripts to kick of the build for instance
./scripts/build-jetson-orin-nano-devkit-nvme.sh
to build for the jetson-orin-nano-devkit-nvme MACHINE on the
default branch configuration.
The default build will build for whatever branch of this repository you've cloned and latest branch of corresponding repositories.
To build the latest tested configuration instead, use kas build to specify the swupdate-oe4t-lasttested.yml file from the base directory, for instance:
kas build layers/meta-tegrademo/dynamic-layers/meta-swupdate/conf/kas/swupdate-oe4t-lasttested.yml
You may need to modify the machine setting or set KAS_MACHINE appropriately.
Use these instructions to add to tegra-demo-distro on whatever branch you'd like to target (kirkstone and later are supported).
cd repos
git submodule add https://github.com/sbabic/meta-swupdate
cd ../layers
ln -s ../repos/meta-swupdate
Then use the setup-env script to start a bitbake shell, and add
this layer to your build
bitbake-layers add-layer ../layers/meta-swupdate
Finally, build the update image using:
bitbake demo-image-<type>-swupdate
where <type> is one of base, sato, weston, or full.
You can use the tegraflash package generated by the image recipe
to do initial flashing, then use the .swu update file to test
the update.
- Flash the initial image using the
tegraflashpackage. - Deploy the
.swufile built with swupdate-image-tegra to the target. - Check the current update state with
nvbootctrl dump-slots-info. - Install the update with:
swupdate-client </path/to/swu/file>
- Reboot to apply the update, if installation was successful. On reboot,
the UEFI bootloader should find and apply the capsule update stored in
the ESP by
swupdate. It should then reboot a second time into the updated firmware in the other slot. - When the system comes back up, use
nvbootctrl dump-slots-infoto check that the capsule update status is1and that the boot slot changed. You can also verify that the root filesystem is mounted on the partition corresponding to the current boot slot.
The conf/distro/include/tegra-swupdate.inc file, under this
directory, contains global configuration options for the swupdate demo.
It will be included automatically by the tegrademo distro
configuration if the meta-swupdate layer is in your BitBake
layer configuration.