The newest openwrt-x86-64-generic-ext4-combined.img upgrade failed

Upgrade from openwrt-x86-64-generic-ext4-combined.img(v5.4.71-r14718-4a0688ed71) to
openwrt-x86-64-generic-ext4-combined.img(v5.4.72-r14818-237f708b3c)
will timeout and ping no answer. But upgrade with openwrt-x86-64-generic-squashfs-combined.img is OK.
And I find the reason is that https://git.openwrt.org/?p=openwrt/openwrt.git;a=commitdiff;h=2dffadece9a7243a236ce7d91719787a671e23d4
Move /var/run/ubus.sock to /var/run/ubus/ubus.sock in preparation for
having ubusd run as non-root user.
sysupgrade with ext4-combined img will not apply this changes into /etc/config/rpcd.
To resolve this, you need edit /etc/config/rpcd before you do sysupgarde.

diff -Naur dfmpv2/b4/etc/config/rpcd dfmpv2/aft/etc/config/rpcd
@@ -1,6 +1,7 @@
+
 config rpcd
-       option socket /var/run/ubus.sock
-       option timeout 30
+       option timeout '30'
+       option socket '/var/run/ubus/ubus.sock'

 config login
        option username 'root'

You may also do the same with files 'group' 'passwd' 'shadow'

diff -Naur dfmpv2/b4/etc/group dfmpv2/aft/etc/group
@@ -11,3 +11,5 @@
 nogroup:x:65534:
 dnsmasq:x:453:dnsmasq
 sshd:x:22:sshd
+ntp:x:123:ntp
+ubus:x:81:ubus
diff -Naur dfmpv2/b4/etc/passwd dfmpv2/aft/etc/passwd
@@ -5,3 +5,5 @@
 nobody:*:65534:65534:nobody:/var:/bin/false
 dnsmasq:x:453:453:dnsmasq:/var/run/dnsmasq:/bin/false
 sshd:x:22:22:sshd:/var/run/sshd:/bin/false
+ntp:x:123:123:ntp:/var/run/ntp:/bin/false
+ubus:x:81:81:ubus:/var/run/ubus:/bin/false
diff -Naur dfmpv2/b4/etc/shadow dfmpv2/aft/etc/shadow
@@ -5,3 +5,5 @@
 nobody:*:0:0:99999:7:::
 dnsmasq:x:0:0:99999:7:::
 sshd:x:0:0:99999:7:::
+ntp:x:0:0:99999:7::
+ubus:x:0:0:99999:7::

I think the better way is to improve sysupgrade work better with ext4-combined format.

1 Like

yes... ext4 with keep settings has been broken for several days...

for me... ubus sock was not an issue... although a hacked password migration was needed

80_mount_root ext4 keepsetting workaround
vert@zr:/fs/sdd1/openwrt/RTNGext/cache/files-postinstall/files-community$ cat lib/preinit/80_mount_root 
#!/bin/sh
# Copyright (C) 2006 OpenWrt.org
# Copyright (C) 2010 Vertical Communications


missing_lines() {
	local file1 file2 line
	file1="$1"
	file2="$2"
	oIFS="$IFS"
	IFS=":"
	while read line; do
		set -- $line
		grep -q "^$1:" "$file2" || echo "$*"
	done < "$file1"
	IFS="$oIFS"
}






do_mount_root() {
	mount_root
	boot_run_hook preinit_mount_root
	[ -f /sysupgrade.tgz ] && {
		echo "- config restore -"

		cp /etc/passwd /tmp/
		cp /etc/group /tmp/
		cp /etc/shadow /tmp/
        
        cd /
		tar xzf /sysupgrade.tgz
		missing_lines /tmp/passwd /etc/passwd >> /etc/passwd
		missing_lines /tmp/group /etc/group >> /etc/group
		missing_lines /tmp/shadow /etc/shadow >> /etc/shadow
        
        
        rm /tmp/shadow 2>/dev/null
        rm /tmp/passwd 2>/dev/null
        rm /tmp/group 2>/dev/null
		
        
        # Prevent configuration corruption on a power loss
		sync
	}
}

[ "$INITRAMFS" = "1" ] || boot_hook_add preinit_main do_mount_root