Giter VIP home page Giter VIP logo

Comments (9)

Foxboron avatar Foxboron commented on August 14, 2024

sbctl signs EFI executables, kernel modules uses a different method and something the tool doesn't support.

Grub requires modules being built into the bootloader and not sideloaded, along with some different flags. Please check the ArchWiki or the documentation your distribution has on this.

https://wiki.archlinux.org/title/GRUB#Secure_Boot_support

from sbctl.

Foxboron avatar Foxboron commented on August 14, 2024

When I try to sign my kernel using sbctl sign -s I'm receiving the following error:
/boot/kernel-6.1.19-gentoo: failed to fetch signatures slice: could not get datadirectory: couldn't parse PE file: unrecognized PE machine: 0x5ea.

This error makes me think you have built your kernel without the required EFISTUB support. So effectively the kernel is not an EFI binary. But you need to check your distro and/or build options for that.

from sbctl.

nvaert1986 avatar nvaert1986 commented on August 14, 2024

I compiled my kernel without EFISTUB support indeed, because I load the kernel via grub and disable everything that I do not need in my kernel. For size, performance and security reasons. This should solve the issue of not being able to sign the kernel. Will I be required to sign my kernel modules too (will my system fully load if I do not sign my kernel modules)?

from sbctl.

Foxboron avatar Foxboron commented on August 14, 2024

Secure Boot and kernel module signing are two separate things. You machine will boot regardless of what you do.

However if you enable lockdown mode, or build with CONFIG_IMA_ARCH_POLICY, the kernel will demand signed modules. This can only be achieved by controlling the built-in key in the kernel or using a shim to load a MOK into the keyring of the kernel.

But since you build your own kernel it will just be guess work on my end what you support and don't support.

from sbctl.

nvaert1986 avatar nvaert1986 commented on August 14, 2024

Secure Boot and kernel module signing are two separate things. You machine will boot regardless of what you do.

However if you enable lockdown mode, or build with CONFIG_IMA_ARCH_POLICY, the kernel will demand signed modules. This can only be achieved by controlling the built-in key in the kernel or using a shim to load a MOK into the keyring of the kernel.

But since you build your own kernel it will just be guess work on my end what you support and don't support.

Thank you, I understand what I need to do here as I use the built-in key in the kernel for signing the kernel modules, which I will keep using then.

from sbctl.

nvaert1986 avatar nvaert1986 commented on August 14, 2024

When I try to sign my kernel using sbctl sign -s I'm receiving the following error:
/boot/kernel-6.1.19-gentoo: failed to fetch signatures slice: could not get datadirectory: couldn't parse PE file: unrecognized PE machine: 0x5ea.

This error makes me think you have built your kernel without the required EFISTUB support. So effectively the kernel is not an EFI binary. But you need to check your distro and/or build options for that.

I'm running Gentoo, but from what I quickly understood from the Arch documentation, I basically need to use grub-mkstandalone to make a standalone EFI file if I'm correct?

from sbctl.

Foxboron avatar Foxboron commented on August 14, 2024

I'm running Gentoo, but from what I quickly understood from the Arch documentation, I basically need to use grub-mkstandalone to make a standalone EFI file if I'm correct?

Sounds correct. I don't use grub so you need to figure that our on your own.

from sbctl.

nvaert1986 avatar nvaert1986 commented on August 14, 2024

I'm running Gentoo, but from what I quickly understood from the Arch documentation, I basically need to use grub-mkstandalone to make a standalone EFI file if I'm correct?

Sounds correct. I don't use grub so you need to figure that our on your own.

What is the boot manager that I should be using to easily be able to generate bundles (including kernel cmd line arugments; that's all I'd need. I don't even use a initramfs except for microcode). Does this happen to be systemd-boot (as this wouldn't be a problem, as I'm running gentoo with systemd).

from sbctl.

Foxboron avatar Foxboron commented on August 14, 2024

I just use systemd-boot and happy with that. You'll have to check if it fits your needs.

from sbctl.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.