diff options
Diffstat (limited to 'src/grp-boot/systemd-boot')
-rw-r--r-- | src/grp-boot/systemd-boot/Makefile | 84 | ||||
-rw-r--r-- | src/grp-boot/systemd-boot/console.h | 2 | ||||
-rw-r--r-- | src/grp-boot/systemd-boot/disk.h | 2 | ||||
-rw-r--r-- | src/grp-boot/systemd-boot/graphics.h | 2 | ||||
-rw-r--r-- | src/grp-boot/systemd-boot/linux.h | 2 | ||||
-rw-r--r-- | src/grp-boot/systemd-boot/measure.h | 2 | ||||
-rw-r--r-- | src/grp-boot/systemd-boot/pefile.h | 2 | ||||
-rw-r--r-- | src/grp-boot/systemd-boot/splash.h | 2 | ||||
-rw-r--r-- | src/grp-boot/systemd-boot/util.h | 2 |
9 files changed, 37 insertions, 63 deletions
diff --git a/src/grp-boot/systemd-boot/Makefile b/src/grp-boot/systemd-boot/Makefile index 3b4d4ddda1..8b770c0c81 100644 --- a/src/grp-boot/systemd-boot/Makefile +++ b/src/grp-boot/systemd-boot/Makefile @@ -25,6 +25,7 @@ include $(topsrcdir)/build-aux/Makefile.head.mk ifneq ($(ENABLE_EFI),) ifneq ($(HAVE_GNUEFI),) +# ------------------------------------------------------------------------------ efi_cppflags = \ $(EFI_CPPFLAGS) \ -I$(top_builddir) -include config.h \ @@ -81,9 +82,18 @@ EFI_FORMAT = -O binary else EFI_FORMAT = --target=efi-app-$(EFI_ARCH) endif # ARCH_AARCH64 -endif # HAVE_GNUEFI -endif # ENABLE_EFI +$(outdir)/%.o: $(srcdir)/%.c + $(AM_V_EFI_CC)$(EFI_CC) $(efi_cppflags) $(efi_cflags) -c $< -o $@ + +$(outdir)/%.so: + @if test $(words $^) = 0; then echo 'Cannot link EFI library with no dependencies: $@' >&2; exit 1; fi + $(AM_V_EFI_CCLD)$(LD) $(efi_ldflags) $^ -o $@ -lefi -lgnuefi $(shell $(CC) -print-libgcc-file-name) + $(AM_V_at)! { nm -D -u $@ | grep ' U '; } + +# These next 2 are the same rule +$(outdir)/%$(EFI_MACHINE_TYPE_NAME).efi : $(outdir)/%.so; $(AM_V_GEN)$(OBJCOPY) -j .text -j .sdata -j .data -j .dynamic -j .dynsym -j .rel -j .rela -j .reloc $(EFI_FORMAT) $< $@ +$(outdir)/%$(EFI_MACHINE_TYPE_NAME).efi.stub: $(outdir)/%.so; $(AM_V_GEN)$(OBJCOPY) -j .text -j .sdata -j .data -j .dynamic -j .dynsym -j .rel -j .rela -j .reloc $(EFI_FORMAT) $< $@ # ------------------------------------------------------------------------------ systemd_boot_headers = \ src/boot/efi/util.h \ @@ -102,33 +112,9 @@ systemd_boot_sources = \ src/boot/efi/measure.c \ src/boot/efi/boot.c -EXTRA_DIST += $(systemd_boot_sources) $(systemd_boot_headers) - -systemd_boot_objects = $(addprefix $(top_builddir)/,$(systemd_boot_sources:.c=.o)) -systemd_boot_solib = $(top_builddir)/src/boot/efi/systemd_boot.so systemd_boot = systemd-boot$(EFI_MACHINE_TYPE_NAME).efi - -ifneq ($(ENABLE_EFI),) -ifneq ($(HAVE_GNUEFI),) -bootlib_DATA = $(systemd_boot) - -$(outdir)/%.o: $(top_srcdir)/src/boot/efi/%.c $(addprefix $(top_srcdir)/,$(systemd_boot_headers)) - @$(MKDIR_P) $(top_builddir)/src/boot/efi/ - $(AM_V_CC)$(EFI_CC) $(efi_cppflags) $(efi_cflags) -c $< -o $@ - -$(systemd_boot_solib): $(systemd_boot_objects) - $(AM_V_CCLD)$(LD) $(efi_ldflags) $(systemd_boot_objects) \ - -o $@ -lefi -lgnuefi $(shell $(CC) -print-libgcc-file-name); \ - nm -D -u $@ | grep ' U ' && exit 1 || : - -$(systemd_boot): $(systemd_boot_solib) - $(AM_V_GEN)$(OBJCOPY) -j .text -j .sdata -j .data -j .dynamic \ - -j .dynsym -j .rel -j .rela -j .reloc $(EFI_FORMAT) $< $@ -endif # HAVE_GNUEFI -endif # ENABLE_EFI - -CLEANFILES += $(systemd_boot_objects) $(systemd_boot_solib) $(systemd_boot) - +bootlib_DATA += $(systemd_boot) +$(outdir)/systemd-boot.so: $(addprefix $(outdir)/,$(notdir $(systemd_boot_sources:.c=.o))) # ------------------------------------------------------------------------------ stub_headers = \ src/boot/efi/util.h \ @@ -149,45 +135,19 @@ stub_sources = \ src/boot/efi/measure.c \ src/boot/efi/stub.c -EXTRA_DIST += \ - $(stub_sources) \ - $(stub_headers) \ - test/splash.bmp - -stub_objects = $(addprefix $(top_builddir)/,$(stub_sources:.c=.o)) -stub_solib = $(top_builddir)/src/boot/efi/stub.so stub = linux$(EFI_MACHINE_TYPE_NAME).efi.stub - -ifneq ($(ENABLE_EFI),) -ifneq ($(HAVE_GNUEFI),) bootlib_DATA += $(stub) - -$(outdir)/%.o: $(top_srcdir)/src/boot/efi/%.c $(addprefix $(top_srcdir)/,$(stub_headers)) - @$(MKDIR_P) $(top_builddir)/src/boot/efi/ - $(AM_V_CC)$(EFI_CC) $(efi_cppflags) $(efi_cflags) -c $< -o $@ - -$(stub_solib): $(stub_objects) - $(AM_V_CCLD)$(LD) $(efi_ldflags) $(stub_objects) \ - -o $@ -lefi -lgnuefi $(shell $(CC) -print-libgcc-file-name); \ - nm -D -u $@ | grep ' U ' && exit 1 || : - -$(stub): $(stub_solib) - $(AM_V_GEN)$(OBJCOPY) -j .text -j .sdata -j .data -j .dynamic \ - -j .dynsym -j .rel -j .rela -j .reloc $(EFI_FORMAT) $< $@ -endif # HAVE_GNUEFI -endif # ENABLE_EFI - -CLEANFILES += $(stub_objects) $(stub_solib) $(stub) - +$(outdir)/linux.so: $(addprefix $(outdir)/,$(notdir $(stub_sources:.c=.o))) # ------------------------------------------------------------------------------ -CLEANFILES += test-efi-disk.img - -test-efi-disk.img: $(systemd_boot) $(stub) test/test-efi-create-disk.sh - $(AM_V_GEN)test/test-efi-create-disk.sh +$(outdir)/test-efi-disk.img: $(outdir)/$(systemd_boot) $(outdir)/$(stub) $(srcdir)/test-efi-create-disk.sh + $(AM_V_GEN)$(@D)/test-efi-create-disk.sh -test-efi: test-efi-disk.img +test-efi: $(outdir)/test-efi-disk.img $(QEMU) -machine accel=kvm -m 1024 -bios $(QEMU_BIOS) -snapshot test-efi-disk.img -EXTRA_DIST += test/test-efi-create-disk.sh +files.out.int += test-efi-disk.img +# ------------------------------------------------------------------------------ +endif # HAVE_GNUEFI +endif # ENABLE_EFI include $(topsrcdir)/build-aux/Makefile.tail.mk diff --git a/src/grp-boot/systemd-boot/console.h b/src/grp-boot/systemd-boot/console.h index 3fe0ce5ec4..887995a9cc 100644 --- a/src/grp-boot/systemd-boot/console.h +++ b/src/grp-boot/systemd-boot/console.h @@ -16,6 +16,8 @@ #ifndef __SDBOOT_CONSOLE_H #define __SDBOOT_CONSOLE_H +#include <efi.h> + #define EFI_SHIFT_STATE_VALID 0x80000000 #define EFI_RIGHT_CONTROL_PRESSED 0x00000004 #define EFI_LEFT_CONTROL_PRESSED 0x00000008 diff --git a/src/grp-boot/systemd-boot/disk.h b/src/grp-boot/systemd-boot/disk.h index af91a9c674..5804b8881a 100644 --- a/src/grp-boot/systemd-boot/disk.h +++ b/src/grp-boot/systemd-boot/disk.h @@ -15,5 +15,7 @@ #ifndef __SDBOOT_DISK_H #define __SDBOOT_DISK_H +#include <efi.h> + EFI_STATUS disk_get_part_uuid(EFI_HANDLE *handle, CHAR16 uuid[37]); #endif diff --git a/src/grp-boot/systemd-boot/graphics.h b/src/grp-boot/systemd-boot/graphics.h index cf48e647e7..d8e5adfcd8 100644 --- a/src/grp-boot/systemd-boot/graphics.h +++ b/src/grp-boot/systemd-boot/graphics.h @@ -18,5 +18,7 @@ #ifndef __SDBOOT_GRAPHICS_H #define __SDBOOT_GRAPHICS_H +#include <efi.h> + EFI_STATUS graphics_mode(BOOLEAN on); #endif diff --git a/src/grp-boot/systemd-boot/linux.h b/src/grp-boot/systemd-boot/linux.h index d9e6ed7955..b87a7f0d38 100644 --- a/src/grp-boot/systemd-boot/linux.h +++ b/src/grp-boot/systemd-boot/linux.h @@ -15,6 +15,8 @@ #ifndef __SDBOOT_kernel_H #define __SDBOOT_kernel_H +#include <efi.h> + EFI_STATUS linux_exec(EFI_HANDLE *image, CHAR8 *cmdline, UINTN cmdline_size, UINTN linux_addr, diff --git a/src/grp-boot/systemd-boot/measure.h b/src/grp-boot/systemd-boot/measure.h index a2cfe817d0..ddd686a8fd 100644 --- a/src/grp-boot/systemd-boot/measure.h +++ b/src/grp-boot/systemd-boot/measure.h @@ -13,6 +13,8 @@ #ifndef __SDBOOT_MEASURE_H #define __SDBOOT_MEASURE_H +#include <efi.h> + #ifndef SD_TPM_PCR #define SD_TPM_PCR 8 #endif diff --git a/src/grp-boot/systemd-boot/pefile.h b/src/grp-boot/systemd-boot/pefile.h index 2e445ede17..bc2d73fea9 100644 --- a/src/grp-boot/systemd-boot/pefile.h +++ b/src/grp-boot/systemd-boot/pefile.h @@ -15,6 +15,8 @@ #ifndef __SDBOOT_PEFILE_H #define __SDBOOT_PEFILE_H +#include <efi.h> + EFI_STATUS pefile_locate_sections(EFI_FILE *dir, CHAR16 *path, CHAR8 **sections, UINTN *addrs, UINTN *offsets, UINTN *sizes); #endif diff --git a/src/grp-boot/systemd-boot/splash.h b/src/grp-boot/systemd-boot/splash.h index 09b543fb47..362ff22643 100644 --- a/src/grp-boot/systemd-boot/splash.h +++ b/src/grp-boot/systemd-boot/splash.h @@ -16,5 +16,7 @@ #ifndef __SDBOOT_SPLASH_H #define __SDBOOT_SPLASH_H +#include <efi.h> + EFI_STATUS graphics_splash(UINT8 *content, UINTN len, const EFI_GRAPHICS_OUTPUT_BLT_PIXEL *background); #endif diff --git a/src/grp-boot/systemd-boot/util.h b/src/grp-boot/systemd-boot/util.h index e673cdf9a0..e2da8b3fee 100644 --- a/src/grp-boot/systemd-boot/util.h +++ b/src/grp-boot/systemd-boot/util.h @@ -22,7 +22,7 @@ #define ELEMENTSOF(x) (sizeof(x)/sizeof((x)[0])) static inline const CHAR16 *yes_no(BOOLEAN b) { - return b ? L"yes" : L"no"; + return b ? (CHAR16*)L"yes" : (CHAR16*)L"no"; } EFI_STATUS parse_boolean(CHAR8 *v, BOOLEAN *b); |