简体   繁体   中英

How to create vmlinuz and initrd

I need to create vmlinuz and initrd that will allow to launch linux with some custom scripts and settings.

How to do it properly?

I've found https://wiki.alpinelinux.org/wiki/How_to_make_a_custom_ISO_image that describes how to create ISO image but as I understand ISO and vmlinuz are different things.

I had moby initrd and vmlinuz .

  1. vmlinuz is a kernel to load. No need to modify it for vm
  2. initrd is what I needed.

I had to unpack it:

mkdir temp
cd temp
gunzip -c initrd.img | cpio -i

So we will have access to the filesystem that will be loaded after the kernel. I made my changes and packed it back to initrd.img with a command

find . | cpio -o -H newc | gzip > ../new-initrd.img

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM