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) {
mark_subsystem_dirty('firmwarelock');
echo "\nOne moment please...\nInvoking firmware upgrade...";
if($type == "bdiff")
mwexec_bg("/etc/rc.firmware delta_update $path");
mwexec_bg("/usr/local/etc/rc.firmware delta_update $path");
elseif($type == "nanobsd")
mwexec_bg("/etc/rc.firmware pfSenseNanoBSDupgrade $path");
mwexec_bg("/usr/local/etc/rc.firmware pfSenseNanoBSDupgrade $path");
else
mwexec_bg("/etc/rc.firmware pfSenseupgrade $path");
mwexec_bg("/usr/local/etc/rc.firmware pfSenseupgrade $path");
sleep(10);
while(is_subsystem_dirty('firmwarelock')) {
sleep(1);
......
......@@ -7,8 +7,8 @@ PRIOR_VERSION=`uname -r | cut -d'.' -f1`
echo $PRIOR_VERSION > /tmp/pre_upgrade_version
# Hack to workaround ticket #3749
if [ "${PRIOR_VERSION}" = "8" ] && grep -q 'sh /etc/rc.reboot' /etc/rc.firmware; then
PROC=$(ps axwww | grep '/etc/rc.firmware *pfSenseupgrade')
if [ "${PRIOR_VERSION}" = "8" ] && grep -q 'sh /etc/rc.reboot' /usr/local/etc/rc.firmware; then
PROC=$(ps axwww | grep '/usr/local/etc/rc.firmware *pfSenseupgrade')
PID=''
IMG=''
if [ -n "${PROC}" ]; then
......@@ -20,8 +20,8 @@ if [ "${PRIOR_VERSION}" = "8" ] && grep -q 'sh /etc/rc.reboot' /etc/rc.firmware;
cp -fp /bin/sh /tmp/sh.old
kill ${PID} >/dev/null 2>&1
kill -9 ${PID} >/dev/null 2>&1
sed -i '' -e 's,sh /,/tmp/sh.old /,' /etc/rc.firmware
/etc/rc.firmware pfSenseupgrade "${IMG}"
sed -i '' -e 's,sh /,/tmp/sh.old /,' /usr/local/etc/rc.firmware
/usr/local/etc/rc.firmware pfSenseupgrade "${IMG}"
exit
fi
fi
......
......@@ -1673,12 +1673,11 @@ function sync_system_time() {
}
function system_halt() {
global $g;
function system_halt()
{
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() {
......
#!/bin/sh
# /etc/rc.firmware
# originally part of m0n0wall (http://neon1.net/m0n0wall)
# Copyright (C) 2005-2009 Scott Ullrich <sullrich@pfsense.org>.
# Copyright (C) 2003 Manuel Kasper <mk@neon1.net>.
......@@ -130,7 +129,7 @@ auto)
touch /var/run/firmwarelock.dirty
backup_chflags
remove_chflags
/etc/rc.firmware_auto
/usr/local/etc/rc.firmware_auto
restore_chflags
/etc/rc.conf_mount_ro
;;
......
......@@ -54,12 +54,12 @@ if [ "$PMD" = "$MD" ]; then
/usr/local/bin/php /etc/rc.conf_mount_rw
fi
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
if [ "$PLATFORM" = "nanobsd" ]; then
sh /etc/rc.firmware pfSenseNanoBSDupgrade /tmp/latest.tgz
sh /usr/local/etc/rc.firmware pfSenseNanoBSDupgrade /tmp/latest.tgz
else
sh /etc/rc.firmware pfSenseupgrade /tmp/latest.tgz
sh /usr/local/etc/rc.firmware pfSenseupgrade /tmp/latest.tgz
fi
fi
if [ "$PLATFORM" = "wrap" ]; then
......
......@@ -148,7 +148,7 @@ if ($_POST && !is_subsystem_dirty('firmwarelock')) {
else if (!file_exists($_FILES['ulfile']['tmp_name'])) {
/* probably out of memory for the MFS */
$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');
} else {
/* move the image so PHP won't delete it */
......@@ -180,15 +180,15 @@ if ($_POST && !is_subsystem_dirty('firmwarelock')) {
mark_subsystem_dirty('firmwarelock');
$savemsg = gettext("The firmware is now being updated. The firewall will reboot automatically.");
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"))
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 {
if($g['platform'] == "nanobsd")
$whichone = "pfSenseNanoBSDupgrade";
else
$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);
}
} else
......
......@@ -186,7 +186,7 @@ if(!$latest_version) {
}
/* launch external upgrade helper */
$external_upgrade_helper_text = "/etc/rc.firmware ";
$external_upgrade_helper_text = "/usr/local/etc/rc.firmware ";
if($g['platform'] == "nanobsd")
$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