Makefile.zboot (bca2f3a9406b89961fbc6c92c52c6fc1fd91d35f) Makefile.zboot (538bc0f40b364f2c7b81f11aa163f723b138b40f)
1# SPDX-License-Identifier: GPL-2.0
2
3# to be include'd by arch/$(ARCH)/boot/Makefile after setting
1# SPDX-License-Identifier: GPL-2.0
2
3# to be include'd by arch/$(ARCH)/boot/Makefile after setting
4# EFI_ZBOOT_PAYLOAD, EFI_ZBOOT_BFD_TARGET and EFI_ZBOOT_MACH_TYPE
4# EFI_ZBOOT_PAYLOAD, EFI_ZBOOT_BFD_TARGET, EFI_ZBOOT_MACH_TYPE and
5# EFI_ZBOOT_FORWARD_CFI
5
6quiet_cmd_copy_and_pad = PAD $@
7 cmd_copy_and_pad = cp $< $@ && \
8 truncate -s $(shell hexdump -s16 -n4 -e '"%u"' $<) $@
9
10# Pad the file to the size of the uncompressed image in memory, including BSS
11$(obj)/vmlinux.bin: $(obj)/$(EFI_ZBOOT_PAYLOAD) FORCE
12 $(call if_changed,copy_and_pad)

--- 26 unchanged lines hidden (view full) ---

39$(obj)/vmlinuz: $(obj)/vmlinux.bin FORCE
40 $(call if_changed,compwithsize)
41
42OBJCOPYFLAGS_vmlinuz.o := -I binary -O $(EFI_ZBOOT_BFD_TARGET) \
43 --rename-section .data=.gzdata,load,alloc,readonly,contents
44$(obj)/vmlinuz.o: $(obj)/vmlinuz FORCE
45 $(call if_changed,objcopy)
46
6
7quiet_cmd_copy_and_pad = PAD $@
8 cmd_copy_and_pad = cp $< $@ && \
9 truncate -s $(shell hexdump -s16 -n4 -e '"%u"' $<) $@
10
11# Pad the file to the size of the uncompressed image in memory, including BSS
12$(obj)/vmlinux.bin: $(obj)/$(EFI_ZBOOT_PAYLOAD) FORCE
13 $(call if_changed,copy_and_pad)

--- 26 unchanged lines hidden (view full) ---

40$(obj)/vmlinuz: $(obj)/vmlinux.bin FORCE
41 $(call if_changed,compwithsize)
42
43OBJCOPYFLAGS_vmlinuz.o := -I binary -O $(EFI_ZBOOT_BFD_TARGET) \
44 --rename-section .data=.gzdata,load,alloc,readonly,contents
45$(obj)/vmlinuz.o: $(obj)/vmlinuz FORCE
46 $(call if_changed,objcopy)
47
48aflags-zboot-header-$(EFI_ZBOOT_FORWARD_CFI) := \
49 -DPE_DLL_CHAR_EX=IMAGE_DLLCHARACTERISTICS_EX_FORWARD_CFI_COMPAT
50
47AFLAGS_zboot-header.o += -DMACHINE_TYPE=IMAGE_FILE_MACHINE_$(EFI_ZBOOT_MACH_TYPE) \
48 -DZBOOT_EFI_PATH="\"$(realpath $(obj)/vmlinuz.efi.elf)\"" \
49 -DZBOOT_SIZE_LEN=$(zboot-size-len-y) \
51AFLAGS_zboot-header.o += -DMACHINE_TYPE=IMAGE_FILE_MACHINE_$(EFI_ZBOOT_MACH_TYPE) \
52 -DZBOOT_EFI_PATH="\"$(realpath $(obj)/vmlinuz.efi.elf)\"" \
53 -DZBOOT_SIZE_LEN=$(zboot-size-len-y) \
50 -DCOMP_TYPE="\"$(comp-type-y)\""
54 -DCOMP_TYPE="\"$(comp-type-y)\"" \
55 $(aflags-zboot-header-y)
51
52$(obj)/zboot-header.o: $(srctree)/drivers/firmware/efi/libstub/zboot-header.S FORCE
53 $(call if_changed_rule,as_o_S)
54
55ZBOOT_DEPS := $(obj)/zboot-header.o $(objtree)/drivers/firmware/efi/libstub/lib.a
56
57LDFLAGS_vmlinuz.efi.elf := -T $(srctree)/drivers/firmware/efi/libstub/zboot.lds
58$(obj)/vmlinuz.efi.elf: $(obj)/vmlinuz.o $(ZBOOT_DEPS) FORCE
59 $(call if_changed,ld)
60
61OBJCOPYFLAGS_vmlinuz.efi := -O binary
62$(obj)/vmlinuz.efi: $(obj)/vmlinuz.efi.elf FORCE
63 $(call if_changed,objcopy)
64
65targets += zboot-header.o vmlinux.bin vmlinuz vmlinuz.o vmlinuz.efi.elf vmlinuz.efi
56
57$(obj)/zboot-header.o: $(srctree)/drivers/firmware/efi/libstub/zboot-header.S FORCE
58 $(call if_changed_rule,as_o_S)
59
60ZBOOT_DEPS := $(obj)/zboot-header.o $(objtree)/drivers/firmware/efi/libstub/lib.a
61
62LDFLAGS_vmlinuz.efi.elf := -T $(srctree)/drivers/firmware/efi/libstub/zboot.lds
63$(obj)/vmlinuz.efi.elf: $(obj)/vmlinuz.o $(ZBOOT_DEPS) FORCE
64 $(call if_changed,ld)
65
66OBJCOPYFLAGS_vmlinuz.efi := -O binary
67$(obj)/vmlinuz.efi: $(obj)/vmlinuz.efi.elf FORCE
68 $(call if_changed,objcopy)
69
70targets += zboot-header.o vmlinux.bin vmlinuz vmlinuz.o vmlinuz.efi.elf vmlinuz.efi