diff options
| author | Michael Brown | 2012-11-02 15:46:39 +0100 |
|---|---|---|
| committer | Michael Brown | 2012-11-02 15:46:39 +0100 |
| commit | 4867085c0cd334004e8d67dff7bd53996f23ade6 (patch) | |
| tree | 31f92c7844273c3b495c105a4c24d98dc54917ac /src/arch/i386 | |
| parent | [build] Inhibit .eh_frame on newer gcc versions (diff) | |
| download | ipxe-4867085c0cd334004e8d67dff7bd53996f23ade6.tar.gz ipxe-4867085c0cd334004e8d67dff7bd53996f23ade6.tar.xz ipxe-4867085c0cd334004e8d67dff7bd53996f23ade6.zip | |
[build] Include version number within only a single object file
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/arch/i386')
| -rw-r--r-- | src/arch/i386/image/multiboot.c | 5 | ||||
| -rw-r--r-- | src/arch/i386/image/nbi.c | 11 | ||||
| -rw-r--r-- | src/arch/i386/interface/syslinux/comboot_call.c | 7 |
3 files changed, 15 insertions, 8 deletions
diff --git a/src/arch/i386/image/multiboot.c b/src/arch/i386/image/multiboot.c index 8b8959e18..3d6d2bf34 100644 --- a/src/arch/i386/image/multiboot.c +++ b/src/arch/i386/image/multiboot.c @@ -39,6 +39,7 @@ FILE_LICENCE ( GPL2_OR_LATER ); #include <ipxe/init.h> #include <ipxe/features.h> #include <ipxe/uri.h> +#include <ipxe/version.h> FEATURE ( FEATURE_IMAGE, "MBOOT", DHCP_EB_FEATURE_MULTIBOOT, 1 ); @@ -247,7 +248,7 @@ static struct multiboot_info __bss16 ( mbinfo ); #define mbinfo __use_data16 ( mbinfo ) /** The multiboot bootloader name */ -static char __data16_array ( mb_bootloader_name, [] ) = "iPXE " VERSION; +static char __bss16_array ( mb_bootloader_name, [32] ); #define mb_bootloader_name __use_data16 ( mb_bootloader_name ) /** The multiboot memory map */ @@ -420,6 +421,8 @@ static int multiboot_exec ( struct image *image ) { mbinfo.cmdline = multiboot_add_cmdline ( image ); mbinfo.mods_addr = virt_to_phys ( mbmodules ); mbinfo.mmap_addr = virt_to_phys ( mbmemmap ); + snprintf ( mb_bootloader_name, sizeof ( mb_bootloader_name ), + "iPXE %s", product_version ); mbinfo.boot_loader_name = virt_to_phys ( mb_bootloader_name ); if ( ( rc = multiboot_add_modules ( image, max, &mbinfo, mbmodules, ( sizeof ( mbmodules ) / diff --git a/src/arch/i386/image/nbi.c b/src/arch/i386/image/nbi.c index c516bb2ec..d3e523e92 100644 --- a/src/arch/i386/image/nbi.c +++ b/src/arch/i386/image/nbi.c @@ -10,6 +10,7 @@ #include <ipxe/fakedhcp.h> #include <ipxe/image.h> #include <ipxe/features.h> +#include <ipxe/version.h> /** @file * @@ -94,12 +95,6 @@ struct ebinfo { uint16_t flags; /* Bit flags */ }; -/** Info passed to NBI image */ -static struct ebinfo loaderinfo = { - VERSION_MAJOR, VERSION_MINOR, - 0 -}; - /** * Prepare a segment for an NBI image * @@ -281,6 +276,10 @@ static int nbi_boot16 ( struct image *image, struct imgheader *imgheader ) { * @ret rc Return status code, if image returns */ static int nbi_boot32 ( struct image *image, struct imgheader *imgheader ) { + struct ebinfo loaderinfo = { + product_major_version, product_minor_version, + 0 + }; int discard_D, discard_S, discard_b; int rc; diff --git a/src/arch/i386/interface/syslinux/comboot_call.c b/src/arch/i386/interface/syslinux/comboot_call.c index 3eee584ce..fbf605f33 100644 --- a/src/arch/i386/interface/syslinux/comboot_call.c +++ b/src/arch/i386/interface/syslinux/comboot_call.c @@ -39,12 +39,13 @@ FILE_LICENCE ( GPL2_OR_LATER ); #include <ipxe/serial.h> #include <ipxe/init.h> #include <ipxe/image.h> +#include <ipxe/version.h> #include <usr/imgmgmt.h> #include "config/console.h" #include "config/serial.h" /** The "SYSLINUX" version string */ -static char __data16_array ( syslinux_version, [] ) = "\r\niPXE " VERSION; +static char __bss16_array ( syslinux_version, [32] ); #define syslinux_version __use_data16 ( syslinux_version ) /** The "SYSLINUX" copyright string */ @@ -326,6 +327,10 @@ static __asmcall void int22 ( struct i386_all_regs *ix86 ) { /* SYSLINUX derivative ID */ ix86->regs.dl = BZI_LOADER_TYPE_IPXE; + /* SYSLINUX version */ + snprintf ( syslinux_version, sizeof ( syslinux_version ), + "\r\niPXE %s", product_version ); + /* SYSLINUX version and copyright strings */ ix86->segs.es = rm_ds; ix86->regs.si = ( ( unsigned ) __from_data16 ( syslinux_version ) ); |
