richardphibel / rpms / systemd

Forked from rpms/systemd 2 years ago
Clone
594167
From 340f8e02cf4db0e6b3733bfcc14630b3ce8181a5 Mon Sep 17 00:00:00 2001
594167
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
594167
Date: Thu, 23 Dec 2021 13:19:42 +0100
594167
Subject: [PATCH] meson: report SBAT settings
594167
594167
(cherry picked from commit e4e44a0107645891e82a538100a7590eb59a516c)
594167
594167
Related: #2017035
594167
---
594167
 src/boot/efi/meson.build | 14 +++++++++++++-
594167
 1 file changed, 13 insertions(+), 1 deletion(-)
594167
594167
diff --git a/src/boot/efi/meson.build b/src/boot/efi/meson.build
594167
index dd318079fc..e628068596 100644
594167
--- a/src/boot/efi/meson.build
594167
+++ b/src/boot/efi/meson.build
594167
@@ -130,7 +130,6 @@ elif get_option('sbat-distro') != ''
594167
                 if (value == '' or value == 'auto') and not meson.is_cross_build()
594167
                         cmd = 'if [ -e /etc/os-release ]; then . /etc/os-release; else . /usr/lib/os-release; fi; echo $@0@'.format(sbatvar[1])
594167
                         value = run_command(sh, '-c', cmd).stdout().strip()
594167
-                        message('@0@ (from @1@): @2@'.format(sbatvar[0], sbatvar[1], value))
594167
                 endif
594167
                 if value == ''
594167
                         error('Required @0@ option not set and autodetection failed'.format(sbatvar[0]))
594167
@@ -147,8 +146,11 @@ elif get_option('sbat-distro') != ''
594167
         pkgver = get_option('sbat-distro-version')
594167
         if pkgver == ''
594167
                 efi_conf.set('SBAT_DISTRO_VERSION', 'GIT_VERSION')
594167
+                # This is determined during build, not configuration, so we can't display it yet.
594167
+                sbat_distro_version_display = '(git version)'
594167
         else
594167
                 efi_conf.set_quoted('SBAT_DISTRO_VERSION', pkgver)
594167
+                sbat_distro_version_display = pkgver
594167
         endif
594167
 endif
594167
 
594167
@@ -288,6 +290,16 @@ summary({
594167
         'EFI include directory' :           efi_incdir},
594167
         section : 'Extensible Firmware Interface')
594167
 
594167
+if efi_conf.get('SBAT_DISTRO', '') != ''
594167
+        summary({
594167
+                'SBAT distro':              efi_conf.get('SBAT_DISTRO'),
594167
+                'SBAT distro generation':   efi_conf.get('SBAT_DISTRO_GENERATION'),
594167
+                'SBAT distro version':      sbat_distro_version_display,
594167
+                'SBAT distro summary':      efi_conf.get('SBAT_DISTRO_SUMMARY'),
594167
+                'SBAT distro URL':          efi_conf.get('SBAT_DISTRO_URL')},
594167
+                section : 'Extensible Firmware Interface')
594167
+endif
594167
+
594167
 ############################################################
594167
 
594167
 efi_headers = files(