kernel panic: init not found (problem with custom built initrd.img) cpio command
I have this python script which builds bootable usb drive with SysLinux based minimal Linux with linux kernel(bzimage), syslinux.cfg, ldlinux.sys and initrd.img. The script also builds initrd.img (a cpio archive) from various files (a linux file structure bin, dev, etc, proc, user, var) init program etc.
But the problem is when i try to boot my x86 machine with this usb driver. Kernel gets loaded then initrd.img but then it errors out saying - kernel panic, init not found.
But I actually also have access to initrd.img that is working (ie. machine is booting without any issues). If I replace my initrd.img with working initrd.img it works so problem is with my initrd.img. I tried to see the contents of initrd.img and compare. I did:
sudo cp initrd.img initrd.gz
sudo gunzip initrd.gz
cpio -i -t < initrd
both of them seem to be same. except for few python libraries in /usr/lib.
I am not sure why my initrd.img is not working. Since I need to modify files in the filesystem I need to run python script to archive and build initrd.img. Is there any way to modify/add or delete files from cpio archive. I tried to do cpio -i initrd. It tries to replace files and directories in my Linux system such as /usr /bin init etc.
|