Easiest way for package and OpenWrt sysupgrade

Hello,

is there any way to automate the update process for the installed packages? Currently, I need to start the update process manually and did not find any way to automate it.

The same question is for the upgrade process of OpenWRT. I Know, that this needs to be done manually and you can only keep your settings, but not the additional installed packages. Is there a way to receive any information, when a new version is available for my router model?
Additional question: What happens when the upgrade process goes wrong?

Thank your very much.

Cheers,
Lasko

yes you must add it schedule task:
00 01 * * * opkg update && opkg list-upgradable | cut -f 1 -d ' ' | xargs opkg upgrade

and before sysupgrade you must do (you could put in schedule task too):
00 02 * * * opkg list-installed | awk '{ printf "%s ",$1 }' > /etc/config/installed_packages
after sysupgrade all previously installed packages are stored as text in file /etc/config/installed_packages

after sysupgrade:
opkg update && for i in $(cat /etc/config/installed_packages); do opkg install $i; done

Easiest way to get the latest packages and latest updates is to make a diffconfig recipe and build the firmware the way you want it. It might seem daunting but is really not that bad. I sysupgrade with the firmware I build and have the latest packages + latest updates.

Here is an example for ipq806x devices:

2 Likes

That sounds like a quick way to trouble sooner or later.

Blind mass upgrade of all packages is never recommended.

(The flag "upgradable" just means that there is a newer version compiled, but that does not mean that there is something worthwhile. And trying to upgrade core packages can brick the router quite heavily)

4 Likes

+1 to @hnyman's comment. Please do not use opkg upgrade unless there is a reason and/or if you are willing to accept the risk that it may mess up your installation.

Upgrading packages (via the CLI opkg upgrade command or the LuCI Upgrade... button) can result in major problems. It is generally highly discouraged, unless you know what you are doing or if there is specific instruction to do so.

2 Likes

I thought those upgrades are like security fixes that need to be up to date all the time like normal linux packages. But to sum up, this is not the case?

That sounds pretty interesting - but to be honest I have no Idea to to do that, what it means and how to use it afterwards. Is there any kind of a beginners guide on this? My router is a Netgear R6220.

Correct. If there is a security issue that needs to be patched, you will see specific information and instructions regarding the remediation.

1 Like

Have a computer running one of these operating systems and packages (quick command line reference per operating system near bottom of wiki):

Here is the quick guide on building (you’ll see my build uses similar commands but uses a “diffconfig” file instead of make menuconfig to simplify the package selection):

1 Like

Thank you very much :smiley:

Thank you very much. One more question as I am not sure about that: Where can I find those information? Will they be shown in the software section of the Router or is there a special OpenWRT Webpage?

Right here.

1 Like

Perfect - Thanks a lot!

In the OpenWrt wiki: https://openwrt.org/advisory/start

1 Like

Is there any way I can add those information via RSS or Atom Feed into an RSS Reader to get them asap?

I have read both guides and it seems pretty easy. What I currently not get (I haven't build one by now): How to handle the additional packages and when they are part of the created image, will they only update themself or do I need to make any settings - in my case wpad-openssl, stubby, adblock - again?

Thank you for your help.

1 Like

awesome. Thank your very much!

I manage all my packages with a diffconfig file. It tells the build system what type of router to build for and what additional packages you want.

Your diffconfig if you are building for one device would start similar to this:


# Use "make defconfig" to expand this to a full .config
CONFIG_TARGET_ipq806x=y
CONFIG_TARGET_ipq806x_generic=y
CONFIG_TARGET_ipq806x_generic_DEVICE_netgear_r7800=y

# WLAN/WPS support
CONFIG_PACKAGE_hostapd-utils=y
CONFIG_PACKAGE_wpad-openssl=y
# CONFIG_PACKAGE_wpad-basic-wolfssl is not set
# CONFIG_PACKAGE_libustream-wolfssl is not set

# Luci (SSL from OpenSSL)
CONFIG_PACKAGE_luci-ssl-openssl=y
CONFIG_PACKAGE_luci-app-adblock=y

After you have built using the commands in the wiki you can rebuild any time you want to get updates. All the packages and everything are placed in a sysupgrade.bin file your bin folder (for easy loading on your router).

I have openwrt’s git set as “upstream”. You can see what all your repositories are by running:

git remote -v

I added openwrt as “upstream” with the following (blanking on what the default is, this might be repetitive):


git remote add upstream https://git.openwrt.org/openwrt/openwrt.git

To rebuild (when you want to update, the -j5 at the end is assuming a 4 CPU build system - adjust to your number of CPUs, ex: -j4 = 3 CPUs, -j5 = 4 CPUs, etc)


git fetch upstream && git rebase upstream/master && ./scripts/feeds update -a && ./scripts/feeds install -a && cp diffconfig .config && make defconfig

make -j5

1 Like

Great! Thank you very much.