Setting extra_uEnv.txt on compulab iot-gateway-8 image with balenaOS 6.5.30+rev8

I want to set UART mode to RS232 on my compulab iot-gateway-8.

Current State:

  1. Flash Balena OS on my device.
  2. Attach to the main OS of the device.
  3. Mount the read-only FS: mount -o remount,rw /.
  4. Edit extra_uEnv.txt like so: echo 'uart_mode=rs232' >> /mnt/boot/extra_uEnv.txt.
  5. 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:

  1. Mount the image file for that device to my OS.
  2. 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.
  3. 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?

Hi Randy,

What you are looking for should be possible - I would recommend trying the following:

  • Mount the image file for the device on your workstation
  • The image file you have here is a “flasher” image - this image boots on the device while provisioning, and flashes an “internal” image onto the device storage.
  • So I would recommend trying to mount the “internal” image - which should be in /opt/ of the flasher image. Mount the boot partition of the internal image (first partition)
  • inside here should be a extra_uEnv.txt file that you can modify with the uart change
  • flashing a new device with this image (the “flasher image”, containing the modified “internal” image , should result in the uart change being copied across.

If it doesn’t, or if you encounter any problems, let us know.

Thanks

1 Like

Thank you - this works!

1 Like