Newbie here, first time upgrading. I had installed Wireguard and a bunch of other modules, all of which were gone after the upgrade. Is this normal? What can I do to preserve my modules and their settings during the upgrade process? I did make a backup, but the backup did not restore any of the previously installed modules.
Yes, as explained in detail many times here and on the wiki.
Nothing, they are not binary compatible between releases - trying to do so would end up badly (as at least the kernel version and its kernel modules will differ incompatibly by definition), you have to reinstall them (respectively their updated/ current equivalents).
Correct, as intended and necessary.
This is the script I use before upgrades to be able to save the user installed package(s) and restore them after the upgrade.
# overlaypkgs.sh
#!/bin/sh
#set -x
do_opkg_update() {
local dir=$(cat /etc/opkg.conf | grep lists_dir | awk '{print $3}')
if [ -d $dir ]; then
[ -z "$(ls -1 ${dir}/* 2>/dev/null)" ] && `opkg update`
else
echo "opkg '${dir}' not found"
exit 1
fi
}
do_backup() {
echo -e "\nChecking. Please wait\n"
rm -f $FILENAME 1>/dev/null 2>&1
touch $FILENAME 1>/dev/null 2>&1 || {
echo "Invalid file name: '${FILENAME}'"
rm -f ${FILENAME} 1>/dev/null 2>&1
exit 1
}
do_opkg_update
COUNT=0; CONTROL="$(ls -1 /overlay$UP/usr/lib/opkg/info/*.control 2>/dev/null)"
[ -n "$CONTROL" ] && for EACH in $CONTROL; do
NAME=$(egrep "^Package: " $EACH | cut -f 2 -d ' ')
if [ ! -f /rom/usr/lib/opkg/info/$NAME.control ]; then
opkg whatdepends $NAME 1>/tmp/opkg.whatdepends 2>/tmp/opkg.error
[ $? -ne 0 ] && { echo "Error! Check '/tmp/opkg.error'"; exit 1; }
if [ -z "$(egrep "depends on $NAME" /tmp/opkg.whatdepends)" ]; then
[ $COUNT -eq 0 ] && echo -e "\nSaved package(s):"
COUNT=$((COUNT+1)); printf "\r%3d " $COUNT
echo "$NAME"; echo $NAME >> $FILENAME
fi
fi
done
COUNT=0; CONTROL="$(ls -1 /etc/rc.d | grep "S" 2>&1)"
[ -n "$CONTROL" ] && for EACH in $CONTROL; do
[ $COUNT -eq 0 ] && echo -e "\nSaved service(s):"
COUNT=$((COUNT+1)); printf "\r%3d " $COUNT
echo "+${EACH:3}"; echo "+${EACH:3}" >> $FILENAME
done
CONTROL="$(ls -1 /etc/init.d 2>&1)"
[ -n "$CONTROL" ] && for EACH in $CONTROL; do
[ -e /etc/rc.d/S??$EACH ] || {
COUNT=$((COUNT+1)); printf "\r%3d " $COUNT
echo "-$EACH"; echo "-$EACH" >> $FILENAME
}
done
rm -f /tmp/opkg.wahtdepends 1>/dev/null 2>&1
if [ $COUNT -eq 0 ]; then
echo -e "\nNo user installed package(s) and/or service(s) found"
exit 1
fi
echo -e "\n'$FILENAME' created"
echo -e "\nIf you keep your settings during the firmware upgrade process,"
echo -e "you will have $FILENAME after the upgrade."
echo -e "\nOtherwise, you should save this file now, then finish your"
echo -e "firmware upgrade and restore $FILENAME."
echo -e "\nEnter '$(basename "$0") restore' command to reinstall user-installed package(s) and/or service(s)."
} # do_backup
do_restore() {
[ -f $FILENAME ] || { echo -e "\n'${FILENAME}' not found"; exit 1; }
do_opkg_update
echo -e "\nReinstalling user packages\n"
echo "Reinstalling user packages" > $FILENAME.log
CONTROL=$(cat $FILENAME)
[ -z "$CONTROL" ] && { echo -e "\nNo user installed package(s) and/or service(s) found"; exit 1; }
for EACH in $CONTROL; do
CONT=${EACH:0:1}; [ $CONT != "+" -a $CONT != "-" ] && {
if [ ! -f /usr/lib/opkg/info/$EACH.control ]; then
[ -n "$(opkg info $EACH)" ] && { opkg install $EACH >> $FILENAME.log; MSG="OK"; } || MSG="not found"
else
MSG="bypassing - already installed"
fi
echo "$EACH --> $MSG"; echo "$EACH --> $MSG" >> $FILENAME.log
}
done
echo >> $FILENAME.log; echo "Enabling service(s)" >> $FILENAME.log
echo -e "\nEnabling service(s)\n"
for EACH in $CONTROL; do
CONT=${EACH:1}
if [ ${EACH:0:1} == "+" ]; then
if [ ! -e /etc/rc.d/S??${CONT} ]; then
$(/etc/init.d/${CONT} enable)
echo "${CONT} --> enabled"; echo "${CONT} --> enabled" >> $FILENAME.log
else
echo "${CONT} --> bypassing - already enabled"; echo "${CONT} --> bypassing - already enabled" >> $FILENAME.log
fi
fi
done
echo >> $FILENAME.log
echo "Disabling service(s)" >> $FILENAME.log
echo -e "\nDisabling service(s)\n"
for EACH in $CONTROL; do
CONT=${EACH:1}
if [ ${EACH:0:1} == "-" ]; then
if [ -e /etc/rc.d/S??${CONT} ]; then
$(/etc/init.d/${CONT} disable)
echo "${CONT} --> disabled"; echo "${CONT} --> disabled" >> $FILENAME.log
else
echo "${CONT} --> bypassing - already disabled"; echo "${CONT} --> bypassing - already disabled" >> $FILENAME.log
fi
fi
done
echo -e "\nAll the package(s) and/or service(s) in $FILENAME processed"
echo -e "\nPlease check '$FILENAME.log' and restart the router"
} # do_restore
usage() {
cat <<EOF
Usage: $(basename "$0") [OPTION(S)]...[backup|restore]
where: -f < file name > to save package name(s)
default='/etc/config/overlaypkgs.lst'
-d debug option
-h show this help text
Backup user installed package(s) and/or service(s) before firmware upgrade and restore them later
EOF
exit 1
} # usage
[ $# -eq 0 ] && usage
FILENAME="/etc/config/overlaypkgs.lst"
while getopts ':df:h' flag
do
case "${flag}" in
d ) set -x ;;
f ) FILENAME=$OPTARG ;;
\? ) echo "Invalid option: -$OPTARG"; usage ;;
: ) echo "Invalid option: -$OPTARG requires an argument"; usage ;;
h\?* ) usage ;;
esac
done
shift "$((OPTIND-1))" # Discard the options and sentinel --
[ $# -ne 1 ] && usage
UP=""; [ -d /overlay/upper ] && UP="/upper"
cmd=$1
case $cmd in
backup ) do_backup ;;
restore ) do_restore ;;
* ) echo "Invalid option: -$cmd"; usage ;;
esac
exit 0
thanks @faruktezcan
can you please provide more info what the script does and how-to use it? I have the same problem that reinstalling all packages is a lot of work
I wrote this script just to be able restore everything after an upgrade, if there is any user installed packages or services and it should be in '/etc' directory.
If you install a package or enable/disable a service according to your needs and want to save your config, you should run the script with 'backup' option. It will create a file in '/etc/config' directory. When you upgrade the router this file will be saved and be in the same place after upgrade.
If you run the same script after the upgrade with the 'restore' option all the packages and services will be brought to the same position before the upgrade.
What it does is exactly what you do manually after an upgrade. It is tested and does not harm anything. Good luck.
This is an example output for 'backup' option.
Checking. Please wait
Saved package(s):
1 usbutils
2 luci-app-privoxy
Saved service(s):
1 +sysfixtime
2 +urngd
3 +boot
4 +system
5 +sysctl
6 +log
7 +rpcd
8 +zram
9 +dnsmasq
10 +dropbear
11 +firewall
12 +network
13 +adblock
14 +odhcpd
15 +fstab
16 +br2684ctl
17 +cron
18 +sqm
19 +uhttpd
20 +ucitrack
21 +gpio_switch
22 +done
23 +led
24 +dsl_control
25 +watchcat
26 +sysntpd
27 +urandom_seed
28 -ddns
29 -privoxy
30 -ram-root
31 -umount
32 -vsftpd
'/etc/config/overlaypkgs.lst' created
If you keep your settings during the firmware upgrade process,
you will have /etc/config/overlaypkgs.lst after the upgrade.
Otherwise, you should save this file now, then finish your
firmware upgrade and restore /etc/config/overlaypkgs.lst.
Enter 'overlaypkgs.sh restore' command to reinstall user-installed package(s) and/or service(s).
I just use ansible to achieve the same effect. After I flash a new image I run a playbook that sets up the router.
link to GitHub repo for ansible role?
Same configuration.
Xiaomi r3g v1
It's private because I have a lot of specific stuff committed there, including SSID, wireless channels, letsencrypt domain, etc.
I can probably get it cleaned up and in a public repo if you'd like.
Please do so. thx
Thank you to the maintainers for 19.07.7.
Hardware is TP-Link Archer C7 v2
- I have successfully upgraded from (ar71xx) 19.07.6 to (ar71xx) 19.07.7 using the LUCI firmware upgrade procedure.
- I then subsequently used the LUCI firmware upgrade procedure to transition sideways to (ath79) 19.07.7
This is, no doubt, not recommended, but 'it worked for me', and the first time I accessed the Wireless Interface page in LUCI, I was informed that an automatic reconfiguration would take place if I chose to continue. I did, and the wireless interfaces came up perfectly, preserving the SSIDs etc.
So, thank you indeed to whoever took the time and trouble to make this work. I was prepared to need to to a factory reset and restart from the beginning, or at least to have to reconfigure the wireless set-up manually, so avoiding this has been a pleasant and unexpected surprise.
L.
Upgraded on a BT Home Hub 5. All went smoothly.
I use dnsmasq as a DNS caching proxy, and note there seems to be an increase in memory size roughly every 4 hours -- this isn't service affecting at this time, just mentioning it in case someone sees something similar (I have adblock refresh overnight which triggers a dnsmasq reload -- at which point the memory falls back, haven't monitored it for more than 24 hours to see if it hits a maximum).
5 Meraki MR24's all running smoothly for two weeks since upgrading to 19.07.7. Many thanks to devs!
Incidentally, to save a bit of time and avoid errors keeping this set of AP's upgraded, since 19.07.4 I've been following the scheme (thanks @cybermaus !) in
which works great to keep dnsmasq, firewall, and odhcpd disabled across upgrades. Looks like this on one of these AP's:
root@ap0:~# ls -l /etc/rc.d | grep disabled
lrwxrwxrwx 1 root root 18 Dec 31 1969 S19dnsmasq -> ../init.d/disabled
lrwxrwxrwx 1 root root 18 Dec 31 1969 S19firewall -> ../init.d/disabled
lrwxrwxrwx 1 root root 18 Dec 31 1969 S35odhcpd -> ../init.d/disabled
root@ap0:~# cat /etc/sysupgrade.conf
## This file contains files and directories that should
## be preserved during an upgrade.
# /etc/example.conf
# /etc/openvpn/
# The following links to a nonexistent file keep these services
# disabled across an upgrade:
/etc/rc.d/S19dnsmasq
/etc/rc.d/S19firewall
/etc/rc.d/S35odhcpd
root@ap0:~#
Sysupgrade from 19.07.07 on TPLINK VR200
Everything good except wifi.
I run latest upgrades and
via opkg update; opkg install kmod-mt76x0e wpad-mini pciutils; reboot
commands'
but There is no wifi settings under network. what I have to do additionally?
Upgraded TP-LINK Archer C2600 v1 from 18.06.8 to 19.07.7.
- Backed up config from luci
- Flashed openwrt-19.07.7-ipq806x-generic-tplink_c2600-squashfs-sysupgrade.bin in luci with
[x] Save config
after verifying checksum - Waited a few minutes until device came back online
- Logged in as root by ssh
- Updated package list with
opkg update
- Upgraded packages with
opkg upgrade $(opkg list-upgradable | cut -d' ' -f1)
- Installed packages with
opkg install 6in4 acme acme-dnsapi ca-bundle ca-certificates ddns-scripts haproxy luci-app-acme luci-app-ddns luci-app-ntpc luci-app-uhttpd luci-ssl ntpclient openssl-util rsync wget
- Rebooted with
reboot
- Waited for less than a minute
- Watched web interface with luci tab using https:// with renewed ACME (Let's Encrypt) cert refreshed to give login prompt
- Checked Status > Overview and saw all looked OK including my four Dynamic DNS services
- Checked Network > Interfaces and saw my networks including HE.net IPv6 tunnel
- Checked Network > Wireless and was prompted with
Wireless configuration migration
The existing wireless configuration needs to be changed for LuCI to function properly.
Upon pressing "Continue", anonymous "wifi-iface" sections will be assigned with a name in the form wifinet# and the network will be restarted to apply the updated configuration.
- Pressed
[Continue]
and watched progress notification, then checked results - Reconnected my newer Android device, getting a 5 GHz link, and my older Android device, getting a 2.4 GHz link
- Checked just about everything else including haproxy service and failed to find a single thing wrong
Yet again OpenWRT disappoints. A weekend of bricking, unbricking, reconfiguring from scratch, disconnecting myself and having to reset and start again is ruined. Now I will have to start messing with obscure and advanced settings in order to find something to break. First on the list: 802.11r.
For a few moments I thought I had managed to break things with 802.11r on this and my Archer A7 v5, but it turned out that I had merely failed to read about the interfaces being briefly disabled for DFS / radar detection.
At first my sarcasm filter didn't kick in. Nicely done!
Thanks @faruktezcan. This helped a lot.
Had to make some amendments as I had removed some base packages which caused an error plus spotted a typo (wahtdepends). Can post a diff file if you're interested.
Please do so. Thanks.