mirror of
https://github.com/ipxe/ipxe
synced 2025-12-20 20:10:18 +03:00
[build] Expose build timestamp, build name, and product names
Expose the build timestamp (measured in seconds since the Epoch) and the build name (e.g. "rtl8139.rom" or "ipxe.efi"), and provide the product name and product short name in a single centralised location. Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
@@ -17,8 +17,8 @@ FILE_LICENCE ( GPL2_OR_LATER );
|
||||
#include <stddef.h>
|
||||
#include <stdio.h>
|
||||
#include <ipxe/init.h>
|
||||
#include <ipxe/version.h>
|
||||
#include <usr/autoboot.h>
|
||||
#include <config/general.h>
|
||||
|
||||
/**
|
||||
* Main entry point
|
||||
@@ -31,7 +31,7 @@ __asmcall int main ( void ) {
|
||||
initialise();
|
||||
|
||||
/* Some devices take an unreasonably long time to initialise */
|
||||
printf ( PRODUCT_SHORT_NAME " initialising devices..." );
|
||||
printf ( "%s initialising devices...", product_short_name );
|
||||
startup();
|
||||
printf ( "ok\n" );
|
||||
|
||||
|
||||
@@ -25,12 +25,35 @@ FILE_LICENCE ( GPL2_OR_LATER );
|
||||
*
|
||||
*/
|
||||
|
||||
#include <wchar.h>
|
||||
#include <ipxe/features.h>
|
||||
#include <ipxe/version.h>
|
||||
#include <config/general.h>
|
||||
|
||||
/**
|
||||
* Create wide-character version of string
|
||||
*
|
||||
* @v string String
|
||||
* @ret wstring Wide-character version of string
|
||||
*/
|
||||
#define WSTRING( string ) _WSTRING ( string )
|
||||
#define _WSTRING( string ) L ## string
|
||||
|
||||
/** Version number feature */
|
||||
FEATURE_VERSION ( VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH );
|
||||
|
||||
/** Build timestamp (generated by linker) */
|
||||
extern char _build_timestamp[];
|
||||
|
||||
/** Build ID (generated by linker) */
|
||||
extern char _build_id[];
|
||||
|
||||
/** Build timestamp */
|
||||
unsigned long build_timestamp = ( ( unsigned long ) _build_timestamp );
|
||||
|
||||
/** Build ID */
|
||||
unsigned long build_id = ( ( unsigned long ) _build_id );
|
||||
|
||||
/** Product major version */
|
||||
const int product_major_version = VERSION_MAJOR;
|
||||
|
||||
@@ -38,4 +61,29 @@ const int product_major_version = VERSION_MAJOR;
|
||||
const int product_minor_version = VERSION_MINOR;
|
||||
|
||||
/** Product version string */
|
||||
const char *product_version = VERSION;
|
||||
const char product_version[] = VERSION;
|
||||
|
||||
/** Product name string */
|
||||
const char product_name[] = PRODUCT_NAME;
|
||||
|
||||
/** Product short name string */
|
||||
const char product_short_name[] = PRODUCT_SHORT_NAME;
|
||||
|
||||
/** Build name string */
|
||||
const char build_name[] = BUILD_NAME;
|
||||
|
||||
/** Wide-character product version string */
|
||||
const wchar_t product_wversion[] = WSTRING ( VERSION );
|
||||
|
||||
/** Wide-character product name string */
|
||||
const wchar_t product_wname[] = WSTRING ( PRODUCT_NAME );
|
||||
|
||||
/** Wide-character product short name string */
|
||||
const wchar_t product_short_wname[] = WSTRING ( PRODUCT_SHORT_NAME );
|
||||
|
||||
/** Wide-character build name string */
|
||||
const wchar_t build_wname[] = WSTRING ( BUILD_NAME );
|
||||
|
||||
/** Copy of build name string within ".prefix" */
|
||||
const char build_name_prefix[] __attribute__ (( section ( ".prefix.name" ) ))
|
||||
= BUILD_NAME;
|
||||
|
||||
Reference in New Issue
Block a user