-
Notifications
You must be signed in to change notification settings - Fork 39
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
tegra: support creating wic images along with tegraflash #1083
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.
LGTM, maybe one day we could switch from the resize-helper
script to systemd-repart that can automatically grow and add partitions
Only when it supports MBR and after we support systemd in the initrd. |
When ID_PART_ENTRY_NAME is available it was returning the full string and not going over cut, due the || true assignment. Signed-off-by: Ricardo Salveti <[email protected]>
Avoid manipulating the partition table to try to extend the size of rootfs when it is not the last partition from the block device. When rootfs is not the last we can assume that the partition table is correct and just try to resize the file system instead. Signed-off-by: Ricardo Salveti <[email protected]>
Resize-helper is now able to handle devices with known and fixed partition table, and when the rootfs is not the last partition used by the system. Signed-off-by: Ricardo Salveti <[email protected]>
So it can be consumed when generating wic images. Signed-off-by: Ricardo Salveti <[email protected]>
Used by tegra targets, without any special config, just the standard boot efi loader. Signed-off-by: Ricardo Salveti <[email protected]>
Wic image can be used when flashing an external storage device, instead of using tegraflasher. Signed-off-by: Ricardo Salveti <[email protected]>
Set IMAGE_ROOTFS_SIZE to the default size (65536) otherwise the tegra layer will replace the variable with the size available in the emmc device, which can be quite large. We don't need the fs to be the exact partition size as we now have resize-helper which can extend the fs dynamically up to the limit of the partition on first run. Signed-off-by: Ricardo Salveti <[email protected]>
Besides setting up the fs label, also set the partition name to otaroot, a a way to help bootloaders identifying the partition used by the ota-based rootfs. Signed-off-by: Ricardo Salveti <[email protected]>
Prefer using label for the rootfs instead of the fixed mmc partition number in order to allow using the rootfs on external devices (e.g. usb, sata, etc). Signed-off-by: Ricardo Salveti <[email protected]>
Support looking for otaroot named partitions when booting via l4tlauncher and also disable a/b rootfs support as that is not used in LmP and causes the device to jump into recovery when not needed. Signed-off-by: Ricardo Salveti <[email protected]>
Allow integrating and flashing an external wic image for the rootfs. Signed-off-by: Ricardo Salveti <[email protected]>
Useful when flashing the rootfs on an external device and avoiding conflicts with the previous rootfs flashed in the emmc rootfs partition. Signed-off-by: Ricardo Salveti <[email protected]>
Import initrd-flash.sh script from meta-tegra rev e132ae1186fd. Additional customizations to follow in separated commits. Signed-off-by: Ricardo Salveti <[email protected]>
Update initrd-flash.sh script to add support for formatting emmc partitions and flash wic images on external devices via bmaptool. User can enable external wic flashing support via: - TEGRAFLASH_ROOTFS_EXTERNAL=1 - TEGRA_EXTERNAL_ROOTFS_WIC=1 - ROOTFS_DEVICE_FOR_INITRD_FLASH=<device>, like nvme0n1 Signed-off-by: Ricardo Salveti <[email protected]>
Tested by adding the following to conf/local.conf (or conf/machine/include/lmp-factory-custom.inc on a factory):
Flashing:
If you want to use a different wic (e.g. from a different job run), just download and replace the local lmp-factory-image.wic.gz file. |
@MrCry0 @quaresmajose mind having another look? added the initrd related patches, thanks! |
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.
LGTM. The tegra-flash-init
and the tegra-helper-scripts
look appropriate to submit to meta-tegra, should I do that?
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.
Still LGTM
@quaresmajose sure, it would be good to check what is nvidia bsp / jetpack and what is meta-tegra specific there, and propose the changes, as it should indeed be generic. Please have a look and let me know if you need a hand in there. |
Ok, I will do that. |
So it can be consumed when generating wic images. foundriesio/meta-lmp#1083 Signed-off-by: Ricardo Salveti <[email protected]> Signed-off-by: Jose Quaresma <[email protected]>
Useful when flashing the rootfs on an external device and avoiding conflicts with the previous rootfs flashed in the emmc rootfs partition. foundriesio/meta-lmp#1083 Signed-off-by: Ricardo Salveti <[email protected]> Signed-off-by: Jose Quaresma <[email protected]>
Update initrd-flash.sh script to add support for formatting emmc partitions and flash wic images on external devices via bmaptool. User can enable external wic flashing support via: - TEGRAFLASH_ROOTFS_EXTERNAL=1 - TEGRA_EXTERNAL_ROOTFS_WIC=1 - ROOTFS_DEVICE_FOR_INITRD_FLASH=<device>, like nvme0n1 foundriesio/meta-lmp#1083 Signed-off-by: Ricardo Salveti <[email protected]> Signed-off-by: Jose Quaresma <[email protected]>
Allow integrating and flashing an external wic image for the rootfs. foundriesio/meta-lmp#1083 Signed-off-by: Ricardo Salveti <[email protected]> Signed-off-by: Jose Quaresma <[email protected]>
So it can be consumed when generating wic images. foundriesio/meta-lmp#1083 Signed-off-by: Ricardo Salveti <[email protected]> Signed-off-by: Jose Quaresma <[email protected]>
Update initrd-flash.sh script to add support for formatting emmc partitions and flash wic images on external devices via bmaptool. User can enable external wic flashing support via: - TEGRAFLASH_ROOTFS_EXTERNAL=1 - TEGRA_EXTERNAL_ROOTFS_WIC=1 - ROOTFS_DEVICE_FOR_INITRD_FLASH=<device>, like nvme0n1 foundriesio/meta-lmp#1083 Signed-off-by: Ricardo Salveti <[email protected]> Signed-off-by: Jose Quaresma <[email protected]>
Allow integrating and flashing an external wic image for the rootfs. foundriesio/meta-lmp#1083 Signed-off-by: Ricardo Salveti <[email protected]> Signed-off-by: Jose Quaresma <[email protected]>
No description provided.