Skip to content

Tegra Capsule Update#1552

Merged
ricardosalveti merged 14 commits intomainfrom
tegra-capsule-updates-backport
Feb 10, 2025
Merged

Tegra Capsule Update#1552
ricardosalveti merged 14 commits intomainfrom
tegra-capsule-updates-backport

Conversation

@igoropaniuk
Copy link
Copy Markdown
Contributor

@igoropaniuk igoropaniuk commented Dec 30, 2024

This PR integrates Capsule Update support into LmP/aktualizr-lite for Tegra

Copy link
Copy Markdown
Member

@quaresmajose quaresmajose left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@quaresmajose
Copy link
Copy Markdown
Member

Maybe it will be better to wait abit for the merge of the foundriesio/lmp-manifest#474

@igoropaniuk
Copy link
Copy Markdown
Contributor Author

@quaresmajose that was my initial plan😊 to merge it after we switch to scrarthgap completely in main( oth meta-lmp and lamp-manifest)

@igoropaniuk igoropaniuk force-pushed the tegra-capsule-updates-backport branch from d799542 to c73cf92 Compare February 2, 2025 10:29
@igoropaniuk
Copy link
Copy Markdown
Contributor Author

@quaresmajose I've rebased on the latest main

Copy link
Copy Markdown
Member

@quaresmajose quaresmajose left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Copy Markdown
Contributor

@angolini angolini left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I cannot comment on capsule update behavior, so I only added few comments related with yocto aesthetics

Comment thread meta-lmp-base/recipes-sota/fioefi/fioefi/fioefi.sh.in
Comment thread meta-lmp-base/recipes-samples/images/lmp-image-common.inc
Comment thread meta-lmp-bsp/recipes-sota/fioefi/fioefi_%.bbappend
LICENSE = "MPL-2.0"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MPL-2.0;md5=815ca599c9df247a0c7f619bab123dad"

inherit allarch
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is it allarch?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's just a copy of the existing recipe for ubootenv meta-lmp-base/recipes-sota/aktualizr/aktualizr-fiovb-env-rollback.bb with the minimal changes

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a config snippet.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let me know if you want me to drop it

Comment thread meta-lmp-base/recipes-sota/aktualizr/aktualizr-fioefi-env-rollback.bb Outdated
Comment thread meta-lmp-bsp/recipes-sota/fioefi/fioefi_%.bbappend
Comment thread meta-lmp-base/recipes-sota/fioefi/fioefi_0.1.bb Outdated
Comment thread meta-lmp-bsp/recipes-sota/fioefi/fioefi_%.bbappend
Comment thread meta-lmp-bsp/recipes-sota/fioefi/fioefi/tegra/fioefi-soc.sh.in
Comment thread meta-lmp-base/recipes-core/systemd/systemd_%.bbappend Outdated
@ricardosalveti
Copy link
Copy Markdown
Member

+1 to remove the cherry-pick lines, this is 'main'.

Introduce recipe, that assembles a "fioefi" script which wraps
UEFI Capsule update commands. Scripts provides the same usage API
as fiovb/ubootenv apps:

$ fioefi_setenv bootupgrade_available 1
$ fioefi_printenv rollback

Signed-off-by: Igor Opaniuk <[email protected]>
Add tegra-specific fioefi script includes. Testing fioefi script:

$ export FIO_OSTREE_TARGET_SYSROOT=/
$ fioefi_setenv bootupgrade_available 1
$ reboot
....
Update Progress - 100% **************************************************
Shutdown state requested 1
Rebooting system ...

When ak-lite is used, it automatically sets a path to the target sysroot via
FIO_OSTREE_TARGET_SYSROOT variable.

Boot firmware version is obtained from the ESRT table [1].

[1] https://uefi.org/specs/UEFI/2.9_A/23_Firmware_Update_and_Reporting.html
Signed-off-by: Igor Opaniuk <[email protected]>
Enable fioefi MACHINE_FEATURE for tegra by default.

Signed-off-by: Igor Opaniuk <[email protected]>
Install fioefi package if fioefi machine feature is enabled.

Signed-off-by: Igor Opaniuk <[email protected]>
Introduce support for fioefi rollback mode in aktualizr.

Signed-off-by: Igor Opaniuk <[email protected]>
Add tegra-bl.cap UEFI capsule to LMP_BOOT_FIRMWARE_FILES.

Signed-off-by: Igor Opaniuk <[email protected]>
Add dependency on tegra-uefi-capsules for lmp-boot-firmware on tegra
machines.

Signed-off-by: Igor Opaniuk <[email protected]>
Do not install UEFI capsules to rootfs, lmp-boot-firmware should handle
that instead.

Signed-off-by: Igor Opaniuk <[email protected]>
Enable systemd-boot support by default for Tegra machines.
Boot test:

Jetson UEFI firmware (version v35.5.0 built on 2024-02-26T13:44:31+00:00)
ESC   to enter Setup.
F11   to enter Boot Manager Menu.
Enter to continue boot.
**  WARNING: Test Key is used.  **
......EFI stub: Booting Linux Kernel...
EFI stub: Using DTB from configuration table
EFI stub: Loaded initrd from LINUX_EFI_INITRD_MEDIA_GUID device path
EFI stub: Exiting boot services and installing virtual address map...
I/TC: Secondary CPU 1 initializing

.....
Linux-microPlatform 4.0.20 jetson-agx-xavier-devkit ttyTCU0

jetson-agx-xavier-devkit login:

Signed-off-by: Igor Opaniuk <[email protected]>
Use L4T_VERSION variable, and convert it to the same format as it's
currenlty exposed via ESRT table:

$ cat /sys/firmware/efi/esrt/entries/entry0/fw_version
2295296

Signed-off-by: Igor Opaniuk <[email protected]>
Don't install systemd-bless-boot.service, as ak-lite invokes
bless-boot tool manually fio SOTA targets with fioefi support.

Signed-off-by: Igor Opaniuk <[email protected]>
Fix ESP partition defined path.

Signed-off-by: Igor Opaniuk <[email protected]>
Disable nv_update_verifier service, as it's invoked manually by
ak-lite for SOTA targets with fioefi support.

Signed-off-by: Igor Opaniuk <[email protected]>
Add support for deploying systemd-boot to ESP partition.
Considering that default deployment has always index == 0, the filenames
in ESP for efi binaries are generated in this way:
deployment index       path
0:                     /boot/EFI/BOOT/bootx64.efi
1:                     /boot/EFI/BOOT/bootx64-1.efi
2:                     /boot/EFI/BOOT/bootx64-2.efi

Signed-off-by: Igor Opaniuk <[email protected]>
@igoropaniuk igoropaniuk force-pushed the tegra-capsule-updates-backport branch from c73cf92 to acb12f5 Compare February 6, 2025 17:56
@igoropaniuk
Copy link
Copy Markdown
Contributor Author

Good to merge?

@angolini
Copy link
Copy Markdown
Contributor

Before merging, please drop "backport" from the title and add a elaborated description to the PR

@igoropaniuk igoropaniuk changed the title Backport Tegra Capsule Update Tegra Capsule Update Feb 10, 2025
Copy link
Copy Markdown
Member

@ricardosalveti ricardosalveti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ricardosalveti ricardosalveti merged commit b1a8fc0 into main Feb 10, 2025
@quaresmajose quaresmajose deleted the tegra-capsule-updates-backport branch February 12, 2025 12:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants