Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OpnSense
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kulya
OpnSense
Commits
93e613c5
Commit
93e613c5
authored
Dec 09, 2014
by
Franco Fichtner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
etc: migrate more files
parent
4eaa3c9d
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
19 additions
and
21 deletions
+19
-21
rc.initial.firmware_update
etc/rc.initial.firmware_update
+3
-3
pre_upgrade_command
tmp/pre_upgrade_command
+4
-4
system.inc
usr/local/etc/inc/system.inc
+3
-4
rc.firmware
usr/local/etc/rc.firmware
+1
-2
rc.firmware_auto
usr/local/etc/rc.firmware_auto
+3
-3
rc.halt
usr/local/etc/rc.halt
+0
-0
rc.shutdown
usr/local/etc/rc.shutdown
+0
-0
system_firmware.php
usr/local/www/system_firmware.php
+4
-4
system_firmware_auto.php
usr/local/www/system_firmware_auto.php
+1
-1
No files found.
etc/rc.initial.firmware_update
View file @
93e613c5
...
@@ -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
"
\n
One moment please...
\n
Invoking firmware upgrade..."
;
echo
"
\n
One moment please...
\n
Invoking 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
);
...
...
tmp/pre_upgrade_command
View file @
93e613c5
...
@@ -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
...
...
usr/local/etc/inc/system.inc
View file @
93e613c5
...
@@ -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
()
{
...
...
etc/rc.firmware
→
usr/local/
etc/rc.firmware
View file @
93e613c5
#!/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
;;
;;
...
...
etc/rc.firmware_auto
→
usr/local/
etc/rc.firmware_auto
View file @
93e613c5
...
@@ -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
...
...
etc/rc.halt
→
usr/local/
etc/rc.halt
View file @
93e613c5
File moved
etc/rc.shutdown
→
usr/local/
etc/rc.shutdown
View file @
93e613c5
File moved
usr/local/www/system_firmware.php
View file @
93e613c5
...
@@ -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
...
...
usr/local/www/system_firmware_auto.php
View file @
93e613c5
...
@@ -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 "
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment