]> git.proxmox.com Git - fwupd-efi.git/commitdiff
Show the version when starting fwupd-efi
authorRichard Hughes <richard@hughsie.com>
Thu, 7 Apr 2022 08:43:55 +0000 (09:43 +0100)
committerRichard Hughes <richard@hughsie.com>
Thu, 7 Apr 2022 12:15:00 +0000 (13:15 +0100)
This also allows to search for a predicatable string in fwupd to add a
runtime version.

efi/fwupdate.c
efi/meson.build
meson.build

index 0917f14e5408fe3af62a8d1057addb52e3f8e2d8..4851a7104b157dca18cfecf9d635dc984ee47e15 100644 (file)
@@ -4,13 +4,15 @@
  * SPDX-License-Identifier: LGPL-2.1+
  */
 
+#include "config.h"
+
 #include <efi.h>
 #include <efilib.h>
 
 #include "fwup-cleanups.h"
 #include "fwup-common.h"
-#include "fwup-efi.h"
 #include "fwup-debug.h"
+#include "fwup-efi.h"
 
 #define UNUSED __attribute__((__unused__))
 #define GNVN_BUF_SIZE                  1024
@@ -544,6 +546,9 @@ efi_main(EFI_HANDLE image, EFI_SYSTEM_TABLE *systab)
        /* if SHIM_DEBUG is set, fwup_info info for our attached debugger */
        fwup_debug_hook();
 
+       /* show the version to screen */
+       fwup_info(L"fwupd-efi version " PACKAGE_VERSION);
+
        /* step 1: find and validate update state variables */
        /* XXX TODO:
         * 1) survey the reset types first, and separate into groups
index a0cabf5b42804333658a7ce2e1e4b7c134508873..936ba3cec3b81b0a028f10e42dd6bc93704efd8f 100644 (file)
@@ -121,6 +121,7 @@ compile_args = ['-Og',
                 '-Wno-address-of-packed-member',
                 '-grecord-gcc-switches',
                 '-DDEBUGDIR="@0@"'.format(debugdir),
+                '-I.',
                 '-isystem', efi_incdir,
                 '-isystem', join_paths(efi_incdir, gnu_efi_path_arch)]
 if get_option('werror')
index 6276a03a8f1bc37b08a4f1678bf1481ae0081b52..7d596956ae29dad4559bdbeea6d3d82074da0e6f 100644 (file)
@@ -5,6 +5,9 @@ project('fwupd-efi', 'c',
   default_options : ['warning_level=2', 'c_std=c99'],
 )
 
+conf = configuration_data()
+conf.set_quoted('PACKAGE_VERSION', meson.project_version())
+
 cc = meson.get_compiler('c')
 objcopy = find_program('objcopy')
 
@@ -37,6 +40,11 @@ if get_option('efi_sbat_distro_id') == ''
     warning('-Defi_sbat_distro_id is unset, see README.md')
 endif
 
+configure_file(
+  output : 'config.h',
+  configuration : conf
+)
+
 pkgg = import('pkgconfig')
 pkgg.generate(
   version : meson.project_version(),