[Solved] Upgrading OpenWrt from CLI

Hi,

When following this guide; https://openwrt.org/docs/guide-user/installation/sysupgrade.cli

I can't seem to get step 4 to work. When I run step 3, I dont get the expected "FILE_NAME: OK" in my command window output. Does this guide need ammending or is it perhaps that the image I am using is not a sysupgrade file and therefore not going to work anyway?

This is the upgrade .bin file I am using;
https://downloads.openwrt.org/releases/18.06.4/targets/brcm47xx/mips74k/openwrt-18.06.4-brcm47xx-mips74k-linksys-e1200-v1-squashfs.bin

I can actually follow the guide and run sysupgrade -v /tmp/*.bin and get a successfull upgrade, I'm just unable to verify the firmware checksum.

Router: Linksys E1200
Software: Openwrt 18.06.2

Thanks.

It wouldn't be literally "FILE_NAME" it would be the name of the file.

You can run sha256sum on one file, which prints the sum on standard output, then manually compare your result to the one on the download web page.

1 Like

Thanks mk24, there is a chance I have massively overlooked this somehow and have been looking for FILE_NAME as you say!!!

I will check again this evening, and report back ..

Hi, this is the output when running step 3

cd /tmp;wget $DOWNLOAD_LINK;wget $SHA256SUMS;sha256sum -c sha256
sums 2>/dev/null|grep OK
Downloading 'http://downloads.openwrt.org/releases/18.06.4/targets/brcm47xx/mips74k/openwrt-18.06.4-brcm47xx-mips74k-linksys-e1200-v1-squashfs.bin'
Connecting to 176.9.48.73:80
Writing to 'openwrt-18.06.4-brcm47xx-mips74k-linksys-e1200-v1-squashfs.bin'
openwrt-18.06.4-brcm 100% |*******************************|  3588k  0:00:00 ETA
Download completed (3674144 bytes)
Downloading 'http://downloads.openwrt.org/releases/18.06.4/targets/brcm47xx/mips74k/'
Connecting to 176.9.48.73:80
Writing to 'mips74k'

Download completed (19301 bytes)

This is becoming extremely complex:

#change to tmp directory
cd /tmp

#download image
wget http://downloads.openwrt.org/releases/18.06.4/targets/brcm47xx/mips74k/openwrt-18.06.4-brcm47xx-mips74k-linksys-e1200-v1-squashfs.bin

#the result of the checksum should match the sum found listed here - http://downloads.openwrt.org/releases/18.06.4/targets/brcm47xx/mips74k
sha256sum openwrt-18.06.4-brcm47xx-mips74k-linksys-e1200-v1-squashfs.bin 

#if it matches, run sysupgrade
sysupgrade openwrt-18.06.4-brcm47xx-mips74k-linksys-e1200-v1-squashfs.bin
1 Like

Hi, Thanks both, I can see how to do this the manual way.

My original question was supposed to be, if you follow the guide and input

cd /tmp;wget $DOWNLOAD_LINK;wget $SHA256SUMS;sha256sum -c sha256
sums 2>/dev/null|grep OK

I dont get an output and therefore cant match a checksum

Doesn't look like you followed the instructions for step 2 correctly.

Step 3 only works if you complete step 2 correctly

For example in Step 2 it says

Set the following variables to the download address of your OpenWrt firmware file (you must customize the URL!):

DOWNLOAD_LINK="http://URLOFFIRMWAREBIN"; SHA256SUMS="lhttp://URLOFSHA256"

You should do this ( in your example above it looks like you forget the sha256sums at the end )

DOWNLOAD_LINK="https://downloads.openwrt.org/releases/18.06.4/targets/brcm47xx/mips74k/openwrt-18.06.4-brcm47xx-mips74k-linksys-e1200-v1-squashfs.bin"
SHA256SUMS="https://downloads.openwrt.org/releases/18.06.4/targets/brcm47xx/mips74k/sha256sums"
1 Like

Ok, you are correct, I did not add sha256sums at the end. Thanks.

I guess I didnt know the difference between;

https://downloads.openwrt.org/releases/18.06.4/targets/brcm47xx/mips74k/
https://downloads.openwrt.org/releases/18.06.4/targets/brcm47xx/mips74k/sha256sums

as I thought the URL I used had the checksums in plain sight but whatever I get it now. topic can be closed!

Thanks.

It is at the bottom of the download page
image

1 Like
1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.