Upgrade from OpenWrt to LEDE and save overlay

  • Which device I use?
    MT7620

  • Which system I use?
    OpenWRT-CC

I want to upgrade my device to LEDE-17.01. There is one problem that it will lose all saved config evenif checking in keep config files. The command I execute: sysupgrade -c -v /tmp/lede-17.01.bin. It boot up normally, but lose all config files which I have changed on OpenWRT-CC, it is same as upgrade without save config files. besides, I try to run mtd -j /tmp/sysupgrade.tgz write /tmp/lede-17.01.bin firmware, and dump the firmware partition hexdump -C /dev/mtd3 > /tmp/firmware. I see the file of sysupgrade.tgz have wrote to jffs2 filesystem. I press "f" to enter failsafe mode and execute mount_root done. Those errors result:

root@(none):/# mount_root done
[   14.270490] jffs2_scan_eraseblock(): End of filesystem marker found at 0x0
[   14.278710] jffs2_build_filesystem(): unlocking the mtd device... [   14.284877] done.
[   14.286844] jffs2_build_filesystem(): erasing all blocks after the end marker... [  116.137226] random: crng init done

[  318.794926] done.
[  318.796945] jffs2: notice: (391) jffs2_build_xattr_subsystem: complete building xattr subsystem, 0 of xdatum (0 unchecked, 0 orphan) and 0 of xref (0 dead, 0 orphan) found.
[  318.857395] mount_root: performing overlay whiteout
[  318.863954] mount_root: syncronizing overlay
[  318.877639] mount_root: failed to sync jffs2 overlay

Any insights are appreciated.

Thanks.

First, ensure you add all files and directories that contain customized files to /etc/sysupgrade.conf

  • For example:
      #
    
          ##::[[---  LEDE Sysupgrade Config ---]]::##
    
      ####################################################
                  ##----- Directories -----##
      ####################################################
    
      /etc/config/
      /etc/crontabs/
      /etc/mc/
      /etc/openvpn/
      /etc/samba/
      /etc/ssh/
      /etc/ssl/
      /root/
      /usr/share/nano/
      /www/
    
      ####################################################
                     ##----- Files -----##
      ####################################################
    
      /etc/banner.failsafe
      /etc/banner.security
      /etc/collectd.conf
      /etc/firewall.user
      /etc/group
      /etc/inputrc
      /etc/passwd
      /etc/profile
      /etc/rc.local
      /etc/shadow
      /etc/smartd.conf
      /etc/sysupgrade.conf
    
    

Then issue: sysupgrade -b /tmp/cc-config-backup.tar.gz

  • Ensure you copy that to a PC or USB drive

@JW0914 Thanks for your reply. The main question is that I don't want to copy backup files to PC or USB drive. sysupgrade with '-c' option will append the backup files to firmware partition with jffs2 filesystem. But I don't know why restore config is failed to upgrade to LEDE from OpenWRT.

There should be no apparent reason why the settings should be destroyed. 17.01 is a direct successor of 15.05.

but one thing is if your device (target) has have had major sysupgrade process changes in between. That can happen.

Quite another thing is that possibly the config itself has changed so much that it would actually make sense to create from scratch. For some targets it is so.

Between backing up your settings, reconfiguring from scratch (with your backup in hand, so to speak) and dirty flashing 17.01, then hoping everything keeps working, and having to start digging when something does not, I'd really prefer the former.

Sure, it will take some time; but you'll be sure something didn't break silently along the way.

1 Like

@hnyman Yes, it is strange. For AR9331 and AR9531 chipset, it is successful to upgrade to LEDE with save config files, but it is failed to MT7620 chip.

@Borromini The main question is upgrade to LEDE17.01 from OpenWRT on luci by saving specified configuration files. But those configuration files are lose when boot LEDE firmware.

That is why I suggest you back them up on your client, then execute a clean flash and reconfigure using the old config files (it's just a tarball) as a reference. That way, you're sure to minimise any incompatibilities which might arise due to changes under the hood between 15.05 and 17.01.

1 Like