diff options
author | Ermal Luçi <eri@pfsense.org> | 2009-06-30 17:11:30 +0000 |
---|---|---|
committer | Ermal Luçi <eri@pfsense.org> | 2009-06-30 17:15:22 +0000 |
commit | a368a026db2e79ef7c48f5db0fbff27da5468c26 (patch) | |
tree | 0b68b80cafa3f8cc310d8deaaa8a8fbd2e2f0482 /etc/rc.initial.firmware_update | |
parent | 6819b7f60c841f89e415d6547e2e776cf1a47c5e (diff) | |
download | pfsense-a368a026db2e79ef7c48f5db0fbff27da5468c26.zip pfsense-a368a026db2e79ef7c48f5db0fbff27da5468c26.tar.gz |
* Reorganize the 'apply' button infrustructure in the GUI.
- Present three new functions is/mark/clear_subsystem_dirty('name_of_subsystem'). This makes easier to create such things without needing to introduce new globals.
- Convert all pages to the new infrustructure
- This improves a lot the control on this notification
Diffstat (limited to 'etc/rc.initial.firmware_update')
-rwxr-xr-x | etc/rc.initial.firmware_update | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/etc/rc.initial.firmware_update b/etc/rc.initial.firmware_update index ec8aad5..cdbaa9b 100755 --- a/etc/rc.initial.firmware_update +++ b/etc/rc.initial.firmware_update @@ -2,18 +2,15 @@ <?php -$g['booting'] = true; require("globals.inc"); +$g['booting'] = true; echo "Starting the {$g['product_name']} console firmware update system"; require("functions.inc"); echo "."; -require("config.inc"); -echo "."; -$g['booting'] = false; -$d_fwupenabled_path = $g['varrun_path'] . "/fwup.enabled"; +$g['booting'] = false; $fp = fopen('php://stdin', 'r'); @@ -46,7 +43,7 @@ switch ($command) { $status = does_url_exist($url); if($status) { conf_mount_rw(); - touch($d_fwupenabled_path); + mark_subsystem_dirty('firmware'); if(file_exists("/root/firmware.tgz")) unlink("/root/firmware.tgz"); echo "\nFetching file size...\n"; @@ -116,7 +113,7 @@ switch ($command) { if(stristr($fp,"bdiff")) $type = "nanobsd"; if(file_exists($path)) { - touch($d_fwupenabled_path); + mark_subsystem_dirty('firmware'); do_upgrade($path, $type); } else { echo "\nCould not find file.\n\n"; @@ -163,7 +160,7 @@ function check_for_kernel_file() { function do_upgrade($path, $type) { global $g; - touch($g['varrun_path'] . "/firmware.lock"); + mark_subsystem_dirty('firmwarelock'); check_for_kernel_file(); echo "\nOne moment please...\nInvoking firmware upgrade..."; if($type == "bdiff") @@ -173,17 +170,16 @@ function do_upgrade($path, $type) { else mwexec_bg("/etc/rc.firmware pfSenseupgrade $path"); sleep(10); - while(file_exists("{$g['varrun_path']}/firmware.lock")) { + while(is_subsystem_dirty('firmwarelock')) { sleep(1); echo "."; } sleep(10); echo "Done. Rebooting...\n\n"; - if(file_exists($g['varrun_path'] . "/firmware.lock")) - unlink($g['varrun_path'] . "/firmware.lock"); + clear_subsystem_dirty('firmwarelock'); } exec("rm -f /root/*.md5"); fclose($fp); -?>
\ No newline at end of file +?> |