bugfix: We need to only pull a small selection of files over through sysupgrade instead of all config files.

opkg config can cause issues on OS upgrade among others.

ref AREDN->ticket:131
This commit is contained in:
Conrad Lara - KG6JEI 2015-07-09 09:25:00 -07:00
parent 8eabf6ad00
commit d7be9104d9
2 changed files with 60 additions and 1 deletions

View File

@ -0,0 +1,32 @@
# This file contains a list of files to retain over a sysupgrade with "Keep Settings" in the GUI.
# This list will be used instead of the list normally used by sysupgrade.
/etc/config/
/etc/config.ap/_setup
/etc/config.ap/_setup.dhcp
/etc/config.ap/_setup.ports
/etc/config.client/_setup
/etc/config.client/_setup.dhcp
/etc/config.client/_setup.ports
/etc/config.mesh_ap/_setup
/etc/config.mesh_ap/_setup.dhcp
/etc/config.mesh_ap/_setup.ports
/etc/config.mesh/_setup
/etc/config.mesh/_setup.dhcp.dmz
/etc/config.mesh/_setup.dhcp.nat
/etc/config.mesh/_setup.ports.dmz
/etc/config.mesh/_setup.ports.nat
/etc/config.mesh/_setup.services.dmz
/etc/config.mesh/_setup.services.nat
/etc/config.router/_setup
/etc/config.router/_setup.dhcp
/etc/config.router/_setup.ports
/etc/dropbear/dropbear_dss_host_key
/etc/dropbear/dropbear_rsa_host_key
/etc/firewall.user
/etc/group
/etc/hosts
/etc/httpd.conf
/etc/local/services
/etc/local/uci/hsmmmesh
/etc/passwd
/etc/shadow

View File

@ -228,6 +228,33 @@ if($fw_install and -f "$tmpdir/firmware")
{
if ( $parms{checkbox_keep_settings} )
{
open (my $SYSUPGRADECONF, "/etc/arednsysupgrade.conf") or die "Failed to open arednsysupgrade.conf";
open (my $TMPSYSUPGRADECONF, '>', "/tmp/sysupgradefilelist") or die "Failed to open TMPSYSUPGRADECONF";
while (<$SYSUPGRADECONF>){
chomp;
next if /^\#/ ;
if ( -e "$_" ) {
print $TMPSYSUPGRADECONF "$_\n";
}
}
close $SYSUPGRADECONF;
close $TMPSYSUPGRADECONF;
system("tar -czf /tmp/arednsysupgradebackup.tgz -T /tmp/sysupgradefilelist");
if ($? == 1) {
print "
<center><h2>ERROR: Could not backup filesystem.</h2>
<h3>An error occured trying to backup the file system
</center>
";
page_footer();
print "</body></html>";
exit 1;
}
system("rm -f /tmp/sysupgradefilelist");
nvram_set("nodeupgraded","1");
print "
<center><h2>Firmware will be written in the background.</h2>
@ -240,7 +267,7 @@ When the Status 4 LED is solid on you can get your new DHCP lease and reconnect
(This page will automatically reload in 2&frac12; minutes)</h3>
</center></body></html>
";
open(FILE, "/sbin/sysupgrade -q $tmpdir/firmware 2>&1 |") or die;
open(FILE, "/sbin/sysupgrade -f /tmp/arednsysupgradebackup.tgz -q $tmpdir/firmware 2>&1 |") or die;
}
else
{