Bug 2218911

Summary: [DDF] Hi all, I wonder. Is there a reason why all this is not solved by single step as this:
Product: Red Hat Enterprise Linux 9 Reporter: Direct Docs Feedback <ddf-bot>
Component: DocumentationAssignee: Sagar Dubewar <sdubewar>
Documentation sub component: DDF QA Contact:
Status: ASSIGNED --- Docs Contact:
Severity: unspecified    
Priority: medium CC: bootloader-eng-team, gcase, jkonecny, kwalker, mlewando, rhel-docs, sdubewar
Version: unspecifiedKeywords: Documentation
Target Milestone: rcFlags: jkonecny: needinfo? (gcase)
jkonecny: needinfo? (kwalker)
Target Release: ---   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Direct Docs Feedback 2023-06-30 14:27:22 UTC
Hi all, I wonder. Is there a reason why all this is not solved by single step as this:

```
%packages
-kernel
kernel-64k
%end
```

That is Anaconda recommended solution for installing just one kernel.

Reported by: jkonecny

https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/9/html/performing_an_advanced_rhel_9_installation/installing-rhel-on-arm-with-kernel-64k_installing-rhel-as-an-experienced-user#annotations:9f30376c-673e-43d9-b635-bd64add0d6b6

Comment 1 Jiri Konecny 2023-06-30 14:35:33 UTC
Feel free to ping me for more questions.

Pinging Gary and Sagar if you agree with the change.

Comment 12 Marta Lewandowska 2023-08-11 09:11:54 UTC
I tried four scenarios: 

1)
%packages
@core
kernel-64k
@end

plus postscript from comment#8

2)
%packages
kernel-64k
@end

plus postscript from comment#8

3)
%packages
kernel-64k
@end

no postscript

4)
%packages
-kernel
kernel-64k
%end

no postscript

1 & 2 are equivalent: both kernels get installed, kernel-64k gets set to default
3: both kernels get installed, kernel gets set to default
in all three cases:
# cat /etc/sysconfig/kernel 
# UPDATEDEFAULT specifies if kernel-install should make
# new kernels the default
UPDATEDEFAULT=yes

# DEFAULTKERNEL specifies the default kernel package type
DEFAULTKERNEL=kernel-core

4 (Jirka's suggestion): only kernel-64k gets installed
# cat /etc/sysconfig/kernel 
# UPDATEDEFAULT specifies if kernel-install should make
# new kernels the default
UPDATEDEFAULT=yes

# DEFAULTKERNEL specifies the default kernel package type
DEFAULTKERNEL=kernel-64k-core

So, DEFAULTKERNEL is only set correctly if one kernel gets installed.
https://github.com/rhinstaller/anaconda/blob/master/pyanaconda/modules/storage/bootloader/utils.py#L193

postscript is necessary to set the correct kernel as default in case more than one is installed.