Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 415665 - sys-apps/seabios: Add use flags for CONFIG_DEBUG_SERIAL and CONFIG_THREAD_OPTIONROMS
Summary: sys-apps/seabios: Add use flags for CONFIG_DEBUG_SERIAL and CONFIG_THREAD_OPT...
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All All
: Normal enhancement (vote)
Assignee: Doug Goldstein (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-05-13 01:02 UTC by Richard Yao (RETIRED)
Modified: 2012-07-22 22:37 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
seabios-1.6.3-r1.ebuild (seabios-1.6.3-r1.ebuild,1.69 KB, text/plain)
2012-06-30 03:17 UTC, Stefan Kuhn
Details
seabios-1.7.0-r1.ebuild (seabios-1.7.0-r1.ebuild,1.64 KB, text/plain)
2012-06-30 03:19 UTC, Stefan Kuhn
Details
metadata.xml (metadata.xml,659 bytes, text/plain)
2012-06-30 03:21 UTC, Stefan Kuhn
Details
seabios-1.7.0-r3.ebuild (seabios-1.7.0-r3.ebuild,1.70 KB, text/plain)
2012-07-01 21:45 UTC, Stefan Kuhn
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Richard Yao (RETIRED) gentoo-dev 2012-05-13 01:02:18 UTC
If you open /var/tmp/portage/sys-apps/seabios-1.6.3/work/seabios-1.6.3 after unpacking seabios 1.6.3, you can run `make menuconfig` to get a Linux-like menu, which has the options for CONFIG_DEBUG_SERIAL and CONFIG_THREAD_OPTIONROMS unchecked.

It would be useful if we had use flags for this. I imagine that `make defconfig` could be used with sed to enable this, like we currently do in genkernel.
Comment 1 Stefan Kuhn 2012-06-30 03:17:24 UTC
Created attachment 316717 [details]
seabios-1.6.3-r1.ebuild
Comment 2 Stefan Kuhn 2012-06-30 03:19:18 UTC
Created attachment 316719 [details]
seabios-1.7.0-r1.ebuild
Comment 3 Stefan Kuhn 2012-06-30 03:21:19 UTC
Created attachment 316721 [details]
metadata.xml
Comment 4 Stefan Kuhn 2012-06-30 03:31:43 UTC
make defconfig did the trick, the *-r1.ebuild use sed to patch the generated .config file.


Changes:
========
- 2 new use flags: "debug-serial-port" and "thread-optionroms" to versions 1.6.0 and 1.7.0
- metadata.xml: Description from the menuconfig for both flags


ChangeLog:
==========
*seabios-1.7.0-r1 (30 Jun 2012)

  30 Jun 2012; Stefan Kuhn <wuodan@hispeed.ch> +seabios-1.7.0-r1.ebuild:
    Added 2 new flags. bug #415665

  30 Jun 2012; Stefan Kuhn <wuodan@hispeed.ch> +seabios-1.6.3-r1.ebuild:
    Added 2 new flags. bug #415665


Todo:
=====
There's the following warning message from "make defconfig" when portage is building simultaneously:
jobserver unavailable: using -j1.  Add `+' to parent make rule.

It's due to EMERGE_DEFAULT_OPTS="-j8", can't find out how to prevent that in the Makefile at the moment.
Comment 5 Stefan Kuhn 2012-06-30 03:37:45 UTC
Tested:
=======
~amd64
------
- flag "debug-serial-port": Tested 1.6.3-r and 1.7.0
- flag "thread-optionroms": Have not had problems starting my VMs with it. The changes to the .config files show in "make menuconfig". That's all I can say.

x86:
----
Don't have an x86 host, someone else please test this and set keywords+="~x86"
Comment 6 Stefan Kuhn 2012-06-30 03:53:42 UTC
Comment on attachment 316721 [details]
metadata.xml

><?xml version="1.0" encoding="UTF-8"?>
><!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
><pkgmetadata>
>	<herd>virtualization</herd>
>	<maintainer>
>		<email>cardoe@gentoo.org</email>
>		<name>Doug Goldstein</name>
>	</maintainer>
>	<use>
>		<flag name='debug-serial-port'>Send debugging information to serial port. Base port is 0x3f8.</flag>
>		<flag name='thread-optionroms'>Allow hardware init to run in parallel with optionrom execution. This can reduce boot time, but can cause some timing variations during option ROM code execution. It is not known if all option ROMs will behave properly with this option.</flag>
>	</use>
></pkgmetadata>
>
Comment 7 Stefan Kuhn 2012-06-30 03:54:24 UTC
Comment on attachment 316721 [details]
metadata.xml

><?xml version="1.0" encoding="UTF-8"?>
><!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
><pkgmetadata>
>	<herd>virtualization</herd>
>	<maintainer>
>		<email>cardoe@gentoo.org</email>
>		<name>Doug Goldstein</name>
>	</maintainer>
>	<use>
>		<flag name='debug-serial-port'>Send debugging information to serial port. Base port is 0x3f8.</flag>
>		<flag name='thread-optionroms'>Allow hardware init to run in parallel with optionrom execution. This can reduce boot time, but can cause some timing variations during option ROM code execution. It is not known if all option ROMs will behave properly with this option.</flag>
>	</use>
></pkgmetadata>
>
Comment 8 Stefan Kuhn 2012-06-30 03:56:29 UTC
Comment on attachment 316721 [details]
metadata.xml

There's a typo, 2 spaces at description of thread-optionroms, sorry
Comment 9 Stefan Kuhn 2012-07-01 17:42:59 UTC
Update on the ToDo:
The warning:
make[1]:warning: jobserver unavailable: using -j1.  Add `+' to parent make rule.

has nothing to do with the 2 new use flags.

It alse happens in seabios-1.7.0 due to
make -j7 out/bios.bin -> make -j7 defconfig

with the new use flags "make -j7 defconfig" is just called earlier and the same warning shows earlier.
Comment 10 Stefan Kuhn 2012-07-01 21:45:45 UTC
Created attachment 316909 [details]
seabios-1.7.0-r3.ebuild

diff seabios-1.7.0-r1.ebuild seabios-1.7.0-r3.ebuild
fixes the mentioned warning by changing "@make" to "@+make" in the Makefile
39a40
> 	sed 's/$(Q)$(MAKE)/$(Q)+$(MAKE)/' -i "${S}/Makefile"
Comment 11 Doug Goldstein (RETIRED) gentoo-dev 2012-07-22 03:06:43 UTC
For serial debugging, why can't you just use the following:

-chardev stdio,id=seabios -device isa-debugcon,iobase=0x402,chardev=seabios

which results in qemu displaying the SeaBIOS debug in its own log. That's a lot more useful then hardcoding debugging via a serial port. The debugging via a serial port is aimed for CoreBoot when using SeaBIOS as an actual BIOS replacement on hardware.

With regard to threading the option roms, its known that this fails with the other QEMU option roms and since this package only targets QEMU, I would say we should not enable this.

I don't really see the benefit to exposing these since people will enable these and they really don't want either enabled. But if you can rationalize it, I'll add it.
Comment 12 Richard Yao (RETIRED) gentoo-dev 2012-07-22 04:33:47 UTC
(In reply to comment #11)
> For serial debugging, why can't you just use the following:
> 
> -chardev stdio,id=seabios -device isa-debugcon,iobase=0x402,chardev=seabios
> 
> which results in qemu displaying the SeaBIOS debug in its own log. That's a
> lot more useful then hardcoding debugging via a serial port. The debugging
> via a serial port is aimed for CoreBoot when using SeaBIOS as an actual BIOS
> replacement on hardware.
> 
> With regard to threading the option roms, its known that this fails with the
> other QEMU option roms and since this package only targets QEMU, I would say
> we should not enable this.
> 
> I don't really see the benefit to exposing these since people will enable
> these and they really don't want either enabled. But if you can rationalize
> it, I'll add it.

CONFIG_DEBUG_SERIAL would help me debug an issue where my Gentoo Hardened VM fails to boot. Right now, I am not sure if the issue is QEMU, KVM, Seabios or the bootloader. It is much more accessible than '-chardev stdio,id=seabios -device isa-debugcon,iobase=0x402,chardev=seabios'. I will try it the next time I find time to work on it, but until now, I did not know it was an option.
Comment 13 Doug Goldstein (RETIRED) gentoo-dev 2012-07-22 04:48:45 UTC
(In reply to comment #12)
> (In reply to comment #11)
> > For serial debugging, why can't you just use the following:
> > 
> > -chardev stdio,id=seabios -device isa-debugcon,iobase=0x402,chardev=seabios
> > 
> > which results in qemu displaying the SeaBIOS debug in its own log. That's a
> > lot more useful then hardcoding debugging via a serial port. The debugging
> > via a serial port is aimed for CoreBoot when using SeaBIOS as an actual BIOS
> > replacement on hardware.
> > 
> > With regard to threading the option roms, its known that this fails with the
> > other QEMU option roms and since this package only targets QEMU, I would say
> > we should not enable this.
> > 
> > I don't really see the benefit to exposing these since people will enable
> > these and they really don't want either enabled. But if you can rationalize
> > it, I'll add it.
> 
> CONFIG_DEBUG_SERIAL would help me debug an issue where my Gentoo Hardened VM
> fails to boot. Right now, I am not sure if the issue is QEMU, KVM, Seabios
> or the bootloader. It is much more accessible than '-chardev
> stdio,id=seabios -device isa-debugcon,iobase=0x402,chardev=seabios'. I will
> try it the next time I find time to work on it, but until now, I did not
> know it was an option.

Again, building the BIOS with CONFIG_DEBUG_SERIAL will hork the SERIAL port for EVERY single VM on a system which will result in a negative experience. Its much better to turn this on per VM using the above line.

The BIOS debug info is spit out IO port 0x402 and I'm just aliasing that over the QEMU's stdio. For some more examples you can search Bochs BIOS debug or SeaBIOS debug.
Comment 14 Richard Yao (RETIRED) gentoo-dev 2012-07-22 21:40:58 UTC
(In reply to comment #11)
> For serial debugging, why can't you just use the following:
> 
> -chardev stdio,id=seabios -device isa-debugcon,iobase=0x402,chardev=seabios

I just tried this. I am booting qemu with an OpenRC init script, so there is no stdio for me to view. It is a neat idea, but it that requires spending more time fiddling than that I would like. I guess this gives me an incentive to write scripts to reduce the time that spend doing that.
Comment 15 Doug Goldstein (RETIRED) gentoo-dev 2012-07-22 22:37:08 UTC
(In reply to comment #14)
> (In reply to comment #11)
> > For serial debugging, why can't you just use the following:
> > 
> > -chardev stdio,id=seabios -device isa-debugcon,iobase=0x402,chardev=seabios
> 
> I just tried this. I am booting qemu with an OpenRC init script, so there is
> no stdio for me to view. It is a neat idea, but it that requires spending
> more time fiddling than that I would like. I guess this gives me an
> incentive to write scripts to reduce the time that spend doing that.

So redirect it to your per-process log file. Or does your init script not do that?