Bug 2144770 - RHEL 8.7 kickstart installation fails when --optional option is used with @core package group [NEEDINFO]
Summary: RHEL 8.7 kickstart installation fails when --optional option is used with @co...
Keywords:
Status: ASSIGNED
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: tboot
Version: 8.7
Hardware: Unspecified
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Tony Camuso
QA Contact: Release Test Team
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-11-22 09:35 UTC by mkenjale
Modified: 2023-08-09 02:21 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Type: Bug
Target Upstream Version:
Embargoed:
tcamuso: needinfo? (mkenjale)


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHELPLAN-140137 0 None None None 2022-11-22 09:40:21 UTC

Description mkenjale 2022-11-22 09:35:45 UTC
=======================
Description of problem:
=======================
- RHEL 8.7 kickstart installation fails when --optional option is used with @core package group
------
DNF error: Error in POSTIN scriptlet in rpm package tboot
------

Kickstart:
-----
%packages
@core --optional
%end
-----

=============================================================
Version-Release number of selected component (if applicable):
=============================================================
- RHEL 8.7 ISO
- tboot-1.10.5-1.el8.x86_64.rpm 

===================
Steps to Reproduce:
===================

1. Write a kickstart file and add "--optional" option to "@core" package group. The following package section is enough to reproduce the issue:
-----
%packages
@core --optional
%end
-----

2. Start kickstart installation.
3. The installation(text as well as graphical mode) will fail with the following error:
------
DNF error: Error in POSTIN scriptlet in rpm package tboot
------

===============
Actual results:
===============
- Installation fails with the following error:
------
DNF error: Error in POSTIN scriptlet in rpm package tboot
------

================
Expected results:
================
- The installation should not fail when "--optional" option is used with @core package group.

================
Additional info:
================
- The issue is not reproducible with RHEL 8.6 or older version of RHEL ISO.
- Difference between RHEL 8.6 and RHEL 8.7 tboot package:
--------
[root@rhel8 ~]# rpm -qp --scripts tboot-1.10.2-1.el8.x86_64.rpm
[root@rhel8 ~]# 
[root@rhel8 ~]# rpm -qp --scripts tboot-1.10.5-1.el8.x86_64.rpm 
postinstall scriptlet (using /bin/sh):
efidir=$(find /boot -type d -name EFI)
if [ -n "$efidir" ]; then
	echo "EFI detected .."
	mkdir -pv /boot/efi/EFI/redhat/x86_64-efi
	cp -vf /usr/lib/grub/x86_64-efi/relocator.mod /boot/efi/EFI/redhat/x86_64-efi/
	cp -vf /usr/lib/grub/x86_64-efi/multiboot2.mod /boot/efi/EFI/redhat/x86_64-efi/
	gcfg=$(find /boot -name grub.cfg -print -quit)
	[ -n "$gcfg" ] && grub2-mkconfig -o "$gcfg"
fi
--------

===========
WORKAROUND:
===========
- Exclude the tboot package from the package group.
--------
%packages
@core --optional
-tboot
%end
--------

- One can install the tboot package post OS installation or in the %post section.
- I was able to install the package in the %post section as below:
--------
%packages
@core --optional
-tboot
%end
--
%post --nochroot --log=/mnt/sysimage/var/log/kickstart_post_nochroot.log
echo "Installing optional packages from core package group"
cd /run/install/sources/mount-0000-cdrom/BaseOS/Packages
rpm -ivh --root=/mnt/sysimage/ tboot-1.10.5-1.el8.x86_64.rpm grub2-efi-x64-modules-2.02-142.el8.noarch.rpm 
%end

Logs:
-----
09:33:26,010 DBG program: Return code: 0
09:36:35,756 INF program: Running in chroot '/mnt/sysroot'... depmod -a 4.18.0-425.3.1.el8.x86_64
09:36:47,403 DBG program: Return code: 0
09:36:47,404 INF program: Running in chroot '/mnt/sysroot'... dracut -f /boot/initramfs-4.18.0-425.3.1.el8.x86_64.img 4.18.0-425.3.1.el8.x86_64
09:37:07,564 DBG program: Return code: 0
09:37:07,648 INF program: Running... /bin/sh /tmp/ks-script-fgli1bo4
09:37:10,734 INF program: Installing optional packages from core package group
09:37:10,735 INF program: warning: tboot-1.10.5-1.el8.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY
09:37:10,735 INF program: Verifying...                          ########################################
09:37:10,735 INF program: Preparing...                          ########################################
09:37:10,735 INF program: Updating / installing...
09:37:10,735 INF program: grub2-efi-x64-modules-1:2.02-142.el8  ########################################
09:37:10,735 INF program: tboot-1:1.10.5-1.el8                  ########################################
09:37:10,735 INF program: EFI detected ..
09:37:10,736 INF program: mkdir: created directory '/boot/efi/EFI/redhat/x86_64-efi'
09:37:10,736 INF program: '/usr/lib/grub/x86_64-efi/relocator.mod' -> '/boot/efi/EFI/redhat/x86_64-efi/relocator.mod'
09:37:10,736 INF program: '/usr/lib/grub/x86_64-efi/multiboot2.mod' -> '/boot/efi/EFI/redhat/x86_64-efi/multiboot2.mod'
09:37:10,736 INF program: Generating grub configuration file ...
09:37:10,736 INF program: Found linux image: /boot/vmlinuz-4.18.0-425.3.1.el8.x86_64
09:37:10,736 INF program: Found initrd image: /boot/initramfs-4.18.0-425.3.1.el8.x86_64.img
09:37:10,736 INF program: done
09:37:10,736 DBG program: Return code: 0
-----
--------

Comment 1 Jan Stodola 2022-11-22 10:33:10 UTC
Reassigning to tboot for review.


Note You need to log in before you can comment on or make changes to this bug.