Choose initramfs generator based on Ubuntu release - #2834
Merged
Conversation
Commit 58af3bc switched tpm2-unlock.sh to dracut unconditionally, which broke the script on 24.04 where the initramfs is generated by initramfs-tools. It also installed both clevis-initramfs and clevis-dracut, so each shipped a hook injecting clevis into the initramfs. Pick the package and the update command per release instead: noble keeps clevis-initramfs and update-initramfs, later releases use clevis-dracut and dracut. The rollback purge now matches what was installed, so it no longer fails on an absent package. Signed-off-by: Simon L. <szaimen@e.mail.de>
1 task
Member
|
Thanks @szaimen! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
#2833 switched
tpm2-unlock.shtodracut -funconditionally. That fixed 26.04, but 24.04 is still in the supported range (SUPPORTED_VERSION_MIN=24.04inlib.sh) and generates its initramfs with initramfs-tools, so the unconditional switch regressed it.That commit also installed both
clevis-initramfsandclevis-dracut. Each ships a hook that injects clevis into the initramfs, so on 26.04 you get the dracut path plus a stale initramfs-tools hook.Change
Pick the package and the update command together, once, based on the release codename:
clevis-initramfsupdate-initramfs -u -k 'all'clevis-dracutdracut -fThree follow-on fixes:
apt-get purgematches what was installed, so it no longer fails on an absent package.msg_box/exit 1error path rather than duplicating the condition.The check keys off
$CODENAMErather than a numeric comparison.check_distro_versionalready rejects anything outside the supported range, and this project only supports LTS releases, so$DISTROcan only be 24.04.x or 26.04.x here — a numeric cutoff would have needed a magic version number that appears nowhere in the project's policy. Testing fornoblealso makes dracut the default, so future releases land on the right path automatically.The
is_this_installedcheck still tests both package names on purpose: it's a "have you run this before?" probe, and anyone who ran the script at 58af3bc on 26.04 may haveclevis-initramfsinstalled.Testing
shellcheck -x not-supported/tpm2-unlock.shpasses clean.I have not verified that
clevis-dracutexists under exactly that name in the 26.04 archive — that rests on the report in #2833 and the Ubuntu clevis guide, as it did before this change. Worth a confirmation from someone with a 26.04 box, along with a real 24.04 run to confirm the restored path.🤖 AI (if applicable)