Maël Posted December 2, 2022 Share Posted December 2, 2022 Hi! I need to use the UART1 port on my NanoPi NEO. This usually means just adding "uart1" to the `overlays` in `/boot/armbianEnv.txt`. What I would like to do is build a custom image that already has the overlay activated by default. I read the following documentations: - https://docs.armbian.com/User-Guide_Armbian_overlays/ - https://docs.armbian.com/Developer-Guide_User-Configurations/ But couldn't find anything about it. At first I tried to define the `DEFAULT_OVERLAYS` env var in `userpatches/config-example.conf` since I noticed it was defined in the configuration for the board, but it didn't work. I manage to make it work by modifying the `armbianEnv.txt` file within the `customize-image.sh` script, using some sed magic. For exemple: RELEASE=$1 LINUXFAMILY=$2 BOARD=$3 BUILD_DESKTOP=$4 Main() { echo "Release: $RELEASE" case $RELEASE in jammy) DisplayArmbianBootConf ;; esac } # Main DisplayArmbianBootConf() { echo "Adding UART1 overlay" sed -i '/overlays/s/$/ uart1/' /boot/armbianEnv.txt echo "armbianEnv.txt: " cat /boot/armbianEnv.txt echo "UART1 added." } Now this works fine, but it feels a bit "hackish". So I was wondering, is there a better way to achieve this ? This I miss an env var, conf file or specific configuration which would allow me to append overlays to the default overlay of the board ? Thanks, 0 Quote Link to comment Share on other sites More sharing options...
Solution schwar3kat Posted December 2, 2022 Solution Share Posted December 2, 2022 6 hours ago, Maël said: I manage to make it work by modifying the `armbianEnv.txt` file within the `customize-image.sh` script, using some sed magic. For exemple: In my opinion, for what it's worth , that's exactly the sort of thing customize-image.sh is intended to be used for. It's arguably less "hackish" than many other hacks, because it is intended for the purpose. 0 Quote Link to comment Share on other sites More sharing options...
Maël Posted December 5, 2022 Author Share Posted December 5, 2022 Hello ! In this case, and seeing that no one else propose a better solution, I will mark you answer a solution. It's a bit sad that the board configuration do define a `DEFAULT_OVERLAYS` but it doesn't seem that we can override it. But the customize-image.sh solution do work pretty well, so definitely not a big deal. Thanks 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.