-
Notifications
You must be signed in to change notification settings - Fork 1
Bring the PAYG UKI below 100MB, plus some other PAYG fixes #179
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
Merged
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
58b9bfa
Remove unused GNOME OS initramfs code
ssssam bbec23c
doc: Add guidance on inspecting the contents of the initramfs and UKI
ssssam 9ded38f
payg: Fix UKI build process
ssssam 7198328
linux: Run `modules_install` in parallel
ssssam 33793a0
linux: Don't compress modules
ssssam 597d687
payg: Update eos-payg-nonfree to reference new libsodium version
ssssam 81f07e9
linux: Disable debug info
ssssam File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| # How to debug initramfs issues | ||
|
|
||
| The EOS7 initramfs build process uses Dracut. | ||
|
|
||
| See the `eos/initramfs.bst` element for an overview of the main initramfs. | ||
|
|
||
| See the `eos/payg/uki.bst` element for details on the UKI used in PAYG devices. | ||
|
|
||
| ## Inspecting the built initramfs | ||
|
|
||
| Linux initramfs files are packed using cpio, an ancient technology from decades past. | ||
| Dracut builds a small cpio archive containing microcode, then appends the main body | ||
| of the initramfs as a separate blob. In EOS7 this blob is compressed with Zstd | ||
| compression. Extracting the initramfs contents is a fun job. Here's how you | ||
| might do it. | ||
|
|
||
| 1. Checkout the built artifact from the artifact cache. | ||
|
|
||
| bst artifact checkout --deps none eos/initramfs.bst --directory ./initramfs | ||
|
|
||
| You should now have `initramfs/usr/lib/modules/$(version)/initramfs` available, | ||
| change to that directory as well. | ||
|
|
||
| 2. Use the `skipcpio` tool from Dracut which will write the body of the | ||
| initramfs to stdout. Make sure dracut and zstd installed on your build | ||
| machine, of course. | ||
|
|
||
| /usr/lib/dracut/skipcpio initramfs | zstd -d > initramfs.body.cpio | ||
|
|
||
| 3. You can now unpack the initramfs into a new, empty directory with `cpio`: | ||
|
|
||
| mkdir extract | ||
| cd extract | ||
| cpio -idmv < ../initramfs.body.cpio | ||
|
|
||
| You can also compare it against a different initramfs using | ||
| [diffoscope](https://diffoscope.org/), which will unpack the cpio archive for you. | ||
|
|
||
| ## Inspecting the PAYG UKI | ||
|
|
||
| The UKI is only used for PAYG devices. | ||
|
|
||
| Note that building the UKI is only possible within Endless. But you can find | ||
| the binary in all prebuilt EOS7 images at `/usr/lib/modules/$(version)/payg-image.efi`. | ||
|
|
||
| You can use `ukify inspect` to examine a UKI binary. | ||
|
|
||
| To extract contents of one of the sections, for example the initramfs, use `objdump`: | ||
|
|
||
| objcopy --dump-section .initrd="./initramfs" ./payg-image.efi |
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was this addition intentional?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, as the initramfs is zstd compressed, but i didnt put that in the commit message. will update