Bug 1704263

Summary: zipl fails the BLS title field contains trailing spaces and is set as default
Product: Red Hat Enterprise Linux 8 Reporter: Javier Martinez Canillas <fmartine>
Component: s390utilsAssignee: Dan Horák <dhorak>
Status: CLOSED ERRATA QA Contact: Vilém Maršík <vmarsik>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 8.1CC: rvr
Target Milestone: rcKeywords: TestOnly
Target Release: 8.0   
Hardware: s390x   
OS: Unspecified   
Whiteboard:
Fixed In Version: s390utils-2.6.0-29.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-11-04 01:58:50 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
zipl-remove-trailing-spaces-from-the-fields-defined-.patch none

Description Javier Martinez Canillas 2019-04-29 12:59:06 UTC
Description of problem:

If the 'title' field in a BLS file contains trailing spaces and it's set as the default entry, zipl fails since isn't able to find the entry with that title.

Version-Release number of selected component (if applicable):

s390utils-base-2.6.0-14.el8.s390x

How reproducible:


Steps to Reproduce:
1. Append a space to the title field of a BLS entry, i.e: /boot/loader/entries/$(cat /etc/machine-id)-$(uname -r).conf.
2. Set that entry as the default, i.e: grubby --set-default /boot/vmlinuz-$(uname -r
3. Run zipl.

Actual results:

zipl fails with the following error:

Error: Config file '/etc/zipl.conf': Line 6: no such section 'Red Hat Enterprise Linux (4.18.0-80.20.el8.s390x) 8.1 (Ootpa)'

Expected results:

It should succeed and print something like the following message:

Adding #1: IPL section 'Red Hat Enterprise Linux (4.18.0-80.20.el8.s390x) 8.1 (Ootpa)' (default)

Additional info:

Removing the trailing space from the BLS title field makes it work again.

Comment 1 Javier Martinez Canillas 2019-05-03 13:10:25 UTC
Created attachment 1562439 [details]
zipl-remove-trailing-spaces-from-the-fields-defined-.patch

Proposed a fix upstream: https://github.com/ibm-s390-tools/s390-tools/pull/62
and attached a patch to the s390utils package.

Tested by adding a trailing space at the end of a BLS title field value, it fails with the current zipl but works with the patched one: 

# rpm -qf /usr/sbin/zipl
s390utils-base-2.6.0-14.el8.s390x

# grubby --set-default /boot/vmlinuz-4.18.0-80.20.el8.s390x
The default is /boot/loader/entries/f871a0cf218348c5ba921f61c92b7eac-4.18.0-80.20.el8.s390x.conf with index 0 and kernel /boot/vmlinuz-4.18.0-80.20.el8.s390x                                                                                

# zipl --dry-run
Using config file '/etc/zipl.conf'
Using BLS config file '/boot/loader/entries/f871a0cf218348c5ba921f61c92b7eac-4.18.0-80.20.el8.s390x.conf'
Using BLS config file '/boot/loader/entries/f871a0cf218348c5ba921f61c92b7eac-0-rescue.conf'
Error: Config file '/etc/zipl.conf': Line 6: no such section 'Red Hat Enterprise Linux (4.18.0-80.20.el8.s390x) 8.1 (Ootpa)'

# dnf update s390utils-base -y

# rpm -qf /usr/sbin/zipl
s390utils-base-2.6.0-15.el8.s390x

 zipl --dry-run
Using config file '/etc/zipl.conf'
Using BLS config file '/boot/loader/entries/f871a0cf218348c5ba921f61c92b7eac-4.18.0-80.20.el8.s390x.conf'
Using BLS config file '/boot/loader/entries/f871a0cf218348c5ba921f61c92b7eac-0-rescue.conf'
Starting dry-run, target device contents will NOT be modified
Building bootmap in '/boot'
Building menu 'zipl-automatic-menu'
Adding #1: IPL section 'Red Hat Enterprise Linux (4.18.0-80.20.el8.s390x) 8.1 (Ootpa)' (default)
Adding #2: IPL section 'Red Hat Enterprise Linux (0-rescue-f871a0cf218348c5ba921f61c92b7eac) 8.1 (Ootpa)'
Preparing boot device: dasda (0120).
Done.

Comment 4 Dan Horák 2020-05-28 08:27:36 UTC
marking as TestOnly, the fix goes in via the zipl rebase in bug 1821250

Comment 6 Vilém Maršík 2020-07-17 09:25:35 UTC
Reproduced on 8.2.0 with s390utils-base-2.6.0-28.el8.s390x :
# vim /boot/loader/entries/8aeefdf575dc463f81b78413bfa6bfd4-4.18.0-193.el8.s390x.conf
# grubby --set-default /boot/vmlinuz-$(uname -r)
The default is /boot/loader/entries/8aeefdf575dc463f81b78413bfa6bfd4-4.18.0-193.el8.s390x.conf with index 0 and kernel /boot/vmlinuz-4.18.0-193.el8.s390x
# zipl
Using config file '/etc/zipl.conf'
Using BLS config file '/boot/loader/entries/8aeefdf575dc463f81b78413bfa6bfd4-4.18.0-193.el8.s390x.conf'
Using BLS config file '/boot/loader/entries/8aeefdf575dc463f81b78413bfa6bfd4-0-rescue.conf'
Error: Config file '/etc/zipl.conf': Line 7: no such section 'Red Hat Enterprise Linux (4.18.0-193.el8.s390x) 8.2 (Ootpa)'

Comment 7 Vilém Maršík 2020-07-17 13:00:41 UTC
Looks fixed on RHEL-8.3.0-20200717.n.0:
# ls /boot/loader/entries/$(cat /etc/machine-id)-$(uname -r).conf
/boot/loader/entries/b5fb72ad9abc43999460975d68045748-4.18.0-226.el8.s390x.conf
# vim /boot/loader/entries/b5fb72ad9abc43999460975d68045748-4.18.0-226.el8.s390x.conf
# grubby --set-default /boot/vmlinuz-$(uname -r)
The default is /boot/loader/entries/b5fb72ad9abc43999460975d68045748-4.18.0-226.el8.s390x.conf with index 0 and kernel /boot/vmlinuz-4.18.0-226.el8.s390x
# zipl
Using config file '/etc/zipl.conf'
Using BLS config file '/boot/loader/entries/b5fb72ad9abc43999460975d68045748-4.18.0-226.el8.s390x.conf'
Using BLS config file '/boot/loader/entries/b5fb72ad9abc43999460975d68045748-0-rescue.conf'
Building bootmap in '/boot'
Building menu 'zipl-automatic-menu'
Adding #1: IPL section 'Red Hat Enterprise Linux (4.18.0-226.el8.s390x) 8.3 (Ootpa)' (default)
Adding #2: IPL section 'Red Hat Enterprise Linux (0-rescue-b5fb72ad9abc43999460975d68045748) 8.3 (Ootpa)'
Preparing boot device: dasda (0120).
Done.

Comment 10 errata-xmlrpc 2020-11-04 01:58:50 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (s390utils bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2020:4537