Chinaunix首页 | 论坛 | 博客
  • 博客访问: 41002
  • 博文数量: 18
  • 博客积分: 0
  • 博客等级: 民兵
  • 技术积分: 70
  • 用 户 组: 普通用户
  • 注册时间: 2013-06-17 12:30
文章分类

全部博文(18)

文章存档

2015年(2)

2013年(16)

我的朋友

分类: LINUX

2015-05-04 16:56:14

问题

  • How can we create a customized RHEL6 ISO with kickstart file included in the ISO?
  • How to include a kickstart file in ISO image and create customized ISO?

环境

  • Red Hat Enterprise Linux 4
  • Red Hat Enterprise Linux 5
  • Red Hat Enterprise Linux 6
  • Red Hat Enterprise Linux 7

决议

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:

  • The image which will be created using the steps above won't be UEFI enabled. So to have an UEFI enabled image, use the following extra options.
-eltorito-alt-boot -e images/efiboot.img -no-emul-boot 
  • And the graft point as follows.
EFI/BOOT={0}/EFI/BOOT images/efiboot.img={0}/images/efiboot.img 
  • Where {0} is replaced by the location where the existing DVD is mounted/extracted.
  • One should also run isohybrid on it so that it can be booted by both BIOS and UEFI:
isohybrid --uefi boot.iso 
阅读(1129) | 评论(0) | 转发(0) |
0

上一篇:linux管理员题目

下一篇:mysqlreport使用指南

给主人留下些什么吧!~~