Commit b5c7f232 authored by Franco Fichtner's avatar Franco Fichtner

firmware: make ABI a bit more flexible and also register name

parent e9cb6519
......@@ -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
......
......@@ -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
......
......@@ -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}"; \
......
......@@ -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']))
);
}
}
......
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,
......
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