Updating the linux kernel and the root file system

Hi, I need to update the linux kernel on the flash memory while the target i executing. Also I need to update the root file system. Can somebody pleas explain me how these things are best done?

Reply to
goodtimes
Loading thread data ...

Is the kernel running directly from flash (XIP), or does your flash hold a (possibly compressed) kernel image that is copied to RAM at boot time and run from there?

If the kernel is running from RAM, it is safe to overwrite the flash partition containing the kernel from a running system. Note that there is always a risk that something goes wrong while writing the image, (power outage, etc) leaving your system unbootable.

A safer method would be to create two partitions to hold your kernel. When you booted from partition A, you write the new kernel to partition B, verify the data is properly written, and then configure the bootloader to boot from partition B from now on. The next update will go to partion A, reversing the setup. In the ideal situation, the bootloader is notified by your OS that the newly upgraded partition has properly booted, or reverts to the previous kernel at the next boot if this is not the case.

Reply to
Ico

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.