# Updating initrd and bootloader without flashing

**URL:** <https://forums.developer.nvidia.com/t/updating-initrd-and-bootloader-without-flashing/269367>\
**Category:** Jetson Xavier NX\
**Tags:** reflash\
**Created:** [October 13, 2023, 3:33pm UTC](https://forums.developer.nvidia.com/t/updating-initrd-and-bootloader-without-flashing/269367 "2023-10-13T15:33:44Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![KavehA](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@KavehA](https://forums.developer.nvidia.com/u/KavehA)\
**Post date:** [October 13, 2023, 3:33pm UTC](https://forums.developer.nvidia.com/t/updating-initrd-and-bootloader-without-flashing/269367/1 "2023-10-13T15:33:44Z")

</div>

When we flash the device with initrd option ( flash.sh -I myinitrd -v myk2 -u myk1 jetson-xavier-nx-devkit-emmc mmcblk0p1), the initrd is written to the /boot/initrd directory. However when we delete this file (/boot/initrd) and the reboot the device, the initrd is still executed. This tell us initrd is also stored somewhere else. Is that on the QSPI chip? How can we update the stored initrd without flashing?  
In this case extlinux.conf has: INITRD /boot/initrd

---

<div class="post-metadata">

**Author:** ![linuxdev](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/linuxdev/32/10243_2.png) [@linuxdev](https://forums.developer.nvidia.com/u/linuxdev)\
**Post date:** [October 14, 2023, 9:42pm UTC](https://forums.developer.nvidia.com/t/updating-initrd-and-bootloader-without-flashing/269367/2 "2023-10-14T21:42:40Z")

</div>

I can’t give you an exact answer. However, most boot content is indeed available in the QSPI of an SD card model (or in a partition of an eMMC model). The priority is to first use the resource named in the `extlinux.conf` file, and if that is not there, then to fall back to the QSPI (or for eMMC models, a signed partition). By removing a file from `extlinux.conf` the search for that item falls back to the next priority: QSPI.

All modification to QSPI is done via flash in recovery mode. I don’t know the specifics of where this would be. However, consider that you might test this: Instead of deleting that file in “`/boot`”, name an alternate file which has no content. Example to create an empty file: “`sudo touch /boot/initrd-empty`”, and then name “`/boot/initrd-empty`” (you could even leave the old initrd in place, or simply rename it). Beware though that there is a good chance this Jetson will no longer boot, and if you don’t have a valid boot entry (e.g., by making a new entry with the empty initrd instead of replacing the existing entry), then you could end up flashing again for eMMC models (for an SD card model you’d just have to put the SD card on a Linux host PC and reedit).

---

<div class="post-metadata">

**Author:** ![KavehA](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@KavehA](https://forums.developer.nvidia.com/u/KavehA)\
**Post date:** [October 16, 2023, 1:55pm UTC](https://forums.developer.nvidia.com/t/updating-initrd-and-bootloader-without-flashing/269367/3 "2023-10-16T13:55:16Z")

</div>

As usuall great info, thank you linuxdev, can we dump the content of QSPI ( /dev/mtd0 ?) from one device that has been flashed (and has the most recent content), create an image, and then write it to another device using dd or flashcp? We would like to know how to update our production devices without flashing. This will allow us to upgrade bootloader and everything else with it as well. Is this possible?

---

<div class="post-metadata">

**Author:** ![KavehA](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@KavehA](https://forums.developer.nvidia.com/u/KavehA)\
**Post date:** [October 16, 2023, 6:05pm UTC](https://forums.developer.nvidia.com/t/updating-initrd-and-bootloader-without-flashing/269367/4 "2023-10-16T18:05:49Z")

</div>

The other option would be to generate the QSPI image with: ./tools/l4t\_generate\_jetson\_xavier\_nx\_qspi\_images.sh  
do you know if this method will include the initrd also?

---

<div class="post-metadata">

**Author:** ![linuxdev](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/linuxdev/32/10243_2.png) [@linuxdev](https://forums.developer.nvidia.com/u/linuxdev)\
**Post date:** [October 16, 2023, 6:10pm UTC](https://forums.developer.nvidia.com/t/updating-initrd-and-bootloader-without-flashing/269367/5 "2023-10-16T18:10:08Z")

</div>

I do not know how to dump the QSPI, but that is something I’d also like to know. Maybe someone from NVIDIA can comment on dumping QSPI? Since QSPI would be in binary format, and not an ext4 partition, it might not be completely useful, although an `initrd` partition _could_ be useful since (after removing any signature) it would become a cpio archive (which _can_ be expanded and examined just like a filesystem).

Keep in mind that all partitions other than the rootfs/APP are signed. If you `dd` copy, then the signature is also copied. During a flash, the signature is added to the unsigned content. I do not know for certain, but I suspect that the signed content of one Jetson may not work with a second Jetson _even if the NULL key is used in both_, since there is probably some sort of seed data that the NULL key is used against.

During a normal flash the binary content to non-rootfs is signed, the content flashed, and then the signed version deleted from the host PC. The “`--no-flash`” option (to various `flash.sh` commands) will result in the signed content _not_ being deleted on the host PC. If you were to use `dd` to replace content in non-rootfs partitions (and I don’t know if you _can_ do this on QSPI content…for sure you can on eMMC content), then you have to use this method to sign the unsigned binary first, and `dd` the signed version (you’d add the non-signed version to replace the stock version of that content, run with `--no-flash`, and then `dd` to the right place).

Can anyone from NVIDIA suggest if or how the QSPI partitions can be dumped? It might be a security thing that these cannot be dumped, e.g., via `dd`, or it might just be possible. I do not know.

Almost forgot: I have not used `./tools/l4t_generate_jetson_xavier_nx_qspi_images.sh`, but it is a human-readable script, so you’d have to just go through it line by line, or even modify it to log each line that doesn’t have useful debug output. Due to security, I expect flashing that content to differ from reading it.

---

<div class="post-metadata">

**Author:** ![KavehA](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@KavehA](https://forums.developer.nvidia.com/u/KavehA)\
**Post date:** [October 16, 2023, 7:24pm UTC](https://forums.developer.nvidia.com/t/updating-initrd-and-bootloader-without-flashing/269367/6 "2023-10-16T19:24:30Z")

</div>

Thank you linuxdev, you are probably correct that the content of QSPI is signed. I noticed that the l4t\_generate\_jetson\_xavier\_nx\_qspi\_images.sh script takes -u -v (for keys) as option. However I am not sure if those keys are different between Jetsons. If the keys don’t change across Jetson instances then the dump and write may work. Hopefully someone Nvidia can help here.

---

<div class="post-metadata">

**Author:** ![JerryChang](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/jerrychang/32/14043_2.png) [@JerryChang](https://forums.developer.nvidia.com/u/JerryChang)\
**Post date:** [October 26, 2023, 2:20am UTC](https://forums.developer.nvidia.com/t/updating-initrd-and-bootloader-without-flashing/269367/8 "2023-10-26T02:20:16Z")

</div>

hello KavehA,

you may prepare the OTA payload to update bootloader remotely.  
(1) You should also visit L4T page, [https://developer.nvidia.com/embedded/jetson-linux-r3541](https://developer.nvidia.com/embedded/jetson-linux-r3541) to download [[OTA Tools](https://developer.nvidia.com/downloads/embedded/l4t/r35_release_v4.1/release/ota_tools_r35.4.1_aarch64.tbz2/)] package.  
(2) You may refer to developer guide for [Preparing the OTA Payload Package] section to prepare the OTA payload.  
for instance, [Software Packages and the Update Mechanism — Jetson Linux Developer Guide documentation](https://docs.nvidia.com/jetson/archives/r35.4.1/DeveloperGuide/text/SD/SoftwarePackagesAndTheUpdateMechanism.html#steps-performed-on-the-host-machine)  
(3) Running below commands to generate an OTA payload package to only update Bootloader.  
for example, `$ sudo -E ./tools/ota_tools/version_upgrade/l4t_generate_ota_package.sh -b jetson-agx-orin-devkit R35-4`

---

<div class="post-metadata">

**Author:** ![KavehA](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@KavehA](https://forums.developer.nvidia.com/u/KavehA)\
**Post date:** [October 29, 2023, 5:02am UTC](https://forums.developer.nvidia.com/t/updating-initrd-and-bootloader-without-flashing/269367/10 "2023-10-29T05:02:31Z")

</div>

Thank you JerryChang

---

<div class="post-metadata">

**Author:** ![KavehA](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@KavehA](https://forums.developer.nvidia.com/u/KavehA)\
**Post date:** [November 1, 2023, 4:25am UTC](https://forums.developer.nvidia.com/t/updating-initrd-and-bootloader-without-flashing/269367/11 "2023-11-01T04:25:45Z")

</div>

Do you know if we can use this OTA update method to update the bootloader on existing JP 4.4 devices that have secure boot enabled? The JetPack 4.4 devices use CBOOT as bootloader and trusty libraries for secure boot.

---

<div class="post-metadata">

**Author:** ![JerryChang](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/jerrychang/32/14043_2.png) [@JerryChang](https://forums.developer.nvidia.com/u/JerryChang)\
**Post date:** [November 1, 2023, 8:29am UTC](https://forums.developer.nvidia.com/t/updating-initrd-and-bootloader-without-flashing/269367/12 "2023-11-01T08:29:14Z")

</div>

it’s supported with PKC+SBK.  
please refer to [Preparing for an Image-Based OTA Update](https://docs.nvidia.com/jetson/archives/l4t-archived/l4t-3273/index.html#page/Tegra%20Linux%20Driver%20Package%20Development%20Guide/updating_jetson_and_host.html#wwpID0E06H0HA).

---

<div class="post-metadata">

**Author:** ![KavehA](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@KavehA](https://forums.developer.nvidia.com/u/KavehA)\
**Post date:** [November 14, 2023, 4:00am UTC](https://forums.developer.nvidia.com/t/updating-initrd-and-bootloader-without-flashing/269367/14 "2023-11-14T04:00:10Z")

</div>

Hi @JerryChang,  
I am just double checking this with you to see if the following command can upgrade the bootloader on the 4.4 devices (note that this question is only about bootloader and not rootfs). 4.4 Uses CBOOT so we would like to know if we can upgrade to UEFI using the following mechanism:  
sudo -E ./tools/ota\_tools/version\_upgrade/l4t\_generate\_ota\_package.sh -b jetson-xavier-nx-devkit R35-4

---

<div class="post-metadata">

**Author:** ![JerryChang](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/jerrychang/32/14043_2.png) [@JerryChang](https://forums.developer.nvidia.com/u/JerryChang)\
**Post date:** [November 14, 2023, 5:18am UTC](https://forums.developer.nvidia.com/t/updating-initrd-and-bootloader-without-flashing/269367/15 "2023-11-14T05:18:10Z")

</div>

> [@KavehA](#):
>
> upgrade to UEFI

hello KavehA,

you cannot update bootloader only across two major release versions, since JP-4.x uses CBoot and JP-5.x moving to UEFI.

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/system/32/68080_2.png) [@system](https://forums.developer.nvidia.com/u/system)\
**Post date:** [November 28, 2023, 5:18am UTC](https://forums.developer.nvidia.com/t/updating-initrd-and-bootloader-without-flashing/269367/16 "2023-11-28T05:18:24Z")

</div>

Closed on November 28, 2023, 5:18am UTC

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
