Skip to content

Commit 07fa00f

Browse files
committed
upgrade guide
Signed-off-by: Jordan Sokolic <[email protected]>
1 parent 360519a commit 07fa00f

File tree

2 files changed

+67
-1
lines changed

2 files changed

+67
-1
lines changed

README.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ This will delete the container and all associated Docker networks so you can sta
6363

6464
### Hairpinning
6565

66-
6766
In order for WLAN clients to see one another, OpenWrt bridges all interfaces in the LAN zone and sets hairpin mode (aka [reflective relay](https://lwn.net/Articles/347344/)) on the WLAN interface, meaning packets arriving on that interface can be 'reflected' back out through the same interface.
6867

6968
`run.sh` tries to handle this if `WIFI_HAIRPIN` is set to true, and prints a warning if it fails.
@@ -79,6 +78,10 @@ Additional containers that are run alongside OpenWrt on the same physical host a
7978

8079
See [Monitoring with InfluxDB + Grafana](monitoring/README.md) for example.
8180

81+
### Upgrading
82+
83+
Read the [upgrade guide](docs/upgrade.md).
84+
8285
---
8386

8487
### Troubleshooting

docs/upgrade.md

+63
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# Upgrade Guide
2+
3+
4+
All commands are executed on the host running the OpenWrt container
5+
unless otherwise specified.
6+
7+
Make a list of installed packages using the script provided in
8+
`etc/list-user-installed.sh`:
9+
10+
$ source openwrt.conf
11+
$ docker cp ./etc/list-user-installed.sh ${CONTAINER}:/tmp/
12+
$ docker exec $CONTAINER /tmp/list-user-installed.sh > packages
13+
14+
Make changes to `openwrt.conf` as necessary (refer to example).
15+
Some parameters may have changed.
16+
17+
Pull (or build) the latest image for your architecture:
18+
19+
$ docker pull $IMAGE:$TAG
20+
21+
OpenWrt contains a backup / restore utility called `sysupgrade`.
22+
Use it to make a configuration backup archive:
23+
24+
$ docker exec $CONTAINER sysupgrade --create-backup - > backup.tar.gz
25+
26+
Docker manages `/etc/hosts` as a bind mount. We need to ingore this file
27+
upon restore to avoid errors, so remove it from the archive:
28+
29+
$ gzip -cd backup.tar.gz | \
30+
tar --delete etc/hosts | \
31+
gzip > backup1.tar.gz
32+
$ mv backup1.tar.gz backup.tar.gz
33+
34+
**Confirm that all expected files are present in the archive before proceeding!**
35+
36+
At this point you may stop the old container:
37+
38+
docker stop $CONTAINER
39+
40+
As a precaution, it's recommended to rename the old container
41+
before deleting it outright:
42+
43+
$ docker rename $CONTAINER ${CONTAINER}-backup
44+
45+
Run the `make clean` target to ensure the new container gets created properly.
46+
47+
If using `systemd`, start the OpenWrt service with `systemctl start openwrt`.
48+
Otherwise, `make run`.
49+
50+
Restore the configuration:
51+
52+
$ cat backup.tar.gz | \
53+
docker exec -i $CONTAINER sysupgrade -v --restore-backup -
54+
55+
Install packages:
56+
57+
$ docker exec -t $CONTAINER opkg install $(cat packages)
58+
59+
Log in to your new OpenWrt instance and make sure everything is working. You may need to restart some services.
60+
61+
Once everything is confirmed working, it's safe to delete the backup container:
62+
63+
$ docker rm ${CONTAINER}-backup

0 commit comments

Comments
 (0)