Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 2088631

Summary: Backport upstream mkksiso changes
Product: Red Hat Enterprise Linux 9 Reporter: Brian Lane <bcl>
Component: loraxAssignee: Brian Lane <bcl>
Status: CLOSED ERRATA QA Contact: Release Test Team <release-test-team-automation>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 9.1CC: jstodola
Target Milestone: rcKeywords: Triaged
Target Release: ---Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: lorax-34.9.18-1.el9 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-11-15 10:11:08 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
kickstart none

Description Brian Lane 2022-05-19 21:38:58 UTC
Upstream mkksiso has been updated to use xorriso to modify the iso, resulting in simpler code, and it should work on a wider range of isos since it doesn't need to rebuild the bootloader.

Comment 1 Jan Stodola 2022-05-23 14:16:53 UTC
Brian, I've checked one of you automated test from RHEL-9.0 with lorax-34.9.14-1.el9 and xorriso is already used there where running mkksiso:

INFO:Running... mount -o loop /var/tmp/images/cdimage.iso /tmp/lorax.imgutils.mvwq5g1c
INFO:mount: /tmp/lorax.imgutils.mvwq5g1c: WARNING: source write-protected, mounted read-only.
INFO:iso arch = x86_64
INFO:Volume Id = RHEL-9-0-0-BaseOS-x86_64
INFO:Using xorrisofs to create the new iso
WARNING:No boot/grub/grub.cfg file found
WARNING:No images/generic.prm file found
WARNING:No images/cdboot.prm file found
INFO:grafts = [('/tmp/mkksiso-5pz_v2pa/.discinfo', '.discinfo'), ('/tmp/mkksiso-5pz_v2pa/.treeinfo', '.treeinfo'), ('/tmp/mkksiso-5pz_v2pa/AppStream', 'AppStream'), ('/tmp/mkksiso-5pz_v2pa/BaseOS', 'BaseOS'), ('/tmp/mkksiso-5pz_v2pa/EFI', 'EFI'), ('/tmp/mkksiso-5pz_v2pa/EULA', 'EULA'), ('/tmp/mkksiso-5pz_v2pa/GPL', 'GPL'), ('/tmp/mkksiso-5pz_v2pa/RPM-GPG-KEY-redhat-beta', 'RPM-GPG-KEY-redhat-beta'), ('/tmp/mkksiso-5pz_v2pa/RPM-GPG-KEY-redhat-release', 'RPM-GPG-KEY-redhat-release'), ('/tmp/mkksiso-5pz_v2pa/extra_files.json', 'extra_files.json'), ('/tmp/mkksiso-5pz_v2pa/images', 'images'), ('/tmp/mkksiso-5pz_v2pa/isolinux', 'isolinux'), ('/tmp/mkksiso-5pz_v2pa/media.repo', 'media.repo'), ('/mnt/tests/installation/mkksiso-ks-into-dvd/ks.cfg', 'ks.cfg')]
xorriso 1.5.4 : RockRidge filesystem manipulator, libburnia project.

Drive current: -outdev 'stdio:/var/tmp/images/cdimage_ks.iso'
Media current: stdio file, overwriteable
Media status : is blank
Media summary: 0 sessions, 0 data blocks, 0 data, 52.5g free
xorriso : WARNING : -volid text is too long for Joliet (24 > 16)
xorriso : WARNING : -volid text does not comply to ISO 9660 / ECMA 119 rules
Added to ISO image: file '/.discinfo'='/tmp/mkksiso-5pz_v2pa/.discinfo'
xorriso : UPDATE :       1 files added in 1 seconds
Added to ISO image: file '/.treeinfo'='/tmp/mkksiso-5pz_v2pa/.treeinfo'
Added to ISO image: directory '/AppStream'='/tmp/mkksiso-5pz_v2pa/AppStream'
Added to ISO image: directory '/BaseOS'='/tmp/mkksiso-5pz_v2pa/BaseOS'
Added to ISO image: directory '/EFI'='/tmp/mkksiso-5pz_v2pa/EFI'
Added to ISO image: file '/EULA'='/tmp/mkksiso-5pz_v2pa/EULA'
Added to ISO image: file '/GPL'='/tmp/mkksiso-5pz_v2pa/GPL'
Added to ISO image: file '/RPM-GPG-KEY-redhat-beta'='/tmp/mkksiso-5pz_v2pa/RPM-GPG-KEY-redhat-beta'
Added to ISO image: file '/RPM-GPG-KEY-redhat-release'='/tmp/mkksiso-5pz_v2pa/RPM-GPG-KEY-redhat-release'
Added to ISO image: file '/extra_files.json'='/tmp/mkksiso-5pz_v2pa/extra_files.json'
Added to ISO image: directory '/images'='/tmp/mkksiso-5pz_v2pa/images'
Added to ISO image: directory '/isolinux'='/tmp/mkksiso-5pz_v2pa/isolinux'
Added to ISO image: file '/media.repo'='/tmp/mkksiso-5pz_v2pa/media.repo'
Added to ISO image: file '/ks.cfg'='/mnt/tests/installation/mkksiso-ks-into-dvd/ks.cfg'
xorriso : UPDATE :    6433 files added in 1 seconds
xorriso : NOTE : Copying to System Area: 432 bytes from file '/usr/share/syslinux/isohdpfx.bin'
libisofs: NOTE : Automatically adjusted MBR geometry to 1039/255/63
libisofs: WARNING : Image size exceeds 1024 cylinders. Cannot align partition.
libisofs: WARNING : There are said to be BIOSes which will not boot this via MBR.
xorriso : UPDATE :  0.42% done
xorriso : UPDATE :  14.78% done
xorriso : UPDATE :  27.77% done, estimate finish Sun Mar 13 13:24:22 2022
xorriso : UPDATE :  39.73% done, estimate finish Sun Mar 13 13:24:22 2022
xorriso : UPDATE :  52.20% done, estimate finish Sun Mar 13 13:24:22 2022
...

So I wonder what is the expected change?

Comment 2 Brian Lane 2022-05-23 16:12:11 UTC
Right, I'm talking about this upstream change: https://github.com/weldr/lorax/pull/1228

Instead of rebuilding the efiboot.img and reconstructing the iso from scratch it modifies the original iso by changing the config files, and optionally adding new ones. I do need to make sure that xorriso on RHEL9 has the correct support though.

Comment 3 Brian Lane 2022-06-15 21:54:16 UTC
https://github.com/weldr/lorax/pull/1240

Comment 4 Jan Stodola 2022-07-08 08:51:51 UTC
Brian,
I tested executing mkksiso as a regular user, but it failed:

[test2@kvm-08-guest32 ~]$ mkksiso default.ks RHEL-9.1.0-20220708.0-x86_64-dvd1.iso user.iso
xorriso 1.5.4 : RockRidge filesystem manipulator, libburnia project.

xorriso : NOTE : Loading ISO image tree from LBA 0
xorriso : UPDATE :    6572 nodes read in 1 seconds
xorriso : NOTE : Detected El-Torito boot information which currently is set to be discarded
Drive current: -indev '/home/test2/RHEL-9.1.0-20220708.0-x86_64-dvd1.iso'
Drive access : shared:readonly
Media current: stdio file, overwriteable
Media status : is written , is appendable
Boot record  : El Torito , MBR isohybrid cyl-align-off GPT
Media summary: 1 session, 4313682 data blocks, 8425m data, 1466m free
Volume id    : 'RHEL-9-1-0-BaseOS-x86_64'
xorriso : UPDATE :       1 files restored (  1401b) in 1 seconds = 0.0xD
Extracted from ISO image: file '/EFI/BOOT/grub.cfg'='/tmp/mkksiso-dv4e8kxu/EFI/BOOT/grub.cfg'
xorriso : UPDATE :       1 files restored (  3147b) in 1 seconds = 0.0xD
Extracted from ISO image: file '/isolinux/isolinux.cfg'='/tmp/mkksiso-dv4e8kxu/isolinux/isolinux.cfg'
xorriso : UPDATE :       1 files restored (    60b) in 1 seconds = 0.0xD
Extracted from ISO image: file '/.discinfo'='/tmp/mkksiso-dv4e8kxu/.discinfo'
INFO:iso arch = x86_64
INFO:Volume Id = RHEL-9-1-0-BaseOS-x86_64
Traceback (most recent call last):
  File "/usr/bin/mkksiso", line 372, in <module>
    sys.exit(main())
  File "/usr/bin/mkksiso", line 362, in main
    MakeKickstartISO(args.ks, args.input_iso, args.output_iso,
  File "/usr/bin/mkksiso", line 283, in MakeKickstartISO
    EditIsolinux(new_args, new_volid, old_volid, tmpdir)
  File "/usr/bin/mkksiso", line 162, in EditIsolinux
    with open(orig_cfg + ".new", "w") as out_fp:
PermissionError: [Errno 13] Permission denied: '/tmp/mkksiso-dv4e8kxu/isolinux/isolinux.cfg.new'
[test2@kvm-08-guest32 ~]$ 

RHEL-9.1.0-20220707.0 + lorax-34.9.16-1.el9 was used for testing.

Moving back to ASSIGNED.

Comment 5 Brian Lane 2022-07-12 17:34:29 UTC
I am unable to reproduce this locally. The error seems to be saying it doesn't have write permission on the tempdir it just created and wrote files into, which is really odd. How did you setup the user you are running this from? Are there and SELinux errors?

Comment 6 Jan Stodola 2022-07-13 09:42:53 UTC
Created attachment 1896661 [details]
kickstart

Reproduced on a freshly installed VM, using the attached kickstart file (the user account is defined there, in the previous attempt the user was created on the installed system using "useradd test2")

Compose was RHEL-9.1.0-20220712.1 with lorax-34.9.16-1.el9 and lorax-templates-generic-34.9.16-1.el9 installed after the installation.

I've checked SELinux errors, there were none and the problem is reproducible with SELinux in permissive mode.

Comment 7 Brian Lane 2022-07-13 18:57:30 UTC
It ends up it was file permissions, the boot iso I was testing with has less restrictive permissions on the config files and directories than the dvd.

Fix is here:

https://github.com/weldr/lorax/pull/1250

Comment 9 Jan Stodola 2022-07-15 07:11:23 UTC
Retested with lorax-34.9.18-1.el9 and no issue was discovered, it's also possible to use mkksiso as a regular user.

Marking as Verified:Tested

Comment 14 Jan Stodola 2022-07-20 16:43:16 UTC
Checked that lorax-34.9.18-1.el9 is in nightly compose RHEL-9.1.0-20220719.0

Moving to VERIFIED

Comment 16 errata-xmlrpc 2022-11-15 10:11:08 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 (lorax 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-2022:8018