Auto reinstall package improvements (#932)

* Add network detection and retry

* Add message when package reinstall is happening

* Update permenant package list
This commit is contained in:
Tim Wilkinson 2023-09-16 18:09:18 -07:00 committed by GitHub
parent cf84853530
commit 91ab73fe6f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 128 additions and 39 deletions

View File

@ -41,6 +41,17 @@ local package_store = "/etc/package_store"
local package_catalog = package_store .. "/catalog.json"
if nixio.fs.stat(package_catalog) then
-- Make sure we can contact the package server before proceeding.
-- We'll wait a few minutes before going ahead anyway
for i = 1,5
do
if os.execute("ping -q -c 1 -W 5 downloads.arednmesh.org > /dev/null 2>&1") == 0 then
break
end
print("Failed to contact package server - retry in 60 seconds")
nixio.nanosleep(60, 0)
end
os.execute("opkg update")
local catalog = luci.jsonc.parse(io.open(package_catalog):read("*a"))
for ipkg, state in pairs(catalog.installed)
@ -56,4 +67,5 @@ if nixio.fs.stat(package_catalog) then
end
end
-- Don't do this again
os.remove("/etc/cron.boot/reinstall-packages")

View File

@ -1,79 +1,142 @@
ath10k-board-qca9887
ath10k-board-qca988x
ath10k-firmware-qca4019-ct
ath10k-firmware-qca9887-ct
ath10k-firmware-qca988x-ct
base-files
bridge
busybox
ca-bundle
curl
dnsmasq
dropbear
firewall
hotplug2
ip
ethtool
firewall4
fstools
fwtool
getrandom
hostapd-common
iperf3
nftables
iw
iwinfo
jansson4
jshn
jsonfilter
kernel
kmod-ath
kmod-ath10k-ct
kmod-ath10k-ct-smallbuffers
kmod-ath9k
kmod-ath9k-common
kmod-cfg80211
kmod-crypto-aes
kmod-crypto-arc4
kmod-crypto-core
kmod-crypto-aead
kmod-crypto-ccm
kmod-crypto-cmac
kmod-crypto-crc32c
kmod-crypto-ctr
kmod-crypto-gcm
kmod-crypto-gf128
kmod-crypto-ghash
kmod-crypto-hash
kmod-crypto-hmac
kmod-crypto-manager
kmod-crypto-null
kmod-crypto-rng
kmod-crypto-seqiv
kmod-crypto-sha256
kmod-gpio-button-hotplug
kmod-ipt-conntrack
kmod-ipt-core
kmod-ipt-ipopt
kmod-ipt-nat
kmod-ipt-nathelper
kmod-hwmon-core
kmod-ipip
kmod-iptunnel
kmod-iptunnel4
kmod-leds-gpio
kmod-ledtrig-default-on
kmod-ledtrig-netdev
kmod-ledtrig-timer
kmod-ledtrig-usbdev
kmod-lib-crc-ccitt
kmod-ledtrig-gpio
kmod-lib-crc32c
kmod-mac80211
kmod-nf-conntrack
kmod-nf-flow
kmod-nf-log
kmod-nf-nat
kmod-nf-reject
kmod-nfnetlink
kmod-nft-core
kmod-nft-fib
kmod-nft-nat
kmod-nft-offload
kmod-nls-base
kmod-tun
kmod-usb-core
kmod-usb-ohci
kmod-usb-uhci
kmod-usb2
kmod-wdt-ath79
libblobmsg-json
kmod-usb-dwc3
kmod-usb-dwc3-qcom
libblobmsg-json20220515
libc
libgcc
libip4tc
libiwinfo
libjson
liblzo
libnl-tiny
libpcap
libcurl4
libgcc1
libiwinfo-data
libiwinfo-lua
libiwinfo20210430
libjson-c5
libjson-script20220515
liblua5.1.5
liblucihttp-lua
liblucihttp0
liblzo2
libmbedtls12
libmnl0
libnftnl11
libnl-tiny1
libpthread
librt
libubox
libubus
libuci
libxtables
libubox20220515
libubus-lua
libubus20220601
libuci-lua
libuci20130104
libuclient20201210
libucode20220812
libxtables12
logd
lua
luasocket
luci-lib-base
luci-lib-ip
luci-lib-jsonc
luci-lib-nixio
mtd
netifd
nftables-json
olsrd
olsrd-mod-arprefresh
olsrd-mod-dot-draw
olsrd-mod-dyn-gw
olsrd-mod-httpinfo
olsrd-mod-jsoninfo
olsrd-mod-nameservice
olsrd-mod-secure
olsrd-mod-txtinfo
olsrd-mod-watchdog
openwrt-keyring
opkg
ssidident
procd
prometheus-exporter
rpcd
rpcd-mod-file
rpcd-mod-luci
rssileds
swconfig
tcpdump-mini
ubi-utils
uboot-envtools
ubox
ubus
ubusd
uci
uclient-fetch
ucode
ucode-mod-fs
ucode-mod-ubus
ucode-mod-uci
uhttpd
urandom-seed
urngd
usign
vtun
wireless-regdb
wpad-mini
zlib

View File

@ -72,6 +72,15 @@ function html.alert_banner()
if not aredn.hardware.supported() then
html.print("<center><div style=\"padding:5px;background-color:#FF4719;color:black;border:1px solid #ccc;width:600px;\"><a href=\"/cgi-bin/sysinfo\">!!!! UNSUPPORTED DEVICE !!!!</a></div></center>")
end
local f = io.open("/etc/cron.boot/reinstall-packages")
if f then
f:close()
f = io.open("/etc/package_store/catalog.json")
if f then
f:close()
html.print("<center><div style=\"padding:5px;color:black;border:1px solid #ccc;width:650px;\">Packages are being reinstalled in the background. This can take a few minutes.</div></center>")
end
end
html.print("</div>")
end

View File

@ -613,7 +613,12 @@ function record_package(op, ipkg, file)
nixio.fs.remove(package_store .. "/" .. ipkg .. ".ipk")
catalog.installed[ipkg] = nil
end
os.remove(package_catalog)
for _,_ in pairs(catalog.installed)
do
write_all(package_catalog, luci.jsonc.stringify(catalog))
break
end
end
-- upload package