[LinuxBIOS] [PATCH] v3: Kconfig payload options and README improvements

Hi, here's a patch for v3 which reworks the payload selection in 'make menuconfig'. After the patch there are two simple options you can use: - Payload file You specify a path and filename for the payload. Default: payload.elf in the current directory. _How_ you create this payload does not matter; manual building, using a pre-built image from somewhere, using buildrom or lbdistro to create one etc. etc. - No payload This will create an "empty" image without any payload. You can later add a payload from the command line using the 'lar' utility. Something like 'lar add payload.elf linuxbios.rom' will add it... This is useful for multiple purposes: - Other "payload-projects" such as GNUFI or Open Firmware etc. can use LinuxBIOS as low-level bootstrap and incorporate LinuxBIOS in their own build process. They use the "empty" LinuxBIOS image as a base and use 'lar' to insert their own GNUFI / OFW / whatever image. - Linux distributions can ship 'linuxbios' packages which come with /usr/bin/lar and "empty" pre-built images for all supported mainboards somewhere in /usr/share, e.g. /usr/share/linuxbios/images/lb_empty_asus_a8n_e.rom /usr/share/linuxbios/images/lb_empty_tyan_s2882.rom /usr/share/linuxbios/images/lb_empty_gigabyte_ga_6bxc_256k.rom /usr/share/linuxbios/images/lb_empty_gigabyte_ga_6bxc_512k.rom etc. The user can then use those pre-built images and the 'lar' tool to insert any desired payload into the "final" image before flashing it. Heck, the distributions could even ship default payloads in /usr/share/linuxbios/payloads. We definately need some more discussion on the payload handling, but I think this patch is a good start. This system is flexible enough to manage any use case you can imagine, IMO. I documented the proposed procedure in the README in the patch, comments welcome. Uwe. -- http://www.hermann-uwe.de | http://www.holsham-traders.de http://www.crazy-hacks.org | http://www.unmaintained-free-software.org

* Uwe Hermann <uwe@hermann-uwe.de> [070530 22:46]:
Rework payload handling to only provide two options:
- Payload file
- No payload
Document the current procedure in the README. Minor cosmetic fixes.
Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de>
Index: Kconfig =================================================================== --- Kconfig (Revision 338) +++ Kconfig (Arbeitskopie) @@ -78,69 +78,30 @@ prompt "Payload type" default PAYLOAD_ELF
-config PAYLOAD_FILO - bool "FILO" +config PAYLOAD_ELF + bool "An ELF executable payload file" help - TODO + Select this option if you have a payload image (an ELF file) + which LinuxBIOS should run as soon as the basic hardware + initialization is completed.
-config PAYLOAD_ETHERBOOT - bool "Etherboot" - help - TODO + You will be able to specify the location and file name of the + payload image later.
-config PAYLOAD_MEMTEST86 - bool "Memtest86" +config PAYLOAD_NONE + bool "No payload" help - TODO + Select this option if you want to create an "empty" LinuxBIOS + ROM image for a certain mainboard, i.e. a LinuxBIOS ROM image + which does not yet contain a payload.
-config PAYLOAD_LINUX - bool "Linux kernel" - help - TODO + For such an image to be useful, you have to use the 'lar' tool + to add a payload to the ROM image later.
-config PAYLOAD_ELF - bool "Any ELF executable" - help - TODO - -config PAYLOAD_DUMMY - bool "Dummy payload" - help - For testing purposes only. - endchoice
-config PAYLOAD_FILO_DIR - string "FILO source code directory" - depends PAYLOAD_FILO - default "/tmp/filo-0.5" - help - The directory where the FILO source code is located. - -config PAYLOAD_FILO_CONFIGFILE - string "Filename of the FILO 'Config' file" - depends PAYLOAD_FILO - default "Config" - help - The filename of the FILO 'Config' file to use. This file must reside - in the directory specified via PAYLOAD_FILO_DIR. - -config PAYLOAD_LINUX_DIR - string "Linux kernel source code directory" - depends PAYLOAD_LINUX - default "/usr/src/linux" - help - The directory where the Linux kernel source code is located. - -config PAYLOAD_LINUX_CONFIGFILE - string "Path and filename of the Linux .config file to use" - depends PAYLOAD_LINUX - default ".config" # FIXME! - help - The path and filename of the Linux .config file to use. - -config PAYLOAD_ELF_FILE - string "Path and filename of the ELF file to use as payload" +config PAYLOAD_FILE + string "Payload path and filename" depends PAYLOAD_ELF default "payload.elf" help
I think its fine up to here.
Index: Makefile =================================================================== --- Makefile (Revision 338) +++ Makefile (Arbeitskopie) doxygen: $(Q)$(DOXYGEN) util/doxygen/Doxyfile.LinuxBIOS
+payload: + $(Q)printf "Not yet implemented. This will invoke a helper tool.\n" +
I'd wait checking this stuff in until we really do something here.
- $(Q)cp $(CONFIG_PAYLOAD) $(obj)/lar.tmp/normal/payload + $(Q)# TODO: Copy no payload or empty payload if CONFIG_PAYLOAD_NONE. + $(Q)cp $(CONFIG_PAYLOAD_FILE) $(obj)/lar.tmp/normal/payload
maybe something like if [ -r $(CONFIG_PAYLOAD_FILE) ]; then cp .... ; fi
-STAGE2_LIB_OBJ = stage2.o clog2.o mem.o malloc.o tables.o delay.o compute_ip_checksum.o +STAGE2_LIB_OBJ = stage2.o clog2.o mem.o malloc.o tables.o delay.o \ + compute_ip_checksum.o
Uh oh, lots of unrelated whitespace stuff in this patch.
+# TODO: Compress the payload (CONFIG_PAYLOAD_FILE) with the default compressor. # -# TODO: This is not implemented yet. -# TODO: This needs to be compressed with the default compressor.
- $(Q)$(CC) -E $(LINUXBIOSINCLUDE) $< \ - -o $(obj)/arch/x86/stage0_asm.s -DBOOTBLK=0x1f00 -DRESRVED=0xf0 \ - -DDATE=\"`date +%Y/%m/%d`\" + $(Q)$(CC) -E $(LINUXBIOSINCLUDE) $< -o $(obj)/arch/x86/stage0_asm.s \ + -DBOOTBLK=0x1f00 -DRESRVED=0xf0 -DDATE=\"`date +%Y/%m/%d`\"
... and reformatting. -- coresystems GmbH • Brahmsstr. 16 • D-79104 Freiburg i. Br. Tel.: +49 761 7668825 • Fax: +49 761 7664613 Email: info@coresystems.de • http://www.coresystems.de/

On Thu, May 31, 2007 at 01:43:43AM +0200, Stefan Reinauer wrote:
Index: Makefile =================================================================== --- Makefile (Revision 338) +++ Makefile (Arbeitskopie) doxygen: $(Q)$(DOXYGEN) util/doxygen/Doxyfile.LinuxBIOS
+payload: + $(Q)printf "Not yet implemented. This will invoke a helper tool.\n" +
I'd wait checking this stuff in until we really do something here.
OK, it's commented now.
- $(Q)cp $(CONFIG_PAYLOAD) $(obj)/lar.tmp/normal/payload + $(Q)# TODO: Copy no payload or empty payload if CONFIG_PAYLOAD_NONE. + $(Q)cp $(CONFIG_PAYLOAD_FILE) $(obj)/lar.tmp/normal/payload
maybe something like if [ -r $(CONFIG_PAYLOAD_FILE) ]; then cp .... ; fi
Yep, done.
-STAGE2_LIB_OBJ = stage2.o clog2.o mem.o malloc.o tables.o delay.o compute_ip_checksum.o +STAGE2_LIB_OBJ = stage2.o clog2.o mem.o malloc.o tables.o delay.o \ + compute_ip_checksum.o
Uh oh, lots of unrelated whitespace stuff in this patch.
True, it's gone now. I made an extra commit out of that. Updated patch attached. Uwe. -- http://www.hermann-uwe.de | http://www.holsham-traders.de http://www.crazy-hacks.org | http://www.unmaintained-free-software.org
participants (2)
-
Stefan Reinauer
-
Uwe Hermann