Re: Compressed kernels currently won't boot

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 31.07.19 23:13, Helge Deller wrote:
On 31.07.19 23:08, Sven Schnelle wrote:
Hi,

On Wed, Jul 31, 2019 at 02:01:34PM -0700, James Bottomley wrote:
On Wed, 2019-07-31 at 21:44 +0200, Sven Schnelle wrote:
Hi James,

On Wed, Jul 31, 2019 at 12:40:12PM -0700, James Bottomley wrote:

What about causing the compressed make to build both a stripped and
a non-stripped bzImage (say sbzImage and bzImage).  That way you
always have the stripped one available for small size things like
boot from tape or DVD?  but in the usual case we use the bzImage
with full contents.

In that case we would also need to build two lifimages - how about
adding a config option option? Something like "Strip debug
information from compressed kernel images"?

Actually, I just looked at what x86 does.  It has this in the
arch/x86/boot/compressed/Makefile:

OBJCOPYFLAGS_vmlinux.bin :=  -R .comment -S
$(obj)/vmlinux.bin: vmlinux FORCE
    $(call if_changed,objcopy)

So it basically strips all the debug information from the kernel before
compressing, which argues there's no need to retain the information
because x86 doesn't bother.

Nice. So we could convince Helge by saying "Look, x86 is also stripping it"! :-)

I'm fine with doing exactly why x86 does :-)

Attached is the revised patch, and it gets the compressed kernel down
from 32MB to 3.8MB.

Helge
diff --git a/arch/parisc/boot/compressed/Makefile b/arch/parisc/boot/compressed/Makefile
index 2da8624e5cf6..c54d9d0f6043 100644
--- a/arch/parisc/boot/compressed/Makefile
+++ b/arch/parisc/boot/compressed/Makefile
@@ -55,7 +55,8 @@ $(obj)/misc.o: $(obj)/sizes.h
 CPPFLAGS_vmlinux.lds += -I$(objtree)/$(obj) -DBOOTLOADER
 $(obj)/vmlinux.lds: $(obj)/sizes.h

-$(obj)/vmlinux.bin: vmlinux
+OBJCOPYFLAGS_vmlinux.bin :=  -R .comment -S
+$(obj)/vmlinux.bin: vmlinux FORCE
 	$(call if_changed,objcopy)

 vmlinux.bin.all-y := $(obj)/vmlinux.bin
diff --git a/arch/parisc/boot/compressed/vmlinux.lds.S b/arch/parisc/boot/compressed/vmlinux.lds.S
index bfd7872739a3..2ac3a643f2eb 100644
--- a/arch/parisc/boot/compressed/vmlinux.lds.S
+++ b/arch/parisc/boot/compressed/vmlinux.lds.S
@@ -48,8 +48,8 @@ SECTIONS
 		*(.rodata.compressed)
 	}

-	/* bootloader code and data starts behind area of extracted kernel */
-	. = (SZ_end - SZparisc_kernel_start + KERNEL_BINARY_TEXT_START);
+	/* bootloader code and data starts at least behind area of extracted kernel */
+	. = MAX(ABSOLUTE(.), (SZ_end - SZparisc_kernel_start + KERNEL_BINARY_TEXT_START));

 	/* align on next page boundary */
 	. = ALIGN(4096);

[Index of Archives]     [Linux SoC]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux