Commit 6c07b2c2 authored by Tuan Hoang's avatar Tuan Hoang Committed by Rasmus Thomsen
Browse files

main/s390-tools: upgrade to 2.13.0

zipl: drop unnecessary -Os patch (not actually used since v2.12.0)
zipl: add a patch for v2.13.0 for handling diag308 response code
osasnmpd: enable building by having make deps net-snmp-dev
misc: update zkey patch, allow parallel building
parent 875aca12
Pipeline #42384 passed with stages
in 1 minute and 29 seconds
diff --git a/zipl/boot/Makefile b/zipl/boot/Makefile
index 52b3a23..9dfb146 100644
--- a/zipl/boot/Makefile
+++ b/zipl/boot/Makefile
@@ -1,6 +1,9 @@
# Common definitions
include ../../common.mak
+ALL_CPPFLAGS := $(filter-out -Os,$(ALL_CPPFLAGS))
+ALL_CFLAGS := $(filter-out -Os,$(ALL_CFLAGS))
+
ALL_CFLAGS = $(NO_PIE_CFLAGS) -Os -g -I $(rootdir)/zipl/include \
-I $(rootdir)/include -DS390_TOOLS_RELEASE=$(S390_TOOLS_RELEASE) \
-fno-builtin -ffreestanding -fno-asynchronous-unwind-tables \
diff --git a/zipl/src/Makefile b/zipl/src/Makefile
index 1f39d06..f6bcb97 100644
--- a/zipl/src/Makefile
+++ b/zipl/src/Makefile
@@ -5,6 +5,8 @@
-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_LDFLAGS)
libs = $(rootdir)/libutil/libutil.a
# Contributor: Natanael Copa <ncopa@alpinelinux.org>
# Maintainer: Tuan Hoang <tmhoang@linux.ibm.com>
pkgname=s390-tools
pkgver=2.12.0
pkgrel=1
pkgver=2.13.0
pkgrel=0
pkgdesc="Tools for use with the s390 Linux kernel and device drivers"
url="https://github.com/ibm-s390-tools/s390-tools"
arch="s390x"
license="MIT"
depends="bash"
makedepends="$depends_dev linux-headers libexecinfo-dev zlib-dev fuse-dev ncurses-dev openssl-dev cryptsetup-dev json-c-dev"
makedepends="$depends_dev linux-headers libexecinfo-dev zlib-dev fuse-dev ncurses-dev openssl-dev
cryptsetup-dev json-c-dev net-snmp-dev"
triggers="$pkgname.trigger=/boot"
subpackages="$pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://github.com/ibm-s390-tools/s390-tools/archive/v$pkgver.tar.gz
......@@ -20,8 +21,6 @@ source="$pkgname-$pkgver.tar.gz::https://github.com/ibm-s390-tools/s390-tools/ar
0009-link-libexecinfo.patch
0010-musl-s390x-signal-def.patch
0101-zipl-dont-optimize-size.patch
0200-dasdinfo-gnu-ext-hack.patch
0300-disable-program-using-gnu-ext.patch
bash.patch
......@@ -31,6 +30,7 @@ source="$pkgname-$pkgver.tar.gz::https://github.com/ibm-s390-tools/s390-tools/ar
argz.h
Makefile.argz
mk-s390-cdboot.c
v2.13.0-943c5dc.patch
"
build() {
......@@ -38,8 +38,8 @@ build() {
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 \
make V=1 CFLAGS="$CFLAGS -D_GNU_SOURCE" \
HAVE_GLIB=0 \
HAVE_PFM=0 \
DISTRELEASE="Alpine" \
LIBEXECINFO_LIBS="-lexecinfo"
......@@ -47,11 +47,14 @@ build() {
}
package() {
make HAVE_SNMP=0 HAVE_PFM=0 DESTDIR="$pkgdir" DISTRELEASE="Alpine" install
make DESTDIR="$pkgdir" DISTRELEASE="Alpine" \
HAVE_GLIB=0 \
HAVE_PFM=0 \
install
install -Dm755 mk-s390-cdboot "$pkgdir"/sbin/mk-s390-cdboot
}
sha512sums="4903ded5368966513e1090faca04482316870cf5fc53206d17ab98b821541e2836a016bd18cd1ca49ed6b5df0dff92dd1ed257ff712920a7aa3fd74e4a6bc6a0 s390-tools-2.12.0.tar.gz
sha512sums="5c031f46fef91b120cda68a00fd3b867ea1b5bdfda537838e123e721a740597a64c28536879002f7dfd5b2291652066fbbb75f7848f3bb40765e9ef62c642aaa s390-tools-2.13.0.tar.gz
32ef9d80a1385df3dca9c749cd0fc15c112ab662b736cef271ed70cbdaa7c8b66c41995b42f350377860a5de754bf8721cb27dc095c2e1293cfe7f5e434ef182 0002-musl-fixes.patch
6e0f8d999eef08677e9f80d1a07e01556474723b9b00435d463428eee22babe4489257ad5c8fffb650bd0fd5714cdac01dc926e1402f9741fc1327d177ece897 0004-missing-time-header.patch
e41548d83d53e4371afcee3601505520506d05b932aeb91f1ca86e589c010fa5d22777d4617c1e25adfc04fbcf45289cf65a8100108c878323e125e312579220 0006-define-path-mounted.patch
......@@ -59,12 +62,12 @@ ecfbba213d2a705e2a5a2697090f659670ca1a12e4568c1de87f17d11d72a1a6c524b23b4db25c05
bdbeb6f3873ede82487c7e4fcac84aa2bf8a922991ec32d029a64cd7142625f5a99920db0f1b6935805d7371ae5a7640c5ea577969937dd96c4f4f996b909ac3 0008-iucvterm-no-nls.patch
798ae2128a2e419a2e76f3198ac7563e84470069571beffd673b9cfc1755f432afaa32d730fd1c43db890009f37bc11a7a00af6e7e6b41ea7ffd789469eaef25 0009-link-libexecinfo.patch
f785a899583de8592422e5e46c4e4893196e3c7885e4a0bb4c717c3587db8c1a4c264c80337b1d0c31b39150f3c3b71b876fe156086ace3a542c12678ae7c85e 0010-musl-s390x-signal-def.patch
f8565253e87e717ea943101b3d270109260099481764ba7905a72c2c5817885a7071ce656ff59a697d075dd4c0b2eb8d02f6aeeb2cb98e47ac1f27d08b109137 0101-zipl-dont-optimize-size.patch
f5e06e28f77c44f591d74f383ce308a6bfb129b00b291601f2be8866dd1382c597348794be2109c9dc0fa8fdbbee509d036fa6c215e73c4c99f476d3c1cb5a83 0200-dasdinfo-gnu-ext-hack.patch
78ec9fa561f039ea44c2efb9ce7ad396746f1c2889165836342a0584266fc514599aff9f8ace7ac420d62de3543d09d2082bcdccaebb616ba4928b847d7466ab 0300-disable-program-using-gnu-ext.patch
0c4b8da70b6e64ff2da56cda6e89c95654b4c9c75376e9a5165c1083c832e85386f70990539c6ab101ed64fe30bf94ae4709aabf967fdd773b0b6b19b8c4aee8 bash.patch
96e204ffde62e6c9e43a9d7d5e4120054fa9ae8cd8a94e7ea02569228115d2e8c903faf9db093bf9a2341089e0384c4155fcf0fd8d6e8030bff3f5c28ca9884c argz.patch
9896e7dc21f0ab84a8ca5398420faa60c5d8afa0acc317f9a131e1955fad0e8219062f497a57bb52febbea9f5d862b1f92184048e6e04164725ae9047dec7a89 argz.patch
2e573314d4c4ed90b61da28de22ae8e2f68ced5489f7e5e0b30f51b776efaf40c1f781d3b485418572d8f33a169fa6946b7358cbd4a7de5a3724b20ed622262b argz.c
50bd5c0f555963dadbfaa72df5bf0801a48743d6d0feddb6ebfa4ffa410196216c1860d3a577361e035169fea4217aef3f04d69394c59db65b60c5ea29eba8cb argz.h
5e19ccfce59a2a79863db676b0ea4280cb9016cda1a30dc233526f52425c305410dd148453b75c2613acac37e364305ee25f8e545d57c5059cca19a13bac2a5e Makefile.argz
349eb06895016d16194819c4a04f604720f1373ea61a9bc4c58467281c9a2ed3539bd4e8b6984f4e5177630dbe8b928aa95912c9a3e3b0e1fe275d59f9fe573d mk-s390-cdboot.c"
349eb06895016d16194819c4a04f604720f1373ea61a9bc4c58467281c9a2ed3539bd4e8b6984f4e5177630dbe8b928aa95912c9a3e3b0e1fe275d59f9fe573d mk-s390-cdboot.c
7926d3d5221c8f8aadac15f0933a9833c3ea568cbc9ce6c37da9dc0a86d36443293d1540f5f780ddef72188a84d4c1c8bd6d33e244baf52a9515d03391aa1e73 v2.13.0-943c5dc.patch"
......@@ -96,7 +96,7 @@ diff --git a/zkey/Makefile b/zkey/Makefile
index a44b14b..48c02fb 100644
--- a/zkey/Makefile
+++ b/zkey/Makefile
@@ -22,7 +22,7 @@
@@ -22,7 +22,7 @@ else
INSTALL_TARGETS += zkey-cryptsetup-skip-cryptsetup2
endif
......@@ -105,18 +105,18 @@ index a44b14b..48c02fb 100644
detect-libcryptsetup.dep:
echo "#include <libcryptsetup.h>" > detect-libcryptsetup.dep
@@ -72,11 +72,11 @@
keystore.o: keystore.c keystore.h properties.h pkey.h cca.h utils.h
zkey-cryptsetup.o: check-dep-zkey-cryptsetup zkey-cryptsetup.c pkey.h cca.h misc.h
@@ -74,11 +74,11 @@ keystore.o: keystore.c keystore.h properties.h pkey.h cca.h ep11.h utils.h
zkey-cryptsetup.o: check-dep-zkey-cryptsetup zkey-cryptsetup.c pkey.h cca.h \
ep11.h misc.h utils.h
-zkey: LDLIBS = -ldl -lcrypto
+zkey: LDLIBS = -ldl -lcrypto $(LIBEXECINFO_LIBS)
zkey: zkey.o pkey.o cca.o properties.o keystore.o utils.o $(libs)
zkey: zkey.o pkey.o cca.o ep11.o properties.o keystore.o utils.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 cca.o utils.o $(libs)
-zkey-cryptsetup: LDLIBS = -ldl -lcryptsetup -ljson-c -lcrypto
+zkey-cryptsetup: LDLIBS = -ldl -lcryptsetup -ljson-c -lcrypto $(LIBEXECINFO_LIBS)
zkey-cryptsetup: zkey-cryptsetup.o pkey.o cca.o ep11.o utils.o $(libs)
$(LINK) $(ALL_LDFLAGS) $^ $(LDLIBS) -o $@
diff --git a/zkey/keystore.c b/zkey/keystore.c
......
From 943c5dc51d493fd89f8c1b0760656446d5653be6 Mon Sep 17 00:00:00 2001
From: Stefan Haberland <sth@linux.ibm.com>
Date: Thu, 25 Jun 2020 13:07:47 +0200
Subject: [PATCH] zipl/stage3: correctly handle diag308 response code
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
In case diag308 gives a response code 0x102 the stage3 loader can
safely assume that no secure IPL is required since no IPL report
block exists.
Suggested-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Signed-off-by: Stefan Haberland <sth@linux.ibm.com>
Reviewed-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Philipp Rudo <prudo@linux.ibm.com>
Tested-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
---
include/boot/s390.h | 1 +
zipl/boot/stage3.c | 25 +++++++++++--------------
2 files changed, 12 insertions(+), 14 deletions(-)
diff --git a/include/boot/s390.h b/include/boot/s390.h
index 8262f5af..89397a22 100644
--- a/include/boot/s390.h
+++ b/include/boot/s390.h
@@ -286,6 +286,7 @@ enum diag308_subcode {
enum diag308_rc {
DIAG308_RC_OK = 0x0001,
+ DIAG308_RC_NO_CONF = 0x0102,
};
static __always_inline unsigned long diag308(unsigned long subcode, void *addr)
diff --git a/zipl/boot/stage3.c b/zipl/boot/stage3.c
index bb490dc8..254872da 100644
--- a/zipl/boot/stage3.c
+++ b/zipl/boot/stage3.c
@@ -57,18 +57,6 @@ static inline void __noreturn start_kernel(void)
while (1);
}
-unsigned int store_ipl_parmblock(struct ipl_pl_hdr *pl_hdr)
-{
- int rc;
-
- rc = diag308(DIAG308_STORE, pl_hdr);
- if (rc == DIAG308_RC_OK &&
- pl_hdr->version <= IPL_MAX_SUPPORTED_VERSION)
- return 0;
-
- return 1;
-}
-
unsigned int
is_verified_address(unsigned long image_addr)
{
@@ -126,9 +114,18 @@ secure_boot_enabled()
unsigned int rc;
pl_hdr = (void *)get_zeroed_page();
- if (!pl_hdr || store_ipl_parmblock(pl_hdr))
+ switch (diag308(DIAG308_STORE, pl_hdr)) {
+ case DIAG308_RC_OK:
+ rc = pl_hdr->version <= IPL_MAX_SUPPORTED_VERSION &&
+ !!(pl_hdr->flags & IPL_FLAG_SECURE);
+ break;
+ case DIAG308_RC_NO_CONF:
+ rc = 0;
+ break;
+ default:
panic(ESECUREBOOT, "%s", msg_sipl_noparm);
- rc = !!(pl_hdr->flags & IPL_FLAG_SECURE);
+ break;
+ }
free_page((unsigned long) pl_hdr);
return rc;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment