summaryrefslogtreecommitdiff
path: root/sys-apps/iotools
diff options
context:
space:
mode:
Diffstat (limited to 'sys-apps/iotools')
-rw-r--r--sys-apps/iotools/Manifest9
-rw-r--r--sys-apps/iotools/files/iotools-1.4-cpuid-pic.patch22
-rw-r--r--sys-apps/iotools/files/iotools-1.4-ldflags.patch13
-rw-r--r--sys-apps/iotools/iotools-1.4.ebuild51
-rw-r--r--sys-apps/iotools/iotools-1.5.ebuild53
-rw-r--r--sys-apps/iotools/metadata.xml10
6 files changed, 158 insertions, 0 deletions
diff --git a/sys-apps/iotools/Manifest b/sys-apps/iotools/Manifest
new file mode 100644
index 000000000000..0163f65ca552
--- /dev/null
+++ b/sys-apps/iotools/Manifest
@@ -0,0 +1,9 @@
+AUX iotools-1.4-cpuid-pic.patch 617 SHA256 078c0b040d9d7d89fda30f7628fbefad1a70356c26c9c2ac7fcc03070fff2c29 SHA512 81c9f1d20fa87b847e5c49909639d35b604a991f7a87077a1b8e5fe36707d9e24289f861d6ce9468de5621e84adedc60f76086cacafc67aa2d1b9aa5f52ba364 WHIRLPOOL 2678c18cd692a90d9fe03305ffb58c1966ef3d1a7097548a4f26fc362639bcfb2a4c5ffad4563aeb6e0293e8d23c9fb594dbd1c8341db103974e73d7a03ebd59
+AUX iotools-1.4-ldflags.patch 302 SHA256 eb3b884dbbe872849bc1a6f02b72716f07428d7b1a2d9c75fd1b18b01668485c SHA512 bc20c64b46f5e6fd6526e4a3fb9ce4e6817b6f4c66330d5c5ea721a5be55410603c16898162b9be41ed607cd4287e6bc187deadb83aeb1a813aeceaf88258ce0 WHIRLPOOL 33a655b7f523e00a2c7b5a7c5844762a8005f6fa00bee043ccd89213cbea98b0d89cd27dc2f8d55fe646aba5bba72d7a4e2c258ff2115163fa4cbd631ea99b99
+DIST iotools-1.4.tar.gz 22217 SHA256 56e7348bb5b91f6b93a9b2759993545575eeb3fa5f9203a9cbb95dad9883807b SHA512 10b5f5c4183fb78900c254359b1d40d681519d4b0a79d10795c44d6f1691d73b93d02ede57cf84b5bac67e6083bc5a0de45c464caccbad8b2127a2c53cd7e94b WHIRLPOOL 808ba3b70c602ff0cdfe38ffcf7c1a3c4ab72cacf977ee8db34049159f20b034b48949f0bd70f1b27436f1183dda5cb677338f80afaf65ba1e1a0ec96a973418
+DIST iotools-1.5.tar.gz 23422 SHA256 3186ba296072f644dda881b78d77e3774b79e8cef3e828fffc947d558b08830d SHA512 d298343ee814c8b7d8404bc6af4050df730e89963a7c53798b3d251e94fd2b13e04c36e6da7ec5fd4126ea3a961be26a937910f791844e1b1d5b7dc5aa638c44 WHIRLPOOL 52d5aedf0ae4ee3257e19a6868f792e54b6ac9d79c0816c934b714811e4da0bc288a7f597098fd9ff2ed65f11cf486db1e2db76c85c0ecde0a095e09f24b2fbe
+EBUILD iotools-1.4.ebuild 1743 SHA256 5d6b2accaefe674538e6402b68ea8a0f889e9d080682105e2bcb1f70b9be82cd SHA512 df07fb30bff57c4e445cba8d08b308dd88cdeb5a0e66a862a6e667b4b037953773ab194edf7c2e663e61cb255107cd294224fc67c37282f6d34adf5af3b6f4d2 WHIRLPOOL eaa173478f3108ef1348f63af7d4a3fcccaa02a4a7e25a1b8f52ed0c975d58b9849307f669c9c257af166e91c7b87598d176726919e3e4d178ff536d813fffcf
+EBUILD iotools-1.5.ebuild 1896 SHA256 6ed170fbd902342a8475907d0c944f14c27a992c2fd553e6f3ba9ec59cdbe1f4 SHA512 befe48aa95a4d6d177d0fd2ea8a3e967bb37ae1f39bf4f46d5977304119ea35e3346d79c73ee1a475b48089b71e6b43d96e33eb78c79ab17921cef913657bdef WHIRLPOOL fe2d82fc6b15e5e815c4a20266d2db588580b0c04c43aafa487a1498b7b7f80a10cd5751147e398d1d01a978f6828a763e7fca63ef72a846b2997c262b5caf36
+MISC ChangeLog 3043 SHA256 e7066a17a96f3509b5f7472ce7f98ea7f710fbb3fe2180e71d31125deccf2a2a SHA512 f861499228f1e7dfe5c669ae3cae5cffefd90ed1563978623be923d034d186177c6455fb2094a3abe00bd36ab2d7da4b19d3601e5fc53dbe5ddcb154d3b1a637 WHIRLPOOL c82f0add3390f2579a5a6122f807d9e85fd326100304c982e427e4a9fd982cb9146f9589790848aba2c24cc0d38008bc9c15001e8899922c0d80ff3df715cb6c
+MISC ChangeLog-2015 1111 SHA256 e63eb9603110449da07fe62a431245fec3fa980ae6e6c0fe77e6630a562fde2b SHA512 78b71632a52dfb58dfb3648e2447f16a6bd6a9c324c2b53c374d03132b523855d964a632fb5c13cf733a063c0fbdc2e3d637b9525a76f81959cde6c49a6a2878 WHIRLPOOL 5afbe8df76e397549cdcea64ca21b8a11fa9a68d69e54cf6a414e4dbcf4182f2efc666897ea6c115c6f011deaea3725172261835cec8fbac0cc98605e97ffa71
+MISC metadata.xml 344 SHA256 7f287ccf3c28346cb4a0d315cafab9fa664e859218bc756fa5f0fc2223c7b17b SHA512 0049857d3084683775560f15a40b51ec3dfec0cbec0918b3eb305b1b6c6ae07114eee1f1bee9fcffd2ed3aed5c329ced039ac3a41da8ecb16a3a627f9588eff8 WHIRLPOOL 20fef867b0e8cbdaccfcba62f19c70a03b6bd0a44db85b02f95e23483c2c1b2fb790254ec391691c72366db37e94e76ffe9f506f11170e13b350e15c9433b5d5
diff --git a/sys-apps/iotools/files/iotools-1.4-cpuid-pic.patch b/sys-apps/iotools/files/iotools-1.4-cpuid-pic.patch
new file mode 100644
index 000000000000..3fde16c6ca01
--- /dev/null
+++ b/sys-apps/iotools/files/iotools-1.4-cpuid-pic.patch
@@ -0,0 +1,22 @@
+http://code.google.com/p/iotools/issues/detail?id=2
+
+--- a/misc.c
++++ b/misc.c
+@@ -149,8 +149,16 @@ cpuid_inline(int cpu, int function, int index, uint32_t *data)
+ }
+
+ asm volatile (
++#ifdef __i386__
++ "xchg %%ebx, %%esi;" /* save ebx (for PIC) */
++ "cpuid;"
++ "xchg %%esi, %%ebx;" /* restore ebx & pass to caller */
++ : "=S" (data[1]),
++#else
+ "cpuid\n\t"
+- : "=a" (data[0]), "=b" (data[1]), "=c" (data[2]), "=d" (data[3])
++ : "=b" (data[1]),
++#endif
++ "=a" (data[0]), "=c" (data[2]), "=d" (data[3])
+ : "0" (function), "2" (index)
+ : "memory"
+ );
diff --git a/sys-apps/iotools/files/iotools-1.4-ldflags.patch b/sys-apps/iotools/files/iotools-1.4-ldflags.patch
new file mode 100644
index 000000000000..242f6912b69a
--- /dev/null
+++ b/sys-apps/iotools/files/iotools-1.4-ldflags.patch
@@ -0,0 +1,13 @@
+http://code.google.com/p/iotools/issues/detail?id=3
+
+--- a/Makefile
++++ b/Makefile
+@@ -44,7 +44,7 @@ OBJS=$(OBJS_TO_BUILD)
+ all: $(BINARY)
+
+ $(BINARY): $(OBJS) iotools.o Makefile
+- $(CC) $(CFLAGS) -o $@ iotools.o $(OBJS)
++ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ iotools.o $(OBJS)
+
+ RUSER ?= root
+ RHOST ?=
diff --git a/sys-apps/iotools/iotools-1.4.ebuild b/sys-apps/iotools/iotools-1.4.ebuild
new file mode 100644
index 000000000000..4b470a70670e
--- /dev/null
+++ b/sys-apps/iotools/iotools-1.4.ebuild
@@ -0,0 +1,51 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="4"
+
+inherit eutils toolchain-funcs
+
+DESCRIPTION="Simple commands to access hardware device registers"
+HOMEPAGE="https://code.google.com/p/iotools/"
+SRC_URI="https://iotools.googlecode.com/files/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="static make-symlinks"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-cpuid-pic.patch
+ epatch "${FILESDIR}"/${P}-ldflags.patch
+ sed -i 's:-Werror::' Makefile || die
+}
+
+src_compile() {
+ emake \
+ CC="$(tc-getCC)" \
+ STATIC=$(usex static 1 0) \
+ IOTOOLS_DEBUG="${CFLAGS}"
+}
+
+src_install() {
+ dosbin iotools
+
+ # Note: This is done manually because invoking the iotools binary
+ # when cross-compiling will likely fail.
+ local known_cmds="and btr bts busy_loop cmos_read cmos_write cpu_list cpuid io_read16 io_read32 io_read8 io_write16 io_write32 io_write8 mmio_dump mmio_read16 mmio_read32 mmio_read64 mmio_read8 mmio_write16 mmio_write32 mmio_write64 mmio_write8 not or pci_list pci_read16 pci_read32 pci_read8 pci_write16 pci_write32 pci_write8 rdmsr rdtsc runon shl shr smbus_quick smbus_read16 smbus_read8 smbus_readblock smbus_receive_byte smbus_send_byte smbus_write16 smbus_write8 smbus_writeblock wrmsr xor"
+ if ! tc-is-cross-compiler ; then
+ local check_cmds=$(echo $(./iotools --list-cmds 2>/dev/null | grep '^ ' | LC_ALL=C sort))
+ if [[ ${known_cmds} != "${check_cmds:-${known_cmds}}" ]] ; then
+ eerror "known_cmds = ${known_cmds}"
+ eerror "check_cmds = ${check_cmds}"
+ die "need to update known_cmds cache in the ebuild"
+ fi
+ fi
+
+ if use make-symlinks ; then
+ local cmd
+ for cmd in ${known_cmds} ; do
+ dosym iotools /usr/sbin/${cmd}
+ done
+ fi
+}
diff --git a/sys-apps/iotools/iotools-1.5.ebuild b/sys-apps/iotools/iotools-1.5.ebuild
new file mode 100644
index 000000000000..d508f1263e1a
--- /dev/null
+++ b/sys-apps/iotools/iotools-1.5.ebuild
@@ -0,0 +1,53 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="4"
+
+inherit eutils toolchain-funcs
+
+DESCRIPTION="Simple commands to access hardware device registers"
+HOMEPAGE="https://code.google.com/p/iotools/"
+SRC_URI="https://iotools.googlecode.com/files/${P}.tar.gz"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ~arm ~ppc x86"
+IUSE="static make-symlinks"
+
+src_prepare() {
+ sed -i 's:-Werror::' Makefile || die
+}
+
+src_compile() {
+ emake \
+ CC="$(tc-getCC)" \
+ STATIC=$(usex static 1 0) \
+ IOTOOLS_DEBUG="${CFLAGS}"
+}
+
+src_install() {
+ dosbin iotools
+
+ # Note: This is done manually because invoking the iotools binary
+ # when cross-compiling will likely fail.
+ local known_cmds="and btr bts busy_loop cmos_read cmos_write cpu_list mem_dump mem_read16 mem_read32 mem_read64 mem_read8 mem_write16 mem_write32 mem_write64 mem_write8 mmio_dump mmio_read16 mmio_read32 mmio_read64 mmio_read8 mmio_write16 mmio_write32 mmio_write64 mmio_write8 not or pci_list pci_read16 pci_read32 pci_read8 pci_write16 pci_write32 pci_write8 runon shl shr smbus_quick smbus_read16 smbus_read8 smbus_readblock smbus_receive_byte smbus_send_byte smbus_write16 smbus_write8 smbus_writeblock xor"
+ case ${ARCH} in
+ amd64|x86) known_cmds+=" cpuid io_read16 io_read32 io_read8 io_write16 io_write32 io_write8 rdmsr rdtsc wrmsr";;
+ esac
+ if ! tc-is-cross-compiler ; then
+ local sorted_cmds=$(echo $(printf '%s\n' ${known_cmds} | LC_ALL=C sort))
+ local check_cmds=$(echo $(./iotools --list-cmds 2>/dev/null | grep '^ ' | LC_ALL=C sort))
+ if [[ ${sorted_cmds} != "${check_cmds:-${sorted_cmds}}" ]] ; then
+ eerror "known_cmds = ${sorted_cmds}"
+ eerror "check_cmds = ${check_cmds}"
+ die "need to update known_cmds cache in the ebuild"
+ fi
+ fi
+
+ if use make-symlinks ; then
+ local cmd
+ for cmd in ${known_cmds} ; do
+ dosym iotools /usr/sbin/${cmd}
+ done
+ fi
+}
diff --git a/sys-apps/iotools/metadata.xml b/sys-apps/iotools/metadata.xml
new file mode 100644
index 000000000000..dde53cf2f5ed
--- /dev/null
+++ b/sys-apps/iotools/metadata.xml
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer type="person">
+ <email>vapier@gentoo.org</email>
+</maintainer>
+<use>
+ <flag name="make-symlinks">Generate sub-command symlinks to iotools -- note that a lot are simple like "xor"</flag>
+</use>
+</pkgmetadata>