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.
Created attachment 316717 [details] seabios-1.6.3-r1.ebuild
Created attachment 316719 [details] seabios-1.7.0-r1.ebuild
Created attachment 316721 [details] metadata.xml
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.
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 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 on attachment 316721 [details] metadata.xml There's a typo, 2 spaces at description of thread-optionroms, sorry
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.
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"
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.
(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.
(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.
(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.
(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?