Linux kernel and CONFIG_EFI_BDS

419 views
Skip to first unread message

Curt Brune

unread,
Nov 14, 2018, 12:14:40 AM11/14/18
to linu...@googlegroups.com
Hi Folks,

I'm trying to follow along with
https://github.com/linuxboot/linuxboot, but am a bit puzzled by this
piece:

- A Linux kernel built with the CONFIG_EFI_BDS option enabled

It looks like CONFIG_EFI_BDS is not standard, so I assume some patches
for that are floating around somewhere. Searched around a bit, then
gave up...

Then I saw pr#32 "Replace Linux kernel BDS patch with `linuxboot.efi`
BDS implementation", which seems like "bravo, that's what I want". It
was submitted in August... Why not applied yet?

That led me to the Heads repo, which has patches and config for a
4.14.62 kernel, but presumes pr#32 is applied... In the history of
that repo I do see the CONFIG_EFI_BDS patches for an older kernel...

So what are people doing today? Makes me wonder what is going on as
the last commit was in May 2018.

At the moment I'm going with the upstream linuxboot, using an older
kernel from Heads (4.14.56) + CONFIG_EFI_BDS. We will see how it
goes.

Cheers,
Curt

Curt Brune

unread,
Nov 14, 2018, 1:45:58 PM11/14/18
to linu...@googlegroups.com
Howdy Folks,

Just an update, the kernel from Heads (4.14.56) + CONFIG_EFI_BDS
worked out OK. I'm kind of curious what the recommended direction on
this is. FWIW I'm kicking all these tires using qemu, not real
hardware.

The u-root initramfs was super easy to create. Need to inspect a bit
more what all init is doing there. Very nice!

For those who come next, a couple of gotchas I ran into:

. size of kernel and initramfs -- building linuxboot would fail,
ultimately because the kernel + initramfs were too large. For the
qemu machine the combined limit was about 10MB (not sure why, future
digging). Turns out compressing the u-root initramfs is a good idea.
Also using xz compression on the kernel helps.

For qemu I've always like using the serial console and the qemu
monitor. To that end these help:

. kernel command line -- add "console=ttyS0,115200n8"
. qemu monitor -- add "-monitor stdio"
. qemu serial -- add "-serial telnet:localhost:9005,server"

I like the --serial option with "server" as the vm waits for the
telnet connection before. The full qemu command line:

qemu-system-x86_64 -nographic -monitor stdio \
-serial telnet:localhost:9005,server \
-machine q35,smm=on -global ICH9-LPC.disable_s3=1 \
-global driver=cfi.pflash01,property=secure,value=on \
-drive if=pflash,format=raw,unit=0,file=/work/curt/src/linuxboot/build/qemu/linuxboot.rom

Cheers,
Curt

Gan Shun Lim

unread,
Nov 14, 2018, 2:04:46 PM11/14/18
to cu...@brune.net, linu...@googlegroups.com
I haven't used CONFIG_EFI_BDS for awhile, You should be able to get around this problem if your kernel just has CONFIG_EFI_STUB instead, and you have your initrd compiled into your kernel. You might need to make a stub initrd to pass into make. That's what I'm doing on my end.

--
You received this message because you are subscribed to the Google Groups "linuxboot" group.
To unsubscribe from this group and stop receiving emails from it, send an email to linuxboot+...@googlegroups.com.
To post to this group, send email to linu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/linuxboot/20181114184554.GC3173%40brune.net.
For more options, visit https://groups.google.com/d/optout.


--
-- Gan

Trammell Hudson

unread,
Nov 14, 2018, 2:05:00 PM11/14/18
to Curt Brune, linu...@googlegroups.com
Hey, Curt!

You should be able to do a clean build with the Heads tree with "make BOARD=qemu-linuxboot" and it will checkout the osresearch/linuxboot branch, build linuxboot.efi, etc. You can then run "make BOARD=qemu-linuxboot run" to launch qemu with the right parameters.

The removal of CONFIG_EFI_BDS patch hasn't been tested on all the platforms; we should figure out if we want to merge it without those systems.


‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐

Hiro Tus

unread,
Jun 23, 2020, 5:19:19 AM6/23/20
to linuxboot
Hi, Mr. Hudson.

I am recently trying to run Linuxboot on QEMU with the files built in Heads. However, I am stuck in the recovery shell when I "make BOARD=qemu-linuxboot run", with the message showing: "Unable to mount /boot". I am wondering if it matters that I cannot find the /dev/sda when in the recovery shell.

 May I ask if everything works well on your QEMU, and have you met the same problem as mine? I really want to know how to solve it. 
Thanks a lot!!!

在 2018年11月15日星期四 UTC+8上午3:05:00,Trammell Hudson写道:
> To unsubscribe from this group and stop receiving emails from it, send an email to linu...@googlegroups.com.
> To post to this group, send email to linu...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/linuxboot/20181114184554.GC3173%40brune.net.
> For more options, visit https://groups.google.com/d/optout.



在 2018年11月15日星期四 UTC+8上午3:05:00,Trammell Hudson写道:
> To unsubscribe from this group and stop receiving emails from it, send an email to linu...@googlegroups.com.
> To post to this group, send email to linu...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/linuxboot/20181114184554.GC3173%40brune.net.
> For more options, visit https://groups.google.com/d/optout.



在 2018年11月15日星期四 UTC+8上午3:05:00,Trammell Hudson写道:
> To unsubscribe from this group and stop receiving emails from it, send an email to linu...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages