Page 1 of 1

How is a Linux zimage made?

Posted: Wed Jun 23, 2021 4:25 am
by clementttttttttt
google is just absolutely useless on this, nothing is explained

Re: How is a Linux zimage made?

Posted: Wed Jun 23, 2021 4:30 am
by iansjack
You need to improve your Googling skills. Third hit for "linux image": https://ineclabs.com/image-zimage-uimag ... ux-kernel/

Re: How is a Linux zimage made?

Posted: Wed Jun 23, 2021 4:33 am
by clementttttttttt
I wanted to know the exact process of how is a zimage generated, not a brief explanation of different Linux kernel images.

Re: How is a Linux zimage made?

Posted: Wed Jun 23, 2021 4:51 am
by iansjack
As it says in the link, you use the command

make zImage

when compiling the kernel. If you want to know exactly what commands that evokes just look at the Makefile (or use the command line

make -n zImage

). Basically, you just compress vmlinux with gzip.

Re: How is a Linux zimage made?

Posted: Wed Jun 23, 2021 4:55 am
by clementttttttttt
thanks i guess

Re: How is a Linux zimage made?

Posted: Wed Jun 23, 2021 4:57 am
by vvaltchev
clementttttttttt wrote:I wanted to know the exact process of how is a zimage generated, not a brief explanation of different Linux kernel images.
Maybe this is what you have been looking for: https://www.star.bnl.gov/~liuzx/lki/lki-1.html
It might be out of date, but the general ideas are more or less the same.

Also, on the vmlinux wikipedia page: https://en.wikipedia.org/wiki/Vmlinux there is some useful information.

Re: How is a Linux zimage made?

Posted: Wed Jun 23, 2021 12:16 pm
by Schol-R-LEA
It sounds to me that the answer you seek is, read through the Makefile(s) in detail. This, however, is unlikely to be a useful task, as the Linux Makefiles are gargantuan and not really written for human readers - they are reasonably well-documented, to be sure, but only to the extent that it is easy to find a given section so that it can be easily maintained.