How Customize OpenWrt with your installed packages

Witth OpenWrt Firmware Selector
https://firmware-selector.openwrt.org/

Version
Aftter you can make your "full version with packages & more "

1 - SSH:
run:opkg list-installed | cut -f 1 -d ' ' | sed ':a;N;$!ba;s/\n/ /g' > liste.txt
2 - Firmware selector ->
Customize installed packages
remove all in windows
3 - Copy the content of liste.txt
4 - Request Build

After a little time you will now have a version compiled according to your wishes

2 Likes

Hi! Good future.
How Can I add the commands in to script after install the firmware?

wget -P /tmp/ -O telegram-openwrt_1.1.1-1_all.ipk https://github.com/alexwbaule/telegramopenwrt/releases/download/1.1.1/telegram-openwrt_1.1.1-1_all.ipk
opkg install /tmp/telegram-openwrt_1.1.1-1_all.ipk

I add The commands into the Script to run on first boot (uci-defaults) - it not work

I would put that in an autorun script instead.

How i can use it uses https://firmware-selector.openwrt.org/ ?

I would first manually create and test an appropriate init.d script, that does what you need on every reboot.

Then once that works, I would try to find some

echo “…“ > your.initd.file

call for the image selector script section that automatically creates that initd file during installation.

It looks doable, but I do not know preexisting examples for that.

This can backfire on upgrades since a new version of OpenWrt may require a different set of dependencies that conflict with the previous version.

2 Likes

This feature seems to be great for easy upgrading when you have previously installed packages manually! Especially when upgrading a device which is connected via wifi only.
I'll try it when updating from 23.05 to 23.05.1. I will Not use opkg list-installed though, since as @vgaetera already pointed out, I can see how this could possibly mess things up. Instead, I will just add my manually installed packages to the prefilled list.

I have some technical questions about this feature:

  1. Does the prefilled list contain exactly the same packages than an uncustomized build? As in, if I would just leave it at default, would the resulting generated image be exactly the same as the precompiled one?

  2. Will dependencies be installed automatically? E.g. if I had iperf3 installed manually on my install and want to upgrade OpenWrt, can I just add iperf3 to that list or do I have to add libiperf3 (dependency of iperf3) as well?

If I were in your shoes, I'd use the Image Builder to create an image with that package already included.

I used the image builder and will answer my questions from above if anyone else stumbles on this question in the future:

Yes, dependencies will get installed automatically. I did not have any issues when using the generated image as sysupgrade.

1 Like