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
b5c7f232
Commit
b5c7f232
authored
Jul 01, 2016
by
Franco Fichtner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
firmware: make ABI a bit more flexible and also register name
parent
e9cb6519
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
32 additions
and
10 deletions
+32
-10
+POST_INSTALL
+POST_INSTALL
+3
-0
Makefile
Makefile
+8
-2
tree.mk
Mk/tree.mk
+2
-0
system.inc
src/etc/inc/system.inc
+18
-7
origin.conf.sample.in
src/etc/pkg/repos/origin.conf.sample.in
+1
-1
No files found.
+POST_INSTALL
View file @
b5c7f232
...
...
@@ -32,7 +32,10 @@ mkdir -p /usr/local/opnsense/version
if [ -f /usr/local/opnsense/version/opnsense ]; then
mv /usr/local/opnsense/version/opnsense /usr/local/opnsense/version/opnsense.last
fi
echo "%%CORE_COMMIT%%" > /usr/local/opnsense/version/opnsense
echo "%%CORE_NAME%%" > /usr/local/opnsense/version/opnsense.name
echo "%%CORE_ABI%%" > /usr/local/opnsense/version/opnsense.abi
if /usr/local/etc/rc.d/configd status > /dev/null; then
/usr/local/etc/rc.d/configd restart
...
...
Makefile
View file @
b5c7f232
...
...
@@ -45,10 +45,12 @@ CORE_VERSION= ${CORE_COMMIT:C/-.*$//1}
CORE_HASH
=
${
CORE_COMMIT
:C/^.
*-//1
}
.endif
CORE_ABI
?=
16.1
.if
"${FLAVOUR}"
==
OpenSSL
||
"${FLAVOUR}"
==
""
CORE_REPOSITORY
?=
latest
CORE_REPOSITORY
?=
${
CORE_ABI
}
/
latest
.elif
"${FLAVOUR}"
==
LibreSSL
CORE_REPOSITORY
?=
libressl
CORE_REPOSITORY
?=
${
CORE_ABI
}
/
libressl
.else
CORE_REPOSITORY
?=
${
FLAVOUR
}
.endif
...
...
@@ -195,17 +197,21 @@ scripts: want-git
# XXX should extend to all possible scripts
@
cp
-v
--
+PRE_DEINSTALL +POST_INSTALL
${
DESTDIR
}
/
@
sed
-i
''
-e
"s/%%CORE_COMMIT%%/
${
CORE_COMMIT
}
/g"
\
-e
"s/%%CORE_NAME%%/
${
CORE_NAME
}
/g"
\
-e
"s/%%CORE_ABI%%/
${
CORE_ABI
}
/g"
\
${
DESTDIR
}
/+POST_INSTALL
install
:
force
@
${
MAKE
}
-C
${
.CURDIR
}
/contrib
install
DESTDIR
=
${
DESTDIR
}
@
${
MAKE
}
-C
${
.CURDIR
}
/src
install
DESTDIR
=
${
DESTDIR
}
\
CORE_NAME
=
${
CORE_NAME
}
CORE_ABI
=
${
CORE_ABI
}
\
CORE_PACKAGESITE
=
${
CORE_PACKAGESITE
}
\
CORE_REPOSITORY
=
${
CORE_REPOSITORY
}
bootstrap
:
force
@
${
MAKE
}
-C
${
.CURDIR
}
/src install_bootstrap
DESTDIR
=
${
DESTDIR
}
\
NO_SAMPLE
=
please
CORE_PACKAGESITE
=
${
CORE_PACKAGESITE
}
\
CORE_NAME
=
${
CORE_NAME
}
CORE_ABI
=
${
CORE_ABI
}
\
CORE_REPOSITORY
=
${
CORE_REPOSITORY
}
plist
:
force
...
...
Mk/tree.mk
View file @
b5c7f232
...
...
@@ -15,6 +15,8 @@ install${TARGET}: force
sed -i '' \
-e "s=%%CORE_PACKAGESITE%%=${CORE_PACKAGESITE}=g" \
-e "s=%%CORE_REPOSITORY%%=${CORE_REPOSITORY}=g" \
-e "s=%%CORE_NAME%%=${CORE_NAME}=g" \
-e "s=%%CORE_ABI%%=${CORE_ABI}=g" \
"${DESTDIR}${ROOT${TARGET}}/${TREE}/$${FILE}"; \
mv -v "${DESTDIR}${ROOT${TARGET}}/${TREE}/$${FILE}" \
"${DESTDIR}${ROOT${TARGET}}/${TREE}/$${FILE%%.in}"; \
...
...
src/etc/inc/system.inc
View file @
b5c7f232
...
...
@@ -1368,22 +1368,33 @@ function system_firmware_configure()
{
global
$config
;
/* our own ABI prefix on the mirror */
$osabi
=
'16.1'
;
/* rewrite the config via the defaults */
$origin_conf
=
'/usr/local/etc/pkg/repos/origin.conf'
;
copy
(
"${origin_conf}.sample"
,
$origin_conf
);
if
(
!
empty
(
$config
[
'system'
][
'firmware'
][
'mirror'
]))
{
mwexecf
(
"/usr/local/sbin/opnsense-update %s %s"
,
array
(
"-sm"
,
str_replace
(
'/'
,
'\/'
,
$config
[
'system'
][
'firmware'
][
'mirror'
]))
mwexecf
(
'/usr/local/sbin/opnsense-update %s %s'
,
array
(
'-sm'
,
str_replace
(
'/'
,
'\/'
,
$config
[
'system'
][
'firmware'
][
'mirror'
]))
);
}
if
(
!
empty
(
$config
[
'system'
][
'firmware'
][
'flavour'
]))
{
mwexecf
(
"/usr/local/sbin/opnsense-update %s %s"
,
array
(
"-sn"
,
str_replace
(
'/'
,
'\/'
,
$osabi
.
'/'
.
$config
[
'system'
][
'firmware'
][
'flavour'
]))
$osabi
=
''
;
switch
(
$config
[
'system'
][
'firmware'
][
'flavour'
])
{
case
'libressl'
:
case
'latest'
:
/* if this is known flavour we treat it with ABI prefix */
$osabi
=
file_get_contents
(
'/usr/local/opnsense/version/opnsense.abi'
)
.
'/'
;
break
;
default
:
break
;
}
mwexecf
(
'/usr/local/sbin/opnsense-update %s %s'
,
array
(
'-sn'
,
str_replace
(
'/'
,
'\/'
,
$osabi
.
$config
[
'system'
][
'firmware'
][
'flavour'
]))
);
}
}
...
...
src/etc/pkg/repos/origin.conf.sample.in
View file @
b5c7f232
OPNsense: {
fingerprints: "/usr/local/etc/pkg/fingerprints/OPNsense",
url: "pkg+%%CORE_PACKAGESITE%%/${ABI}/
16.1/
%%CORE_REPOSITORY%%",
url: "pkg+%%CORE_PACKAGESITE%%/${ABI}/%%CORE_REPOSITORY%%",
signature_type: "fingerprints",
mirror_type: "srv",
priority: 11,
...
...
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