Use system restore to install hotfixes

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|

Use system restore to install hotfixes

Me_3594
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: Use system restore to install hotfixes

Gnomad
Sounds reasonable, user8446 also suggested it here.  However, I just did a test "restoring" from a tar.gz that contained a single file /etc/test_BAD, and after the subsequent reboot the file was not present in the Shield's folder structure as I'd expected.  So the restore script may be doing something more than a simple tar -zxvf.  

Signing off for the night, but let you know if I get round to investigating further - insights from anyone else appreciated!
OpenWrt SNAPSHOT, r10391-3d8d528939
Reply | Threaded
Open this post in threaded view
|

Re: Use system restore to install hotfixes

hans2
I haven't looked at it yet, not sure what is easier - change these scripts or create a new page in LuCI.

/etc/sysupgrade.conf = list of files to backup
/sbin/sysupgrade = executable
/usr/lib/lua/luci/view/admin_system/ = folder with the htm files (?)

Maybe you can have a look at it?


No more: Shield Pro v1, Chaos Calmer, FW 1.51 SP1
Reply | Threaded
Open this post in threaded view
|

Re: Use system restore to install hotfixes

Gnomad
There's a action_flashops() function within /usr/lib/lua/luci/controller/admin/system.lua that looks to do the work from the htm file.  Within that it sets a command
local restore_cmd = "tar -xzC/ >/dev/null 2>&1"
but I can't see that this is executed at all.  The handler further down in the file looks like it just reboots only:
elseif luci.http.formvalue("restore") then
    -- Unpack received .tar.gz
    local upload = luci.http.formvalue("archive")
    if upload and #upload > 0 then
        luci.template.render("admin_system/applyreboot")
    --   luci.sys.reboot()
        luci.sys.call("reboot -f")
    end
elseif ...

No calls to /sbin/sysupgrade that I can see.  Any tips on syntax for a command to insert before the reboot, to try calling "restore_cmd" against "upload"?  
(been 15 years since I've done much unix flavoured scripting!)
OpenWrt SNAPSHOT, r10391-3d8d528939
Reply | Threaded
Open this post in threaded view
|

Re: Use system restore to install hotfixes

user8446
Administrator
In the meantime I checked it it does in fact save what you put in the config for a manual restore later.
Running in bridge mode, 1.51 SP1 fw
Reply | Threaded
Open this post in threaded view
|

Re: Use system restore to install hotfixes

hans2
Interesting to see that system.lua on Shield is very different from the OpenWRT Admin Full MOD

https://github.com/openwrt/luci/blob/master/modules/luci-mod-admin-full/luasrc/controller/admin/system.lua

What is the best way to merge these enhancements in Shield?
No more: Shield Pro v1, Chaos Calmer, FW 1.51 SP1
Reply | Threaded
Open this post in threaded view
|

Re: Use system restore to install hotfixes

Gnomad
Hi all, I've managed to code a fix.  
Try the updated system.lua from this pull request, let me know how it goes!  
OpenWrt SNAPSHOT, r10391-3d8d528939
Reply | Threaded
Open this post in threaded view
|

Re: Use system restore to install hotfixes

hans2
Some changes are instantaneous but for some you need to commit the changes

in CLI use "uci commit" followed by "/etc/init.d/uhttpd restart"

This should update the cache without the need for a reboot.
No more: Shield Pro v1, Chaos Calmer, FW 1.51 SP1
Reply | Threaded
Open this post in threaded view
|

Re: Use system restore to install hotfixes

user8446
Administrator
Since it appears that the shield LuCI version is modified, how would be bring back the standard options in the GUI such as package updating, etc.?
Running in bridge mode, 1.51 SP1 fw
Reply | Threaded
Open this post in threaded view
|

Re: Use system restore to install hotfixes

Gnomad
Seems a little easier said than done unfortunately.  My first attempt was to replace the whole file, but there are a number of dependencies - like the "post" function that the official current system.lua uses - that are missing.  Ideally, we'd need to find out the exact version that ITUS forked, then do our comparisons and restores from that.  Nice if we could get their repository & full change history somehow (anyone formerly ITUS listening? ;-)

Of course then that version also wouldn't have any of the bug fixes that LuCI people have been working on over the last X months, but that's a separate issue.

Maybe we can keep an eye on the Rhino Labs product to see if the hardware & firmware releases are compatible?  
For myself, keeping expectations low.. trying to be satisfied with cherry-picking things for now.
OpenWrt SNAPSHOT, r10391-3d8d528939
Reply | Threaded
Open this post in threaded view
|

Re: Use system restore to install hotfixes

user8446
Administrator
Gnomad-
I was finally able to test this out on a 2nd shield box I bought from another user. This saved me 2 hours of custom tweaks and mods... put in all the files in the backup config from my main box, change the file with your fix in the new box and after rebooting just restore with the backup file. Everything copies over and then reboots.

I would recommend everyone do a backup so if you ever need to default you can restore back to your custom config quickly!
Running in bridge mode, 1.51 SP1 fw
Reply | Threaded
Open this post in threaded view
|

Re: Use system restore to install hotfixes

breda
Hi user8446 can I use an image from another Shield to update my shield? wanted to see if that fixes the no internet connectivity in bridge mode? If so is it possible to drop box  a file to me ?

thanks
Reply | Threaded
Open this post in threaded view
|

Re: Use system restore to install hotfixes

user8446
Administrator
That's a great idea but I don't know where your issue is so I don't know which files to backup. I'm replying back on the original thread and then we can use this restore after that.
Running in bridge mode, 1.51 SP1 fw