LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   CentOS (https://www.linuxquestions.org/questions/centos-111/)
-   -   Custom Centos 7 ISO (https://www.linuxquestions.org/questions/centos-111/custom-centos-7-iso-4175525377/)

lodiablo99 11-14-2014 04:57 AM

Custom Centos 7 ISO
 
Hello,

I getting frustrated by trying to customize a Centos install cd.
Every attempt results in a "kernel panic unable to mount root fs on unknown block(2,0)" when I try to boot from the iso.By troubleshooting I did found that the problem is linked to the initrd.img in the /isolinux folder. With the original initrd.img my customized iso boots correctly.But I also need to customize initrd.img.

This is what I do and it fails (even without modifying the content of initrd.img)... :
  1. copy content iso to a tmp/centos folder
  1. cp /tmp/centos/isolinux/initrd.img /tmp/initrd.img.xz
  1. cd /tmp
  1. xz -d initrd.img.xz
  1. xz (-9) initrd.img
  1. cp initrd.img.xz /tmp/centos/isolinux/initrd.img
  1. chown 500 /tmp/centos/isolinux/initrd.img
  1. chgrp 502 /tmp/centos/isolinux/initrd.img
  1. mkisofs....

The problem happens somewhere in bold I think... :). Because if I recreate my iso file without decompressing / compressing the initrd.img file, it works correctly.
I lose 2Mb of data between the original initrd.img and xz decompress/compressed version..., a diff between (lsinitrd of both files) only reveals a difference on total size. What am i missing here?

sag47 11-16-2014 10:11 PM

Why are you modifying the initrd.img? You should only need to modify the squashfs and not touch the initrd.

John VV 11-17-2014 02:32 AM

what are you trying to do ?
what is being changed in the "initrd.img" ?

lodiablo99 11-18-2014 01:21 AM

Hello,

Thanks Sag47, I was a confused and you are right, the correct approach is to only modify the squachfs.img .

I'm modifying the "rootfs.img/initrd.img(centos6)" to add some scripts that are needed for a kickstart install. These scripts are called in the %pre section of the ks.cfg.

Thanks all for the help


All times are GMT -5. The time now is 09:09 AM.