Skip to content

Various changes in preparation for upgrading Dracut#2835

Merged
chewi merged 9 commits intomainfrom
chewi/pre-dracut
Apr 22, 2025
Merged

Various changes in preparation for upgrading Dracut#2835
chewi merged 9 commits intomainfrom
chewi/pre-dracut

Conversation

@chewi
Copy link
Copy Markdown
Contributor

@chewi chewi commented Apr 17, 2025

Various changes in preparation for upgrading Dracut

My changes to upgrade Dracut and use its improved --sysroot functionality are quite heavy, so I decided to split the changes into two parts. This first part is the miscellaneous changes that are needed but can be applied on their own.

  • sys-auth/google-oslogin: Install soname symlinks and general tidy up
    The initrd was previously created in pkg_setup to avoid the sandbox. This will no longer be the case. ldconfig was creating missing symlinks, which now breaks the sandbox.

  • setup_board: Add ldconfig wrapper for non-native arches
    We will no longer run the whole of Dracut with QEMU, but we do still need to run ldconfig with it. Portage will also use this wrapper.

  • sys-kernel/coreos-kernel: Add missing dependencies
    This wasn't an issue in CI, but I hit issues when building coreos-kernel locally without the entire board root present.

  • build_dev_binpkgs: Refactor the script with better Bash techniques
    This script was hurting my eyes when dealing with the issue below.

  • build_dev_binpkgs: Only build packages available to the board profile
    Updating the SDK to systemd-257 (see below) caused this script to break.

  • sys-apps/systemd: Bump to v257.5 for the SDK only
    We need this for dracut-install to have the new JSON support.

  • sys-kernel/coreos-modules: Compress kernel with xz rather than zstd
    The new initrd is heavier for various reasons. I trimmed some aspects, but I chose to keep all the keymaps as only supporting US English is unfair to bare metal users.

  • sys-kernel/coreos-modules: Compress initrd with xz rather than zstd
    See above.

  • build_library: Change extraction script to xz and rewrite to be simpler
    As above and the existing script was hard to understand.

How to use

Nothing directly user-facing has changed here. Just check that nothing has broken.

Testing done

A full CI run with all tests did pass eventually after some flakiness. I have already successfully run these changes together with the rest of the changes in part 2.

With the new initrd extraction script, we don't get the phantom extra "rootfs" directory on amd64 anymore. It says it has reduced by 413KB, but that usage was never actually real. Part 2 will add the CPU microcode, which will result in an extra rootfs directory again, but this one will be real.

  • Changelog entries added in the respective changelog/ directory (user-facing change, bug fix, security fix, update)
  • Inspected CI output for image differences: /boot and /usr size, packages, list files for any missing binaries, kernel modules, config files, kernel modules, etc.

@chewi chewi self-assigned this Apr 17, 2025
@chewi chewi marked this pull request as ready for review April 21, 2025 16:22
@chewi chewi requested a review from a team April 21, 2025 16:22
chewi added 9 commits April 22, 2025 13:13
The missing soname symlinks were causing ldconfig to create them later,
breaking the sandbox. The upstream Makefile installs them for you, so
let's use it even though it needs some taming.

This adds the systemd timer to refresh the NSS cache. This seems
important, and I can't see any reason to omit it.

This also moves the binaries from /usr/libexec to /usr/bin. Upstream has
always put them in /usr/bin, and putting them elsewhere requires tweaks.

Signed-off-by: James Le Cuirot <jlecuirot@microsoft.com>
Signed-off-by: James Le Cuirot <jlecuirot@microsoft.com>
These dependencies are always present in CI by the time this package
gets built, but this may not be the case when building manually. This
leads to gaps in the initrd and ultimately failed boots.

Signed-off-by: James Le Cuirot <jlecuirot@microsoft.com>
Signed-off-by: James Le Cuirot <jlecuirot@microsoft.com>
Updating only the SDK to systemd-257 caused this script to break, as it
saw this version being pulled in as a BDEPEND and then tried to build it
using the board profile. See the comment for details.

Signed-off-by: James Le Cuirot <jlecuirot@microsoft.com>
We need this for dracut-install to have JSON support. It doesn't matter
that the Flatcar image will still have v256.

Signed-off-by: James Le Cuirot <jlecuirot@microsoft.com>
zstd is faster but we're getting seriously short on space.
Unfortunately, the arm64 kernel still cannot be compressed, but it has
benefited from another space saving measure recently, and GRUB also
takes up less space in /boot.

Signed-off-by: James Le Cuirot <jlecuirot@microsoft.com>
Again, zstd is faster but we're getting seriously short on space. Unlike
the kernel itself, this applies to both amd64 and arm64.

Signed-off-by: James Le Cuirot <jlecuirot@microsoft.com>
This version writes fewer temporary files and tries cpio multiple times
for concatenated archives again.

Signed-off-by: James Le Cuirot <jlecuirot@microsoft.com>
@chewi chewi force-pushed the chewi/pre-dracut branch from b6e7b19 to 1439806 Compare April 22, 2025 12:14
@chewi chewi requested a review from krnowak April 22, 2025 12:16
@chewi chewi merged commit 8fae246 into main Apr 22, 2025
2 of 4 checks passed
@chewi chewi deleted the chewi/pre-dracut branch April 22, 2025 13:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants