- Make zipl to use the BLS title field as the IPL section name

This commit is contained in:
Dan Horák 2018-11-12 17:07:10 +01:00
parent 01b858f02d
commit b0eb99190c
2 changed files with 60 additions and 1 deletions

View File

@ -0,0 +1,53 @@
--- /dev/null
+++ b/s390-tools-zipl-title-section-name.patch
@@ -0,0 +1,50 @@
+From ce171812a829d6e0fe1c7d1f91d2ddd301f03bec Mon Sep 17 00:00:00 2001
+From: Javier Martinez Canillas <javierm@redhat.com>
+Date: Tue, 6 Nov 2018 13:29:32 +0100
+Subject: [PATCH] zipl: use the BLS "title" field as the IPL section name
+
+Most bootloaders use the BootLoaderSpec "title" field to name the entries
+in their boot menu. The zipl bootloader used the "version" field instead,
+since it was wrongly assumed that the zipl boot menu didn't support names
+that contained spaces, which are usually present in a BLS "title" field.
+
+But this is not the case, names with space characters are supported by the
+IPL and is just a constraint of the section heading in the zipl.conf file.
+
+So to be consistent with all the other bootloaders, use the "title" field
+also on zipl when populating the boot menu entries from BLS files.
+
+Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
+---
+ scripts/zipl-switch-to-blscfg | 1 +
+ zipl/src/scan.c | 2 +-
+ 2 files changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/scripts/zipl-switch-to-blscfg b/scripts/zipl-switch-to-blscfg
+index 5272033e9848..5141b1c0dd6d 100755
+--- a/scripts/zipl-switch-to-blscfg
++++ b/scripts/zipl-switch-to-blscfg
+@@ -150,6 +150,7 @@ while IFS='= ' read key val; do
+ if [ -f "${OUTPUT}" ]; then
+ print_error "BLS file ${OUTPUT} already exists"
+ fi
++ echo "title $section" >> ${OUTPUT}
+ fi
+ elif [[ $val ]]; then
+ val="$(echo $val | sed -e 's/^[ \t"]*//;s/[ \t"]*$//')"
+diff --git a/zipl/src/scan.c b/zipl/src/scan.c
+index fe72e9ab13df..9160d083e5cb 100644
+--- a/zipl/src/scan.c
++++ b/zipl/src/scan.c
+@@ -701,7 +701,7 @@ scan_bls_field(struct misc_file_buffer *file, struct scan_token* scan,
+ file->buffer[key_end] = '\0';
+ file->buffer[val_end] = '\0';
+
+- if (strncmp("version", &file->buffer[key_start], key_end - key_start) == 0) {
++ if (strncmp("title", &file->buffer[key_start], key_end - key_start) == 0) {
+ scan_append_section_heading(scan, index, &file->buffer[val_start]);
+ }
+
+--
+2.19.1
+

View File

@ -5,7 +5,7 @@ Name: s390utils
Summary: Utilities and daemons for IBM z Systems
Group: System Environment/Base
Version: 2.7.0
Release: 1%{?dist}
Release: 2%{?dist}
Epoch: 2
License: MIT
ExclusiveArch: s390 s390x
@ -32,6 +32,8 @@ Source24: 91-zipl.install
# change the defaults to match Fedora environment
Patch0: s390-tools-zipl-invert-script-options.patch
Patch3: 0007-blscfg-sort-like-rpm-nvr-not-like-a-single-version.patch
# https://github.com/ibm-s390-tools/s390-tools/pull/47
Patch5: s390-tools-zipl-title-section-name.patch
Patch1000: cmsfs-1.1.8-warnings.patch
Patch1001: cmsfs-1.1.8-kernel26.patch
@ -62,6 +64,7 @@ be used together with the zSeries (s390) Linux kernel and device drivers.
# Fedora/RHEL changes
%patch0 -p1 -b .zipl-invert-script-options
%patch3 -p1 -b .blscfg-rpm-nvr-sort
%patch5 -p1 -b .zipl-title-section-name.patch
#
# cmsfs
@ -811,6 +814,9 @@ User-space development files for the s390/s390x architecture.
%changelog
* Tue Nov 06 2018 Javier Martinez Canillas <javierm@redhat.com> - 2:2.7.0-2
- Make zipl to use the BLS title field as the IPL section name
* Wed Oct 31 2018 Dan Horák <dan[at]danny.cz> - 2:2.7.0-1
- rebased to 2.7.0