Luci attended system upgrade: is it an easy replacement for image builder?

Can anyone tell me if my package selection looks ok?

ath10k-firmware-qca99x0-ct base-files busybox ca-bundle -dnsmasq dropbear -firewall fstools -ip6tables -iptables kmod-ath10k-ct kmod-ath9k kmod-gpio-button-hotplug -kmod-ipt-offload libc libgcc libustream-wolfssl logd uhttpd uhttpd-mod-ubus luci-mod-admin-full luci-theme-bootstrap -luci-app-firewall luci-app-opkg -luci-proto-ppp libiwinfo-lua -luci-proto-ipv6 rpcd-mod-rrdns mtd netifd -odhcp6c -odhcpd-ipv6only opkg -ppp -ppp-mod-pppoe procd swconfig uboot-envtools ucert uci uclient-fetch urandom-seed urngd wpad-basic-wolfssl

I'm hoping this list works for an idiot like myself

You probably already found an online image builder?

Because of your post I didn't even knew about 'asu' although I use it from aparcar.org so in the end we all learn something.

Could you please edit/wrap your "package customisation" text styling between a set of Grave accent ` so its more readable and don't break up the - dashes within package names.

So far I would start from the defaults and you probably don't need any ipv6 odhcpcd ppp/pppoe uhttpd stuff (don't know your exact needs).

If you start with defaults which I would suggest again for once, use the luci webinterface to setup your custom ip/adapter/vlan/wifi/ssid settings and look in the TOP RIGHT corner of the luci webinterface BEFORE you apply your changes/settings. Because you will see all the "uci commands" that are needed to put in "your script" for your image. Copy paste them in plaintext file and you may have a great change it will automatically setup your custom online imagebuilder image with your settings by default and survive a factory reset but do use Squashfs!

I didn't break anything I thought the - before a package indicated an exclusion.
Thanks for the code edit tip.
I've only compiled the image so far as I'm waiting for a good day to do it when my wife doesn't need the WiFi for work.
Many thanks Bowen.

Rather than doing the - for exclusion can I just remove it from the text then?
So it would look like this:
ath10k-firmware-qca99x0-ct base-files busybox ca-bundle dropbear fstools kmod-ath10k-ct kmod-ath9k kmod-gpio-button-hotplug libc libgcc libustream-wolfssl logd uhttpd uhttpd-mod-ubus luci-mod-admin-full luci-theme-bootstrap luci-app-opkg libiwinfo-lua rpcd-mod-rrdns mtd netifd -odhcp6c opkg procd swconfig uboot-envtools ucert uci uclient-fetch urandom-seed urngd wpad-basic-wolfssl

Ok so tomorrow according to tracking one of my Comfast ew72 outdoor AP's arrive. so I'll use it as a guinea pig and test the process out, all going well that should give me some practice for the expensive version of the Tp-Link 245v3 (yes I know I paid extra for a 265 which I then flashed away what was the price difference).

Anyway thanks for everyone's help I'll report back tomorrow after the test.

If you have all the "uci commands" in a text file, apply them manually yourself using ssh on a clean image and see if it has the desired effect on your config.

Maybe you have to split the uci parts in multiple sets of commands and commits with some sleep time before it may finally put everything to its place. Than you may wrap a shebang at the beginning of text file and then you have a script.

#!/bin/sh

/bin/sleep 5 #wait 5 seconds

#some commands may need absolute/global filesystem path
#/usr/bin/exampleprogram argument
#/usr/sbin/exampleprogram argument

uci command a
uci command b
uci commit

/bin/sleep 5 #wait 5 seconds

uci command x
uci command y



exit 0

Test that script on a clean image with ssh/scp, than finally include the tested/working script in the asu image builder recipe. However I'm not sure if you just copy the uci commands from your script in that asu webpage or also the actual beginning and ending shebang/exit0 syntax. See other users with more experiance: Custom script to run on first boot using linux builder - #15 by u251

So if anyone is interested with the answer to my original question it's YES after a factory reset any packages installed via Luci-attended-sysupgrade persist with a reset. I smoked a load of jazz cabbage yesterday and messed up my router late at night, so this morning i did a factory reset only to find my packages persisted. I'm still going to image build and strip it down properly but the Luci package does work in the same way as a image build.

1 Like

So with no great surprise to my wife, my 1st image build bricked the device and it seems the pins are labeled slightly different to the eap245 I'll get a multimeter out later and test unless someone can help me out

Ok so I'll open a new thread I guess might be a better source for others

What are the sleep times supposed to do in a setup script?

My biggest setup script for my devices have about 900 lines of UCI code, but I have no delays in it.

Maybe for more manual hardcoded hacking with sed, echo, cat config file replace and restarting services manually. With uci a interface may only comes up after the commit message and some delay. Maybe in or between that period you have other wishes certificate/authentication before other parts of the uci config may succeed?

A commit only writes your changes from the ram to the actual config file.
To load it in a interface or something else you need to run a restart or reload operation.

But the whole idea with !# script is that they run the code as if you did it yourself but without delay so every command must be done before it moves on or it gives a error message.
You can even make commands in the script like opkg update and on next line opkg install <something> and the script will nicely wait while the device is downloading the package list and then it will install ”something”.

Well since you recently saved your brick, try to avoid a new one and just build a default image with the online image builder having the default packages but only the following test commands in the script to see if/how the script may work. As in if it needs extra shebang/exit0 stuff.

echo "just a simple echo test" > /etc/echotest.txt
mkdir /etc/blablabla
touch /etc/blablabla/testfile
date > /etc/blablabla/datescript.txt
date >> /etc/echotest.txt #puts date at the last line in file

Than step by step try to add your new default config with uci commands (verified before in a clean image using ssh) in this custom script.

You might also try to remove all packages you don't like from the current default image and see if that still boots, than later adjust the package list for the online image builder.

Thanks Walter I was planning on saving the UCI commands but as I was setting up I enabled one of the WiFi controllers and that saved everything..... I just went with the generic build as you said and just followed the dumb ap guide.
Next I seem to have bricked the Comfast I got also

So after a week of bricking routers(only one device is dead dead and needs a EEprom re-program) I think I'm finally at the point I can start building custom images.

I actually managed to create a text file this morning of the UCI commands, so to be sure.
Factory reset the device and SSH into it,
Copy and paste the text file in and see if it works,
All going well then build a custom image with the text file copied into the command list( do I need to add anything else or just;

UCI command blablah
UCI command blah blah

)?

What command list?

https://openwrt.org/docs/guide-user/base-system/uci

Sorry I meant the custom builder first boot custom script.

https://openwrt.org/docs/guide-developer/uci-defaults
You then need a UCI default script file.

Does the front-end image builder need something like that? I was told to just copy what the config changes were from the top right of the Luci interface run them in a clean build via SSH if they work then add them to the online custom builder frontend

Yes!

The other tip was only the easiest way to get the actual UCI code for your settings, but that is still a good tip.

But instead of working full time bricking routers with trial and error you maybe should read some parts of the user guide and developers guide?