I want to set UART mode to RS232 on my compulab iot-gateway-8.
Current State:
- Flash Balena OS on my device.
- Attach to the main OS of the device.
- Mount the read-only FS:
mount -o remount,rw /
. - Edit extra_uEnv.txt like so:
echo 'uart_mode=rs232' >> /mnt/boot/extra_uEnv.txt
. - Reboot the device.
The steps above correctly accomplish what I need to for that particular device. However, this is obviously not scalable for hundreds or thousands of devices.
Desired State:
- Mount the image file for that device to my OS.
- Make a persistent update (doesn’t matter what it is to be honest) such that the line “uart_mode=rs232” is in the “extra_uEnv.txt” immediately upon flashing.
- Flash new devices with this modded image.
I’ve already tried something like the above by mounting the boot partition of the image file to my OS, and adding this file to that directory, but when flashing, it seems that this file got overwritten somehow.
Is what I’m asking possible?