Dear Developers,

I am a quite happy user of the cerowrt "fork" of openwrt. Cerowrt users noticed 
some time ago that sysupgrade from the command line did not work anymore. We 
found the root cause mount-utils. It turns out busy box's /bin/mount has 
slightly different calling arguments than mount-utils /usr/bin/mount due to 
which 


Here is an example of the failure:
root@nacktmulle:~# sysupgrade -d 60 -n -v /tmp/3.10.21-1-sysupgrade.bin 
killall: watchdog: no process killed
Sending TERM to remaining processes ... udhcpc lighttpd crond lighttpd snmpd 
xinetd dbus-daemon odhcp6c zebra babeld watchquagga avahi-daemon rngd ntpd pimd 
minissdpd dnsmasq sh ubusd askfirst netifd 
Sending KILL to remaining processes ... ubusd askfirst 
Switching to ramdisk...
mount:  /proc is not a block device
umount: /tmp/root: not mounted
Failed to switch over to ramfs. Please reboot.
root@nacktmulle:~# 

As you can see this did not work. After a reboot I removed the mount-utils 
packet:
root@nacktmulle:~# sysupgrade -d 60 -n -v /tmp3.10.21-1-sysupgrade.bin 
killall: watchdog: no process killed
Sending TERM to remaining processes ... udhcpc lighttpd crond lighttpd snmpd 
xinetd dbus-daemon odhcp6c zebra babeld watchquagga avahi-daemon rngd ntpd pimd 
minissdpd dnsmasq ubusd askfirst netifd 
Sending KILL to remaining processes ... ubusd askfirst 
Switching to ramdisk...
Performing system upgrade...
Unlocking firmware ...

Writing from <stdin> to firmware ...     
Upgrade completed

So this works…

It turns out that /lib/upgrade/common.sh contains:
supivot() { # <new_root> <old_root>
        mount | grep "on $1 type" 2>&- 1>&- || mount -o bind $1 $1
        mkdir -p $1$2 $1/proc $1/sys $1/dev $1/tmp $1/overlay && \
        mount -o noatime,move /proc $1/proc && \
        pivot_root $1 $1$2 || {
        umount -l $1 $1
                return 1
        }

        mount -o noatime,move $2/sys /sys
        mount -o noatime,move $2/dev /dev
        mount -o noatime,move $2/tmp /tmp
        mount -o noatime,move $2/overlay /overlay 2>&-
        return 0
}

And this fails to mount /proc if /usr/bin/mount precedes /usr/bin/mount in the 
path. So the workaround is to remove mount-utils before running sysupgrade, but 
a better fix would be to make sysupgrade more robust, by simply replacing all 
invocations of "mount" with "/usr/mount" or "busy box mount", unless 
mount-utils is deprecated.



Best Regards
        Sebastian Moeller
_______________________________________________
openwrt-devel mailing list
[email protected]
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel

Reply via email to