ar71xx: Fix sysupgrades for Allnet and OpenMesh devices
authorGabor Juhos <juhosg@openwrt.org>
Sun, 20 Oct 2013 15:59:05 +0000 (15:59 +0000)
committerGabor Juhos <juhosg@openwrt.org>
Sun, 20 Oct 2013 15:59:05 +0000 (15:59 +0000)
Both Allnet and OpenMesh sysupgrade uses fw_setenv from uboot-envtools to
change different settings in the uboot environment. uboot-envtools version
2013.01 introduced a filesystem lock "/var/lock/fw_printenv.lock" to guarantee
mutually exclusive access to the uboot environment. But the path /var doesn't
exist on the sysupgrade ramfs.

An upgrade on these devices fails since r36033 ("[package] uboot-envtools:
upgrade to version 2013.01.01") with following messages:

 Error opening lock file /var/lock/fw_printenv.lock
 failed to update U-Boot environment

Creating the "/var/lock" path before running fw_setenv is therefore a
requirement unless the locking functionality in fw_setenv is removed or
replaced with optional locking.

Signed-off-by: Sven Eckelmann <sven@open-mesh.com>
Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
SVN-Revision: 38483

target/linux/ar71xx/base-files/lib/upgrade/allnet.sh
target/linux/ar71xx/base-files/lib/upgrade/openmesh.sh

index 9a375ff19d2ad94d46508e516c0f8c192e428158..98b368d15055f1864f1a60582cac3a8732973326 100644 (file)
@@ -4,9 +4,11 @@
 # a minimal web-interface for flashing a new firmware.
 
 # make sure we got uboot-envtools and fw_env.config copied over to the ramfs
 # a minimal web-interface for flashing a new firmware.
 
 # make sure we got uboot-envtools and fw_env.config copied over to the ramfs
+# create /var/lock for the lock "fw_setenv.lock" of fw_setenv
 platform_add_ramfs_ubootenv() {
        [ -e /usr/sbin/fw_printenv ] && install_bin /usr/sbin/fw_printenv /usr/sbin/fw_setenv
        [ -e /etc/fw_env.config ] && install_file /etc/fw_env.config
 platform_add_ramfs_ubootenv() {
        [ -e /usr/sbin/fw_printenv ] && install_bin /usr/sbin/fw_printenv /usr/sbin/fw_setenv
        [ -e /etc/fw_env.config ] && install_file /etc/fw_env.config
+       mkdir -p $RAM_ROOT/var/lock
 }
 append sysupgrade_pre_upgrade platform_add_ramfs_ubootenv
 
 }
 append sysupgrade_pre_upgrade platform_add_ramfs_ubootenv
 
index 5179875fe04bfbf3f2603a85e9be5ceba8954073..fb8ef191f77f7fa49f3842d49d193939fd304794 100644 (file)
@@ -27,10 +27,12 @@ cfg_value_get()
 }
 
 # make sure we got uboot-envtools and fw_env.config copied over to the ramfs
 }
 
 # make sure we got uboot-envtools and fw_env.config copied over to the ramfs
+# create /var/lock for the lock "fw_setenv.lock" of fw_setenv
 platform_add_ramfs_ubootenv()
 {
        [ -e /usr/sbin/fw_printenv ] && install_bin /usr/sbin/fw_printenv /usr/sbin/fw_setenv
        [ -e /etc/fw_env.config ] && install_file /etc/fw_env.config
 platform_add_ramfs_ubootenv()
 {
        [ -e /usr/sbin/fw_printenv ] && install_bin /usr/sbin/fw_printenv /usr/sbin/fw_setenv
        [ -e /etc/fw_env.config ] && install_file /etc/fw_env.config
+       mkdir -p $RAM_ROOT/var/lock
 }
 append sysupgrade_pre_upgrade platform_add_ramfs_ubootenv
 
 }
 append sysupgrade_pre_upgrade platform_add_ramfs_ubootenv