chiark / gitweb /
build-sys: make EFI support build-time optional
authorLennart Poettering <lennart@poettering.net>
Wed, 13 Feb 2013 22:07:59 +0000 (23:07 +0100)
committerLennart Poettering <lennart@poettering.net>
Wed, 13 Feb 2013 22:08:25 +0000 (23:08 +0100)
Makefile.am
configure.ac
src/core/manager.c
src/core/mount-setup.c
src/shared/efivars.c

index d73b78c..65294a5 100644 (file)
@@ -295,8 +295,7 @@ rootlibexec_PROGRAMS = \
 systemgenerator_PROGRAMS = \
        systemd-getty-generator \
        systemd-fstab-generator \
-       systemd-system-update-generator \
-       systemd-efi-boot-generator
+       systemd-system-update-generator
 
 dist_bin_SCRIPTS = \
        src/analyze/systemd-analyze
@@ -1002,8 +1001,7 @@ noinst_PROGRAMS += \
        test-cgroup \
        test-install \
        test-watchdog \
-       test-log \
-       test-efivars
+       test-log
 
 noinst_tests += \
        test-job-type \
@@ -1071,11 +1069,16 @@ test_hostname_SOURCES = \
 test_hostname_LDADD = \
        libsystemd-core.la
 
+if ENABLE_EFI
+noinst_PROGRAMS += \
+       test-efivars
+
 test_efivars_SOURCES = \
        src/test/test-efivars.c
 
 test_efivars_LDADD = \
        libsystemd-shared.la
+endif
 
 test_unit_name_SOURCES = \
        src/test/test-unit-name.c
@@ -1410,12 +1413,17 @@ systemd_system_update_generator_LDADD = \
        libsystemd-shared.la
 
 # ------------------------------------------------------------------------------
+if ENABLE_EFI
+systemgenerator_PROGRAMS +=  \
+       systemd-efi-boot-generator
+
 systemd_efi_boot_generator_SOURCES = \
        src/efi-boot-generator/efi-boot-generator.c
 
 systemd_efi_boot_generator_LDADD = \
        libsystemd-label.la \
        libsystemd-shared.la
+endif
 
 # ------------------------------------------------------------------------------
 systemd_rc_local_generator_SOURCES = \
@@ -3079,6 +3087,7 @@ EXTRA_DIST += \
        units/systemd-timedated.service.in
 
 # ------------------------------------------------------------------------------
+if ENABLE_EFI
 bootctl_SOURCES = \
        src/boot/boot.h \
        src/boot/boot-loader.h \
@@ -3093,6 +3102,7 @@ bootctl_LDADD = \
 
 bin_PROGRAMS += \
        bootctl
+endif
 
 # ------------------------------------------------------------------------------
 if HAVE_MYHOSTNAME
index 228f696..834b123 100644 (file)
@@ -636,6 +636,15 @@ fi
 AM_CONDITIONAL(ENABLE_POLKIT, [test "x$have_polkit" = "xyes"])
 
 # ------------------------------------------------------------------------------
+have_efi=no
+AC_ARG_ENABLE(efi, AS_HELP_STRING([--disable-efi], [disable EFI support]))
+if test "x$enable_efi" != "xno"; then
+        AC_DEFINE(ENABLE_EFI, 1, [Define if EFI support is to be enabled])
+        have_efi=yes
+fi
+AM_CONDITIONAL(ENABLE_EFI, [test "x$have_efi" = "xyes"])
+
+# ------------------------------------------------------------------------------
 AC_ARG_WITH(rc-local-script-path-start,
         AS_HELP_STRING([--with-rc-local-script-path-start=PATH],
                 [Path to /etc/rc.local]),
@@ -882,6 +891,7 @@ AC_MSG_RESULT([
         localed:                 ${have_localed}
         coredump:                ${have_coredump}
         polkit:                  ${have_polkit}
+        efi:                     ${have_efi}
         kmod:                    ${have_kmod}
         blkid:                   ${have_blkid}
         nss-myhostname:          ${have_myhostname}
index bd49892..28f169d 100644 (file)
@@ -309,7 +309,9 @@ int manager_new(SystemdRunningAs running_as, Manager **_m) {
 
         dual_timestamp_get(&m->userspace_timestamp);
         dual_timestamp_from_monotonic(&m->kernel_timestamp, 0);
+#ifdef ENABLE_EFI
         efi_get_boot_timestamps(&m->userspace_timestamp, &m->firmware_timestamp, &m->loader_timestamp);
+#endif
 
         m->running_as = running_as;
         m->name_data_slot = m->conn_data_slot = m->subscribed_data_slot = -1;
index 2cd0b60..e7e2736 100644 (file)
@@ -77,8 +77,10 @@ static const MountPoint mount_table[] = {
           NULL,       MNT_FATAL|MNT_IN_CONTAINER },
         { "securityfs", "/sys/kernel/security",      "securityfs", NULL, MS_NOSUID|MS_NOEXEC|MS_NODEV,
           NULL,       MNT_NONE },
+#ifdef ENABLE_EFI
         { "efivarfs",   "/sys/firmware/efi/efivars", "efivarfs",   NULL, MS_NOSUID|MS_NOEXEC|MS_NODEV,
           is_efi_boot, MNT_NONE },
+#endif
         { "tmpfs",      "/dev/shm",                  "tmpfs",      "mode=1777", MS_NOSUID|MS_NODEV|MS_STRICTATIME,
           NULL,       MNT_FATAL|MNT_IN_CONTAINER },
         { "devpts",     "/dev/pts",                  "devpts",     "mode=620,gid=" STRINGIFY(TTY_GID), MS_NOSUID|MS_NOEXEC,
index 840e4e0..8494f37 100644 (file)
@@ -28,6 +28,8 @@
 #include "utf8.h"
 #include "efivars.h"
 
+#ifdef ENABLE_EFI
+
 bool is_efi_boot(void) {
         return access("/sys/firmware/efi", F_OK) >= 0;
 }
@@ -469,3 +471,5 @@ int efi_get_loader_device_part_uuid(sd_id128_t *u) {
 
         return 0;
 }
+
+#endif