Updating OpenWrt

How would I go about updating OpenWrt to the release version from 18.06-rc1?

It is currently installed on a disk which is shared with Arch Linux via Grub.

Without knowing your full setup its tough to comment with anything concrete.

With that said:

  1. Backup the arch partition
  2. Download the sysupgrade image appropriate for your target (presume arm or x86_64)
  3. Copy the image to /tmp via scp, or login via luci and select upgrade in the gui https://openwrt.org/docs/guide-quick-start/sysupgrade.luci

Thanks for the help.

Regarding backing up the arch partition, what is the recommended way?

Can I just mount it under OpenWrt and create a tarball?

Possibly, but i wouldnt consider that backup being restorable (it might be but its not a way ive ever used myself)

Best to use dd. Search around the arch wiki. Their documentation is pretty solid

https://wiki.archlinux.org/index.php/disk_cloning

I'm not sure where to locate the correct image...

My /etc/openwrt_release contains:-

DISTRIB_ID='OpenWrt'
DISTRIB_RELEASE='18.06.0-rc1'
DISTRIB_REVISION='r7090-d2aa3a1b62'
DISTRIB_TARGET='x86/generic'
DISTRIB_ARCH='i386_pentium4'
DISTRIB_DESCRIPTION='OpenWrt 18.06.0-rc1 r7090-d2aa3a1b62'
DISTRIB_TAINTS=''

Should be this target;

https://downloads.openwrt.org/releases/18.06.1/targets/x86/generic/

Cant make any gurantees, if anything looks odd, pause and check/research further. Best of luck!

By the way, 18.06.2 is just about to be released. If you wait a few days you could skip 18.06.1 completely..

Thanks for the pointer, unfortunately I always get stuck at this point and don't know which of these files to select - I'm guessing it should be this one:-

https://downloads.openwrt.org/releases/18.06.1/targets/x86/generic/openwrt-18.06.1-x86-generic-generic-rootfs.tar.gz

Thanks. I think I need to practice doing a sysupgrade. I guess I can do another one later, and it should be a lot more straightforward.

Backup your configs in openwrt. And make a list of packages you installed.

Looks like the ‘upgrade’ is to simply overwrite the existing partions.

https://openwrt.org/docs/guide-user/installation/openwrt_x86

What does mount show ? Look for squashfs or ext4 beside /dev/sda2 . Then it should be just a case of extracting and writng the appropriate image with dd per the link above.

If you followed ext4 steps, then download the kernel image. (Squashfs image should contain eveverthing - nothing further to do) https://downloads.openwrt.org/releases/18.06.1/targets/x86/generic/openwrt-18.06.1-x86-generic-vmlinuz and copy it into place (check where its mounted, probably /boot) . There should be 16Mb total allocated there but if you run out of space just delete the old kernel image. Finally, update grub so it knows about the new kernel.

If its grub one. Just update the cfg file carefully with the name of the kernel you just downloaded.

If its grub2 follow a tutorial. Eg
https://linuxhint.com/grub2_mkconfig_tutorial/

Is there a file showing which pkgs have been installed? I presume 'opkg install' will take input from a list file...

Since I've been messing with OpenWrt I have made changes to configs on an adhoc basis and can only remember changing /etc/config/network... I guess I should make a copy of the /etc/config dir.

Have a read of this page. This link should take you to the section with a script to get all the customizations you have made.

https://openwrt.org/docs/guide-user/installation/generic.sysupgrade?s[]=opkg&s[]=reference#identifying_customizations

For future, id suggest doing what i do. I keep notes on everything ive done, including packages installed, their configuration, ip addressing/routes, speedtests, profiles etc, so i can follow that in the event i need to rebuild (or troubleshoot something and then rollback)

This updating OpenWrt seems a lot more complicated than I had imagined...

My main problem is that I have a disk which I'm dual booting with Arch Linux and I'd like to preserve that partition.

What I tried is to install OpenWrt (18.06.2) on a USB stick and modified it suit and then tried copying over the original OpenWrt partition, but that does not work as intended. It boots up but networking doesn't work so can't do anything with it.

Still no hints as to the file systems you're using for OpenWrt. You should be able to manage them from the Arch Linux environment, perhaps after installing the proper tooling.

 Device       Boot         Start         End     Sectors    Size  Id Type
>>  /dev/sda1    *              512       33279       32768     16M  83 Linux   
    /dev/sda2                 33792   143394815   143361024   68.4G  83 Linux
    /dev/sda3             143394816   195371007    51976192   24.8G  83 Linux

This is my disk with 3 ext4 partitions. sda2 is OpenWrt sda3 is Arch Linux.
It took me while getting this configured... Maybe I should start from scratch by installing OpenWrt then creating a partition for Arch and restoring it...

You should be able to sudo mount /dev/sda2 /mnt (or some mount point of your choice) and read and write from that disk from Arch Linux. All the standard tools of a Linux-based OS are at your disposal.

Mounting is not the problem. It's installing OpenWrt on a particular partition.

I've installed it onto a USB stick and it works, but when I copy it to the target partition there is something missing... maybe the UUID or such need to be changed... Whatever it is, the NIC driver doesn't load.

Have you updated grub? It's not completely clear if the updated OpenWrt instance boots at all.

Without seeing the logs, "the NIC driver doesn't load" is pretty vague.

OpenWrt boots up... what should I look for in the logs... presumably you mean dmesg... Is there anything else?

I'm reluctant to post dmesg as its 42K

Why you believe that the kernel isn’t properly scanning for the network device and attaching the proper driver.