-
Notifications
You must be signed in to change notification settings - Fork 28
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
bin/ubuntu-core-initramfs: build the early initrd from installed ucode packages #252
base: main
Are you sure you want to change the base?
Conversation
426f4da
to
fdbf8e9
Compare
fdbf8e9
to
22951f8
Compare
Tested on Intel NUC. Not tested on AMD. |
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.
Thanks for taking care of the TODO! I have a couple of questions below.
shutil.copyfileobj(f, output) | ||
|
||
def mk_intel_ucode(output_path): | ||
check_call(['iucode_tool', f'--write-to={output_path}', '/lib/firmware/intel-ucode/']) |
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.
Should this call /usr/share/initramfs-tools/hooks/intel_microcode
? I know that this is the way that this is done atm by the script in the debian
folder but I fear that we become out of sync with the way that the distro creates the microcode bits. For instance I see that the script uses --write-earlyfw
but that is not here. We can leave it as a TODO if not too practical.
def mk_amd_ucode(output): | ||
for path in glob.glob('/lib/firmware/amd-ucode/*.bin'): | ||
with open(path, 'rb') as f: | ||
shutil.copyfileobj(f, output) |
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.
Similar question to the one for intel about using /usr/share/initramfs-tools/hooks/amd64_microcode
if os.path.exists('/lib/firmware/amd-ucode'): | ||
with open(os.path.join(microcode_dir, 'AuthenticAMD.bin'), 'wb') as f: | ||
mk_amd_ucode(f) | ||
if os.path.exists('/lib/firmware/intel-ucode'): | ||
mk_intel_ucode(os.path.join(microcode_dir, 'GenuineIntel.bin')) |
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.
We should check that if it the target arch is amd64 both actually exist and error otherwise.
No description provided.