Difference between revisions of "Building a custom CentOS 7 install CD"

From Wiki
Jump to: navigation, search
 
Line 1: Line 1:
 
<pre>
 
<pre>
wget http://mirrors.liquidweb.com/CentOS/7/isos/x86_64/CentOS-7-x86_64-NetInstall-1511.iso
+
wget https://mirrors.edge.kernel.org/centos/7/isos/x86_64/CentOS-7-x86_64-NetInstall-1810.iso
sudo mount -o loop -t iso9660 CentOS-7-x86_64-NetInstall-1511.iso /var/mnt/iso/
+
sudo mount -o loop -t iso9660 CentOS-7-x86_64-NetInstall-1810.iso /var/mnt/iso/
 
rsync -avHl /var/mnt/iso/ centos7/
 
rsync -avHl /var/mnt/iso/ centos7/
 
</pre>
 
</pre>
  
Create a kickstart file and edit as needed.
+
Create a kickstart file and edit as needed. Example config:
 +
 
 +
https://gist.github.com/1ea792e140eedcf0985a04fda7b2dfdc
  
 
Create splash image.
 
Create splash image.
  
Update isolinux.cfg file as follows.
+
Update isolinux.cfg file as follows. For EFI hosts use the EFI/BOOT/grub.cfg file.
 +
 
 +
<pre>
  
 
<pre>
 
<pre>
Line 20: Line 24:
 
Once you have made all changes you can create the iso file.
 
Once you have made all changes you can create the iso file.
  
  mkisofs -o centos7.iso -V 'CentOS 7 x86_64' -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -R -J -v -T centos7
+
  mkisofs -o /var/tmp/centos7.iso -V 'CentOS 7 x86_64' -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -R -J -v -T centos7
  
 
EFI hosts require a slightly different command.
 
EFI hosts require a slightly different command.
 
  mkisofs -v -V 'CentOS 7 x86_64' -J -R -cache-inodes -o ../centos7_kickstart-efi.iso -b isolinux/isolinux.bin -no-emul-boot -boot-load-size 4 -boot-info-table -eltorito-alt-boot -b images/efiboot.img -no-emul-boot -boot-load-size 18755 ./
 
  mkisofs -v -V 'CentOS 7 x86_64' -J -R -cache-inodes -o ../centos7_kickstart-efi.iso -b isolinux/isolinux.bin -no-emul-boot -boot-load-size 4 -boot-info-table -eltorito-alt-boot -b images/efiboot.img -no-emul-boot -boot-load-size 18755 ./

Latest revision as of 14:05, 23 August 2019

wget https://mirrors.edge.kernel.org/centos/7/isos/x86_64/CentOS-7-x86_64-NetInstall-1810.iso
sudo mount -o loop -t iso9660 CentOS-7-x86_64-NetInstall-1810.iso /var/mnt/iso/
rsync -avHl /var/mnt/iso/ centos7/

Create a kickstart file and edit as needed. Example config:

https://gist.github.com/1ea792e140eedcf0985a04fda7b2dfdc

Create splash image.

Update isolinux.cfg file as follows. For EFI hosts use the EFI/BOOT/grub.cfg file.


<pre>
label linux
  menu label ^Install CentOS 7 - Kickstart
  kernel vmlinuz
  append initrd=initrd.img inst.stage2=hd:LABEL=CentOS\x207\x20x86_64 inst.ks=cdrom:/ks.cfg inst.repo=http://mirrors.liquidweb.com/CentOS/7/os/x86_64/

Once you have made all changes you can create the iso file.

mkisofs -o /var/tmp/centos7.iso -V 'CentOS 7 x86_64' -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -R -J -v -T centos7

EFI hosts require a slightly different command.

mkisofs -v -V 'CentOS 7 x86_64' -J -R -cache-inodes -o ../centos7_kickstart-efi.iso -b isolinux/isolinux.bin -no-emul-boot -boot-load-size 4 -boot-info-table -eltorito-alt-boot -b images/efiboot.img -no-emul-boot -boot-load-size 18755 ./