From 0d248979fef396bf8e8edddbba7514678aaa3e3a Mon Sep 17 00:00:00 2001 From: Mehmet Kayaalp Date: Thu, 7 Apr 2016 16:20:17 -0400 Subject: [PATCH 1/2] KEYS: Insert incompressible bytes to vmlinux to reserve space in bzImage Call insert-sys-cert script with null file to ensure that random bytes are inserted to the space reserved with CONFIG_SYSTEM_EXTRA_CERTIFICATE, before compressing the vmlinux. This results in an uncompressed reserved area inside the bzImage as well, so that it can be replaced with an actual certificate later (after the bzImage is distributed). Signed-off-by: Mehmet Kayaalp --- arch/x86/boot/compressed/Makefile | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/arch/x86/boot/compressed/Makefile b/arch/x86/boot/compressed/Makefile index f9ce75d..5ca599d 100644 --- a/arch/x86/boot/compressed/Makefile +++ b/arch/x86/boot/compressed/Makefile @@ -58,8 +58,14 @@ $(obj)/vmlinux: $(vmlinux-objs-y) FORCE $(call if_changed,ld) @: +quiet_cmd_inscert = INSCERT /dev/null to $< + cmd_inscert = scripts/insert-sys-cert -b $< -c /dev/null > /dev/null + OBJCOPYFLAGS_vmlinux.bin := -R .comment -S $(obj)/vmlinux.bin: vmlinux FORCE +ifeq ("$(CONFIG_SYSTEM_EXTRA_CERTIFICATE)", "y") + $(call if_changed,inscert) +endif $(call if_changed,objcopy) targets += $(patsubst $(obj)/%,%,$(vmlinux-objs-y)) vmlinux.bin.all vmlinux.relocs -- 2.5.0