Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
What to do when firmware ignores boot options?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Installing Gentoo
View previous topic :: View next topic  
Author Message
wodooo
n00b
n00b


Joined: 30 Jun 2017
Posts: 2

PostPosted: Fri Jun 30, 2017 3:52 pm    Post subject: What to do when firmware ignores boot options? Reply with quote

Hello,

I've got my installation running with GRUB2 and now I'm trying to boot my kernel and initramfs without a bootloader. Unfortunately, it seems my firmware is bugged (it's a Dell XPS with latest BIOS) and ignores boot parameters. This is how I create a boot entry:
Code:
# efibootmgr --create --disk /dev/nvme0n1 --part 3 --label "gentoo" -e 3 --loader '\EFI\gentoo\kernel.efi' -u 'ro initrd=\EFI\gentoo\initramfs.efi'

The boot entry appears, but loading it causes a kernel panic.
Code:
Kernal panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)

I came to the conclusion that it is bugged after finding this, and this.

Some things I tried:
Compiling kernel with hardcoded parameters:
Code:
CONFIG_CMDLINE_BOOL=y
CONFIG_CMDLINE="root=/dev/mapper/root ro initrd=\\EFI\\gentoo\\initramfs.efi"
CONFIG_CMDLINE_OVERRIDE=y

and then adding boot entry without parameters:
Code:
# efibootmgr --create --disk /dev/nvme0n1 --part 3 --label "gentoonoparam" -e 3 --loader '\EFI\gentoo\kernel.efi'

The result is the same. By the way, this kernel with hardcoded parameters boots just fine from GRUB2.
I also tried various combinations like using "/dev/rom0" instead of "/dev/mapper/root" and using forward slashed instead of backward slashed in the "initrd=..." parameter.
By the way, I cannot not use initramfs because my root is encrypted and I need a to unlock it. To generate an initramfs I use Dracut.

Do you guys have any ideas on how to workaround this problem?
Any help is appreciated.
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 7134
Location: almost Mile High in the USA

PostPosted: Fri Jun 30, 2017 4:18 pm    Post subject: Reply with quote

This sounds very similar to another posting about someone having problems with EFI not passing parameters properly to kernels. So it appears to be a firmware bug after all, it's odd that it works for some people and not for others.

The underlying issue is that EFI needs to know about where the initramfs is, as EFI I/O routines are used to load the initramfs in RAM even if the kernel needs to be pointed to it. The kernel's drivers aren't used until after the initramfs is loaded.

If you were looking for a workaround, it seems you found it, use grub (or refind.) Is there a problem with grub/refind?
_________________
Intel Core i7 2700K@ 4.1GHz/HD3000 graphics/8GB DDR3/180GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
wodooo
n00b
n00b


Joined: 30 Jun 2017
Posts: 2

PostPosted: Fri Jun 30, 2017 5:20 pm    Post subject: Reply with quote

eccerr0r wrote:
Is there a problem with grub/refind?

Kind of. I plan to enable secure boot and later even trusted boot. Maybe I'm wrong, but it seems that enabling secure boot without a boot loader is easier as I only need to sign the kernel and the initramfs, nothing else.
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 7134
Location: almost Mile High in the USA

PostPosted: Fri Jun 30, 2017 11:30 pm    Post subject: Reply with quote

Well, the kernel would need to be signed, but the initramfs, as it's not an efi executable, would have to use some sort of checksum that the kernel needs to check.

But since you would have to depend on a non-EFI security mechanism for that anyway, then why not have GRUB or REFIND check your kernel and initramfs, and GRUB/REFIND be a signed binary?

I'd say plug your firmware manufacturer and force them to fix it, if you must have efibootmgr work like other machines, it's a bug after all?

The other option - can you completely embed your intiramfs into your kernel?
_________________
Intel Core i7 2700K@ 4.1GHz/HD3000 graphics/8GB DDR3/180GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Installing Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum