aboutsummaryrefslogtreecommitdiff
path: root/package/s390-tools
diff options
context:
space:
mode:
Diffstat (limited to 'package/s390-tools')
-rw-r--r--package/s390-tools/0001-zkey-ekmfweb-fix-linking-of-libekmfweb.patch53
-rw-r--r--package/s390-tools/0002-osasnmpd-Makefile-fix-cross-compilation.patch41
-rw-r--r--package/s390-tools/Config.in14
-rw-r--r--package/s390-tools/s390-tools.hash3
-rw-r--r--package/s390-tools/s390-tools.mk98
5 files changed, 209 insertions, 0 deletions
diff --git a/package/s390-tools/0001-zkey-ekmfweb-fix-linking-of-libekmfweb.patch b/package/s390-tools/0001-zkey-ekmfweb-fix-linking-of-libekmfweb.patch
new file mode 100644
index 0000000000..76a642af70
--- /dev/null
+++ b/package/s390-tools/0001-zkey-ekmfweb-fix-linking-of-libekmfweb.patch
@@ -0,0 +1,53 @@
+From a4e6f7239d8cee37e58eac974482d6deefa8a137 Mon Sep 17 00:00:00 2001
+From: Alexander Egorenkov <egorenar@linux.ibm.com>
+Date: Thu, 5 Nov 2020 17:42:58 +0100
+Subject: [PATCH 1/1] zkey/ekmfweb: fix linking of libekmfweb
+
+Use -L compiler's parameter instead of the environment variable
+LIBRARY_PATH.
+
+Fixes the following problem on buildroot:
+
+buildroot/qemu-s390x/host/bin/s390x-linux-gcc -shared -Wl,--version-script=zkey-ekmfweb.map -Wl,-z,defs,-Bsymbolic -Wl,-soname,zkey-ekmfweb.so.1 zkey-ekmfweb.o properties.o pkey.o cca.o ep11.o utils.o ../..//libutil/libutil.a -lekmfweb -ldl -lcrypto -o zkey-ekmfweb.so
+buildroot/qemu-s390x/host/bin/s390x-linux-gcc -I ../../include -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -I ../include -std=gnu99 -Wno-unused-parameter -Wno-missing-field-initializers -DS390_TOOLS_RELEASE=2.15.1-build-20201105 -DS390_TOOLS_LIBDIR=/lib/s390-tools -DS390_TOOLS_DATADIR=/usr/share/s390-tools -DS390_TOOLS_SYSCONFDIR=/etc -DS390_TOOLS_BINDIR=/sbin -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os -D_GNU_SOURCE -c udev_ccwgroup.c -o udev_ccwgroup.o
+buildroot/qemu-s390x/host/bin/s390x-linux-gcc -I ../../include -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -I ../include -std=gnu99 -Wno-unused-parameter -Wno-missing-field-initializers -DS390_TOOLS_RELEASE=2.15.1-build-20201105 -DS390_TOOLS_LIBDIR=/lib/s390-tools -DS390_TOOLS_DATADIR=/usr/share/s390-tools -DS390_TOOLS_SYSCONFDIR=/etc -DS390_TOOLS_BINDIR=/sbin -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os -D_GNU_SOURCE -c iscsi.c -o iscsi.o
+buildroot/qemu-s390x/host/bin/s390x-linux-gcc -I ../../include -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -I ../include -std=gnu99 -Wno-unused-parameter -Wno-missing-field-initializers -DS390_TOOLS_RELEASE=2.15.1-build-20201105 -DS390_TOOLS_LIBDIR=/lib/s390-tools -DS390_TOOLS_DATADIR=/usr/share/s390-tools -DS390_TOOLS_SYSCONFDIR=/etc -DS390_TOOLS_BINDIR=/sbin -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os -D_GNU_SOURCE -c dasd.c -o dasd.o
+buildroot/qemu-s390x/host/opt/ext-toolchain/bin/../lib/gcc/s390x-buildroot-linux-gnu/9.3.0/../../../../s390x-buildroot-linux-gnu/bin/ld: cannot find -lekmfweb
+collect2: error: ld returned 1 exit status
+make[4]: *** [Makefile:36: zkey-ekmfweb.so] Error 1
+make[3]: *** [Makefile:128: ekmfweb] Error 2
+buildroot/qemu-s390x/host/bin/s390x-linux-gcc -I ../../include -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -I ../include -std=gnu99 -Wno-unused-parameter -Wno-missing-field-initializers -DS390_TOOLS_RELEASE=2.15.1-build-20201105 -DS390_TOOLS_LIBDIR=/lib/s390-tools -DS390_TOOLS_DATADIR=/usr/share/s390-tools -DS390_TOOLS_SYSCONFDIR=/etc -DS390_TOOLS_BINDIR=/sbin -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os -D_GNU_SOURCE -c zfcp.c -o zfcp.o
+make[2]: *** [Makefile:43: zkey] Error 2
+make[2]: *** Waiting for unfinished jobs....
+
+Signed-off-by: Alexander Egorenkov <egorenar@linux.ibm.com>
+Acked-by: Ingo Franzki <ifranzki@linux.ibm.com>
+---
+ zkey/ekmfweb/Makefile | 4 +---
+ 1 file changed, 1 insertion(+), 3 deletions(-)
+
+diff --git a/zkey/ekmfweb/Makefile b/zkey/ekmfweb/Makefile
+index 79a16cb5..1a3a4977 100644
+--- a/zkey/ekmfweb/Makefile
++++ b/zkey/ekmfweb/Makefile
+@@ -7,8 +7,6 @@ all: zkey-ekmfweb.so
+
+ libs = $(rootdir)/libutil/libutil.a
+
+-export LIBRARY_PATH = $(rootdir)/libekmfweb:$LIBRARY_PATH
+-
+ zkey-ekmfweb.o: zkey-ekmfweb.c zkey-ekmfweb.h ../kms-plugin.h \
+ ../cca.h ../utils.h ../pkey.h ../properties.h \
+ $(rootdir)include/ekmfweb/ekmfweb.h libekmfweb.dep
+@@ -29,7 +27,7 @@ utils.o: ../utils.c ../utils.h ../pkey.h ../cca.h ../ep11.h
+ $(CC) $(ALL_CPPFLAGS) $(ALL_CFLAGS) -fPIC -c $< -o $@
+
+ zkey-ekmfweb.so: ALL_CFLAGS += -fPIC
+-zkey-ekmfweb.so: LDLIBS = -lekmfweb -ldl -lcrypto
++zkey-ekmfweb.so: LDLIBS = -L$(rootdir)/libekmfweb -lekmfweb -ldl -lcrypto
+ zkey-ekmfweb.so: ALL_LDFLAGS += -shared -Wl,--version-script=zkey-ekmfweb.map \
+ -Wl,-z,defs,-Bsymbolic -Wl,-soname,zkey-ekmfweb.so.$(VERM)
+ zkey-ekmfweb.so: zkey-ekmfweb.o properties.o pkey.o cca.o ep11.o utils.o $(libs)
+--
+2.26.2
+
diff --git a/package/s390-tools/0002-osasnmpd-Makefile-fix-cross-compilation.patch b/package/s390-tools/0002-osasnmpd-Makefile-fix-cross-compilation.patch
new file mode 100644
index 0000000000..8e3d1399f2
--- /dev/null
+++ b/package/s390-tools/0002-osasnmpd-Makefile-fix-cross-compilation.patch
@@ -0,0 +1,41 @@
+From d7faa31a871d14ab02b290bdf2b2fa085766d2ac Mon Sep 17 00:00:00 2001
+From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+Date: Fri, 27 Nov 2020 23:43:15 +0100
+Subject: [PATCH] osasnmpd/Makefile: fix cross-compilation
+
+Fix the following build failure by allowing the user to provide
+NET_SNMP_CONFIG:
+
+/bin/sh: net-snmp-config: command not found
+/home/buildroot/autobuild/run/instance-2/output-1/host/lib/gcc/s390x-buildroot-linux-gnu/9.3.0/../../../../s390x-buildroot-linux-gnu/bin/ld: osasnmpd.o: in function `main':
+osasnmpd.c:(.text.startup+0xcc): undefined reference to `snmp_log_perror'
+
+Fixes:
+ - http://autobuild.buildroot.org/results/00796f2ebd5fb0e08ac7a05a9ee566f2bc4bd1c3
+
+Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+[Upstream status: https://github.com/ibm-s390-tools/s390-tools/pull/99]
+---
+ osasnmpd/Makefile | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/osasnmpd/Makefile b/osasnmpd/Makefile
+index 15496b2..8ce0932 100644
+--- a/osasnmpd/Makefile
++++ b/osasnmpd/Makefile
+@@ -1,9 +1,10 @@
+ include ../common.mak
+-LDLIBS = `net-snmp-config --agent-libs`
++NET_SNMP_CONFIG = net-snmp-config
++LDLIBS = `$(NET_SNMP_CONFIG) --agent-libs`
+ # On some Linux systems `net-snmp-config --agent-libs` introduces -pie,
+ # therefore add -fPIC to prevent link failures.
+ ALL_CFLAGS += -fPIC
+-ALL_CFLAGS += `net-snmp-config --cflags`
++ALL_CFLAGS += `$(NET_SNMP_CONFIG) --cflags`
+
+ OBJS = ibmOSAMib.o ibmOSAMibUtil.o osasnmpd.o
+
+--
+2.29.2
+
diff --git a/package/s390-tools/Config.in b/package/s390-tools/Config.in
new file mode 100644
index 0000000000..4aede4e265
--- /dev/null
+++ b/package/s390-tools/Config.in
@@ -0,0 +1,14 @@
+comment "s390-tools needs a glibc toolchain w/ C++, wchar, dynamic library"
+ depends on BR2_s390x
+ depends on !BR2_TOOLCHAIN_USES_GLIBC || !BR2_INSTALL_LIBSTDCPP
+
+config BR2_PACKAGE_S390_TOOLS
+ bool "s390-tools"
+ depends on BR2_s390x
+ depends on BR2_INSTALL_LIBSTDCPP
+ depends on BR2_TOOLCHAIN_USES_GLIBC
+ select BR2_PACKAGE_ZLIB
+ help
+ Tools for use with the s390 Linux kernel and device drivers.
+
+ https://github.com/ibm-s390-tools/s390-tools
diff --git a/package/s390-tools/s390-tools.hash b/package/s390-tools/s390-tools.hash
new file mode 100644
index 0000000000..1de2399e03
--- /dev/null
+++ b/package/s390-tools/s390-tools.hash
@@ -0,0 +1,3 @@
+# Locally computed:
+sha256 8dc1180031018756ccd5acf6c26c4175bcac79e512e8a2ea8569fdf5d3f9bd6c s390-tools-2.15.1.tar.gz
+sha256 cca17a9a944ebec769adee4aebd805c912c357785ff2705a99ffe68563021f75 LICENSE
diff --git a/package/s390-tools/s390-tools.mk b/package/s390-tools/s390-tools.mk
new file mode 100644
index 0000000000..535caf208e
--- /dev/null
+++ b/package/s390-tools/s390-tools.mk
@@ -0,0 +1,98 @@
+################################################################################
+#
+# s390-tools
+#
+################################################################################
+
+S390_TOOLS_VERSION = 2.15.1
+S390_TOOLS_SITE = $(call github,ibm-s390-tools,s390-tools,v$(S390_TOOLS_VERSION))
+S390_TOOLS_LICENSE = MIT
+S390_TOOLS_LICENSE_FILES = LICENSE
+S390_TOOLS_DEPENDENCIES = zlib
+
+S390_TOOLS_MAKE_OPTS = \
+ ARCH=$(BR2_ARCH) \
+ CFLAGS="$(TARGET_CFLAGS) -D_GNU_SOURCE" \
+ LINK="$(TARGET_CC)" \
+ LINKXX="$(TARGET_CXX)"
+
+ifeq ($(BR2_PACKAGE_LIBCURL),y)
+S390_TOOLS_DEPENDENCIES += libcurl
+S390_TOOLS_MAKE_OPTS += \
+ HAVE_CURL=1 \
+ HAVE_LIBCURL=1
+else
+S390_TOOLS_MAKE_OPTS += \
+ HAVE_CURL=0 \
+ HAVE_LIBCURL=0
+endif
+
+ifeq ($(BR2_PACKAGE_JSON_C),y)
+S390_TOOLS_DEPENDENCIES += json-c
+S390_TOOLS_MAKE_OPTS += HAVE_JSONC=1
+else
+S390_TOOLS_MAKE_OPTS += HAVE_JSONC=0
+endif
+
+ifeq ($(BR2_PACKAGE_OPENSSL),y)
+S390_TOOLS_DEPENDENCIES += openssl
+S390_TOOLS_MAKE_OPTS += HAVE_OPENSSL=1
+else
+S390_TOOLS_MAKE_OPTS += HAVE_OPENSSL=0
+endif
+
+ifeq ($(BR2_PACKAGE_CRYPTSETUP),y)
+S390_TOOLS_DEPENDENCIES += cryptsetup
+S390_TOOLS_MAKE_OPTS += HAVE_CRYPTSETUP2=1
+else
+S390_TOOLS_MAKE_OPTS += HAVE_CRYPTSETUP2=0
+endif
+
+ifeq ($(BR2_PACKAGE_LIBGLIB2),y)
+S390_TOOLS_DEPENDENCIES += libglib2
+S390_TOOLS_MAKE_OPTS += HAVE_GLIB2=1
+else
+S390_TOOLS_MAKE_OPTS += HAVE_GLIB2=0
+endif
+
+ifeq ($(BR2_PACKAGE_NCURSES),y)
+S390_TOOLS_DEPENDENCIES += ncurses
+S390_TOOLS_MAKE_OPTS += HAVE_NCURSES=1
+else
+S390_TOOLS_MAKE_OPTS += HAVE_NCURSES=0
+endif
+
+ifeq ($(BR2_PACKAGE_LIBPFM4),y)
+S390_TOOLS_DEPENDENCIES += libpfm4
+S390_TOOLS_MAKE_OPTS += HAVE_PFM=1
+else
+S390_TOOLS_MAKE_OPTS += HAVE_PFM=0
+endif
+
+ifeq ($(BR2_PACKAGE_LIBFUSE),y)
+S390_TOOLS_DEPENDENCIES += libfuse
+S390_TOOLS_MAKE_OPTS += HAVE_FUSE=1
+else
+S390_TOOLS_MAKE_OPTS += HAVE_FUSE=0
+endif
+
+ifeq ($(BR2_PACKAGE_NETSNMP),y)
+S390_TOOLS_DEPENDENCIES += netsnmp
+S390_TOOLS_MAKE_OPTS += \
+ NET_SNMP_CONFIG=$(STAGING_DIR)/usr/bin/net-snmp-config \
+ HAVE_SNMP=1
+else
+S390_TOOLS_MAKE_OPTS += HAVE_SNMP=0
+endif
+
+define S390_TOOLS_BUILD_CMDS
+ $(TARGET_MAKE_ENV) $(MAKE) $(TARGET_CONFIGURE_OPTS) -C $(@D) \
+ $(S390_TOOLS_MAKE_OPTS)
+endef
+
+define S390_TOOLS_INSTALL_TARGET_CMDS
+ $(TARGET_MAKE_ENV) $(MAKE) $(TARGET_CONFIGURE_OPTS) -C $(@D) install \
+ $(S390_TOOLS_MAKE_OPTS) DESTDIR="$(TARGET_DIR)"
+endef
+
+$(eval $(generic-package))