Update to 3.2

- Convert PLIST_FILES and PORTDOCS to PLIST

Changes:	https://git.savannah.gnu.org/cgit/dmidecode.git/tree/NEWS
This commit is contained in:
Sunpoet Po-Chuan Hsieh 2018-09-16 00:06:36 +00:00
parent 052ec94932
commit f7a25ceb86
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=479853
4 changed files with 24 additions and 71 deletions

View file

@ -2,8 +2,7 @@
# $FreeBSD$
PORTNAME= dmidecode
PORTVERSION= 3.1
PORTREVISION= 1
PORTVERSION= 3.2
CATEGORIES= sysutils
MASTER_SITES= SAVANNAH
@ -20,16 +19,6 @@ OPTIONS_DEFINE= DOCS
MAKE_ENV= DOCSDIR="${DOCSDIR}"
USES= tar:xz
PLIST_FILES= etc/periodic/daily/dmidecode \
man/man8/biosdecode.8.gz \
man/man8/dmidecode.8.gz \
man/man8/ownership.8.gz \
man/man8/vpddecode.8.gz \
sbin/biosdecode \
sbin/dmidecode \
sbin/ownership \
sbin/vpddecode
PORTDOCS= AUTHORS CHANGELOG README
SUB_FILES= dmidecode
post-install:

View file

@ -1,3 +1,3 @@
TIMESTAMP = 1495555101
SHA256 (dmidecode-3.1.tar.xz) = d766ce9b25548c59b1e7e930505b4cad9a7bb0b904a1a391fbb604d529781ac0
SIZE (dmidecode-3.1.tar.xz) = 61204
TIMESTAMP = 1537020822
SHA256 (dmidecode-3.2.tar.xz) = 077006fa2da0d06d6383728112f2edef9684e9c8da56752e97cd45a11f838edd
SIZE (dmidecode-3.2.tar.xz) = 54440

View file

@ -1,58 +1,10 @@
--- dmidecode.c.orig 2017-05-23 13:34:14 UTC
--- dmidecode.c.orig 2018-09-14 13:52:12 UTC
+++ dmidecode.c
@@ -58,6 +58,10 @@
* https://trustedcomputinggroup.org/pc-client-platform-tpm-profile-ptp-specification/
*/
@@ -66,6 +66,7 @@
#include <stdlib.h>
#include <unistd.h>
#include <arpa/inet.h>
+#include <sys/socket.h>
+#ifdef __FreeBSD__
+#include <errno.h>
+#include <kenv.h>
+#endif
#include <stdio.h>
#include <string.h>
#include <strings.h>
@@ -4934,13 +4938,18 @@ static int legacy_decode(u8 *buf, const
#define EFI_NO_SMBIOS (-2)
static int address_from_efi(off_t *address)
{
+#if defined(__linux__)
FILE *efi_systab;
const char *filename;
char linebuf[64];
+#elif defined(__FreeBSD__)
+ char addrstr[KENV_MVALLEN + 1];
+#endif
int ret;
*address = 0; /* Prevent compiler warning */
+#if defined(__linux__)
/*
* Linux up to 2.6.6: /proc/efi/systab
* Linux 2.6.7 and up: /sys/firmware/efi/systab
@@ -4973,6 +4982,25 @@ static int address_from_efi(off_t *addre
if (ret == EFI_NO_SMBIOS)
fprintf(stderr, "%s: SMBIOS entry point missing\n", filename);
return ret;
+#elif defined(__FreeBSD__)
+ /*
+ * On FreeBSD, SMBIOS anchor base address in UEFI mode is exposed
+ * via kernel environment:
+ * https://svnweb.freebsd.org/base?view=revision&revision=307326
+ */
+ ret = kenv(KENV_GET, "hint.smbios.0.mem", addrstr, sizeof(addrstr));
+ if (ret == -1) {
+ if (errno != ENOENT)
+ perror("kenv");
+ return EFI_NOT_FOUND;
+ }
+
+ *address = strtoull(addrstr, NULL, 0);
+ if (!(opt.flags & FLAG_QUIET))
+ printf("# SMBIOS entry point at 0x%08llx\n",
+ (unsigned long long)*address);
+ return 0;
+#endif
}
int main(int argc, char * const argv[])
#ifdef __FreeBSD__
#include <errno.h>

View file

@ -0,0 +1,12 @@
etc/periodic/daily/dmidecode
man/man8/biosdecode.8.gz
man/man8/dmidecode.8.gz
man/man8/ownership.8.gz
man/man8/vpddecode.8.gz
sbin/biosdecode
sbin/dmidecode
sbin/ownership
sbin/vpddecode
%%PORTDOCS%%%%DOCSDIR%%/AUTHORS
%%PORTDOCS%%%%DOCSDIR%%/NEWS
%%PORTDOCS%%%%DOCSDIR%%/README