mirror of https://github.com/ipxe/ipxe.git
Fix BUILD_SERIAL.
Change from using #if to #ifdef, since #if can't cope with string constants.pull/1/head
parent
85b00c4b72
commit
cf79681b80
18
src/Config
18
src/Config
|
@ -221,18 +221,6 @@
|
||||||
# which saves power while waiting for user interaction.
|
# which saves power while waiting for user interaction.
|
||||||
# Good for compute clusters and VMware emulation.
|
# Good for compute clusters and VMware emulation.
|
||||||
# But may not work for all CPUs.
|
# But may not work for all CPUs.
|
||||||
# -DBUILD_SERIAL
|
|
||||||
# Include an auto-incrementing build number in
|
|
||||||
# the Etherboot welcome message. Useful when
|
|
||||||
# developing, to be sure that the file you
|
|
||||||
# compiled is the one you're currently testing.
|
|
||||||
# -DBUILD_ID
|
|
||||||
# Include a build ID string in the Etherboot
|
|
||||||
# welcome message. Useful when developing, if
|
|
||||||
# you have multiple builds with different
|
|
||||||
# configurations and want to check you're
|
|
||||||
# running the one you think you are. Requires
|
|
||||||
# -DBUILD_SERIAL.
|
|
||||||
#
|
#
|
||||||
# @/OptionDescription@
|
# @/OptionDescription@
|
||||||
|
|
||||||
|
@ -365,12 +353,6 @@ CFLAGS+= -DPXE_IMAGE -DPXE_EXPORT
|
||||||
# via pxeboot, use only with DOWNLOAD_PROTO_NFS
|
# via pxeboot, use only with DOWNLOAD_PROTO_NFS
|
||||||
# CFLAGS+= -DFREEBSD_PXEEMU
|
# CFLAGS+= -DFREEBSD_PXEEMU
|
||||||
|
|
||||||
# Include an auto-incrementing build serial number and optional build
|
|
||||||
# ID string
|
|
||||||
# CFLAGS+= -DBUILD_SERIAL
|
|
||||||
# CFLAGS+= -DBUILD_SERIAL -DBUILD_ID=\"testing\"
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Garbage from Makefile.main temporarily placed here until a home can
|
# Garbage from Makefile.main temporarily placed here until a home can
|
||||||
|
|
|
@ -359,26 +359,24 @@ CLEANUP += $(NRV2B)
|
||||||
# build targets to get a serial number printed at the end of the
|
# build targets to get a serial number printed at the end of the
|
||||||
# build. Enable -DBUILD_SERIAL in order to see it when the code runs.
|
# build. Enable -DBUILD_SERIAL in order to see it when the code runs.
|
||||||
#
|
#
|
||||||
BUILDSERIAL_H = include/.buildserial.h
|
BUILDSERIAL_H = config/.buildserial.h
|
||||||
|
BUILDSERIAL_NOW = config/.buildserial.now
|
||||||
|
BUILDSERIAL_NEXT = config/.buildserial.next
|
||||||
|
|
||||||
$(BUILDSERIAL_H) :
|
$(BUILDSERIAL_NOW) $(BUILDSERIAL_NEXT) :
|
||||||
@if [ ! -s $@ ]; then echo '#define BUILD_SERIAL_NUM 0' > $@; fi
|
echo 1 > $@
|
||||||
@perl -pi -e 's/(BUILD_SERIAL_NUM)\s+(\d+)/"$${1} ".($${2}+1)/e' $@
|
|
||||||
|
|
||||||
bs : $(BUILDSERIAL_H)
|
$(BUILDSERIAL_H) : $(BUILDSERIAL_NOW) $(BUILDSERIAL_NEXT)
|
||||||
@perl -n -e '/BUILD_SERIAL_NUM\s+(\d+)/ && ' \
|
echo '#define BUILD_SERIAL_NUM $(shell cat $<)' > $@
|
||||||
-e 'print "Build serial number is $$1\n";' $<
|
|
||||||
|
|
||||||
ifeq ($(filter bs,$(MAKECMDGOALS)),bs)
|
ifeq ($(filter bs,$(MAKECMDGOALS)),bs)
|
||||||
.PHONY : $(BUILDSERIAL_H)
|
$(shell diff -q $(BUILDSERIAL_NOW) $(BUILDSERIAL_NEXT) > /dev/null || \
|
||||||
|
cp -f $(BUILDSERIAL_NEXT) $(BUILDSERIAL_NOW))
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Ensure that include/.buildserial.h always exists, to solve the
|
bs : $(BUILDSERIAL_NOW)
|
||||||
# problem of bootstrapping a BUILD_SERIAL-enabled build.
|
@echo $$(( $(shell cat $<) + 1 )) > $(BUILDSERIAL_NEXT)
|
||||||
#
|
@echo "Build serial number is $(shell cat $<)"
|
||||||
ifeq ($(wildcard $(BUILDSERIAL_H)),)
|
|
||||||
$(shell $(TOUCH) $(BUILDSERIAL_H))
|
|
||||||
endif
|
|
||||||
|
|
||||||
# List of available architectures
|
# List of available architectures
|
||||||
#
|
#
|
||||||
|
|
55
src/config.h
55
src/config.h
|
@ -17,11 +17,11 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define CONSOLE_FIRMWARE 1 /* Default BIOS console */
|
#define CONSOLE_FIRMWARE /* Default BIOS console */
|
||||||
#define CONSOLE_SERIAL 0 /* Serial port */
|
#undef CONSOLE_SERIAL /* Serial port */
|
||||||
#define CONSOLE_DIRECT_VGA 0 /* Direct access to VGA card */
|
#undef CONSOLE_DIRECT_VGA /* Direct access to VGA card */
|
||||||
#define CONSOLE_BTEXT 0 /* Who knows what this does? */
|
#undef CONSOLE_BTEXT /* Who knows what this does? */
|
||||||
#define CONSOLE_PC_KBD 0 /* Direct access to PC keyboard */
|
#undef CONSOLE_PC_KBD /* Direct access to PC keyboard */
|
||||||
|
|
||||||
/* @END general.h */
|
/* @END general.h */
|
||||||
|
|
||||||
|
@ -35,18 +35,49 @@
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define COMCONSOLE 0x3f8 /* I/O port address */
|
#define COMCONSOLE 0x3f8 /* I/O port address */
|
||||||
|
|
||||||
/* Keep settings from a previous user of the serial port (e.g. lilo or
|
/* Keep settings from a previous user of the serial port (e.g. lilo or
|
||||||
* LinuxBIOS), ignoring COMSPEED, COMDATA, COMPARITY and COMSTOP.
|
* LinuxBIOS), ignoring COMSPEED, COMDATA, COMPARITY and COMSTOP.
|
||||||
*/
|
*/
|
||||||
#define COMPRESERVE 0
|
#undef COMPRESERVE
|
||||||
|
|
||||||
#if ! COMPRESERVE
|
#ifdef COMPRESERVE
|
||||||
#define COMSPEED 9600 /* Baud rate */
|
#define COMSPEED 9600 /* Baud rate */
|
||||||
#define COMDATA 8 /* Data bits */
|
#define COMDATA 8 /* Data bits */
|
||||||
#define COMPARITY 0 /* Parity: 0=None, 1=Odd, 2=Even */
|
#define COMPARITY 0 /* Parity: 0=None, 1=Odd, 2=Even */
|
||||||
#define COMSTOP 1 /* Stop bits */
|
#define COMSTOP 1 /* Stop bits */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* @END serial.h */
|
/* @END serial.h */
|
||||||
|
|
||||||
|
/* @BEGIN isa.h
|
||||||
|
*
|
||||||
|
* ISA probe address configuration
|
||||||
|
*
|
||||||
|
* You can override the list of addresses that will be probed by any
|
||||||
|
* ISA drivers.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
#undef ISA_PROBE_ADDRS /* e.g. 0x200, 0x300 */
|
||||||
|
#undef ISA_PROBE_ONLY /* Do not probe any other addresses */
|
||||||
|
|
||||||
|
/* @END isa.h */
|
||||||
|
|
||||||
|
/* @BEGIN general.h
|
||||||
|
*
|
||||||
|
* Obscure configuration options
|
||||||
|
*
|
||||||
|
* You probably don't need to touch these.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define RELOCATE /* Relocate to high memory */
|
||||||
|
#undef BUILD_SERIAL /* Include an automatic build serial
|
||||||
|
* number. Add "bs" to the list of
|
||||||
|
* make targets. For example:
|
||||||
|
* "make bin/rtl8139.dsk bs" */
|
||||||
|
#undef BUILD_ID /* Include a custom build ID string,
|
||||||
|
* e.g "test-foo" */
|
||||||
|
|
||||||
|
/* @END general.h */
|
||||||
|
|
|
@ -11,21 +11,46 @@
|
||||||
|
|
||||||
#include "config/general.h"
|
#include "config/general.h"
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Build ID string calculations
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
#undef XSTR
|
||||||
|
#undef STR
|
||||||
|
#define XSTR(s) STR(s)
|
||||||
|
#define STR(s) #s
|
||||||
|
|
||||||
#ifdef BUILD_SERIAL
|
#ifdef BUILD_SERIAL
|
||||||
#include ".buildserial.h"
|
#include "config/.buildserial.h"
|
||||||
#define xstr(s) str(s)
|
#define BUILD_SERIAL_STR "#" XSTR(BUILD_SERIAL_NUM)
|
||||||
#define str(s) #s
|
#else
|
||||||
|
#define BUILD_SERIAL_STR ""
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void print_config ( void ) {
|
|
||||||
printf( "Etherboot " VERSION
|
|
||||||
#ifdef BUILD_SERIAL
|
|
||||||
" [build "
|
|
||||||
#ifdef BUILD_ID
|
#ifdef BUILD_ID
|
||||||
BUILD_ID " "
|
#define BUILD_ID_STR BUILD_ID
|
||||||
|
#else
|
||||||
|
#define BUILD_ID_STR ""
|
||||||
#endif
|
#endif
|
||||||
"#" xstr(BUILD_SERIAL_NUM) "]"
|
|
||||||
#endif /* BUILD_SERIAL */
|
#if defined(BUILD_ID) && defined(BUILD_SERIAL)
|
||||||
|
#define BUILD_SPACER " "
|
||||||
|
#else
|
||||||
|
#define BUILD_SPACER ""
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(BUILD_ID) || defined(BUILD_SERIAL)
|
||||||
|
#define BUILD_STRING " [build " BUILD_ID_STR BUILD_SPACER BUILD_SERIAL_STR "]"
|
||||||
|
#else
|
||||||
|
#define BUILD_STRING ""
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Print out configuration
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
void print_config ( void ) {
|
||||||
|
printf( "Etherboot " VERSION BUILD_STRING
|
||||||
" (GPL) http://etherboot.org\n"
|
" (GPL) http://etherboot.org\n"
|
||||||
"Drivers: " );
|
"Drivers: " );
|
||||||
print_drivers();
|
print_drivers();
|
||||||
|
@ -115,30 +140,30 @@ void print_config ( void ) {
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if CONSOLE_DUAL
|
#ifdef CONSOLE_DUAL
|
||||||
#undef CONSOLE_FIRMWARE
|
#undef CONSOLE_FIRMWARE
|
||||||
#define CONSOLE_FIRMWARE 1
|
#define CONSOLE_FIRMWARE 1
|
||||||
#undef CONSOLE_SERIAL
|
#undef CONSOLE_SERIAL
|
||||||
#define CONSOLE_SERIAL 1
|
#define CONSOLE_SERIAL 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if CONSOLE_FIRMWARE
|
#ifdef CONSOLE_FIRMWARE
|
||||||
REQUIRE_OBJECT ( bios_console );
|
REQUIRE_OBJECT ( bios_console );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if CONSOLE_SERIAL
|
#ifdef CONSOLE_SERIAL
|
||||||
REQUIRE_OBJECT ( serial );
|
REQUIRE_OBJECT ( serial );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if CONSOLE_DIRECT_VGA
|
#ifdef CONSOLE_DIRECT_VGA
|
||||||
REQUIRE_OBJECT ( video_subr );
|
REQUIRE_OBJECT ( video_subr );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if CONSOLE_BTEXT
|
#ifdef CONSOLE_BTEXT
|
||||||
REQUIRE_OBJECT ( btext );
|
REQUIRE_OBJECT ( btext );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if CONSOLE_PC_KBD
|
#ifdef CONSOLE_PC_KBD
|
||||||
REQUIRE_OBJECT ( pc_kbd );
|
REQUIRE_OBJECT ( pc_kbd );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -147,6 +172,6 @@ REQUIRE_OBJECT ( pc_kbd );
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if RELOCATE
|
#ifdef RELOCATE
|
||||||
REQUIRE_OBJECT ( relocate );
|
REQUIRE_OBJECT ( relocate );
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -32,11 +32,21 @@ static char isa_magic[0]; /* guaranteed unique symbol */
|
||||||
* User-supplied probe address list
|
* User-supplied probe address list
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
static isa_probe_addr_t isa_extra_probe_addrs[] = {
|
#ifdef ISA_PROBE_ADDRS
|
||||||
ISA_PROBE_ADDRS
|
# ifdef ISA_PROBE_ONLY
|
||||||
#if ISA_PROBE_ONLY
|
# define HAVE_ISA_PROBE_ADDRS 1
|
||||||
, 0
|
# define ISA_PROBE_ADDR_LIST ISA_PROBE_ADDRS, 0
|
||||||
|
# else
|
||||||
|
# define HAVE_ISA_PROBE_ADDRS 1
|
||||||
|
# define ISA_PROBE_ADDR_LIST ISA_PROBE_ADDRS
|
||||||
|
# endif
|
||||||
|
#else
|
||||||
|
# define HAVE_ISA_PROBE_ADDRS 0
|
||||||
|
# define ISA_PROBE_ADDR_LIST
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
static isa_probe_addr_t isa_extra_probe_addrs[] = {
|
||||||
|
ISA_PROBE_ADDR_LIST
|
||||||
};
|
};
|
||||||
#define isa_extra_probe_addr_count \
|
#define isa_extra_probe_addr_count \
|
||||||
( sizeof ( isa_extra_probe_addrs ) / sizeof ( isa_extra_probe_addrs[0] ) )
|
( sizeof ( isa_extra_probe_addrs ) / sizeof ( isa_extra_probe_addrs[0] ) )
|
||||||
|
|
Loading…
Reference in New Issue