分类: LINUX
2015-05-04 16:56:14
NOTE: Red Hat does not support the traditional concept of the Golden Image, instead we recommend and promote the use of kickstart to build consistent systems. Red Hat does not support the customization of installation media. This article is provided as a how-to and Red Hat will not be able to support the process described here.
1. Download the RHEL installation dvd iso or minimal boot media boot.iso
2. Mount the ISO
# mount /path/to/rhel-dvd.iso /mnt/ -o loop
3. Copy the entire contents of the disk to another location.
# mkdir /rhel
# shopt -s dotglob
# cp -ri /mnt/* /rhel
4. Create a kickstart file.
This is an example:
install
cdrom
repo --name="Red Hat Enterprise Linux" --baseurl=file:/mnt/source --cost=100
repo --name="High Availability" --baseurl=file:/mnt/source/HighAvailability --cost=1000
lang en_US.UTF-8
keyboard us
timezone --utc Asia/Shanghai
selinux --enforcing
authconfig --enableshadow --passalgo=sha512 --enablefingerprint
firewall --service=ssh
bootloader --location=mbr --driveorder=sda --append="rhgb quiet"
%packages
@base
@core
mtools
gdm
luci
%end
5. Copy the kickstart file to the /rhel directory
# cp /path/to/ks.cfg /rhel
6. Change the file '/rhel/isolinux/isolinux.cfg', change the following lines :
label linux
menu label ^Install or upgrade an existing system
menu default
kernel vmlinuz
append initrd=initrd.img
to
label linux
menu label ^Install or upgrade an existing system
menu default
kernel vmlinuz
append initrd=initrd.img ks=cdrom:/ks.cfg
NOTE: For RHEL7 Server, "append initrd=initrd.img inst.stage2=hd:LABEL=RHEL-7.0\x20Server.x86_64 quiet" is the default parameter.
So, use "append initrd=initrd.img inst.stage2=hd:LABEL=Volume_ID quiet ks=cdrom:/ks.cfg". Replace Volume_ID by your preferable volume id (label).
7. Rebuild the DVD iso image
# cd /rhel
# mkisofs -o /tmp/new.iso -b isolinux/isolinux.bin -c isolinux/boot.cat --no-emul-boot --boot-load-size 4 --boot-info-table -J -R -V disks .
NOTE: In RHEL7, please make sure that you specify the volume id with -V option, and it's same as Volume_ID in step 6.
8. Boot the machine from this ISO
Kickstart has detailed documentation in the Installation Guide
Important Note:
-eltorito-alt-boot -e images/efiboot.img -no-emul-boot
EFI/BOOT={0}/EFI/BOOT images/efiboot.img={0}/images/efiboot.img
isohybrid --uefi boot.iso