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
0fd2743e
Commit
0fd2743e
authored
Oct 05, 2016
by
Franco Fichtner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rc: add firmware upgrade bits for major bump
parent
2d2df026
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
38 additions
and
20 deletions
+38
-20
rc.firmware
src/etc/rc.firmware
+0
-6
rc.firmware.subr
src/etc/rc.firmware.subr
+20
-11
rc.initial.firmware
src/etc/rc.initial.firmware
+18
-3
No files found.
src/etc/rc.firmware
View file @
0fd2743e
...
...
@@ -29,12 +29,6 @@ LOCKFILE="/tmp/pkg_upgrade.progress"
FLOCK
=
"/usr/local/bin/flock"
ARGS
=
"-n -o
${
LOCKFILE
}
"
if
[
!
-f
${
FLOCK
}
]
;
then
# backwards-compat to be removed post-16.7
/usr/local/etc/rc.firmware.subr
"
${
@
}
"
exit
0
fi
if
!
${
FLOCK
}
${
ARGS
}
/usr/local/etc/rc.firmware.subr
"
${
@
}
"
;
then
echo
"A firmware update is currently in progress."
fi
src/etc/rc.firmware.subr
View file @
0fd2743e
...
...
@@ -32,21 +32,30 @@ TEE="/usr/bin/tee -a"
:
>
${
LOCKFILE
}
echo
"***GOT REQUEST TO UPGRADE
: all
***"
>>
${
LOCKFILE
}
echo
"***GOT REQUEST TO UPGRADE***"
>>
${
LOCKFILE
}
# upgrade all packages if possible
opnsense-update
-p
2>&1 |
${
TEE
}
${
LOCKFILE
}
if
[
-z
"
${
1
}
"
]
;
then
# upgrade all packages if possible
opnsense-update
-p
2>&1 |
${
TEE
}
${
LOCKFILE
}
# trigger a webgui restart to cope with changes
/usr/local/etc/rc.restart_webgui 2>&1 |
${
TEE
}
${
LOCKFILE
}
# trigger a webgui restart to cope with changes
/usr/local/etc/rc.restart_webgui 2>&1 |
${
TEE
}
${
LOCKFILE
}
# if we can update base, we'll do that as well
if
opnsense-update
-c
;
then
# if we can update base, we'll do that as well
if
opnsense-update
-c
;
then
if
opnsense-update
-bk
2>&1 |
${
TEE
}
${
LOCKFILE
}
;
then
echo
'***REBOOT***'
>>
${
LOCKFILE
}
sleep
5
/usr/local/etc/rc.reboot
fi
fi
elif
[
"
${
1
}
"
=
"upgrade"
-a
-n
"
${
2
}
"
]
;
then
# upgrade to a major release
if
opnsense-update
-ur
${
2
}
2>&1 |
${
TEE
}
${
LOCKFILE
}
;
then
echo
'***REBOOT***'
>>
${
LOCKFILE
}
sleep
5
/usr/local/etc/rc.reboot
fi
fi
echo
'***DONE***'
>>
${
LOCKFILE
}
src/etc/rc.initial.firmware
View file @
0fd2743e
...
...
@@ -27,8 +27,23 @@
set
-e
echo
"This will automatically fetch all available updates, apply them,"
echo
-n
"and reboot if necessary. Proceed with this action? [y/N]: "
UPGRADE
=
"/usr/local/opnsense/firmware-upgrade"
ARGS
=
if
[
-f
${
UPGRADE
}
]
;
then
NAME
=
$(
cat
${
UPGRADE
}
)
echo
"A major firmware upgrade is available for this installation:
${
NAME
}
"
echo
echo
"Make sure you have read the release notes and migration guide before"
echo
"attempting this upgrade. Around 200MB will need to be downloaded and"
echo
-n
"require 500MB of free space. Proceed with this action? [y/N]: "
ARGS
=
"upgrade
${
NAME
}
"
else
echo
"This will automatically fetch all available updates, apply them,"
echo
-n
"and reboot if necessary. Proceed with this action? [y/N]: "
fi
read
YN
case
${
YN
}
in
...
...
@@ -41,4 +56,4 @@ esac
echo
/usr/local/etc/rc.firmware
/usr/local/etc/rc.firmware
${
ARGS
}
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