mirror of
https://github.com/netbirdio/FreeBSD-ports.git
synced 2026-05-22 18:42:42 -07:00
pfSense-pkg-Netgate_Coreboot_Upgrade: Rename
Rename it to pfSense-pkg-Netgate_Firmware_Upgrade since it will now cover blinkboot upgrades as well on new hardware models While here, remove gmake from explicit dependencies list and move it to USES=gmake, also remove conditionals used for FreeBSD 10.x since we don't support this version since pfSense 2.3.x
This commit is contained in:
@@ -16012,3 +16012,4 @@ devel/py-backports_abc||2020-01-02|Uses Python 2.7 which is EOLed upstream
|
||||
devel/py-futures||2020-01-02|Uses Python 2.7 which is EOLed upstream
|
||||
devel/py-singledispatch||2020-01-02|Uses Python 2.7 which is EOLed upstream
|
||||
graphics/py-pillow6|graphics/pillow|2020-01-02|Uses Python 2.7 which is EOLed upstream
|
||||
sysutils/pfSense-pkg-Netgate_Coreboot_Upgrade|sysutils/pfSense-pkg-Netgate_Firmware_Upgrade|2021-03-09|Renamed
|
||||
|
||||
-10
@@ -1,10 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<pfsensepkgs>
|
||||
<package>
|
||||
<name>Netgate Coreboot Upgrade</name>
|
||||
<internal_name>Netgate_Coreboot_Upgrade</internal_name>
|
||||
<descr><![CDATA[Provide a mechanism to upgrade Coreboot for Netgate hardware models.]]></descr>
|
||||
<version>%%PKGVERSION%%</version>
|
||||
<configurationfile>netgate_coreboot_upgrade.xml</configurationfile>
|
||||
</package>
|
||||
</pfsensepkgs>
|
||||
@@ -1,3 +0,0 @@
|
||||
Provide a mechanism to update Coreboot of Netgate hardware
|
||||
|
||||
WWW: https://www.netgate.com/
|
||||
+11
-21
@@ -1,21 +1,22 @@
|
||||
# $FreeBSD$
|
||||
|
||||
PORTNAME= pfSense-pkg-Netgate_Coreboot_Upgrade
|
||||
PORTNAME= pfSense-pkg-Netgate_Firmware_Upgrade
|
||||
PORTVERSION= 0.29
|
||||
PORTREVISION= 1
|
||||
CATEGORIES= sysutils
|
||||
MASTER_SITES= # empty
|
||||
|
||||
MAINTAINER= coreteam@pfsense.org
|
||||
COMMENT= pfSense package Netgate Coreboot Upgrade
|
||||
COMMENT= pfSense package Netgate Firmware Upgrade
|
||||
|
||||
LICENSE= APACHE20
|
||||
|
||||
BUILD_DEPENDS= e2fsprogs-libuuid>=0:misc/e2fsprogs-libuuid \
|
||||
gmake:devel/gmake
|
||||
BUILD_DEPENDS= e2fsprogs-libuuid>=0:misc/e2fsprogs-libuuid
|
||||
RUN_DEPENDS= flashrom>=1.1:sysutils/flashrom \
|
||||
e2fsprogs-libuuid>=0:misc/e2fsprogs-libuuid
|
||||
|
||||
USES= gmake
|
||||
|
||||
NO_MTREE= yes
|
||||
USE_GITHUB= nodefault
|
||||
|
||||
@@ -32,8 +33,7 @@ COREBOOT_PLCCB_ROM=ADI_PLCC-01.00.00.11.bin
|
||||
PLIST_SUB= COREBOOT_DFF2_ROM=${COREBOOT_DFF2_ROM} \
|
||||
COREBOOT_RCC_ROM=${COREBOOT_RCC_ROM} \
|
||||
COREBOOT_RCCVE_ROM=${COREBOOT_RCCVE_ROM} \
|
||||
COREBOOT_PLCCB_ROM=${COREBOOT_PLCCB_ROM} \
|
||||
PLCC=${PLCC}
|
||||
COREBOOT_PLCCB_ROM=${COREBOOT_PLCCB_ROM}
|
||||
|
||||
SUB_FILES= pkg-install pkg-deinstall
|
||||
SUB_LIST= PORTNAME=${PORTNAME}
|
||||
@@ -42,12 +42,6 @@ CBFSTOOL_PATH= ${WRKSRC}/coreboot/util/cbfstool
|
||||
|
||||
.include <bsd.port.options.mk>
|
||||
|
||||
.if ${OSVERSION} >= 1100001
|
||||
PLCC=""
|
||||
.else
|
||||
PLCC="@comment "
|
||||
.endif
|
||||
|
||||
pre-extract:
|
||||
${MKDIR} ${WRKSRC}
|
||||
|
||||
@@ -63,14 +57,12 @@ do-build:
|
||||
${FILESDIR}/adi_flash_util/adi_flash_util.c
|
||||
${CC} ${CFLAGS} -o ${WRKSRC}/adi_powercycle \
|
||||
${FILESDIR}/adi_powercycle/adi_powercycle.c
|
||||
.if ${OSVERSION} >= 1100001
|
||||
${CC} ${CFLAGS} -o ${WRKSRC}/adi_smbios_util/adi_smbios_util -luuid \
|
||||
-I${LOCALBASE}/include -L${LOCALBASE}/lib \
|
||||
-include ${WRKSRC}/adi_smbios_util/config.h \
|
||||
${WRKSRC}/adi_smbios_util/adi_smbios_util.c
|
||||
${GMAKE} -C ${CBFSTOOL_PATH} HOSTCC=${CC} HOSTCXX=${CXX} \
|
||||
VBOOT_SOURCE=${WRKSRC_vboot}
|
||||
.endif
|
||||
|
||||
do-install:
|
||||
${MKDIR} ${STAGEDIR}/etc/inc/priv
|
||||
@@ -78,7 +70,7 @@ do-install:
|
||||
${MKDIR} ${STAGEDIR}${PREFIX}/pkg
|
||||
${MKDIR} ${STAGEDIR}${PREFIX}/sbin
|
||||
${MKDIR} ${STAGEDIR}${PREFIX}/www
|
||||
${INSTALL_DATA} ${FILESDIR}${PREFIX}/pkg/netgate_coreboot_upgrade.inc \
|
||||
${INSTALL_DATA} ${FILESDIR}${PREFIX}/pkg/netgate_firmware_upgrade.inc \
|
||||
${STAGEDIR}${PREFIX}/pkg
|
||||
@${REINPLACE_CMD} -i '' \
|
||||
-e "s|%%DATADIR%%|${DATADIR}|" \
|
||||
@@ -86,12 +78,12 @@ do-install:
|
||||
-e "s|%%COREBOOT_RCC_ROM%%|${COREBOOT_RCC_ROM}|" \
|
||||
-e "s|%%COREBOOT_RCCVE_ROM%%|${COREBOOT_RCCVE_ROM}|" \
|
||||
-e "s|%%COREBOOT_PLCCB_ROM%%|${COREBOOT_PLCCB_ROM}|" \
|
||||
${STAGEDIR}${PREFIX}/pkg/netgate_coreboot_upgrade.inc
|
||||
${INSTALL_DATA} ${FILESDIR}${PREFIX}/pkg/netgate_coreboot_upgrade.xml \
|
||||
${STAGEDIR}${PREFIX}/pkg/netgate_firmware_upgrade.inc
|
||||
${INSTALL_DATA} ${FILESDIR}${PREFIX}/pkg/netgate_firmware_upgrade.xml \
|
||||
${STAGEDIR}${PREFIX}/pkg
|
||||
${INSTALL_DATA} ${FILESDIR}${PREFIX}/www/netgate_coreboot_upgrade.php \
|
||||
${INSTALL_DATA} ${FILESDIR}${PREFIX}/www/netgate_firmware_upgrade.php \
|
||||
${STAGEDIR}${PREFIX}/www
|
||||
${INSTALL_DATA} ${FILESDIR}/etc/inc/priv/netgate_coreboot_upgrade.priv.inc \
|
||||
${INSTALL_DATA} ${FILESDIR}/etc/inc/priv/netgate_firmware_upgrade.priv.inc \
|
||||
${STAGEDIR}/etc/inc/priv
|
||||
${INSTALL_DATA} ${FILESDIR}${DATADIR}/info.xml \
|
||||
${STAGEDIR}${DATADIR}
|
||||
@@ -101,10 +93,8 @@ do-install:
|
||||
${INSTALL_DATA} ${FILESDIR}/roms/*.bin ${STAGEDIR}${DATADIR}/roms
|
||||
${INSTALL_PROGRAM} ${WRKSRC}/adi_flash_util ${STAGEDIR}${PREFIX}/sbin
|
||||
${INSTALL_PROGRAM} ${WRKSRC}/adi_powercycle ${STAGEDIR}${PREFIX}/sbin
|
||||
.if ${OSVERSION} >= 1100001
|
||||
${INSTALL_PROGRAM} ${WRKSRC}/adi_smbios_util/adi_smbios_util \
|
||||
${STAGEDIR}${PREFIX}/sbin
|
||||
${INSTALL_PROGRAM} ${CBFSTOOL_PATH}/cbfstool ${STAGEDIR}${PREFIX}/sbin
|
||||
.endif
|
||||
|
||||
.include <bsd.port.mk>
|
||||
+6
-6
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
* netgate_coreboot_upgrade.priv.inc
|
||||
* netgate_firmware_upgrade.priv.inc
|
||||
*
|
||||
* part of pfSense (https://www.pfsense.org)
|
||||
* Copyright (c) 2017-2021 Rubicon Communications, LLC (Netgate)
|
||||
@@ -21,10 +21,10 @@
|
||||
|
||||
global $priv_list;
|
||||
|
||||
$priv_list['page-system-netgate-coreboot-upgrade'] = array();
|
||||
$priv_list['page-system-netgate-coreboot-upgrade']['name'] = "System - Netgate Coreboot Upgrade";
|
||||
$priv_list['page-system-netgate-coreboot-upgrade']['descr'] = "Allow access to 'System: Netgate Coreboot Upgrade'";
|
||||
$priv_list['page-system-netgate-coreboot-upgrade']['match'] = array();
|
||||
$priv_list['page-system-netgate-coreboot-upgrade']['match'][] = "netgate_coreboot_upgrade.php*";
|
||||
$priv_list['page-system-netgate-firmware-upgrade'] = array();
|
||||
$priv_list['page-system-netgate-firmware-upgrade']['name'] = "System - Netgate Firmware Upgrade";
|
||||
$priv_list['page-system-netgate-firmware-upgrade']['descr'] = "Allow access to 'System: Netgate Firmware Upgrade'";
|
||||
$priv_list['page-system-netgate-firmware-upgrade']['match'] = array();
|
||||
$priv_list['page-system-netgate-firmware-upgrade']['match'][] = "netgate_firmware_upgrade.php*";
|
||||
|
||||
?>
|
||||
+20
-20
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/*
|
||||
* netgate_coreboot_upgrade.inc
|
||||
* netgate_firmware_upgrade.inc
|
||||
*
|
||||
* part of pfSense (https://www.pfsense.org)
|
||||
* Copyright (c) 2017-2021 Rubicon Communications, LLC (Netgate)
|
||||
@@ -22,7 +22,7 @@
|
||||
require_once("globals.inc");
|
||||
require_once("system.inc");
|
||||
|
||||
function get_coreboot_model() {
|
||||
function get_firmware_model() {
|
||||
$specplatform = system_identify_specific_platform();
|
||||
|
||||
switch($specplatform['name']) {
|
||||
@@ -48,14 +48,14 @@ function get_coreboot_model() {
|
||||
}
|
||||
|
||||
function is_netgate_hw() {
|
||||
return !empty(get_coreboot_model());
|
||||
return !empty(get_firmware_model());
|
||||
}
|
||||
|
||||
function get_coreboot_details($coreboot) {
|
||||
function get_firmware_details($firmware) {
|
||||
$details = array();
|
||||
|
||||
if (!preg_match('/^ADI_(RCC|RCCVE|DFF2|PLCC)-([\d.]{11})/',
|
||||
$coreboot, $matches)) {
|
||||
$firmware, $matches)) {
|
||||
return $details;
|
||||
}
|
||||
|
||||
@@ -69,14 +69,14 @@ function get_coreboot_details($coreboot) {
|
||||
return $details;
|
||||
}
|
||||
|
||||
function get_current_coreboot_details() {
|
||||
$coreboot = exec("/bin/kenv -q smbios.bios.version 2>/dev/null");
|
||||
function get_current_firmware_details() {
|
||||
$firmware = exec("/bin/kenv -q smbios.bios.version 2>/dev/null");
|
||||
|
||||
return get_coreboot_details($coreboot);
|
||||
return get_firmware_details($firmware);
|
||||
}
|
||||
|
||||
function get_new_coreboot_details() {
|
||||
$coreboot_path = "%%DATADIR%%/roms/";
|
||||
function get_new_firmware_details() {
|
||||
$firmware_path = "%%DATADIR%%/roms/";
|
||||
|
||||
$rom_names = array(
|
||||
'RCC' => '%%COREBOOT_RCC_ROM%%',
|
||||
@@ -85,38 +85,38 @@ function get_new_coreboot_details() {
|
||||
'PLCC' => '%%COREBOOT_PLCCB_ROM%%',
|
||||
);
|
||||
|
||||
$model = get_coreboot_model();
|
||||
$model = get_firmware_model();
|
||||
$details = array();
|
||||
$path = $coreboot_path . $rom_names[$model];
|
||||
$path = $firmware_path . $rom_names[$model];
|
||||
|
||||
if (empty($model) || empty($rom_names[$model]) ||
|
||||
!file_exists($coreboot_path . $rom_names[$model])) {
|
||||
!file_exists($firmware_path . $rom_names[$model])) {
|
||||
return $details;
|
||||
}
|
||||
|
||||
$details = get_coreboot_details($rom_names[$model]);
|
||||
$details['rom_path'] = $coreboot_path . $rom_names[$model];
|
||||
$details = get_firmware_details($rom_names[$model]);
|
||||
$details['rom_path'] = $firmware_path . $rom_names[$model];
|
||||
|
||||
return $details;
|
||||
}
|
||||
|
||||
function upgrade_coreboot($coreboot, &$output) {
|
||||
function upgrade_firmware($firmware, &$output) {
|
||||
global $g;
|
||||
|
||||
putenv("PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:" .
|
||||
"/usr/local/sbin");
|
||||
|
||||
if ($coreboot['model'] == 'PLCC') {
|
||||
if ($firmware['model'] == 'PLCC') {
|
||||
$_gc = exec("/usr/local/sbin/adi_smbios_util -w -u " .
|
||||
$coreboot['rom_path'] . ' 2>&1', $output, $rc);
|
||||
$firmware['rom_path'] . ' 2>&1', $output, $rc);
|
||||
} else {
|
||||
$_gc = exec("/usr/local/sbin/adi_flash_util -u " .
|
||||
$coreboot['rom_path'] . ' 2>&1', $output, $rc);
|
||||
$firmware['rom_path'] . ' 2>&1', $output, $rc);
|
||||
}
|
||||
|
||||
$output = implode("\n", $output);
|
||||
|
||||
@file_put_contents("{$g['conf_path']}/netgate_coreboot_upgrade.log",
|
||||
@file_put_contents("{$g['conf_path']}/netgate_firmware_upgrade.log",
|
||||
$output);
|
||||
|
||||
return ($rc == 0);
|
||||
+8
-8
@@ -5,7 +5,7 @@
|
||||
<copyright>
|
||||
<![CDATA[
|
||||
/*
|
||||
* netgate_coreboot_upgrade.xml
|
||||
* netgate_firmware_upgrade.xml
|
||||
*
|
||||
* part of pfSense (https://www.pfsense.org)
|
||||
* Copyright (c) 2017-2021 Rubicon Communications, LLC (Netgate)
|
||||
@@ -25,15 +25,15 @@
|
||||
*/
|
||||
]]>
|
||||
</copyright>
|
||||
<description>Provide a mechanism to upgrade Coreboot of Netgate hardware models</description>
|
||||
<name>Netgate Coreboot Upgrade</name>
|
||||
<title>System: Netgate Coreboot Upgrade</title>
|
||||
<include_file>/usr/local/pkg/netgate_coreboot_upgrade.inc</include_file>
|
||||
<description>Provide a mechanism to upgrade Firmware of Netgate hardware models</description>
|
||||
<name>Netgate Firmware Upgrade</name>
|
||||
<title>System: Netgate Firmware Upgrade</title>
|
||||
<include_file>/usr/local/pkg/netgate_firmware_upgrade.inc</include_file>
|
||||
<menu>
|
||||
<name>Netgate Coreboot Upgrade</name>
|
||||
<tooltiptext>Upgrade Coreboot of Netgate hardware models.</tooltiptext>
|
||||
<name>Netgate Firmware Upgrade</name>
|
||||
<tooltiptext>Upgrade Firmware of Netgate hardware models.</tooltiptext>
|
||||
<section>System</section>
|
||||
<url>/netgate_coreboot_upgrade.php</url>
|
||||
<url>/netgate_firmware_upgrade.php</url>
|
||||
</menu>
|
||||
<custom_php_validation_command>
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user