diff --git a/xen/common/version.c b/xen/common/version.c index 223cb52e69..937eb1281c 100644 --- a/xen/common/version.c +++ b/xen/common/version.c @@ -140,7 +140,7 @@ struct cv_info_pdb70 char pdb_filename[]; }; -static int __init xen_build_init(void) +void __init xen_build_init(void) { const Elf_Note *n = __note_gnu_build_id_start; unsigned int sz; @@ -148,11 +148,11 @@ static int __init xen_build_init(void) /* --build-id invoked with wrong parameters. */ if ( __note_gnu_build_id_end <= &n[0] ) - return -ENODATA; + return; /* Check for full Note header. */ if ( &n[1] >= __note_gnu_build_id_end ) - return -ENODATA; + return; sz = (void *)__note_gnu_build_id_end - (void *)n; @@ -188,10 +188,7 @@ static int __init xen_build_init(void) #endif if ( !rc ) printk(XENLOG_INFO "build-id: %*phN\n", build_id_len, build_id_p); - - return rc; } -__initcall(xen_build_init); #endif /* * Local variables: diff --git a/xen/drivers/char/console.c b/xen/drivers/char/console.c index 9bbcb0f57a..38ecd9c015 100644 --- a/xen/drivers/char/console.c +++ b/xen/drivers/char/console.c @@ -934,6 +934,9 @@ void __init console_init_preirq(void) xen_compiler(), debug_build() ? 'y' : 'n', xen_compile_date()); printk("Latest ChangeSet: %s\n", xen_changeset()); + /* Locate and print the buildid, if applicable. */ + xen_build_init(); + if ( opt_sync_console ) { serial_start_sync(sercon_handle); diff --git a/xen/include/xen/version.h b/xen/include/xen/version.h index 97c247a5eb..9ac926d0e1 100644 --- a/xen/include/xen/version.h +++ b/xen/include/xen/version.h @@ -19,8 +19,11 @@ const char *xen_deny(void); int xen_build_id(const void **p, unsigned int *len); #ifdef BUILD_ID +void xen_build_init(void); int xen_build_id_check(const Elf_Note *n, unsigned int n_sz, const void **p, unsigned int *len); +#else +static inline void xen_build_init(void) {}; #endif #endif /* __XEN_VERSION_H__ */