I have an Apalis imx6 module that is running the default lxde 2.4 beta image. It has kernel 3.10.
I would like to update the kernel and rootfs to the latest version.
The trouble here is that it will have to be done through ssh session. Physical access is not an option.
I have seen in one of the post regarding how to update the kernel by simply copying the image file to the dev that corresponding to the flash where the image file is stored.
What I’m struggling with is how to update the rootfs. Any help would be really appreciated.
In addition, any tools suggestion that can help making the update process power fail safe would be greatly appreciated.
In order to update the rootfs you need to be able to unmount it, so you can replace the files. You can achieve this with a tmpfs in ram.
Create a tmpfs, copy a temporary (preferrably very small) rootfs into it. chroot into that newly copied rootfs and then you can unmount the main rootfs and update it with the one stored in ram.
About power fail safe updates: We offer Torizon for Apalis iMX6. This is an industrial linux platform which offers secure over-the-air updates with failsafe. Check out this link for further information: TorizonCore - Easy-to-use Industrial Linux Platform
We don’t use an Apalis module, but a Colibri module, so the procedure should be quite the same.
We deliver our product with a sd card on the carrier board, which we use to update.
So we download and extract the new linux image to the sd card and start the update on the next boot by setting the bootcmd parameter: fw_setenv bootcmd "run setupdate && run update"
To make this work, you also need to modify the flash_blk.scr script from the toradex layer to reset the bootcmd command after the update.
I updated the update_new variable in the flash_blk.scr to:
setenv update_new 'updt_fuse -n && run update_latest && env default -a && saveenv && setenv bootcmd "env default -a && saveenv && reset" && saveenv && reset; run update_v2.5b3'
This way, also all uboot environment variables are reseted to new default values in your linux image. We needed this, as we needed to change a new environment variable during the update.