Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(RHEL-16354) UKI support in kernel-install #212

Merged

Conversation

keszybz
Copy link
Contributor

@keszybz keszybz commented Nov 23, 2023

No description provided.

behrmann and others added 2 commits November 23, 2023 12:58
Currently the kernel-install man page only documents the bls layout for use
with the boot loader spec type redhat-plumbers#1. 90-loaderentry.install uses this layout to
generate loader entries and copy the kernel image and initrd to $BOOT.

This commit documents a second layout "uki" and adds 90-uki-copy.install,
which copies a UKI "uki.efi" from the staging area or any file with the .efi
extension given on the command line to
$BOOT/EFI/Linux/$ENTRY_TOKEN-$KERNEl_VERSION(+$TRIES).efi

This allows for both locally generated and distro-provided UKIs to be handled
by kernel-install.

(cherry picked from commit 0ccfd35)

Resolves: RHEL-16354
(cherry picked from commit 642617f)

Related: RHEL-16354
Copy link

github-actions bot commented Nov 23, 2023

Tracker - RHEL-16354

The following commits meet all requirements

commit upstream
29465e5 - kernel-install: Add uki layout systemd/systemd@0ccfd35
aed3ad9 - kernel-install: remove math slang from man page systemd/systemd@642617f
b34d812 - kernel-install: handle uki installs automatically systemd/systemd@3d5f0bf
a5cd953 - 90-uki-copy.install: create $BOOT/EFI/Linux directory if needed systemd/systemd@c7314ee
2d02cab - kernel-install: Log location that uki is installed in systemd/systemd@4f5278e
fc0a826 - bootctl: fix errno logging systemd/systemd@e425849
261159e - bootctl: add kernel-identity command systemd/systemd@53c368d
c618308 - bootctl: add kernel-inspect command systemd/systemd@a052559
10e24f1 - bootctl: add kernel-inspect to --help text systemd/systemd@24a3b37
d09ed14 - bootctl: drop full stop at end of --help texts systemd/systemd@2b19796
6e39540 - bootctl: change section title for kernel image commands systemd/systemd@1e7d6cc
e9d7a25 - bootctl: remove space that should not be there systemd/systemd@e684d2d
7f9037f - bootctl: kernel-inspect: print os info systemd/systemd@2d42604
6d43879 - bootctl-uki: several coding style fixlets systemd/systemd@5b532e1
887768e - tree-wide: unify how we pick OS pretty name to display systemd/systemd@02b7005
f1a6198 - bootctl-uki: several follow-ups for inspect_osrel() systemd/systemd@1b7586d
c05b78c - bootctl: Add missing %m systemd/systemd@3b42ffe
458d84a - bootctl: tweak DOS header magic check systemd/systemd@78088b8

@github-actions github-actions bot added pr/needs-ci Formerly needs-ci pr/needs-review Formerly needs-review tracker/missing Formerly needs-bz labels Nov 23, 2023
Copy link
Member

@jamacku jamacku left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@keszybz Please update commit message of commit - 506ff04- kernel-install: handle uki installs automatically.

Please replace Resolves: #25822 with Resolves: https://github.com/systemd/systemd/issues/25822.

Resolves: # is a keyword used in RHEL to reference Bugzilla bugs. And since we don't allow multiple trackers in one PR, our automation is failing.

@jamacku jamacku added this to the RHEL-9.4.0 milestone Nov 23, 2023
@github-actions github-actions bot added pr/changes-requested and removed pr/needs-review Formerly needs-review labels Nov 23, 2023
kraxel and others added 16 commits November 23, 2023 14:16
Detect image type using "bootctl kernel-identify $kernel",
store result in KERNEL_INSTALL_IMAGE_TYPE.

Extend layout autodetection to check the kernel image type
and pick layout=uki for UKIs.

Resolves: systemd/systemd#25822
(cherry picked from commit 3d5f0bf)

Related: RHEL-16354
Do not consider a missing 'Linux' subdirectory an error.
Just create it instead.

(cherry picked from commit c7314ee)

Related: RHEL-16354
Let's log where we install a UKI when running in verbose mode.

(cherry picked from commit 4f5278e)

Related: RHEL-16354
(cherry picked from commit e425849)

Related: RHEL-16354
The command takes a kernel as argument and checks what kind of kernel
the image is.  Returns one of uki, pe or unknown.

(cherry picked from commit 53c368d)

Resolves: RHEL-16354
Takes a kernel image as argument. Prints details about the kernel.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
(cherry picked from commit a052559)

Resolves: RHEL-16354
(cherry picked from commit 24a3b37)

Related: RHEL-16354
We never do that, don't do so here either.

(cherry picked from commit 2b19796)

Related: RHEL-16354
Let's call them kernel *images*, not just *kernels*.

(cherry picked from commit 1e7d6cc)

Related: RHEL-16354
(cherry picked from commit e684d2d)

Related: RHEL-16354
(cherry picked from commit 2d42604)

Related: RHEL-16354
Mostly follow-ups for #26082.

(cherry picked from commit 5b532e1)

Related: RHEL-16354
(cherry picked from commit 02b7005)

Related: RHEL-16354
Follow-ups for #26124 and #26158.

- use os_release_pretty_name(),
- constify the buffer passed to inspect_osrel(),
- propagate errors in inspect_osrele(), and ignore them in the caller
  side,
- and several coding style fixlets.

(cherry picked from commit 1b7586d)

Related: RHEL-16354
(cherry picked from commit 3b42ffe)

Related: RHEL-16354
Read the magic first, try reading the full DOS exe header only in case
the magic check succeeds.

This avoids throwing an header read error on small dummy files as used
by test-kernel-install.

(cherry picked from commit 78088b8)

Related: RHEL-16354
@keszybz keszybz force-pushed the rhel-9.4.0-kernel-install-uki branch from 8d61527 to 458d84a Compare November 23, 2023 13:18
@github-actions github-actions bot removed the tracker/missing Formerly needs-bz label Nov 23, 2023
@github-actions github-actions bot changed the title UKI support in kernel-install (RHEL-16354) UKI support in kernel-install Nov 23, 2023
@github-actions github-actions bot added pr/needs-ci Formerly needs-ci and removed pr/needs-ci Formerly needs-ci tracker/invalid-product labels Nov 23, 2023
@jamacku jamacku self-requested a review November 23, 2023 16:02
@github-actions github-actions bot added pr/needs-review Formerly needs-review and removed pr/changes-requested pr/needs-ci Formerly needs-ci labels Nov 23, 2023
@jamacku jamacku requested a review from msekletar November 24, 2023 09:26
Copy link
Member

@msekletar msekletar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@msekletar
Copy link
Member

Btw, bootctl pieces weren't strictly needed (I think) as we don't really use systemd-boot in RHEL but I guess it doesn't hurt to have them in as bootctl is useful to some extent even without systemd-boot.

@github-actions github-actions bot removed the pr/needs-review Formerly needs-review label Dec 7, 2023
@jamacku jamacku dismissed their stale review December 8, 2023 08:18

resolved

@jamacku jamacku removed their request for review December 8, 2023 08:19
@github-actions github-actions bot merged commit 618e38b into redhat-plumbers:main Dec 8, 2023
31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants