imx: add a compilation flag to support the persistence of the rootfs.
The image generation for the board NXP® i.MX 8MQuad Evaluation Kit (EVK)
has been refactored, so the rootfs can either be loaded from a RAMDisk
or from a partition on a media storage such as an SD card, by enabling
the compilation flag USE_PERSISTENT_ROOTFS.
In addition, the image size is now dynamically allocated, depending on
the size of the partition(s) that is/are part of the image.
The flash-image target (part of the all target) produces a out/boot.img
which can be copied to a SD card using the command:
dd if=out/boot.img of=/dev/sdX bs=1M conv=fsync
Where 'X' has to be adjusted to the device of the SD card when connected
to the host system.
****** Please be careful to choose the correct device ******
****** or there's a risk of damaging the host system. ******
Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
Reviewed-by: Joakim Bech <joakim.bech@linaro.org>
Signed-off-by: Jämes Ménétrey <james.menetrey@unine.ch>
diff --git a/imx/u-boot_boot_script b/imx/u-boot_boot_script
index 4bb473d..a2ee4fe 100644
--- a/imx/u-boot_boot_script
+++ b/imx/u-boot_boot_script
@@ -13,5 +13,10 @@
fi;
fdt print /firmware/optee;
run loadimage;
-fatload mmc ${mmcdev}:${mmcpart} ${initrd_addr} ramdisk.img;
-booti ${loadaddr} ${initrd_addr} ${fdt_addr};
+if fatload mmc ${mmcdev}:${mmcpart} ${initrd_addr} ramdisk.img; then
+ booti ${loadaddr} ${initrd_addr} ${fdt_addr};
+else
+ echo "Booting on the persistent file system ..."
+ run loadimage;run mmcargs;
+ booti ${loadaddr} - ${fdt_addr};
+fi;
\ No newline at end of file