2

Task

I have an .img file(cpio, for initramfs). Actually, it is result of mkinitcpio. U-boot is used as a boot loader. But U-boot needs either UImage or ZImage. I need to glue U-boot with created cpio image. ZImage is preferrable as a result, because size matters.

Question

Is utility mkimage only able to create UImage? Is it possible to convert cpio to ZImage? How can I do it?

skap
  • 123
  • 1
  • 4

1 Answers1

1

A zImage file contains a compressed Linux kernel image. If it is not available pre-built, you create it by compiling the kernel sources with make zImage. The initramfs created by mkinitcpio is a cpio archive containing the files of an initial ram filesystem that is used at startup. The kernel image and the initramfs are different things, so you can't convert the cpio archive into a zImage.

Johan Myréen
  • 12,862
  • 1
  • 32
  • 33
  • I should have mixed up everything. How can Early user space phase be executed when we have zImage instead of cpio? – skap Sep 03 '17 at 21:53
  • They are not mutually exclusive. The bootloader typically load both zImage and the initramfs, although you can make do without the initramfs. The zImage file contains the kernel, which is started first. The kernel then uses the initramfs as an initial file system. The point of the initramfs is that you can use a generic kernel, stripped of most device drivers and file system code, which can be loaded as modules from the initramfs. If you build a custom kernel containing all the drivers you needed to boot up your hardware, it's not necessary to use an initramfs. – Johan Myréen Sep 04 '17 at 07:15