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

Remove mkinitrd script. #8126

Merged
merged 1 commit into from
Mar 1, 2024

Conversation

cwize1
Copy link
Contributor

@cwize1 cwize1 commented Feb 28, 2024

Merge Checklist

All boxes should be checked before merging the PR (just tick any boxes which don't apply to this PR)

  • The toolchain has been rebuilt successfully (or no changes were made to it)
  • The toolchain/worker package manifests are up-to-date
  • Any updated packages successfully build (or no packages were changed)
  • Packages depending on static components modified in this PR (Golang, *-static subpackages, etc.) have had their Release tag incremented.
  • Package tests (%check section) have been verified with RUN_CHECK=y for existing SPEC files, or added to new SPEC files
  • All package sources are available
  • cgmanifest files are up-to-date and sorted (./cgmanifest.json, ./toolkit/scripts/toolchain/cgmanifest.json, .github/workflows/cgmanifest.json)
  • LICENSE-MAP files are up-to-date (./SPECS/LICENSES-AND-NOTICES/data/licenses.json, ./SPECS/LICENSES-AND-NOTICES/LICENSES-MAP.md, ./SPECS/LICENSES-AND-NOTICES/LICENSE-EXCEPTIONS.PHOTON)
  • All source files have up-to-date hashes in the *.signatures.json files
  • sudo make go-tidy-all and sudo make go-test-coverage pass
  • Documentation has been updated to match any changes to the build system
  • Ready to merge

Summary

This changes removes the mkinitrd script and replaces all calls with direct calls to dracut.

In addition, the /boot/initrd.img- file has been renamed to /boot/initramfs-.img to match the default name used by dracut. This avoids needing to add a patch to dracut to change the default name of the initrd file.

Also, previously the mkinitrd script passed the --hostonly flag to dracut to ensure the hostonly option was enabled. This has been replaced with setting the hostonly only in the /etc/dracut.conf file instead. One nice advantage this provides is that it allows a user to override this default by adding a config file under the /etc/dracut.conf.d directory.

Change Log
  • Remove mkinitrd script.
  • Rename /boot/initrd.img-<kver> to /boot/initramfs-<kver>.img.
  • Set hostonly to yes in /etc/dracut.conf.
  • Call dracut directly in iniramfs package post-install scripts.
Does this affect the toolchain?

YES, but only a kernel-headers version bump.

Test Methodology
  • Built image locally and booted it in a VM.

@cwize1 cwize1 requested review from a team as code owners February 28, 2024 00:17
@cwize1 cwize1 requested a review from a team as a code owner February 28, 2024 00:30
Copy link
Contributor

@PawelWMS PawelWMS left a comment

Choose a reason for hiding this comment

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

The toolkit changes look good.

Copy link
Contributor

@ddstreetmicrosoft ddstreetmicrosoft left a comment

Choose a reason for hiding this comment

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

Several things, most importantly we definitely need to revisit the (incomplete) kexec-tools upgrade, and we absolutely need to make sure kdump is not using the system initrd.

I'd also like to understand why we have the initramfs package at all.

Finally, that kernel-rt grub config stuff almost certainly is no longer needed and should be removed.

SPECS-EXTENDED/kernel-rt/kernel-rt.spec Show resolved Hide resolved
SPECS-EXTENDED/kernel-rt/kernel-rt.spec Show resolved Hide resolved
SPECS/dracut/dracut-conf-add-defaults.patch Show resolved Hide resolved
SPECS/dracut/dracut.spec Show resolved Hide resolved
SPECS/initramfs/initramfs.spec Show resolved Hide resolved
SPECS/kexec-tools/kdumpctl Show resolved Hide resolved
@cwize1 cwize1 force-pushed the user/chrisgun/RenameToInitramfs branch 2 times, most recently from 78ade9a to 59e9bd0 Compare February 29, 2024 00:26
Copy link
Contributor

@ddstreetmicrosoft ddstreetmicrosoft left a comment

Choose a reason for hiding this comment

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

definitely multiple issues with our overall setup but as you pointed out you're not trying to fix everything in this pr, just make a minor tweak, and that tweak looks fine (mostly), and i'll try to keep track of the existing issues and fix in separate prs

SPECS/kexec-tools/kdumpctl Show resolved Hide resolved
SPECS-EXTENDED/kernel-rt/kernel-rt.spec Show resolved Hide resolved
SPECS/dracut/dracut-conf-add-defaults.patch Show resolved Hide resolved
SPECS/dracut/dracut.spec Show resolved Hide resolved
SPECS/initramfs/initramfs.spec Show resolved Hide resolved
This changes removes the mkinitrd script and replaces all calls with direct calls to dracut.

In addition, the /boot/initrd.img-<kver> file has been renamed to /boot/initramfs-<kver>.img to match the default name used by dracut. This avoids needing to add a patch to dracut to change the default name of the initrd file.

Also, previously the mkinitrd script passed the `--hostonly` flag to dracut to ensure the hostonly option was enabled. This has been replaced with setting the hostonly only in the `/etc/dracut.conf` file instead. One nice advantage this provides is that it allows a user to override this default by adding a config file under the `/etc/dracut.conf.d` directory.
@cwize1 cwize1 force-pushed the user/chrisgun/RenameToInitramfs branch from 59e9bd0 to e8681b6 Compare February 29, 2024 21:28
@cwize1 cwize1 merged commit de743d6 into microsoft:3.0-dev Mar 1, 2024
9 checks passed
anphel31 added a commit that referenced this pull request Mar 6, 2024
cwize1 added a commit that referenced this pull request Mar 6, 2024
In change #8126, the mkinitrd script was removed in favor of using
dracut directly. However, one feature that was missed was that the
mkinitrd script pulls additional dracut settings from files under the
/var/lib/initramfs/kernel directory. This was being used to add the VM
guest drivers to initramfs file. Since these drivers are no longer being
added, the images don't boot under Hyper-V.

This change re-adds the guest VM drivers to dracut, but using the
/etc/dracut.conf.d config directory.
@LaszloGombos
Copy link

A message from dracut upstream regarding the intention of standardizing the naming of the generated initramfs.

dracut-ng/dracut-ng#160
uapi-group/specifications#100

You should perhaps consider keeping the initrd-$KVER naming schema.

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.

6 participants