[SOLVED] EspressoBin Board ext4 sd upgrade

Hye,

anyone is working or have a easy way to upgrade ext4 version of the LEDE/OpenWRT distrib ?

I have just finished some espressobin board with the 18.06, all works very well, but I may have lost some bugfixes from the new release 18.06.1.

Have I any other choices that building new installation from scratch ?

The upgrade is impossible with the ext4 tar in the luci/web.
Is there some command lines possible to get in the way of a soft and easy upgrade from 18.06 to 18.06.1 ?

At least on x86 it's possible to use the ext4 images with the sysupgrade command, and that preserves settings. There's no technical difference between an 'upgrade' image and a 'factory' image unlike on many embedded systems. It seems for your target that is the same - there's just one image.

I'd say: back up your settings (sysupgrade or the web UI allow you to do that, store them on your local system, then try sysupgrade /path/to/default.img. That looks like it should work.

Yes, thanks for the advice, I also had to get the packages list installed with the user script found on https://wiki.openwrt.org/doc/howto/generic.sysupgrade?s[]=listuserpackages

What I have done;

UPGRADE OPKG

root@BINBOARD:~# cat /root/listuserpackages.sh

#!/bin/ash
echo >&2 User-installed packages are the following:
sed -ne '/^Package:[[:blank:]]*/ {
s///
h
}
/user installed/ {
g
p
}' /usr/lib/opkg/status
/bin/ash /root/listuserpackages.sh /root/listuserinstalledpacakges.txt
opkg update
cat /root/listuserinstalledpacakges.txt | tr \\n \\0 | xargs -0 -n1 opkg upgrade

UPGRADE SYS

root@STARGATE:/tmp# sysupgrade -v -b /root/backup-owrt_1806220303.tar

root@STARGATE:/tmp# wget https://downloads.openwrt.org/releases/18.06.1/targets/mvebu/cortexa53/openwrt-18.06.1-mvebu-cortexa53-globalscale-espressobin-ext4-sdcard.img.gz

root@STARGATE:/tmp# gunzip openwrt-18.06.1-mvebu-cortexa53-globalscale-espressobin-ext4-sdcard.img.gz

root@STARGATE:/tmp# sysupgrade -v -F /tmp/openwrt-18.06.1-mvebu-cortexa53-globalscale-espressobin-ext4-sdcard.img

Then I lost the WIFI :wink: so I get back with a console access to the espressobin board

UPGRADE / REINSTALL PACKAGES

opkg update
cat /root/listuserinstalledpacakges.txt | tr \\n \\0 | xargs -0 -n1 opkg upgrade

RESULTS

18.06.1 applied easily to my espressobin board and with only some easy scripting to do a full and secure upgrade !
Just needed the console access to get the full process endup, and have to set the parameters of the files to backup (/root and /etc/openvpn)

The actual sysupgrade do a full replacement of the root partition.
With this method the only missing tweak is how to resize2fs the partition after upgrade ?

May be having some more choice like, replace the content only with a rsync may have help.

For now I have to do the resize2fs offline, it is not possible from the device itself when the rootfs is already mounted.

Why did you use -F?

The WiFi dying shouldn't happen (as in: I'd your settings were preserved it should come back up). So I assume the upgrade process didn't keep any of your settings?

I get an error without -F.
the common one of the check of the img saying it is not upgradable.
So I use the forced way.

I also lost the wifi because of the missing kmod after the upgrade...
I do not seing a way to get the upgrade of package in the first boot, in an automatic way.

The bad thing with the espresso bin and updating the ext4 sd OpenWRT is it format the all sd card.
If you have resized the rootfs partition or added a third partition to get an overlay, you will lost everything...
may be it is specific of the upgrade script of the espressobin board and might be fixed or enhanced.

That doesn't sound ideal at all. Having a quick look at the image code it looks like it's just a plain ext4 fs?

This is because You probably unpacked the image before serving it to sysupgrade. There is small json data appended at the end of the *.img.gz file which is parsed by sysupgrade, and will be lost if You unpack the image.

This is how all OpenWrt images work, they have preconfigured amount of packages and the official image always has the same set of them. You can prepare image beforehand with Image Builder.

That is correct with current OpenWrt master. Part of this series https://patchwork.ozlabs.org/patch/1060392 which I sent few days ago remedies this problem. You can fetch those patches applied to OpenWrt tree from here https://github.com/tmn505/openwrt/tree/ebin. Would be nice to hear some report after testing.

Sorry for the late answer...

Great works, thanks to you to get it better supported in OpenWRT.

I made a compilation from the master of today, with your patch series, v2, get from patchworks...
The eMMC from a V7 EBIN is not detected !...

How can I help to get this debugged ?

I have tested the dtb with the 18.06.2 and the dtb with the compiled image.
No luck...

Done more tests, and posted some results on your github commits

I have tested the daily 19-07 snapshot and now I get my overlay erased...

Do I miss something ?

next try from 19-07-DEVEL to 19-07-DEVEL looks fine, and the third partition was not erased !

GREAT

here the log of the console from a sysupgrade with the WEBUI;

root@OpenWrt:/# killall: telnetd: no process killed                                                                                                                                                   
killall: dropbear: no process killed                                                                                                                                                                  
Sending TERM to remaining processes ... rpcd dnsmasq netifd odhcpd ntpd sh ubus ubusd logd                                                                                                            
Sending KILL to remaining processes ...                                                                                                                                                               
Switching to ramdisk...                                                                                                                                                                               
[   90.241609] EXT4-fs (mmcblk0p2): re-mounted. Opts: (null)                                                                                                                                          
Performing system upgrade...                                                                                                                                                                          
Reading partition table from bootdisk...                                                                                                                                                              
0+1 records in                                                                                                                                                                                        
0+1 records out                                                                                                                                                                                       
zcat: write error: Broken pipe                                                                                                                                                                        
zcat: write: Broken pipe                                                                                                                                                                              
Reading partition table from image...                                                                                                                                                                 
2048+0 records in                                                                                                                                                                                     
2048+0 records out                                                                                                                                                                                    
zcat: write: Broken pipe                                                                                                                                                                              
Writing image to /dev/mmcblk0p1...                                                                                                                                                                    
zcat: write error: Broken pipe                                                                                                                                                                        
zcat: write: Broken pipe                                                                                                                                                                              
33280+0 records in                                                                                                                                                                                    
16+1 records out                                                                                                                                                                                      
Writing image to /dev/mmcblk0p2...                                                                                                                                                                    
524544+0 records in                                                                                                                                                                                   
256+1 records out                                                                                                                                                                                     
Writing new UUID to /dev/mmcblk0...                                                                                                                                                                   
4+0 records in                                                                                                                                                                                        
4+0 records out                                                                                                                                                                                       
zcat: write error: Broken pipe                                                                                                                                                                        
zcat: write: Broken pipe                                                                                                                                                                              
[  121.894063] EXT4-fs (mmcblk0p1): mounted filesystem without journal. Opts: (null)                                                                                                                  
Upgrade completed                                                                                                                                                                                     
Rebooting system...                                                                                                                                                                                   
umount: can't unmount /dev: Resource busy                                                                                                                                                             
umount: can't unmount /tmp: Resource busy                                                                                                                                                             
[  123.267113] reboot: Restarting system                                                                                                                                                              

next reboot after a sysupgrade, the /dev/mmcblk0p3 is still here ;
root@OpenWrt:/# ls /dev/mmcblk0*

mmcblk0       mmcblk0boot1  mmcblk0p2     mmcblk0rpmb                                                                                                                                                 
mmcblk0boot0  mmcblk0p1     mmcblk0p3

will be solved in 19-07 release !

but is not solved with the snapshots from today 2019 07 09; this one is erasing the partitions and get my /dev/mmcblk0p3 trashed !

I will try to search the commits missing from 19.07 or the commit which get the bug back in master !

ok : with 19.07
not ok : with master

I did not find any differences between master and 19.07 from the GIT.

My tests make a differences,

  • when I try to upgrade from 19 .07 to 19.07, the added third partition on the eMMC is preserved.
  • when I try to upgrade from 19.07 to snapshot (master) I get the third partition erased.

I can do more tests if needed but I am still confused about this bug.

Is anyone getting bad results of upgrade with the latest release...

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