Commit 93e613c5 authored by Franco Fichtner's avatar Franco Fichtner

etc: migrate more files

parent 4eaa3c9d
...@@ -172,11 +172,11 @@ function do_upgrade($path, $type) { ...@@ -172,11 +172,11 @@ function do_upgrade($path, $type) {
mark_subsystem_dirty('firmwarelock'); mark_subsystem_dirty('firmwarelock');
echo "\nOne moment please...\nInvoking firmware upgrade..."; echo "\nOne moment please...\nInvoking firmware upgrade...";
if($type == "bdiff") if($type == "bdiff")
mwexec_bg("/etc/rc.firmware delta_update $path"); mwexec_bg("/usr/local/etc/rc.firmware delta_update $path");
elseif($type == "nanobsd") elseif($type == "nanobsd")
mwexec_bg("/etc/rc.firmware pfSenseNanoBSDupgrade $path"); mwexec_bg("/usr/local/etc/rc.firmware pfSenseNanoBSDupgrade $path");
else else
mwexec_bg("/etc/rc.firmware pfSenseupgrade $path"); mwexec_bg("/usr/local/etc/rc.firmware pfSenseupgrade $path");
sleep(10); sleep(10);
while(is_subsystem_dirty('firmwarelock')) { while(is_subsystem_dirty('firmwarelock')) {
sleep(1); sleep(1);
......
...@@ -7,8 +7,8 @@ PRIOR_VERSION=`uname -r | cut -d'.' -f1` ...@@ -7,8 +7,8 @@ PRIOR_VERSION=`uname -r | cut -d'.' -f1`
echo $PRIOR_VERSION > /tmp/pre_upgrade_version echo $PRIOR_VERSION > /tmp/pre_upgrade_version
# Hack to workaround ticket #3749 # Hack to workaround ticket #3749
if [ "${PRIOR_VERSION}" = "8" ] && grep -q 'sh /etc/rc.reboot' /etc/rc.firmware; then if [ "${PRIOR_VERSION}" = "8" ] && grep -q 'sh /etc/rc.reboot' /usr/local/etc/rc.firmware; then
PROC=$(ps axwww | grep '/etc/rc.firmware *pfSenseupgrade') PROC=$(ps axwww | grep '/usr/local/etc/rc.firmware *pfSenseupgrade')
PID='' PID=''
IMG='' IMG=''
if [ -n "${PROC}" ]; then if [ -n "${PROC}" ]; then
...@@ -20,8 +20,8 @@ if [ "${PRIOR_VERSION}" = "8" ] && grep -q 'sh /etc/rc.reboot' /etc/rc.firmware; ...@@ -20,8 +20,8 @@ if [ "${PRIOR_VERSION}" = "8" ] && grep -q 'sh /etc/rc.reboot' /etc/rc.firmware;
cp -fp /bin/sh /tmp/sh.old cp -fp /bin/sh /tmp/sh.old
kill ${PID} >/dev/null 2>&1 kill ${PID} >/dev/null 2>&1
kill -9 ${PID} >/dev/null 2>&1 kill -9 ${PID} >/dev/null 2>&1
sed -i '' -e 's,sh /,/tmp/sh.old /,' /etc/rc.firmware sed -i '' -e 's,sh /,/tmp/sh.old /,' /usr/local/etc/rc.firmware
/etc/rc.firmware pfSenseupgrade "${IMG}" /usr/local/etc/rc.firmware pfSenseupgrade "${IMG}"
exit exit
fi fi
fi fi
......
...@@ -1673,12 +1673,11 @@ function sync_system_time() { ...@@ -1673,12 +1673,11 @@ function sync_system_time() {
} }
function system_halt() { function system_halt()
global $g; {
system_reboot_cleanup(); system_reboot_cleanup();
mwexec("/usr/bin/nohup /etc/rc.halt > /dev/null 2>&1 &"); mwexec("/usr/bin/nohup /usr/local/etc/rc.halt > /dev/null 2>&1 &");
} }
function system_reboot() { function system_reboot() {
......
#!/bin/sh #!/bin/sh
# /etc/rc.firmware
# originally part of m0n0wall (http://neon1.net/m0n0wall) # originally part of m0n0wall (http://neon1.net/m0n0wall)
# Copyright (C) 2005-2009 Scott Ullrich <sullrich@pfsense.org>. # Copyright (C) 2005-2009 Scott Ullrich <sullrich@pfsense.org>.
# Copyright (C) 2003 Manuel Kasper <mk@neon1.net>. # Copyright (C) 2003 Manuel Kasper <mk@neon1.net>.
...@@ -130,7 +129,7 @@ auto) ...@@ -130,7 +129,7 @@ auto)
touch /var/run/firmwarelock.dirty touch /var/run/firmwarelock.dirty
backup_chflags backup_chflags
remove_chflags remove_chflags
/etc/rc.firmware_auto /usr/local/etc/rc.firmware_auto
restore_chflags restore_chflags
/etc/rc.conf_mount_ro /etc/rc.conf_mount_ro
;; ;;
......
...@@ -54,12 +54,12 @@ if [ "$PMD" = "$MD" ]; then ...@@ -54,12 +54,12 @@ if [ "$PMD" = "$MD" ]; then
/usr/local/bin/php /etc/rc.conf_mount_rw /usr/local/bin/php /etc/rc.conf_mount_rw
fi fi
if [ -r "/tmp/custom.tgz" ]; then if [ -r "/tmp/custom.tgz" ]; then
sh /etc/rc.firmware pfSenseupgrade /tmp/latest.tgz /tmp/custom.tgz sh /usr/local/etc/rc.firmware pfSenseupgrade /tmp/latest.tgz /tmp/custom.tgz
else else
if [ "$PLATFORM" = "nanobsd" ]; then if [ "$PLATFORM" = "nanobsd" ]; then
sh /etc/rc.firmware pfSenseNanoBSDupgrade /tmp/latest.tgz sh /usr/local/etc/rc.firmware pfSenseNanoBSDupgrade /tmp/latest.tgz
else else
sh /etc/rc.firmware pfSenseupgrade /tmp/latest.tgz sh /usr/local/etc/rc.firmware pfSenseupgrade /tmp/latest.tgz
fi fi
fi fi
if [ "$PLATFORM" = "wrap" ]; then if [ "$PLATFORM" = "wrap" ]; then
......
...@@ -148,7 +148,7 @@ if ($_POST && !is_subsystem_dirty('firmwarelock')) { ...@@ -148,7 +148,7 @@ if ($_POST && !is_subsystem_dirty('firmwarelock')) {
else if (!file_exists($_FILES['ulfile']['tmp_name'])) { else if (!file_exists($_FILES['ulfile']['tmp_name'])) {
/* probably out of memory for the MFS */ /* probably out of memory for the MFS */
$input_errors[] = gettext("Image upload failed (out of memory?)"); $input_errors[] = gettext("Image upload failed (out of memory?)");
mwexec("/etc/rc.firmware disable"); mwexec("/usr/local/etc/rc.firmware disable");
clear_subsystem_dirty('firmware'); clear_subsystem_dirty('firmware');
} else { } else {
/* move the image so PHP won't delete it */ /* move the image so PHP won't delete it */
...@@ -180,15 +180,15 @@ if ($_POST && !is_subsystem_dirty('firmwarelock')) { ...@@ -180,15 +180,15 @@ if ($_POST && !is_subsystem_dirty('firmwarelock')) {
mark_subsystem_dirty('firmwarelock'); mark_subsystem_dirty('firmwarelock');
$savemsg = gettext("The firmware is now being updated. The firewall will reboot automatically."); $savemsg = gettext("The firmware is now being updated. The firewall will reboot automatically.");
if (stristr($_FILES['ulfile']['name'],"nanobsd") or $_POST['isnano'] == "yes") if (stristr($_FILES['ulfile']['name'],"nanobsd") or $_POST['isnano'] == "yes")
mwexec_bg("/etc/rc.firmware pfSenseNanoBSDupgrade {$g['upload_path']}/firmware.tgz"); mwexec_bg("/usr/local/etc/rc.firmware pfSenseNanoBSDupgrade {$g['upload_path']}/firmware.tgz");
else if(stristr($_FILES['ulfile']['name'],"bdiff")) else if(stristr($_FILES['ulfile']['name'],"bdiff"))
mwexec_bg("/etc/rc.firmware delta_update {$g['upload_path']}/firmware.tgz"); mwexec_bg("/usr/local/etc/rc.firmware delta_update {$g['upload_path']}/firmware.tgz");
else { else {
if($g['platform'] == "nanobsd") if($g['platform'] == "nanobsd")
$whichone = "pfSenseNanoBSDupgrade"; $whichone = "pfSenseNanoBSDupgrade";
else else
$whichone = "pfSenseupgrade"; $whichone = "pfSenseupgrade";
mwexec_bg("/etc/rc.firmware {$whichone} {$g['upload_path']}/firmware.tgz"); mwexec_bg("/usr/local/etc/rc.firmware {$whichone} {$g['upload_path']}/firmware.tgz");
unset($whichone); unset($whichone);
} }
} else } else
......
...@@ -186,7 +186,7 @@ if(!$latest_version) { ...@@ -186,7 +186,7 @@ if(!$latest_version) {
} }
/* launch external upgrade helper */ /* launch external upgrade helper */
$external_upgrade_helper_text = "/etc/rc.firmware "; $external_upgrade_helper_text = "/usr/local/etc/rc.firmware ";
if($g['platform'] == "nanobsd") if($g['platform'] == "nanobsd")
$external_upgrade_helper_text .= "pfSenseNanoBSDupgrade "; $external_upgrade_helper_text .= "pfSenseNanoBSDupgrade ";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment