aboutsummaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authorTuan Hoang <tmhoang@linux.ibm.com>2019-03-21 11:08:53 +0100
committerNatanael Copa <ncopa@alpinelinux.org>2019-04-05 08:36:22 +0000
commit87214df91a3e5209f3c10dc42f635f47f71aaf11 (patch)
treeffaf77539275435b4f63f1c4aebe4275bfa4a1e0 /main
parent780041a8bc368ebcd2bb81d60c5aefbb799a24fc (diff)
downloadaports-87214df91a3e5209f3c10dc42f635f47f71aaf11.tar.bz2
aports-87214df91a3e5209f3c10dc42f635f47f71aaf11.tar.xz
main/s390-tools: upgrade to 2.8.0
1.38.0 starts introducing GNU argz functions in libutil, zconf, zkey. Since those argz functions are fairly simple, we now pack them with s390-tools package. The only sub program is missing is cpuplugd due to missing feenableexcept functions. Add new dev packages for building zkey. Remove zipl pie patch since building zipl with pie is built-in. Update license, maintainer, description, repository (version 2.0.0 is a relicensed of 1.39.0 without any changes).
Diffstat (limited to 'main')
-rw-r--r--main/s390-tools/0001-zipl-flags.patch25
-rw-r--r--main/s390-tools/0002-musl-fixes.patch103
-rw-r--r--main/s390-tools/0003-major-minor.patch24
-rw-r--r--main/s390-tools/0009-link-libexecinfo.patch17
-rw-r--r--main/s390-tools/0100-zipl-no-pie.patch54
-rw-r--r--main/s390-tools/0101-zipl-dont-optimize-size.patch21
-rw-r--r--main/s390-tools/0300-disable-program-using-gnu-ext.patch32
-rw-r--r--main/s390-tools/APKBUILD45
-rw-r--r--main/s390-tools/Makefile.argz14
-rw-r--r--main/s390-tools/argz.c389
-rw-r--r--main/s390-tools/argz.h117
-rw-r--r--main/s390-tools/argz.patch145
12 files changed, 745 insertions, 241 deletions
diff --git a/main/s390-tools/0001-zipl-flags.patch b/main/s390-tools/0001-zipl-flags.patch
deleted file mode 100644
index da642fec93..0000000000
--- a/main/s390-tools/0001-zipl-flags.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-From 584fd01d78e94d98ea2cb21954789fcc844fabcb Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Dan=20Hor=C3=A1k?= <dan@danny.cz>
-Date: Fri, 22 Apr 2016 13:21:50 +0200
-Subject: [PATCH] zipl: disable strict aliasing for bootloader
-
----
- zipl/boot/Makefile | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/zipl/boot/Makefile b/zipl/boot/Makefile
-index bb8a19d..f1f4401 100644
---- a/zipl/boot/Makefile
-+++ b/zipl/boot/Makefile
-@@ -4,7 +4,7 @@ include ../../common.mak
- CFLAGS_BOOT = -Os -g -I../include -D__ASSEMBLY__ \
- -DS390_TOOLS_RELEASE=$(S390_TOOLS_RELEASE) \
- -fno-builtin -ffreestanding -fno-asynchronous-unwind-tables \
-- -fno-delete-null-pointer-checks \
-+ -fno-delete-null-pointer-checks -fno-strict-aliasing \
- -fexec-charset=IBM1047 -m64 -mpacked-stack \
- -mstack-size=8192 -mstack-guard=128 -msoft-float $(WARNFLAGS)
-
---
-2.7.4
-
diff --git a/main/s390-tools/0002-musl-fixes.patch b/main/s390-tools/0002-musl-fixes.patch
index 31271118d3..8c029b410a 100644
--- a/main/s390-tools/0002-musl-fixes.patch
+++ b/main/s390-tools/0002-musl-fixes.patch
@@ -37,8 +37,8 @@ index 0c1581a..8515fb6 100644
exit(-1);
}
-- vtocblk = (u_int64_t) vtoc_get_cyl_from_cchhb(&vlabel.vtoc) *
-+ vtocblk = (uint64_t) vtoc_get_cyl_from_cchhb(&vlabel.vtoc) *
+- vtocblk = (u_int64_t)vtoc_get_cyl_from_cchhb(&vlabel.vtoc) *
++ vtocblk = (uint64_t)vtoc_get_cyl_from_cchhb(&vlabel.vtoc) *
info->geo.heads * info->geo.sectors +
vtoc_get_head_from_cchhb(&vlabel.vtoc) * info->geo.sectors +
vlabel.vtoc.b;
@@ -76,10 +76,10 @@ index cc72e0a..8e34a10 100644
unsigned long long begin;
unsigned long long size;
diff --git a/fdasd/fdasd.c b/fdasd/fdasd.c
-index ccc7046..fb28b1e 100644
+index 7c1a1a7..0898fb9 100644
--- a/fdasd/fdasd.c
+++ b/fdasd/fdasd.c
-@@ -61,9 +61,9 @@ setpos (fdasd_anchor_t *anc, int dsn, int pos)
+@@ -211,9 +211,9 @@ static void setpos(fdasd_anchor_t *anc, int dsn, int pos)
anc->partno[dsn] = pos;
}
@@ -91,64 +91,61 @@ index ccc7046..fb28b1e 100644
/* large volume */
if (anc->f4->DS4DEVCT.DS4DSCYL == LV_COMPAT_CYL &&
-@@ -72,7 +72,7 @@ static u_int32_t get_usable_cylinders(fdasd_anchor_t *anc)
+@@ -221,7 +221,7 @@ static u_int32_t get_usable_cylinders(fdasd_anchor_t *anc)
+ return anc->f4->DS4DCYL;
/* normal volume */
if (anc->f4->DS4DEVCT.DS4DEVFG & ALTERNATE_CYLINDERS_USED)
- cyl = anc->f4->DS4DEVCT.DS4DSCYL -
-- (u_int16_t) anc->f4->DS4DEVAC;
-+ (uint16_t) anc->f4->DS4DEVAC;
+- cyl = anc->f4->DS4DEVCT.DS4DSCYL - (u_int16_t)anc->f4->DS4DEVAC;
++ cyl = anc->f4->DS4DEVCT.DS4DSCYL - (uint16_t)anc->f4->DS4DEVAC;
else
cyl = anc->f4->DS4DEVCT.DS4DSCYL;
- return cyl;
-@@ -81,7 +81,7 @@ static u_int32_t get_usable_cylinders(fdasd_anchor_t *anc)
+
+@@ -230,7 +230,7 @@ static u_int32_t get_usable_cylinders(fdasd_anchor_t *anc)
+
static void get_addr_of_highest_f1_f8_label(fdasd_anchor_t *anc, cchhb_t *addr)
{
-
- u_int8_t record;
+ uint8_t record;
- /* We have to count the follwing labels:
+ /* We have to count the following labels:
* one format 4
* one format 5
-@@ -2446,12 +2446,12 @@ fdasd_get_partition_data (fdasd_anchor_t *anc, extent_t *part_extent,
- partition_info_t *part_info)
- {
+@@ -2468,9 +2468,9 @@ static int fdasd_get_partition_data(fdasd_anchor_t *anc, extent_t *part_extent,
unsigned long start, stop, limit;
-- u_int32_t cc, cyl;
-- u_int16_t hh, head;
-+ uint32_t cc, cyl;
-+ uint16_t hh, head;
- cchh_t llimit,ulimit;
partition_info_t *part_tmp;
- char mesg[48];
+ cchh_t llimit, ulimit;
+- u_int16_t hh, head;
+- u_int32_t cc, cyl;
- u_int8_t b1, b2;
++ uint16_t hh, head;
++ uint32_t cc, cyl;
+ uint8_t b1, b2;
+ char mesg[48];
start = FIRST_USABLE_TRK;
-
-@@ -2764,8 +2764,8 @@ fdasd_auto_partition(fdasd_anchor_t *anc)
- cchh_t llimit,ulimit;
- cchhb_t hf1;
- extent_t ext;
-- u_int32_t cyl;
+@@ -2775,8 +2775,8 @@ static void fdasd_auto_partition(fdasd_anchor_t *anc)
+ {
+ partition_info_t *part_info = anc->first;
+ cchh_t llimit, ulimit;
- u_int16_t head;
-+ uint32_t cyl;
+- u_int32_t cyl;
+ uint16_t head;
++ uint32_t cyl;
+ extent_t ext;
+ cchhb_t hf1;
- if (!anc->silent)
- printf("auto-creating one partition for the whole disk...\n");
diff --git a/fdasd/fdasd.h b/fdasd/fdasd.h
index f22444e..39ea480 100644
--- a/fdasd/fdasd.h
+++ b/fdasd/fdasd.h
-@@ -188,7 +188,7 @@ struct fdasd_options options = {
+@@ -67,7 +67,7 @@ static struct fdasd_options options = {
};
typedef struct partition_info {
-- u_int8_t used;
-+ uint8_t used;
- unsigned long start_trk;
- unsigned long end_trk;
- unsigned long len_trk;
+- u_int8_t used;
++ uint8_t used;
+ unsigned long start_trk;
+ unsigned long end_trk;
+ unsigned long len_trk;
@@ -223,7 +223,7 @@ typedef struct fdasd_anchor {
int option_reuse;
int option_recreate;
@@ -548,40 +545,6 @@ index ea5b1c2..592200c 100644
#endif /* VTOC_H */
-diff --git a/libutil/util_opt.c b/libutil/util_opt.c
-index a1a5cda..39540b6 100644
---- a/libutil/util_opt.c
-+++ b/libutil/util_opt.c
-@@ -6,7 +6,6 @@
- * Copyright IBM Corp. 2016
- */
-
--#include <argz.h>
- #include <libgen.h>
- #include <stdio.h>
- #include <stdlib.h>
-diff --git a/libvmdump/vm_dump.cpp b/libvmdump/vm_dump.cpp
-index 53923ce..f2e460c 100644
---- a/libvmdump/vm_dump.cpp
-+++ b/libvmdump/vm_dump.cpp
-@@ -14,7 +14,7 @@
-
- Dump::DumpType VMDump::getDumpType(const char* inputFileName)
- {
-- char fmbk_id[8] = {0xc8, 0xc3, 0xd7, 0xc4, 0xc6, 0xd4, 0xc2, 0xd2};
-+ unsigned char fmbk_id[8] = {0xc8, 0xc3, 0xd7, 0xc4, 0xc6, 0xd4, 0xc2, 0xd2};
- struct _fir_basic fir;
- struct _fmbk fmbk;
- struct _adsr adsr;
-@@ -84,7 +84,7 @@ Dump::DumpType VMDump::getDumpType(const char* inputFileName)
-
- VMDump::VMDump(const char *fileName) : Dump(fileName, "rb")
- {
-- char fmbk_id[8] = {0xc8, 0xc3, 0xd7, 0xc4, 0xc6, 0xd4, 0xc2, 0xd2};
-+ unsigned char fmbk_id[8] = {0xc8, 0xc3, 0xd7, 0xc4, 0xc6, 0xd4, 0xc2, 0xd2};
-
- ebcdicAsciiConv = iconv_open("ISO-8859-1", "EBCDIC-US");
-
diff --git a/libvtoc/vtoc.c b/libvtoc/vtoc.c
index 048587b..9763f2e 100644
--- a/libvtoc/vtoc.c
diff --git a/main/s390-tools/0003-major-minor.patch b/main/s390-tools/0003-major-minor.patch
deleted file mode 100644
index f46f97377a..0000000000
--- a/main/s390-tools/0003-major-minor.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-diff --git a/fdasd/fdasd.c b/fdasd/fdasd.c
-index fb28b1e..218dca3 100644
---- a/fdasd/fdasd.c
-+++ b/fdasd/fdasd.c
-@@ -9,6 +9,7 @@
-
- #include <getopt.h>
- #include <stdio.h>
-+#include <sys/sysmacros.h>
-
- #include "lib/dasd_sys.h"
- #include "lib/util_opt.h"
-diff --git a/tape390/tape390_common.c b/tape390/tape390_common.c
-index 90954c0..ffe72bf 100644
---- a/tape390/tape390_common.c
-+++ b/tape390/tape390_common.c
-@@ -13,6 +13,7 @@
- #include <stdlib.h>
- #include <string.h>
- #include <sys/stat.h>
-+#include <sys/sysmacros.h>
-
- #include "tape390_common.h"
-
diff --git a/main/s390-tools/0009-link-libexecinfo.patch b/main/s390-tools/0009-link-libexecinfo.patch
index 9902e8db7f..be78bc1382 100644
--- a/main/s390-tools/0009-link-libexecinfo.patch
+++ b/main/s390-tools/0009-link-libexecinfo.patch
@@ -1,13 +1,12 @@
diff --git a/common.mak b/common.mak
-index 175ec37..6d45e56 100644
+index 9c349e5..0a5fd69 100644
--- a/common.mak
+++ b/common.mak
-@@ -224,7 +224,7 @@ endif
- $(CXX) $(ALL_CPPFLAGS) $(ALL_CXXFLAGS) -c $< -o $@
+@@ -228,6 +228,7 @@ else
+ NO_PIE_LINKFLAGS :=
+ NO_PIE_LDFLAGS :=
+ endif
++LDLIBS += $(LIBEXECINFO_LIBS)
- %: %.o
-- $(LINK) $(ALL_LDFLAGS) $^ $(LOADLIBES) $(LDLIBS) -o $@
-+ $(LINK) $(ALL_LDFLAGS) $^ $(LOADLIBES) $(LDLIBS) $(LIBEXECINFO_LIBS) -o $@
-
- %.a:
- $(AR) rcs $@ $^
+ # Overwrite implicite makefile rules for having nice compile output
+ %.o: %.c
diff --git a/main/s390-tools/0100-zipl-no-pie.patch b/main/s390-tools/0100-zipl-no-pie.patch
deleted file mode 100644
index 50e983e0a8..0000000000
--- a/main/s390-tools/0100-zipl-no-pie.patch
+++ /dev/null
@@ -1,54 +0,0 @@
-diff --git a/zipl/boot/Makefile b/zipl/boot/Makefile
-index 6474aad..83771f1 100644
---- a/zipl/boot/Makefile
-+++ b/zipl/boot/Makefile
-@@ -1,7 +1,7 @@
- # Common definitions
- include ../../common.mak
-
--CFLAGS_BOOT = -Os -g -I../include -D__ASSEMBLY__ \
-+CFLAGS_BOOT = -fno-pie -Os -g -I../include -D__ASSEMBLY__ \
- -DS390_TOOLS_RELEASE=$(S390_TOOLS_RELEASE) \
- -fno-builtin -ffreestanding -fno-asynchronous-unwind-tables \
- -fno-delete-null-pointer-checks -fno-strict-aliasing \
-@@ -54,11 +54,11 @@ stage3.exec: head.o stage3.o kdump3.o libc.o sclp.o sclp_stage3.o \
- }' \
- ); \
- case $$STAGE in \
-- 0) SFLAGS="-nostdlib -Wl,-Ttext,0";; \
-- 1) SFLAGS="-nostdlib -Wl,-Ttext,0x18";; \
-- 1b) SFLAGS="-nostdlib -Wl,-Ttext,0xE000";; \
-- 2) SFLAGS="-nostdlib -Wl,-T,stage2.lds";; \
-- 3) SFLAGS="-nostdlib -Wl,-T,stage3.lds";; \
-+ 0) SFLAGS="-no-pie -nostdlib -Wl,-Ttext,0";; \
-+ 1) SFLAGS="-no-pie -nostdlib -Wl,-Ttext,0x18";; \
-+ 1b) SFLAGS="-no-pie -nostdlib -Wl,-Ttext,0xE000";; \
-+ 2) SFLAGS="-no-pie -nostdlib -Wl,-T,stage2.lds";; \
-+ 3) SFLAGS="-no-pie -nostdlib -Wl,-T,stage3.lds";; \
- esac; \
- $(LINK) $$SFLAGS -m64 $^ -o $@
-
-@@ -77,7 +77,7 @@ stage3.exec: head.o stage3.o kdump3.o libc.o sclp.o sclp_stage3.o \
- $< $@
-
- data.o: $(FILES)
-- $(LD) -r -b binary -o data.o $(FILES)
-+ $(LD) -no-pie -r -b binary -o data.o $(FILES)
-
- data.h: data.o
- rm -f data.h
-diff --git a/zipl/src/Makefile b/zipl/src/Makefile
-index 0ea0077..c526a46 100644
---- a/zipl/src/Makefile
-+++ b/zipl/src/Makefile
-@@ -7,8 +7,8 @@ ALL_CPPFLAGS += -I../include -I../boot -I../../include \
- -DZFCPDUMP_FS_RD=$(ZFCPDUMP_FS_RD) \
- -DZFCPDUMP_PART_IMAGE=$(ZFCPDUMP_PART_IMAGE) \
- -DZFCPDUMP_PART_RD=$(ZFCPDUMP_PART_RD) \
-- -D_FILE_OFFSET_BITS=64
--ALL_LDFLAGS += -Wl,-z,noexecstack
-+ -D_FILE_OFFSET_BITS=64 -fno-pie
-+ALL_LDFLAGS += -Wl,-z,noexecstack -no-pie
-
- libs = $(rootdir)/libutil/libutil.a \
- $(rootdir)/libu2s/libu2s.a
diff --git a/main/s390-tools/0101-zipl-dont-optimize-size.patch b/main/s390-tools/0101-zipl-dont-optimize-size.patch
index 889dbf4750..6ef8d93e7c 100644
--- a/main/s390-tools/0101-zipl-dont-optimize-size.patch
+++ b/main/s390-tools/0101-zipl-dont-optimize-size.patch
@@ -1,26 +1,27 @@
diff --git a/zipl/boot/Makefile b/zipl/boot/Makefile
-index 83771f1..f221dbf 100644
+index 52b3a23..9dfb146 100644
--- a/zipl/boot/Makefile
+++ b/zipl/boot/Makefile
-@@ -1,6 +1,8 @@
+@@ -1,6 +1,9 @@
# Common definitions
include ../../common.mak
+ALL_CPPFLAGS := $(filter-out -Os,$(ALL_CPPFLAGS))
+ALL_CFLAGS := $(filter-out -Os,$(ALL_CFLAGS))
- CFLAGS_BOOT = -fno-pie -Os -g -I../include -D__ASSEMBLY__ \
++
+ CFLAGS_BOOT = $(NO_PIE_CFLAGS) -Os -g -I../include -D__ASSEMBLY__ \
-DS390_TOOLS_RELEASE=$(S390_TOOLS_RELEASE) \
-fno-builtin -ffreestanding -fno-asynchronous-unwind-tables \
diff --git a/zipl/src/Makefile b/zipl/src/Makefile
-index c526a46..24ec04f 100644
+index 1f39d06..f6bcb97 100644
--- a/zipl/src/Makefile
+++ b/zipl/src/Makefile
-@@ -8,6 +8,8 @@ ALL_CPPFLAGS += -I../include -I../boot -I../../include \
- -DZFCPDUMP_PART_IMAGE=$(ZFCPDUMP_PART_IMAGE) \
- -DZFCPDUMP_PART_RD=$(ZFCPDUMP_PART_RD) \
- -D_FILE_OFFSET_BITS=64 -fno-pie
+@@ -5,6 +5,8 @@ ALL_CPPFLAGS += -I../include -I../boot \
+ -DZFCPDUMP_IMAGE="STRINGIFY($(ZFCPDUMP_DIR)/$(ZFCPDUMP_IMAGE))" \
+ -DZFCPDUMP_INITRD="STRINGIFY($(ZFCPDUMP_DIR)/$(ZFCPDUMP_INITRD))" \
+ -D_FILE_OFFSET_BITS=64 $(NO_PIE_CFLAGS)
+ALL_CPPFLAGS := $(filter-out -Os,$(ALL_CPPFLAGS))
+ALL_CFLAGS := $(filter-out -Os,$(ALL_CFLAGS))
- ALL_LDFLAGS += -Wl,-z,noexecstack -no-pie
+ ALL_LDFLAGS += -Wl,-z,noexecstack $(NO_PIE_LDFLAGS)
- libs = $(rootdir)/libutil/libutil.a \
+ libs = $(rootdir)/libu2s/libu2s.a \
diff --git a/main/s390-tools/0300-disable-program-using-gnu-ext.patch b/main/s390-tools/0300-disable-program-using-gnu-ext.patch
index fcb92a088a..7688130757 100644
--- a/main/s390-tools/0300-disable-program-using-gnu-ext.patch
+++ b/main/s390-tools/0300-disable-program-using-gnu-ext.patch
@@ -1,4 +1,3 @@
-zconf/zcrypt : argz functions
cpuplugd : feenableexcept function
diff --git a/Makefile b/Makefile
@@ -6,38 +5,11 @@ index a760c0f..7fe2694 100644
--- a/Makefile
+++ b/Makefile
@@ -6,7 +6,7 @@ include common.mak
- LIB_DIRS = libvtoc libu2s libutil libzds libdasd libvmdump
+ LIB_DIRS = libvtoc libu2s libutil libzds libdasd libvmdump libccw libvmcp
TOOL_DIRS = zipl zdump fdasd dasdfmt dasdview tunedasd \
tape390 osasnmpd qetharp ip_watcher qethconf scripts zconf \
- vmconvert vmcp man mon_tools dasdinfo vmur cpuplugd ipl_tools \
+ vmconvert vmcp man mon_tools dasdinfo vmur ipl_tools \
ziomon iucvterm hyptop cmsfs-fuse qethqoat zfcpdump zdsfs cpumf \
- systemd hmcdrvfs cpacfstats zdev dump2tar
+ systemd hmcdrvfs cpacfstats zdev dump2tar zkey netboot etc zpcictl
SUB_DIRS = $(LIB_DIRS) $(TOOL_DIRS)
-diff --git a/scripts/Makefile b/scripts/Makefile
-index 94cd6e0..e2c8091 100644
---- a/scripts/Makefile
-+++ b/scripts/Makefile
-@@ -1,7 +1,7 @@
- include ../common.mak
-
--SCRIPTS = dbginfo.sh zfcpdbf scsi_logging_level
--MAN_PAGES = dbginfo.sh.1 zfcpdbf.1
-+SCRIPTS = zfcpdbf scsi_logging_level
-+MAN_PAGES = zfcpdbf.1
-
- all:
-
-diff --git a/zconf/Makefile b/zconf/Makefile
-index 0877c8c..e376104 100644
---- a/zconf/Makefile
-+++ b/zconf/Makefile
-@@ -9,7 +9,7 @@ USRSBIN_SCRIPTS = lsmem chmem lsluns
- MANPAGES= lsdasd.8 lstape.8 lscss.8 chccwdev.8 lsqeth.8 lszfcp.8 lsluns.8 \
- cio_ignore.8 znetconf.8 chmem.8 lsmem.8 dasdstat.8
-
--SUB_DIRS = zcrypt scm chp
-+SUB_DIRS =
-
- all: $(SUB_DIRS)
-
diff --git a/main/s390-tools/APKBUILD b/main/s390-tools/APKBUILD
index c8a890da4e..c90552f66e 100644
--- a/main/s390-tools/APKBUILD
+++ b/main/s390-tools/APKBUILD
@@ -1,21 +1,19 @@
# Contributor: Natanael Copa <ncopa@alpinelinux.org>
-# Maintainer: Tuan M. Hoang <tmhoang@flatglobe.org>
+# Maintainer: Tuan Hoang <tmhoang@linux.ibm.com>
pkgname=s390-tools
-pkgver=1.37.1
+pkgver=2.8.0
pkgrel=0
-pkgdesc="Utilities for Linux on IBM z Systems"
-url="http://www.ibm.com/developerworks/linux/linux390/s390-tools.html"
+pkgdesc="Tools for use with the s390 Linux kernel and device drivers"
+url="https://github.com/ibm-s390-tools/s390-tools"
arch="s390x"
-license="GPL-2.0-or-later"
+license="MIT"
depends_dev=""
-makedepends="$depends_dev linux-headers libexecinfo-dev zlib-dev fuse-dev ncurses-dev"
+makedepends="$depends_dev linux-headers libexecinfo-dev zlib-dev fuse-dev ncurses-dev openssl-dev cryptsetup-dev json-c-dev"
triggers="$pkgname.trigger=/boot"
install="$pkgname.post-install $pkgname.post-upgrade"
subpackages="$pkgname-doc"
-source="http://download.boulder.ibm.com/ibmdl/pub/software/dw/linux390/ht_src/$pkgname-$pkgver.tar.bz2
- 0001-zipl-flags.patch
+source="$pkgname-$pkgver.tar.gz::https://github.com/ibm-s390-tools/$pkgname/archive/v$pkgver.tar.gz
0002-musl-fixes.patch
- 0003-major-minor.patch
0004-missing-time-header.patch
0006-define-path-mounted.patch
0007-tunedasd-no-need-error-h.patch
@@ -23,45 +21,54 @@ source="http://download.boulder.ibm.com/ibmdl/pub/software/dw/linux390/ht_src/$p
0009-link-libexecinfo.patch
0010-musl-s390x-signal-def.patch
- 0100-zipl-no-pie.patch
0101-zipl-dont-optimize-size.patch
0200-dasdinfo-gnu-ext-hack.patch
0300-disable-program-using-gnu-ext.patch
zconf-shell.patch
+ argz.patch
+ argz.c
+ argz.h
+ Makefile.argz
mk-s390-cdboot.c
"
builddir="$srcdir/$pkgname-$pkgver"
build() {
cd "$builddir"
+ mkdir -p "$builddir"/libargz
+ cp "$srcdir"/argz.h "$builddir"/include/argz.h
+ cp "$srcdir"/argz.c "$builddir"/libargz/argz.c
+ cp "$srcdir"/Makefile.argz "$builddir"/libargz/Makefile
make -j1 V=1 CFLAGS="$CFLAGS -D_GNU_SOURCE" \
HAVE_SNMP=0 \
HAVE_PFM=0 \
+ DISTRELEASE="Alpine" \
LIBEXECINFO_LIBS="-lexecinfo"
gcc -Wall -o mk-s390-cdboot "$srcdir"/mk-s390-cdboot.c
}
package() {
cd "$builddir"
- make HAVE_SNMP=0 HAVE_PFM=0 DESTDIR="$pkgdir" install
+ make HAVE_SNMP=0 HAVE_PFM=0 DESTDIR="$pkgdir" DISTRELEASE="Alpine" install
install -Dm755 mk-s390-cdboot "$pkgdir"/sbin/mk-s390-cdboot
}
-sha512sums="43a255171956aad3d04e666a2ab949f392bb8d8faca0a8f8a4714f9eabbc93e625ed0ec0cae69f05ef6a3ab86982de2a757184b771b60e927d86c931fb5cdf89 s390-tools-1.37.1.tar.bz2
-3e1d0829e13bea69f48c556c2454b2927ffc59a7f4a04f7ebce41b9b5ed95ce963922fec9981e7ae62be801abbdc2cd27498399d0c4b8f9d10fae82dc3a9df85 0001-zipl-flags.patch
-658b804edfef85e63c5df7a23dccff5a53c3ab5b310b81b1e584c672070d7cec64ac78624de282e535227517e405ff33003a2ddc5f1f4ec7d4edf6e125305638 0002-musl-fixes.patch
-d8936addbf7713d14a44f9137c19769eb66f9c1d8ddc7dc58a7abbe4791045ed3c6eca88e2bbf8a6d3b18d8e437481df95d1827722bb1f7e093aa86753be85d1 0003-major-minor.patch
+sha512sums="c13a58924b069a832a8c73e450dd6c9c3942787c1fa345450b1537af17ca23eda99025ee78edbe6c7192d82840596f9e07e25a10fccfba69f8a82b29980d82d1 s390-tools-2.8.0.tar.gz
+f30729f9eb956dedc2a47888b9ea3da6a0e28aab23833fe6493932838371d6b0aa5eef686d7f36294a5ea1cd82d8b28bb5718f484cc7ecd8ae67dc827480447f 0002-musl-fixes.patch
5cadad403b0bce9c92e326612b2fa6d32b15b550ef9241fd77cc3b86e6e443087c29c539727a9584896624317cde9276543aeed4fa62ff1db233f8cfd8872d03 0004-missing-time-header.patch
984fd24ff1bf2d77f6aca77e4a75334ad21a9e36ce27fabb848d82a8e68446e2effeb16a725d5b93ae178ac11379f83a003c8c0d9e408cf96419873741517c3e 0006-define-path-mounted.patch
a0ca14c6de2415a725c44e067157c2b5a8db582f4eadbd355fadab5e050870073cf5f5e11212fd046bf24841ed60b84e1475fed115d1e307b8fc1f2da69e5fbd 0007-tunedasd-no-need-error-h.patch
bdbeb6f3873ede82487c7e4fcac84aa2bf8a922991ec32d029a64cd7142625f5a99920db0f1b6935805d7371ae5a7640c5ea577969937dd96c4f4f996b909ac3 0008-iucvterm-no-nls.patch
-754ae56dc45326eccd9b5e7be5c1faffeeee7d8ff84ed3275269e28324b65c0437ebf6cff55dea2188a06f09a798a00c9792ccc41a805e1d24824a4d7334bec0 0009-link-libexecinfo.patch
+798ae2128a2e419a2e76f3198ac7563e84470069571beffd673b9cfc1755f432afaa32d730fd1c43db890009f37bc11a7a00af6e7e6b41ea7ffd789469eaef25 0009-link-libexecinfo.patch
43edeb7f3ab3f5bbc6cd43e6d04deafcfa18211886f3801a226d46679cd70fc709732d5f41d8cc421f9fb0b441a395ebd2a57512f97662531a3050819c97ba1e 0010-musl-s390x-signal-def.patch
-d879173250fc0cabef198785923248e6832158e38d6ea9ef615f14e2d6698810b54c38c8327f20b2c43d8d509a274b27a7c0ad999a0c0bed2743715f21ab859a 0100-zipl-no-pie.patch
-1cbbe3fe265c7d4164143d24c532c18b354be4bc295ad24064d379660e43a475b7d678b458cdf74ffdb44d6cd38a497dbe00758d688c547c6ece63b6dee091b7 0101-zipl-dont-optimize-size.patch
+97f5e0482f69b64c0f71df1bc39c10126d857b9fa38775f6d4b8dabe1267a0ff5fe231c937b82da76445118eb7c37625fc30190924c479dfacc7c1b8b0a7e487 0101-zipl-dont-optimize-size.patch
98f5a150e30752d2bec6447d8f24b89a3afda43c31ebe3e6ce940ac398ae9ebfab2c516e05686e7969461c7cf7e467e1221981a5499a9bb8a5aef2f265ec8b45 0200-dasdinfo-gnu-ext-hack.patch
-6736ca9deb25838511e715e96d1f5bfc283460689e767181463d1827c80be200b1375708ff48772599083b14f74594f7053cf30fcc6c93ba7fa5dfae832434de 0300-disable-program-using-gnu-ext.patch
+9e7550f9e19ee287b514893206edf70f4b4e45988a2e5d590f6b6902108a4581bda5c6904e4b10b08897771d6af7beb8632f21601ccad42cc385045823be159e 0300-disable-program-using-gnu-ext.patch
4fd96891cc2dc868793003a50eae3258a82db1c840b6d2a63107586e96f6c68686e54b625f5395190af606d996c812582938e9148ce51bdb08075f4fdbe96973 zconf-shell.patch
+95a70259166fb90b645604501bfa9ab9473f8de102bdf75baa1ba43749efab6488d419ceb6c32058bcb21a3cbdcbacc2638201f74c17a2ed891b0c287d6e7348 argz.patch
+2e573314d4c4ed90b61da28de22ae8e2f68ced5489f7e5e0b30f51b776efaf40c1f781d3b485418572d8f33a169fa6946b7358cbd4a7de5a3724b20ed622262b argz.c
+50bd5c0f555963dadbfaa72df5bf0801a48743d6d0feddb6ebfa4ffa410196216c1860d3a577361e035169fea4217aef3f04d69394c59db65b60c5ea29eba8cb argz.h
+5e19ccfce59a2a79863db676b0ea4280cb9016cda1a30dc233526f52425c305410dd148453b75c2613acac37e364305ee25f8e545d57c5059cca19a13bac2a5e Makefile.argz
349eb06895016d16194819c4a04f604720f1373ea61a9bc4c58467281c9a2ed3539bd4e8b6984f4e5177630dbe8b928aa95912c9a3e3b0e1fe275d59f9fe573d mk-s390-cdboot.c"
diff --git a/main/s390-tools/Makefile.argz b/main/s390-tools/Makefile.argz
new file mode 100644
index 0000000000..a3061dd5af
--- /dev/null
+++ b/main/s390-tools/Makefile.argz
@@ -0,0 +1,14 @@
+include ../common.mak
+
+lib = libargz.a
+
+all: $(lib)
+
+objects = argz.o
+
+$(lib): $(objects)
+
+install: all
+
+clean:
+ rm -f *.o $(lib)
diff --git a/main/s390-tools/argz.c b/main/s390-tools/argz.c
new file mode 100644
index 0000000000..09ede86bae
--- /dev/null
+++ b/main/s390-tools/argz.c
@@ -0,0 +1,389 @@
+/* Copyright (C) 1996-2019 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+ Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1996.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#include <argz.h>
+#include <stdlib.h>
+
+
+/* Add BUF, of length BUF_LEN to the argz vector in ARGZ & ARGZ_LEN. */
+error_t
+argz_append (char **argz, size_t *argz_len, const char *buf, size_t buf_len)
+{
+ size_t new_argz_len = *argz_len + buf_len;
+ char *new_argz = realloc (*argz, new_argz_len);
+ if (new_argz)
+ {
+ memcpy (new_argz + *argz_len, buf, buf_len);
+ *argz = new_argz;
+ *argz_len = new_argz_len;
+ return 0;
+ }
+ else
+ return ENOMEM;
+}
+
+/* Add STR to the argz vector in ARGZ & ARGZ_LEN. This should be moved into
+ argz.c in libshouldbelibc. */
+error_t
+argz_add (char **argz, size_t *argz_len, const char *str)
+{
+ return argz_append (argz, argz_len, str, strlen (str) + 1);
+}
+
+/* Returns the number of strings in ARGZ. */
+size_t
+argz_count (const char *argz, size_t len)
+{
+ size_t count = 0;
+ while (len > 0)
+ {
+ size_t part_len = strlen(argz);
+ argz += part_len + 1;
+ len -= part_len + 1;
+ count++;
+ }
+ return count;
+}
+
+/* Make a '\0' separated arg vector from a unix argv vector, returning it in
+ ARGZ, and the total length in LEN. If a memory allocation error occurs,
+ ENOMEM is returned, otherwise 0. */
+error_t
+argz_create (char *const argv[], char **argz, size_t *len)
+{
+ int argc;
+ size_t tlen = 0;
+ char *const *ap;
+ char *p;
+
+ for (argc = 0; argv[argc] != NULL; ++argc)
+ tlen += strlen (argv[argc]) + 1;
+
+ if (tlen == 0)
+ *argz = NULL;
+ else
+ {
+ *argz = malloc (tlen);
+ if (*argz == NULL)
+ return ENOMEM;
+
+ for (p = *argz, ap = argv; *ap; ++ap, ++p)
+ p = stpcpy (p, *ap);
+ }
+ *len = tlen;
+
+ return 0;
+}
+
+error_t
+argz_create_sep (const char *string, int delim, char **argz, size_t *len)
+{
+ size_t nlen = strlen (string) + 1;
+
+ if (nlen > 1)
+ {
+ const char *rp;
+ char *wp;
+
+ *argz = (char *) malloc (nlen);
+ if (*argz == NULL)
+ return ENOMEM;
+
+ rp = string;
+ wp = *argz;
+ do
+ if (*rp == delim)
+ {
+ if (wp > *argz && wp[-1] != '\0')
+ *wp++ = '\0';
+ else
+ --nlen;
+ }
+ else
+ *wp++ = *rp;
+ while (*rp++ != '\0');
+
+ if (nlen == 0)
+ {
+ free (*argz);
+ *argz = NULL;
+ *len = 0;
+ }
+
+ *len = nlen;
+ }
+ else
+ {
+ *argz = NULL;
+ *len = 0;
+ }
+
+ return 0;
+}
+
+char *
+argz_next (const char *argz, size_t argz_len, const char *entry)
+{
+ if (entry)
+ {
+ if (entry < argz + argz_len)
+ entry = strchr (entry, '\0') + 1;
+
+ return entry >= argz + argz_len ? NULL : (char *) entry;
+ }
+ else
+ if (argz_len > 0)
+ return (char *) argz;
+ else
+ return NULL;
+}
+
+/* Delete ENTRY from ARGZ & ARGZ_LEN, if any. */
+void
+argz_delete (char **argz, size_t *argz_len, char *entry)
+{
+ if (entry)
+ /* Get rid of the old value for NAME. */
+ {
+ size_t entry_len = strlen (entry) + 1;
+ *argz_len -= entry_len;
+ memmove (entry, entry + entry_len, *argz_len - (entry - *argz));
+ if (*argz_len == 0)
+ {
+ free (*argz);
+ *argz = 0;
+ }
+ }
+}
+
+/* Puts pointers to each string in ARGZ, plus a terminating 0 element, into
+ ARGV, which must be large enough to hold them all. */
+void
+argz_extract (const char *argz, size_t len, char **argv)
+{
+ while (len > 0)
+ {
+ size_t part_len = strlen (argz);
+ *argv++ = (char *) argz;
+ argz += part_len + 1;
+ len -= part_len + 1;
+ }
+ *argv = 0;
+}
+
+/* Insert ENTRY into ARGZ & ARGZ_LEN before BEFORE, which should be an
+ existing entry in ARGZ; if BEFORE is NULL, ENTRY is appended to the end.
+ Since ARGZ's first entry is the same as ARGZ, argz_insert (ARGZ, ARGZ_LEN,
+ ARGZ, ENTRY) will insert ENTRY at the beginning of ARGZ. If BEFORE is not
+ in ARGZ, EINVAL is returned, else if memory can't be allocated for the new
+ ARGZ, ENOMEM is returned, else 0. */
+error_t
+argz_insert (char **argz, size_t *argz_len, char *before, const char *entry)
+{
+ if (! before)
+ return argz_add (argz, argz_len, entry);
+
+ if (before < *argz || before >= *argz + *argz_len)
+ return EINVAL;
+
+ if (before > *argz)
+ /* Make sure before is actually the beginning of an entry. */
+ while (before[-1])
+ before--;
+
+ {
+ size_t after_before = *argz_len - (before - *argz);
+ size_t entry_len = strlen (entry) + 1;
+ size_t new_argz_len = *argz_len + entry_len;
+ char *new_argz = realloc (*argz, new_argz_len);
+
+ if (new_argz)
+ {
+ before = new_argz + (before - *argz);
+ memmove (before + entry_len, before, after_before);
+ memmove (before, entry, entry_len);
+ *argz = new_argz;
+ *argz_len = new_argz_len;
+ return 0;
+ }
+ else
+ return ENOMEM;
+ }
+}
+
+/* Make '\0' separated arg vector ARGZ printable by converting all the '\0's
+ except the last into the character SEP. */
+void
+argz_stringify (char *argz, size_t len, int sep)
+{
+ if (len > 0)
+ while (1)
+ {
+ size_t part_len = strnlen (argz, len);
+ argz += part_len;
+ len -= part_len;
+ if (len-- <= 1) /* includes final '\0' we want to stop at */
+ break;
+ *argz++ = sep;
+ }
+}
+
+error_t
+argz_add_sep (char **argz, size_t *argz_len, const char *string, int delim)
+{
+ size_t nlen = strlen (string) + 1;
+
+ if (nlen > 1)
+ {
+ const char *rp;
+ char *wp;
+
+ *argz = (char *) realloc (*argz, *argz_len + nlen);
+ if (*argz == NULL)
+ return ENOMEM;
+
+ wp = *argz + *argz_len;
+ rp = string;
+ do
+ if (*rp == delim)
+ {
+ if (wp > *argz && wp[-1] != '\0')
+ *wp++ = '\0';
+ else
+ --nlen;
+ }
+ else
+ *wp++ = *rp;
+ while (*rp++ != '\0');
+
+ *argz_len += nlen;
+ }
+
+ return 0;
+}
+
+/* Append BUF, of length BUF_LEN to *TO, of length *TO_LEN, reallocating and
+ updating *TO & *TO_LEN appropriately. If an allocation error occurs,
+ *TO's old value is freed, and *TO is set to 0. */
+static void
+str_append (char **to, size_t *to_len, const char *buf, const size_t buf_len)
+{
+ size_t new_len = *to_len + buf_len;
+ char *new_to = realloc (*to, new_len + 1);
+
+ if (new_to)
+ {
+ *((char *) mempcpy (new_to + *to_len, buf, buf_len)) = '\0';
+ *to = new_to;
+ *to_len = new_len;
+ }
+ else
+ {
+ free (*to);
+ *to = 0;
+ }
+}
+
+/* Replace any occurrences of the string STR in ARGZ with WITH, reallocating
+ ARGZ as necessary. If REPLACE_COUNT is non-zero, *REPLACE_COUNT will be
+ incremented by number of replacements performed. */
+error_t
+argz_replace (char **argz, size_t *argz_len, const char *str, const char *with,
+ unsigned *replace_count)
+{
+ error_t err = 0;
+
+ if (str && *str)
+ {
+ char *arg = 0;
+ char *src = *argz;
+ size_t src_len = *argz_len;
+ char *dst = 0;
+ size_t dst_len = 0;
+ int delayed_copy = 1; /* True while we've avoided copying anything. */
+ size_t str_len = strlen (str), with_len = strlen (with);
+
+ while (!err && (arg = argz_next (src, src_len, arg)))
+ {
+ char *match = strstr (arg, str);
+ if (match)
+ {
+ char *from = match + str_len;
+ size_t to_len = match - arg;
+ char *to = strndup (arg, to_len);
+
+ while (to && from)
+ {
+ str_append (&to, &to_len, with, with_len);
+ if (to)
+ {
+ match = strstr (from, str);
+ if (match)
+ {
+ str_append (&to, &to_len, from, match - from);
+ from = match + str_len;
+ }
+ else
+ {
+ str_append (&to, &to_len, from, strlen (from));
+ from = 0;
+ }
+ }
+ }
+
+ if (to)
+ {
+ if (delayed_copy)
+ /* We avoided copying SRC to DST until we found a match;
+ now that we've done so, copy everything from the start
+ of SRC. */
+ {
+ if (arg > src)
+ err = argz_append (&dst, &dst_len, src, (arg - src));
+ delayed_copy = 0;
+ }
+ if (! err)
+ err = argz_add (&dst, &dst_len, to);
+ free (to);
+ }
+ else
+ err = ENOMEM;
+
+ if (replace_count)
+ (*replace_count)++;
+ }
+ else if (! delayed_copy)
+ err = argz_add (&dst, &dst_len, arg);
+ }
+
+ if (! err)
+ {
+ if (! delayed_copy)
+ /* We never found any instances of str. */
+ {
+ free (src);
+ *argz = dst;
+ *argz_len = dst_len;
+ }
+ }
+ else if (dst_len > 0)
+ free (dst);
+ }
+
+ return err;
+}
diff --git a/main/s390-tools/argz.h b/main/s390-tools/argz.h
new file mode 100644
index 0000000000..80b4cf1cee
--- /dev/null
+++ b/main/s390-tools/argz.h
@@ -0,0 +1,117 @@
+/* Routines for dealing with '\0' separated arg vectors.
+ Copyright (C) 1995-2019 Free Software Foundation, Inc.
+ This file is part of the GNU C Library.
+
+ The GNU C Library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, see
+ <http://www.gnu.org/licenses/>. */
+
+#ifndef _ARGZ_H
+#define _ARGZ_H 1
+
+#include <features.h>
+#include <errno.h>
+#include <string.h> /* Need size_t, and strchr is called below. */
+
+/* error_t may or may not be available from errno.h, depending on the
+ operating system. */
+#ifndef __error_t_defined
+# define __error_t_defined 1
+typedef int error_t;
+#endif
+
+/* Make a '\0' separated arg vector from a unix argv vector, returning it in
+ ARGZ, and the total length in LEN. If a memory allocation error occurs,
+ ENOMEM is returned, otherwise 0. The result can be destroyed using free. */
+extern error_t argz_create (char *const __argv[], char **__restrict __argz,
+ size_t *__restrict __len);
+
+/* Make a '\0' separated arg vector from a SEP separated list in
+ STRING, returning it in ARGZ, and the total length in LEN. If a
+ memory allocation error occurs, ENOMEM is returned, otherwise 0.
+ The result can be destroyed using free. */
+extern error_t argz_create_sep (const char *__restrict __string,
+ int __sep, char **__restrict __argz,
+ size_t *__restrict __len);
+
+/* Returns the number of strings in ARGZ. */
+extern size_t argz_count (const char *__argz, size_t __len);
+
+/* Puts pointers to each string in ARGZ into ARGV, which must be large enough
+ to hold them all. */
+extern void argz_extract (const char *__restrict __argz, size_t __len,
+ char **__restrict __argv);
+
+/* Make '\0' separated arg vector ARGZ printable by converting all the '\0's
+ except the last into the character SEP. */
+extern void argz_stringify (char *__argz, size_t __len, int __sep);
+
+/* Append BUF, of length BUF_LEN to the argz vector in ARGZ & ARGZ_LEN. */
+extern error_t argz_append (char **__restrict __argz,
+ size_t *__restrict __argz_len,
+ const char *__restrict __buf, size_t __buf_len);
+
+/* Append STR to the argz vector in ARGZ & ARGZ_LEN. */
+extern error_t argz_add (char **__restrict __argz,
+ size_t *__restrict __argz_len,
+ const char *__restrict __str);
+
+/* Append SEP separated list in STRING to the argz vector in ARGZ &
+ ARGZ_LEN. */
+extern error_t argz_add_sep (char **__restrict __argz,
+ size_t *__restrict __argz_len,
+ const char *__restrict __string, int __delim);
+
+/* Delete ENTRY from ARGZ & ARGZ_LEN, if it appears there. */
+extern void argz_delete (char **__restrict __argz,
+ size_t *__restrict __argz_len,
+ char *__restrict __entry);
+
+/* Insert ENTRY into ARGZ & ARGZ_LEN before BEFORE, which should be an
+ existing entry in ARGZ; if BEFORE is NULL, ENTRY is appended to the end.
+ Since ARGZ's first entry is the same as ARGZ, argz_insert (ARGZ, ARGZ_LEN,
+ ARGZ, ENTRY) will insert ENTRY at the beginning of ARGZ. If BEFORE is not
+ in ARGZ, EINVAL is returned, else if memory can't be allocated for the new
+ ARGZ, ENOMEM is returned, else 0. */
+extern error_t argz_insert (char **__restrict __argz,
+ size_t *__restrict __argz_len,
+ char *__restrict __before,
+ const char *__restrict __entry);
+
+/* Replace any occurrences of the string STR in ARGZ with WITH, reallocating
+ ARGZ as necessary. If REPLACE_COUNT is non-zero, *REPLACE_COUNT will be
+ incremented by number of replacements performed. */
+extern error_t argz_replace (char **__restrict __argz,
+ size_t *__restrict __argz_len,
+ const char *__restrict __str,
+ const char *__restrict __with,
+ unsigned int *__restrict __replace_count);
+
+/* Returns the next entry in ARGZ & ARGZ_LEN after ENTRY, or NULL if there
+ are no more. If entry is NULL, then the first entry is returned. This
+ behavior allows two convenient iteration styles:
+
+ char *entry = 0;
+ while ((entry = argz_next (argz, argz_len, entry)))
+ ...;
+
+ or
+
+ char *entry;
+ for (entry = argz; entry; entry = argz_next (argz, argz_len, entry))
+ ...;
+*/
+extern char *argz_next (const char *__restrict __argz, size_t __argz_len,
+ const char *__restrict __entry);
+
+#endif /* argz.h */
diff --git a/main/s390-tools/argz.patch b/main/s390-tools/argz.patch
new file mode 100644
index 0000000000..3419f626c7
--- /dev/null
+++ b/main/s390-tools/argz.patch
@@ -0,0 +1,145 @@
+diff --git a/Makefile b/Makefile
+index 6081acc..fe8dd2f 100644
+--- a/Makefile
++++ b/Makefile
+@@ -3,7 +3,7 @@ ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ -e s/arm.*/ar
+ # Include common definitions
+ include common.mak
+
+-LIB_DIRS = libvtoc libu2s libutil libzds libdasd libvmdump libccw libvmcp
++LIB_DIRS = libargz libvtoc libu2s libutil libzds libdasd libvmdump libccw libvmcp
+ TOOL_DIRS = zipl zdump fdasd dasdfmt dasdview tunedasd \
+ tape390 osasnmpd qetharp ip_watcher qethconf scripts zconf \
+ vmconvert vmcp man mon_tools dasdinfo vmur ipl_tools \
+diff --git a/common.mak b/common.mak
+index 0a5fd69..c6f429c 100644
+--- a/common.mak
++++ b/common.mak
+@@ -312,6 +312,10 @@ endif
+ # check the library directory via "make -C" when the tools Makefile is
+ # processed.
+
++$(rootdir)/libargz/libargz.a: $(rootdir)/libargz
++ $(MAKE) -C $(rootdir)/libargz/ libargz.a
++.PHONY: $(rootdir)/libargz
++
+ $(rootdir)/libutil/libutil.a: $(rootdir)/libutil
+ $(MAKE) -C $(rootdir)/libutil/ libutil.a
+ .PHONY: $(rootdir)/libutil
+diff --git a/zconf/chp/Makefile b/zconf/chp/Makefile
+index 2e3065f..486d469 100644
+--- a/zconf/chp/Makefile
++++ b/zconf/chp/Makefile
+@@ -2,7 +2,7 @@ include ../../common.mak
+
+ all: chchp lschp
+
+-libs = $(rootdir)/libutil/libutil.a
++libs = $(rootdir)/libutil/libutil.a $(rootdir)/libargz/libargz.a
+
+ chchp: chchp.o $(libs)
+ lschp: lschp.o $(libs)
+diff --git a/zconf/css/Makefile b/zconf/css/Makefile
+index 2a36820..749cc6e 100644
+--- a/zconf/css/Makefile
++++ b/zconf/css/Makefile
+@@ -2,7 +2,8 @@
+ include ../../common.mak
+
+ libs = $(rootdir)/libccw/libccw.a \
+- $(rootdir)/libutil/libutil.a
++ $(rootdir)/libutil/libutil.a \
++ $(rootdir)/libargz/libargz.a
+
+ objects = lscss.o misc.o
+
+diff --git a/zconf/qeth/Makefile b/zconf/qeth/Makefile
+index 43716a3..f69d4f0 100644
+--- a/zconf/qeth/Makefile
++++ b/zconf/qeth/Makefile
+@@ -2,7 +2,7 @@ include ../../common.mak
+
+ all: lsqeth
+
+-libs = $(rootdir)/libvmcp/libvmcp.a $(rootdir)/libutil/libutil.a
++libs = $(rootdir)/libvmcp/libvmcp.a $(rootdir)/libutil/libutil.a $(rootdir)/libargz/libargz.a
+
+ lsqeth: lsqeth.o misc.o $(libs)
+
+diff --git a/zconf/scm/Makefile b/zconf/scm/Makefile
+index 12faf44..1d9ec36 100644
+--- a/zconf/scm/Makefile
++++ b/zconf/scm/Makefile
+@@ -2,7 +2,7 @@ include ../../common.mak
+
+ all: lsscm
+
+-libs = $(rootdir)/libutil/libutil.a
++libs = $(rootdir)/libutil/libutil.a $(rootdir)/libargz/libargz.a
+
+ lsscm: lsscm.o $(libs)
+
+diff --git a/zconf/zcrypt/Makefile b/zconf/zcrypt/Makefile
+index d075f34..a1744a4 100644
+--- a/zconf/zcrypt/Makefile
++++ b/zconf/zcrypt/Makefile
+@@ -2,7 +2,7 @@ include ../../common.mak
+
+ all: chzcrypt lszcrypt zcryptctl
+
+-libs = $(rootdir)/libutil/libutil.a
++libs = $(rootdir)/libutil/libutil.a $(rootdir)/libargz/libargz.a
+
+ chzcrypt: chzcrypt.o misc.o $(libs)
+ lszcrypt: lszcrypt.o misc.o $(libs)
+diff --git a/zkey/Makefile b/zkey/Makefile
+index a44b14b..48c02fb 100644
+--- a/zkey/Makefile
++++ b/zkey/Makefile
+@@ -22,7 +22,7 @@ else
+ INSTALL_TARGETS += zkey-cryptsetup-skip-cryptsetup2
+ endif
+
+-libs = $(rootdir)/libutil/libutil.a
++libs = $(rootdir)/libutil/libutil.a $(rootdir)/libargz/libargz.a
+
+ detect-libcryptsetup.dep:
+ echo "#include <libcryptsetup.h>" > detect-libcryptsetup.dep
+@@ -70,11 +70,11 @@ properties.o: check-dep-zkey properties.c properties.h
+ keystore.o: keystore.c keystore.h properties.h
+ zkey-cryptsetup.o: check-dep-zkey-cryptsetup zkey-cryptsetup.c pkey.h misc.h
+
+-zkey: LDLIBS = -ldl -lcrypto
++zkey: LDLIBS = -ldl -lcrypto $(LIBEXECINFO_LIBS)
+ zkey: zkey.o pkey.o properties.o keystore.o $(libs)
+ $(LINK) $(ALL_LDFLAGS) $^ $(LDLIBS) -o $@
+
+-zkey-cryptsetup: LDLIBS = -ldl -lcryptsetup -ljson-c
++zkey-cryptsetup: LDLIBS = -ldl -lcryptsetup -ljson-c $(LIBEXECINFO_LIBS)
+ zkey-cryptsetup: zkey-cryptsetup.o pkey.o $(libs)
+ $(LINK) $(ALL_LDFLAGS) $^ $(LDLIBS) -o $@
+
+diff --git a/zkey/keystore.c b/zkey/keystore.c
+index 9dcac07..2f87798 100644
+--- a/zkey/keystore.c
++++ b/zkey/keystore.c
+@@ -23,6 +23,7 @@
+ #include <sys/file.h>
+ #include <sys/stat.h>
+ #include <sys/types.h>
++#include <fcntl.h>
+
+ #include "lib/util_base.h"
+ #include "lib/util_file.h"
+diff --git a/libutil/Makefile b/libutil/Makefile
+index ca90f2a..3042f3d 100644
+--- a/libutil/Makefile
++++ b/libutil/Makefile
+@@ -1,6 +1,6 @@
+ include ../common.mak
+
+-lib = libutil.a
++lib = libutil.a $(rootdir)/libargz/libargz.a
+
+ examples = util_base_example \
+ util_panic_example \