-
Notifications
You must be signed in to change notification settings - Fork 229
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable rootfs ab redundancy support #1428
Enable rootfs ab redundancy support #1428
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @dwalkes , overall this looks good. See in-line for some specific questions and changes.
@@ -20,6 +20,8 @@ NVDISPLAY_INIT ?= "${NVDISPLAY_INIT_DEFAULT}" | |||
NVDISPLAY_INIT_DEPS = "" | |||
NVDISPLAY_INIT_DEPS:tegra194 = "nvdisp-init:do_deploy" | |||
|
|||
SRC_URI += "${@'file://L4TConfiguration-RootfsRedundancyLevelABEnable.dtso' if d.getVar('USE_REDUNDANT_FLASH_LAYOUT') else ''}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The suffix for the DTS fragment should be .dtsi
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Fixed.
NVIDIA provides redundant flash layouts with A/B support for most platforms. This commit adds a parameter USE_REDUNDANT_FLASH_LAYOUT which uses them instead of the default non-redundant. * Add a variable USE_REDUNDANT_FLASH_LAYOUT to control whether to use the default flash layout or the redundant flash layout for both internal and external layouts. The weak override var USE_REDUNDANT_FLASH_LAYOUT_DEFAULT can be set at the distro layer to override the default (off) state if desired. * Build a PARTITION_LAYOUT_TEMPLATE_REDUNDANT variable which appends the rootfs_ab string to the partition layout file for all cases other than when PARTITION_LAYOUT_TEMPLATE_DEFAULT_SUPPORTS_REDUNDANT is set, where PARTITION_LAYOUT_TEMPLATE_DEFAULT_SUPPORTS_REDUNDANT is set for nano platforms using flash_t234_qspi.xml which already contains redundant partitions. * Build a PARTITION_LAYOUT_EXTERNAL_REDUNDANT variable which appends the rootfs_ab string to the PARTITION_LAYOUT_EXTERNAL file for all platforms with the exception of orin nano platforms which use "flash_l4t_external.xml" by default. * Add a ROOTFSPART_SIZE_DEFAULT var which sets the default rootfs partition size for the MACHINE when not using dual redundancy. * Add a ROOTFSPART_SIZE_REDUNDANT var which divides the ROOTFSPART_SIZE_DEFAULT by two when USE_REDUNDANT_FLASH_LAYOUT is specified. After this commit: * Custom MACHINE types which need to support multiple flash layouts for redundancy can name their layouts to match the NVIDIA syntax, ending with _rootfs_ab, define PARTITION_LAYOUT_EXTERNAL_DEFAULT as well as PARTITION_LAYOUT_TEMPLATE_DEAFULT and the USE_REDUNDANT_FLASH_LAYOUT will function as expected for these platforms as well to select the appropriate xml files. * Custom MACHINEs which don't need to support multiple flash layouts can just define PARTITION_LAYOUT_EXTERNAL and/or PARTITION_LAYOUT_TEMPLATE as done previously to override the default assignments for these variables in tegra-common.inc * Custom MACHINEs which need to specify a custom partition size can either specify ROOTFSPART_SIZE_DEFAULT to let the size be set based on USE_REDUNDANT_FLASH_LAYOUT, or set ROOTFSPART_SIZE to force to a specific size regardless of USE_REDUNDANT_FLASH_LAYOUT See also https://github.com/OE4T/meta-tegra/wiki/Rendundant-Rootfs-A-B-Partition-Support Signed-off-by: Dan Walkes <[email protected]>
When USE_REDUNDANT_FLASH_LAYOUT is specified, add the .dtbo file to the build which enables RootfsA/B suport in UEFI based on discussion at [1]. This content of the variable is set based on the corresponding logic found in nvidia's flash.sh. The usage for this variable can be found at [2]. 1: OE4T#1182 (comment) 2: https://github.com/NVIDIA/edk2-nvidia/blob/71fc2f6de48f3e9f01214b4e9464dd03620b876b/Silicon/NVIDIA/Application/L4TLauncher/L4TRootfsValidation.c#L464-L466 Signed-off-by: Dan Walkes <[email protected]>
41aabd4
to
5c5f37f
Compare
* Update meta-tegra repo to latest supporting [1]. * Set distro configuration to default to A/B redundant rootfs. 1: OE4T/meta-tegra#1428 Signed-off-by: Dan Walkes <[email protected]>
I believe I've addressed all the comments here. I've also re-tested on Tomorrow I'll try with |
* Update meta-tegra repo to latest supporting [1]. * Set distro configuration to default to A/B redundant rootfs. 1: OE4T/meta-tegra#1428 Signed-off-by: Dan Walkes <[email protected]>
Tested with jetson-xavier-nx-devkit-emmc
Tested with jetson-orin-nano-devkit
Tested with jetson-orin-nano-devkit-nvme
In each of the redundant cases I ran capsule update and verified the slots changed accordingly. I think this is ready to merge but let me know if you'd like me to try something else. I'd like to backport this to kirkstone next as well, let me know if you'd like a PR for this. |
Thanks @dwalkes ! Once we've got a passing build on master (with your PR merged there), I'll cherry-pick these to the other branches. |
* Update meta-tegra repo to latest supporting [1]. * Set distro configuration to default to A/B redundant rootfs. 1: OE4T/meta-tegra#1428 Signed-off-by: Dan Walkes <[email protected]>
* Update meta-tegra repo to latest supporting [1]. * Set distro configuration to default to A/B redundant rootfs. 1: OE4T/meta-tegra#1428 Signed-off-by: Dan Walkes <[email protected]>
I've backported these changes to nanbield, mickledore, and kirkstone branches. |
@dwalkes @madisongh with my orin nano on kirkstone with the tegra-demo-distro I don't see the redundant flash layout as being 1
I have these in my local.conf FWIW
|
@arrow53 I think OE4T/tegra-demo-distro#284 was never backported to kirkstone. @madisongh would you prefer not to change tegra-demo-distro branches to avoid swapping partition layouts on stable branches? I should probably just clarify wording in https://github.com/OE4T/meta-tegra/wiki/Redundant-Rootfs-A-B-Partition-Support#setting-up-a-custom-machine in that case. |
@dwalkes Yes, that's right - OE4T/tegra-demo-distro#284 would have been a big surprise to folks already using kirkstone if it had been backported. |
Add BSP support for enabling A/B redundancy and managing redundant and non-redundant A/B partition layouts, using the Nvidia provided BSP layouts.
See details in the wiki page at https://github.com/OE4T/meta-tegra/wiki/Redundant-Rootfs-A-B-Partition-Support
When combined with #1285 , this logic provides a base for supporting A/B slot switching using uefi variables and capsule updates which is independent of a specific update tool used to write parititions.
Control for supporting A/B rootfs partition layout is supported through
USE_REDUNDANT_FLASH_LAYOUT
which is set to 0 by default in the BSP layer, but set to 1 in tegra-demo-distro.Custom MACHINEs which already define their own
ROOTFSPART_SIZE
,PARTITION_LAYOUT_TEMPLATE
, andROOTFSPART_SIZE
shouldn't be impacted by this change, although anyone who has done their own overlay implementation for Rootfs A/B may want to remove it in favor of this implementation.I've initially tested this on
jetson-xavier-nx-devkit-emmc
anddemo-image-base
with this sequence:In local.conf:
After building/booting, I see slots enabled and slot A selected
After performing capsule update:
and rebooting, I see:
And rootfs changed to partition 2:
If/when this looks ready to merge I'll test on a few other platforms and try some non-redundant configs.
Closes #1389