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

implement ucode and uki hooks #48

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

implement ucode and uki hooks #48

wants to merge 1 commit into from

Conversation

dkwo
Copy link
Collaborator

@dkwo dkwo commented Jan 9, 2025

I received these patches from Daniel Semyonov.
I have not tested them yet, but I figured I would post them here so that anyone can take a look.

Some notes from the author:

  • As tinyramfs uses POSIX sh, I made sure to only use POSIX features of
    other commands I called (awk, sed, grep, wc).
    For awk specifically, the code I wrote didn't work for gawk without
    the -Wposix flag, but testing with 3 other implementations (those
    available in Void) indicates they only emit a warning with this flag
    to stderr.
  • As I used objcopy (which isn't really standardized AFAIK) to build the
    UKI, I added support for both GNU's objcopy (which also need objdump)
    and llvm-objcopy.
  • The microcode hook adds only the current CPU's microcode in hostonly
    mode (it generates an image from the firmware files, though I only
    tested this hook on an AMD machine), unless a prebuilt image is
    specified (in which case it just uses it).

@dkwo
Copy link
Collaborator Author

dkwo commented Jan 9, 2025

My comments: After looking at the patches, they mostly look fine. This is quite close to the scripts I've been already using for a while, except for:

  1. I was passing --set-section-flags to llvm-objcopy. I now tested without, and it works indeed fine.

  2. At least for intel && hostonly, I was using iucode_tool -S --write-earlyfw=${tmpdir}/ucode /usr/lib/firmware/intel-ucode/* instead, and I wonder if this simpler command is preferred.

@dkwo
Copy link
Collaborator Author

dkwo commented Jan 9, 2025

At the moment, it seems that intel code uses decimal, but it should use hex.
Btw, I think exporting DM_DISABLE_UDEV=1 in cryptsetup hook is not needed, while it's enough to do it for lvm.

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.

1 participant