pkgsrc-WIP-changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

flashrom: Import flashrom-0.9.7 as wip/flashrom



Module Name:	pkgsrc-wip
Committed By:	Mateusz Poszwa <old4%o2.pl@localhost>
Pushed By:	f8l
Date:		Mon Jan 30 21:36:58 2017 +0100
Changeset:	2163ad67f3a8bea3e027964ef6ef40a34e2f50bb

Added Files:
	flashrom/DESCR
	flashrom/Makefile
	flashrom/PLIST
	flashrom/distinfo
	flashrom/patches/patch-flashrom.c
	flashrom/patches/patch-hwaccess.c

Log Message:
flashrom: Import flashrom-0.9.7 as wip/flashrom

To see a diff of this commit:
https://wip.pkgsrc.org/cgi-bin/gitweb.cgi?p=pkgsrc-wip.git;a=commitdiff;h=2163ad67f3a8bea3e027964ef6ef40a34e2f50bb

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

diffstat:
 flashrom/DESCR                    |  1 +
 flashrom/Makefile                 | 47 +++++++++++++++++++++++++
 flashrom/PLIST                    |  3 ++
 flashrom/distinfo                 |  8 +++++
 flashrom/patches/patch-flashrom.c | 22 ++++++++++++
 flashrom/patches/patch-hwaccess.c | 72 +++++++++++++++++++++++++++++++++++++++
 6 files changed, 153 insertions(+)

diffs:
diff --git a/flashrom/DESCR b/flashrom/DESCR
new file mode 100644
index 0000000..600d128
--- /dev/null
+++ b/flashrom/DESCR
@@ -0,0 +1 @@
+Flashrom is a utility which can be used to detect, read, and write BIOS chips.
diff --git a/flashrom/Makefile b/flashrom/Makefile
new file mode 100644
index 0000000..67acc88
--- /dev/null
+++ b/flashrom/Makefile
@@ -0,0 +1,47 @@
+# $NetBSD: Makefile,v 1.9 2016/02/26 10:24:12 jperkin Exp $
+#
+
+DISTNAME=	flashrom-0.9.7
+PKGNAME=	${DISTNAME:S/-r/pre/}
+CATEGORIES=	sysutils
+MASTER_SITES=	http://download.flashrom.org/releases/
+EXTRACT_SUFX=	.tar.bz2
+
+MAINTAINER=	jakllsch%NetBSD.org@localhost
+HOMEPAGE=	http://www.flashrom.org/
+COMMENT=	Universal (coreboot/LinuxBIOS) flash utility
+LICENSE=        gnu-gpl-v2
+
+USE_TOOLS+= gmake pkg-config
+
+.include "../../mk/bsd.prefs.mk"
+
+.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "x86_64"
+DEPENDS+=	dmidecode-[0-9]*:../../sysutils/dmidecode
+.endif
+
+SUBST_CLASSES.NetBSD+=	pciutils
+SUBST_CLASSES.SunOS+=	pciutils
+SUBST_FILES.pciutils=	Makefile
+SUBST_FILES.pciutils+=	hwaccess.h
+SUBST_MESSAGE.pciutils=	adjusting pciutils headers
+SUBST_STAGE.pciutils=	pre-configure
+SUBST_SED.pciutils+= -e 's,<pci/pci.h>,<pciutils/pci.h>,g'
+
+.if ${OPSYS} == "NetBSD" || ${OPSYS} == "SunOS"
+LDFLAGS+=	-lpci
+CPPFLAGS+=	-I/${PREFIX}/include
+.endif
+
+LDFLAGS.SunOS+=		-lsocket -lnsl
+MAKE_ENV.SunOS+=	WARNERROR=0
+
+INSTALLATION_DIRS=	sbin ${PKGMANDIR}/man8
+
+do-install:
+	${INSTALL_PROGRAM} ${WRKSRC}/flashrom ${DESTDIR}${PREFIX}/sbin/flashrom
+	${INSTALL_MAN} ${WRKSRC}/flashrom.8 ${DESTDIR}${PREFIX}/${PKGMANDIR}/man8/flashrom.8
+
+.include "../../devel/libftdi/buildlink3.mk"
+.include "../../sysutils/pciutils/buildlink3.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/flashrom/PLIST b/flashrom/PLIST
new file mode 100644
index 0000000..d695712
--- /dev/null
+++ b/flashrom/PLIST
@@ -0,0 +1,3 @@
+@comment $NetBSD: PLIST,v 1.1.1.1 2010/10/23 15:56:19 jakllsch Exp $
+man/man8/flashrom.8
+sbin/flashrom
diff --git a/flashrom/distinfo b/flashrom/distinfo
new file mode 100644
index 0000000..bc6fe24
--- /dev/null
+++ b/flashrom/distinfo
@@ -0,0 +1,8 @@
+$NetBSD: distinfo,v 1.10 2016/12/22 21:07:17 joerg Exp $
+
+SHA1 (flashrom-0.9.7.tar.bz2) = d08b4073ea3ebf63f03c3e502f4291f50ef348ee
+RMD160 (flashrom-0.9.7.tar.bz2) = e160e0ac1e0e138702f3f467707175df96b7e6b1
+SHA512 (flashrom-0.9.7.tar.bz2) = a226c1ac3f9c7822b74ca14b7f9b53013110b2cdb66b1f936593c693ee54f19d643cc3a97a9635c05f2c959aca817668006f609ddb503a84d0bf5d510065674e
+Size (flashrom-0.9.7.tar.bz2) = 408883 bytes
+SHA1 (patch-flashrom.c) = 9867fa7ff7d0a55bff5fc0e6c8c6c901af6211f8
+SHA1 (patch-hwaccess.c) = a76c1def47b8b3a79c8d024c43c510f3989bd6d9
diff --git a/flashrom/patches/patch-flashrom.c b/flashrom/patches/patch-flashrom.c
new file mode 100644
index 0000000..d4d10b3
--- /dev/null
+++ b/flashrom/patches/patch-flashrom.c
@@ -0,0 +1,22 @@
+$NetBSD: patch-flashrom.c,v 1.1 2014/03/06 15:46:39 joerg Exp $
+
+--- flashrom.c.orig	2014-03-02 13:42:29.000000000 +0000
++++ flashrom.c
+@@ -1738,7 +1738,7 @@ int selfcheck(void)
+ 	 * For 'flashchips' we check the first element to be non-null. In the
+ 	 * other cases there exist use cases where the first element can be
+ 	 * null. */
+-	if (flashchips == NULL || flashchips[0].vendor == NULL) {
++	if (flashchips[0].vendor == NULL) {
+ 		msg_gerr("Flashchips table miscompilation!\n");
+ 		ret = 1;
+ 	}
+@@ -1746,7 +1746,7 @@ int selfcheck(void)
+ 		if (selfcheck_eraseblocks(chip))
+ 			ret = 1;
+ 
+-#if CONFIG_INTERNAL == 1
++#if 0 && CONFIG_INTERNAL == 1
+ 	if (chipset_enables == NULL) {
+ 		msg_gerr("Chipset enables table does not exist!\n");
+ 		ret = 1;
diff --git a/flashrom/patches/patch-hwaccess.c b/flashrom/patches/patch-hwaccess.c
new file mode 100644
index 0000000..fe0c320
--- /dev/null
+++ b/flashrom/patches/patch-hwaccess.c
@@ -0,0 +1,72 @@
+$NetBSD: patch-hwaccess.c,v 1.1 2016/12/22 21:07:17 joerg Exp $
+
+It is UB whether define() is not handled inside macro expansions.
+
+--- hwaccess.c.orig	2016-12-22 15:40:41.401773946 +0000
++++ hwaccess.c
+@@ -18,16 +18,40 @@
+  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+  */
+ 
+-#define IS_X86	(defined(__i386__) || defined(__x86_64__) || defined(__amd64__))
+-#define IS_MIPS	(defined (__mips) || defined (__mips__) || defined (__MIPS__) || defined (mips))
+-#define IS_PPC	(defined(__powerpc__) || defined(__powerpc64__) || defined(__ppc__) || defined(__ppc64__))
+-#define IS_ARM	(defined (__arm__) || defined (_ARM))
++#if defined(__i386__) || defined(__x86_64__) || defined(__amd64__)
++#define IS_X86	1
++#else
++#define IS_X86	0
++#endif
++#if defined (__mips) || defined (__mips__) || defined (__MIPS__) || defined (mips)
++#define IS_MIPS	1
++#else
++#define IS_MIPS	0
++#endif
++#if defined(__powerpc__) || defined(__powerpc64__) || defined(__ppc__) || defined(__ppc64__)
++#define IS_PPC	1
++#else
++#define IS_PPC	0
++#endif
++#if defined (__arm__) || defined (_ARM)
++#define IS_ARM	1
++#else
++#define IS_ARM	0
++#endif
+ #if !(IS_X86 || IS_MIPS || IS_PPC || IS_ARM)
+ #error Unknown architecture
+ #endif
+ 
+-#define IS_LINUX	(defined(__gnu_linux__) || defined(__linux__))
+-#define IS_MACOSX	(defined(__APPLE__) && defined(__MACH__))
++#if defined(__gnu_linux__) || defined(__linux__)
++#define IS_LINUX	1
++#else
++#define IS_LINUX	0
++#endif
++#if defined(__APPLE__) && defined(__MACH__)
++#define IS_MACOSX	1
++#else
++#define IS_MACOSX	0
++#endif
+ #if !(IS_LINUX || IS_MACOSX || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__) || defined(__DJGPP__) || defined(__LIBPAYLOAD__) || defined(__sun))
+ #error "Unknown operating system"
+ #endif
+@@ -45,8 +69,16 @@
+ #include "flash.h"
+ #include "hwaccess.h"
+ 
+-#define USE_IOPL	(IS_LINUX || IS_MACOSX || defined(__NetBSD__) || defined(__OpenBSD__))
+-#define USE_DEV_IO	(defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__))
++#if IS_LINUX || IS_MACOSX || defined(__NetBSD__) || defined(__OpenBSD__)
++#define USE_IOPL	1
++#else
++#define USE_IOPL	0
++#endif
++#if (defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__))
++#define USE_DEV_IO	1
++#else
++#define USE_DEV_IO	0
++#endif
+ 
+ #if IS_X86 && USE_DEV_IO
+ int io_fd;


Home | Main Index | Thread Index | Old Index