EasyInstaller: How can I write a file into a partition of a previously flashed linux image?

I use the EasyInstaller v1.5 to flash a custom Linux image into a TK1 2GB v1.2A SOM. After flashing (e.g. as part of the wrapup.sh script) I would like to write a file into one of the images partitions. How can I get this done?

What content options (see here) are you exactly using? If you use filelist you can just add it to the list. However, you cannot combine filelist and filename currently.

Assuming you are using filename, I really recommend integrating the files into the tarball you are installing. The wrapup.sh script is meant for “lightweight” operations, e.g. custom cleanup or notifications.

That said, it should be possible to mount the rootfs with regular Linux scripting:

mkdir /var/volatile/rootfs/
mount /dev/mmcblk0p2 /var/volatile/rootfs/
umount /var/volatile/rootfs/

In this case we want to explicitly not deploy the file as part of the regular image but writing it explicitly as part of the flash procedure via wrapup.sh. In detail: We have the TK1 SOM with the EI flashed into its eMMC. Then we trigger autoinstall of our linux image and would like to write a file into the previously flashed linux image from within the wrapup.sh. (As the installed linux image potentially overrides the BusyBox in the eMMC the BusyBox is running from RAM I guess.)

It was not clear to me how to “interface” a partition (we don’t want to write it into the Ubuntu rootfs) from BusyBox. As I understood you all BusyBox commands ( mount, touch, umount, etc.) should work without additional consideration. Is that right?

Thx. I played around a bit: I use a SOM with our linux image flashed, then I use recovery-linux.sh to get the EasyInstaller into RAM. If I run fdisk -l the partition I am interested in (lets say /dev/mmcblk0pX) is shown. Mounting /dev/mmcblk0pX into /tmp works just fine (mounting into most other directories won’t be possible due to “read-only fs” I guess). Getting a file into there (with touch /tmp/file-name.txt) works just fine as well. umount works just fine as well.

Perfect, that it works. Thanks for sharing the information.