Skip to contentSkip to conversation

New: Building a mipsel kernel format vmlinuz (+ gzip + initrd) generates non-compressed, non-bootable image

Buildroot bugzilla at busybox.net 1 participant 10 messages Oct 31, 2017 – Jan 10, 2018

lore
Share & tools
lore
#0 lore raw

https://bugs.busybox.net/show_bug.cgi?id=10471

Bug ID: 10471
Summary: Building a mipsel kernel format vmlinuz (+ gzip +
initrd) generates non-compressed, non-bootable image
Product: buildroot
Version: 2017.02
Hardware: PC
OS: Linux
Status: NEW
Severity: major
Priority: P5
Component: Other
Assignee: unassigned at buildroot.uclibc.org
Reporter: a.enchevich at gmail.com
CC: buildroot at uclibc.org
Target Milestone: ---

Created attachment 7376
--> https://bugs.busybox.net/attachment.cgi?id=7376&action=edit
My buildroot's .config file

I have sources + images provided by Broadcom for their 7362a0 set top box boards. The kernel image there is has initrd linked in and is:

$ ls -l 
-rw-r--r-- 1  me users  5669240 Sep 20 17:52 vmlinuz-initrd-7362a0
$ file vmlinuz-initrd-7362a0
vmlinuz-initrd-7362a0: gzip compressed data, last modified: Wed Sep 20 14:52:20
2017, max compression, from Unix

So the vmlinuz that works is about 5.7MB, gzipped, with the initrd.

= = =

When I try generating a vmlinuz kernel in buildroot, however, I am getting a file which is ELF and DOES NOT have the initrd and can not be booted:
-rw-r--r-- 1 me users 8814700 Oct 31 14:04 vmlinuz-from-BR2

$ file vmlinuz-from-BR2 
vmlinuz-from-BR2: ELF 32-bit LSB executable, MIPS, MIPS32 version 1 (SYSV),
statically linked, stripped

The reasons I am saying that initrd is not linked in, is because:
a) the vmlinuz image dies very early during the TFTP transfer (packet 8 or 9).
b) because I also tried compiling a vmlinux image+initrd. That one is about 21MB and about 8.8MB stripped and gzipped. I tried booting the gzipped vmlinux and it works fine. I do not yet know the reason why it is so much bigger than Broadcom's original vmlinuz image, but I suppose it is because I linked in various packages to play with - DirectFB, SDL, SDL2, etc...

= = =

So firstly, it seems that the option 'initial RAM filesystem linked into linux kernel' from the Filesystem images menu is ignored in the case of vmlinuz.

Secondly, I was expecting a gzipped data (not and ELF binary) when option 'Kernel compression format (gzip compression)' is selected (regardless of vmlinux/vmlinuz).

Signature · 2 lines
You are receiving this mail because:
You are on the CC list for the bug.
#1 lore raw

[Buildroot] [Bug 10471] Building a mipsel kernel format vmlinuz (+ gzip + initrd) generates non-compressed, non-bootable image

https://bugs.busybox.net/show_bug.cgi?id=10471

--- Comment #1 from Alexander Enchevich <[email protected]> --- Created attachment 7381
--> https://bugs.busybox.net/attachment.cgi?id=7381&action=edit
Kernel .config file

Signature · 2 lines
You are receiving this mail because:
You are on the CC list for the bug.
#2 lore raw

[Buildroot] [Bug 10471] Building a mipsel kernel format vmlinuz (+ gzip + initrd) generates non-compressed, non-bootable image

In reply to bugzilla at busybox.net

https://bugs.busybox.net/show_bug.cgi?id=10471

--- Comment #2 from Alexander Enchevich <[email protected]> --- Reading the above perhaps a quick clarification is in order to help understand why I believe the vmlinuz produced by buildroot is significantly smaller then it should be (and hence, IMO, is missing the initial ram disk):

Good vmlinuZ (from Broadcom):
compressed: 6 MB
uncompressed: 13 MB

Good vmlinuX (from buildroot):
compressed: 9 MB
uncompressed: 21 MB

BAD vmlinuZ (from buildroot):

compressed:    9 MB (8.8)
uncompressed:  9 MB (8.7)
Signature · 2 lines
You are receiving this mail because:
You are on the CC list for the bug.
#3 lore raw

[Buildroot] [Bug 10471] Building a mipsel kernel format vmlinuz (+ gzip + initrd) generates non-compressed, non-bootable image

In reply to bugzilla at busybox.net

https://bugs.busybox.net/show_bug.cgi?id=10471

--- Comment #3 from Alexander Enchevich <[email protected]> --- Created attachment 7386
--> https://bugs.busybox.net/attachment.cgi?id=7386&action=edit
Buildroot defconfig

Signature · 2 lines
You are receiving this mail because:
You are on the CC list for the bug.
#4 lore raw

[Buildroot] [Bug 10471] Building a mipsel kernel format vmlinuz (+ gzip + initrd) generates non-compressed, non-bootable image

In reply to bugzilla at busybox.net

https://bugs.busybox.net/show_bug.cgi?id=10471

--- Comment #4 from Alexander Enchevich <[email protected]> --- Created attachment 7391
--> https://bugs.busybox.net/attachment.cgi?id=7391&action=edit
Kernel's defconfig

Signature · 2 lines
You are receiving this mail because:
You are on the CC list for the bug.
#5 lore raw

[Buildroot] [Bug 10471] Building a mipsel kernel format vmlinuz (+ gzip + initrd) generates non-compressed, non-bootable image

In reply to bugzilla at busybox.net

https://bugs.busybox.net/show_bug.cgi?id=10471

--- Comment #5 from Alexander Enchevich <[email protected]> --- The git repo for Broadcom's stblinux 3.3 is
https://github.com/Broadcom/stblinux-3.3.git. However it can not be used as a git URL directly because the kernel is not at the top level but dir down. The version I used is latest at time of filing this bug (tag: stblinux-3.3-4.2).

To make this kernel compile with the standard buildroot gcc compiler and binutils I made a patch, because there was a problem with binutils > v.2.24.51 not being able to mix hard- and softfloat FPU mode/instructions.

Also the the gzip compression option was ignored, for which there is also patch.

Signature · 2 lines
You are receiving this mail because:
You are on the CC list for the bug.
#6 lore raw

[Buildroot] [Bug 10471] Building a mipsel kernel format vmlinuz (+ gzip + initrd) generates non-compressed, non-bootable image

In reply to bugzilla at busybox.net

https://bugs.busybox.net/show_bug.cgi?id=10471

Alexander Enchevich <[email protected]> changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |a.enchevich at gmail.com

--- Comment #6 from Alexander Enchevich <[email protected]> --- Created attachment 7396
--> https://bugs.busybox.net/attachment.cgi?id=7396&action=edit
patch kernel to compile with buildroot's gcc 4.8.x

Signature · 2 lines
You are receiving this mail because:
You are on the CC list for the bug.
#7 lore raw

[Buildroot] [Bug 10471] Building a mipsel kernel format vmlinuz (+ gzip + initrd) generates non-compressed, non-bootable image

In reply to bugzilla at busybox.net

https://bugs.busybox.net/show_bug.cgi?id=10471

--- Comment #7 from Alexander Enchevich <[email protected]> --- Created attachment 7401
--> https://bugs.busybox.net/attachment.cgi?id=7401&action=edit
Enable kernel gzip compression

Signature · 2 lines
You are receiving this mail because:
You are on the CC list for the bug.
#8 lore raw

[Buildroot] [Bug 10471] Building a mipsel kernel format vmlinuz (+ gzip + initrd) generates non-compressed, non-bootable image

In reply to bugzilla at busybox.net

https://bugs.busybox.net/show_bug.cgi?id=10471

--- Comment #8 from Thomas Petazzoni <[email protected]> --- Could you reproduce this problem with a MIPS defconfig available in the upstream Linux kernel?

I personally really don't want to debug stuff deep down in the Broadcom BSP.

Signature · 2 lines
You are receiving this mail because:
You are on the CC list for the bug.
#9 lore raw

[Buildroot] [Bug 10471] Building a mipsel kernel format vmlinuz (+ gzip + initrd) generates non-compressed, non-bootable image

In reply to bugzilla at busybox.net

https://bugs.busybox.net/show_bug.cgi?id=10471

Thomas Petazzoni <[email protected]> changed:

What |Removed |Added
----------------------------------------------------------------------------

         Resolution|---                         |WONTFIX
             Status|NEW                         |RESOLVED

--- Comment #9 from Thomas Petazzoni <[email protected]> --- The original contributor never came back with a way to reproduce the problem with a reasonable kernel version (i.e not the Broadcom BSP), so let's mark the bug as WONTFIX.

Do not hesitate to reopen with an easier way to reproduce the problem. Thanks!

Signature · 2 lines
You are receiving this mail because:
You are on the CC list for the bug.