4eda52
From 9c67a1570d89ff462cb51f4b2a6d2ed0af8e2e9c Mon Sep 17 00:00:00 2001
4295f9
From: Michal Sekletar <msekleta@redhat.com>
4295f9
Date: Mon, 30 Aug 2021 18:38:09 +0200
4295f9
Subject: [PATCH] boot: don't build bootctl when -Dgnu-efi=false is set
4295f9
4295f9
(cherry picked from commit fbe3a414e1d8f7b05dccf3d24d4fa475eb9c6bc9)
4295f9
4eda52
Resolves: #2003130
4295f9
---
4295f9
 meson.build                       | 8 +++++---
4295f9
 shell-completion/bash/meson.build | 2 +-
4295f9
 shell-completion/zsh/meson.build  | 2 +-
4295f9
 units/meson.build                 | 2 +-
4295f9
 4 files changed, 8 insertions(+), 6 deletions(-)
4295f9
4295f9
diff --git a/meson.build b/meson.build
4295f9
index 738879eb21..d28f04607a 100644
4295f9
--- a/meson.build
4295f9
+++ b/meson.build
4295f9
@@ -1608,6 +1608,10 @@ else
4295f9
 endif
4295f9
 conf.set10('ENABLE_EFI', have)
4295f9
 
4295f9
+subdir('src/fundamental')
4295f9
+subdir('src/boot/efi')
4295f9
+conf.set10('HAVE_GNU_EFI', have_gnu_efi)
4295f9
+
4295f9
 ############################################################
4295f9
 
4295f9
 build_bpf_skel_py = find_program('tools/build-bpf-skel.py')
4295f9
@@ -1660,7 +1664,6 @@ includes = [libsystemd_includes, include_directories('src/shared')]
4295f9
 
4295f9
 subdir('po')
4295f9
 subdir('catalog')
4295f9
-subdir('src/fundamental')
4295f9
 subdir('src/basic')
4295f9
 subdir('src/libsystemd')
4295f9
 subdir('src/shared')
4295f9
@@ -1751,7 +1754,6 @@ subdir('src/journal')
4295f9
 subdir('src/libsystemd-network')
4295f9
 
4295f9
 subdir('src/analyze')
4295f9
-subdir('src/boot/efi')
4295f9
 subdir('src/busctl')
4295f9
 subdir('src/coredump')
4295f9
 subdir('src/cryptenroll')
4295f9
@@ -2145,7 +2147,7 @@ if conf.get('HAVE_PAM') == 1
4295f9
                 install_dir : rootlibexecdir)
4295f9
 endif
4295f9
 
4295f9
-if conf.get('ENABLE_EFI') == 1 and conf.get('HAVE_BLKID') == 1
4295f9
+if conf.get('HAVE_BLKID') == 1 and conf.get('HAVE_GNU_EFI') == 1
4295f9
         public_programs += executable(
4295f9
                 'bootctl',
4295f9
                 'src/boot/bootctl.c',
4295f9
diff --git a/shell-completion/bash/meson.build b/shell-completion/bash/meson.build
4295f9
index c26b413d92..bfdd2b01f0 100644
4295f9
--- a/shell-completion/bash/meson.build
4295f9
+++ b/shell-completion/bash/meson.build
4295f9
@@ -33,7 +33,7 @@ items = [['busctl',              ''],
4295f9
          ['systemd-run',         ''],
4295f9
          ['udevadm',             ''],
4295f9
          ['kernel-install',      ''],
4295f9
-         ['bootctl',             'ENABLE_EFI'],
4295f9
+         ['bootctl',             'HAVE_GNU_EFI'],
4295f9
          ['coredumpctl',         'ENABLE_COREDUMP'],
4295f9
          ['homectl',             'ENABLE_HOMED'],
4295f9
          ['hostnamectl',         'ENABLE_HOSTNAMED'],
4295f9
diff --git a/shell-completion/zsh/meson.build b/shell-completion/zsh/meson.build
4295f9
index f5f9b0f993..3a92f303b8 100644
4295f9
--- a/shell-completion/zsh/meson.build
4295f9
+++ b/shell-completion/zsh/meson.build
4295f9
@@ -28,7 +28,7 @@ items = [['_busctl',                   ''],
4295f9
          ['_sd_outputmodes',           ''],
4295f9
          ['_sd_unit_files',            ''],
4295f9
          ['_sd_machines',              ''],
4295f9
-         ['_bootctl',                  'ENABLE_EFI'],
4295f9
+         ['_bootctl',                  'HAVE_GNU_EFI'],
4295f9
          ['_coredumpctl',              'ENABLE_COREDUMP'],
4295f9
          ['_hostnamectl',              'ENABLE_HOSTNAMED'],
4295f9
          ['_localectl',                'ENABLE_LOCALED'],
4295f9
diff --git a/units/meson.build b/units/meson.build
4295f9
index 68be8d0108..27a2b60137 100644
4295f9
--- a/units/meson.build
4295f9
+++ b/units/meson.build
4295f9
@@ -102,7 +102,7 @@ units = [
4295f9
         ['systemd-ask-password-wall.path',      '',
4295f9
          'multi-user.target.wants/'],
4295f9
         ['systemd-ask-password-wall.service',   ''],
4295f9
-        ['systemd-boot-system-token.service',   'ENABLE_EFI',
4295f9
+        ['systemd-boot-system-token.service',   'HAVE_GNU_EFI',
4295f9
          'sysinit.target.wants/'],
4295f9
         ['systemd-coredump.socket',             'ENABLE_COREDUMP',
4295f9
          'sockets.target.wants/'],