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

bin/ubuntu-core-initramfs: build the early initrd from installed ucode packages #252

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

Conversation

valentindavid
Copy link
Collaborator

No description provided.

@valentindavid
Copy link
Collaborator Author

Tested on Intel NUC. Not tested on AMD.

Copy link
Member

@alfonsosanchezbeato alfonsosanchezbeato left a 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/'])

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)

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

Comment on lines +754 to +758
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'))

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.

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.

2 participants