diff --git a/etc/rc.initial.firmware_update b/etc/rc.initial.firmware_update index 3ece180a3a..5acfe40736 100755 --- a/etc/rc.initial.firmware_update +++ b/etc/rc.initial.firmware_update @@ -88,8 +88,10 @@ switch ($command) { echo "\nMD5 checksum matches.\n"; exec("rm -f /root/*.md5"); } + if(stristr($url,"bdiff")) + $type = "bdiff"; if(file_exists("/root/firmware.tgz")) - do_upgrade("/root/firmware.tgz"); + do_upgrade("/root/firmware.tgz", $type); } else { echo "\nCould not download update.\n\n"; fclose($fp); @@ -102,9 +104,11 @@ switch ($command) { fclose($fp); die; } + if(stristr($fp,"bdiff")) + $type = "bdiff"; if(file_exists($path)) { touch($d_fwupenabled_path); - do_upgrade($path); + do_upgrade($path, $type); } else { echo "\nCould not find file.\n\n"; fclose($fp); @@ -148,11 +152,14 @@ function check_for_kernel_file() { } } -function do_upgrade($path) { +function do_upgrade($path, $type) { global $fp; check_for_kernel_file(); echo "\nOne moment please... Invoking firmware upgrade...\n"; - exec("/etc/rc.firmware pfSenseupgrade $path"); + if($type == "bdiff") + exec("/etc/rc.firmware delta_update $path"); + else + exec("/etc/rc.firmware pfSenseupgrade $path"); unlink_if_exists($path); die; } diff --git a/usr/local/www/system_firmware.php b/usr/local/www/system_firmware.php index d23ccc7390..fe766e3f50 100755 --- a/usr/local/www/system_firmware.php +++ b/usr/local/www/system_firmware.php @@ -119,7 +119,10 @@ if ($_POST && !file_exists($d_firmwarelock_path)) { /* fire up the update script in the background */ touch($d_firmwarelock_path); $savemsg = "The firmware is now being updated. The firewall will reboot automatically."; - mwexec_bg("/etc/rc.firmware pfSenseupgrade {$g['upload_path']}/firmware.tgz"); + if(stristr($_FILES['ulfile']['tmp_name'],"bdiff")) + mwexec_bg("/etc/rc.firmware delta_update {$g['upload_path']}/firmware.tgz"); + else + mwexec_bg("/etc/rc.firmware pfSenseupgrade {$g['upload_path']}/firmware.tgz"); } else { $savemsg = "Firmware image missing or other error, please try again."; }