Decompressing vmlinuz kernel image

It is one of the most misunderstood things about kernel image.

The name bzImage not related with bzip algorithm, bzImage is a shorten form of big zimage.

A big zimage file consist of bootsect.o, setup.o, misc.o and piggy.o files. The original vmlinux kernel image compressed in piggy.o file.

Until the kernel version 2.6.30 only gzip algorithm can be used within big zimage file. After that new compression algorithms support added. Now you can select one of the algorithm from gzip, lzma, xz, lzo, lz4 and bzip2. So, you can choose bzip2 as compression method but it defines just the format of piggy.o file, not the bzImage file, it is more than this.

If you want to decompress kernel part from a bzImage file, you can use extract-vmlinux script which comes with kernel source code under scripts/ folder.