您的位置:首页 > 运维架构 > Linux

定制 CentOS 6.5_x64 ISO 系统(mkisofs)

2014-01-14 18:54 246 查看
定制 CentOS 6.5_x64 ISO 系统

1, 上传ISO 镜像
wgethttp://192.168.0.1/centos/CentOS-6.5-x86_64-bin-DVD1.iso

2, mount ISO to /mnt
mount -o loop /root/CentOS-6.5-x86_64-bin-DVD1.iso /mnt

3, copy iso 文件到 /opt/CentOS-6.5-x86_64-bin-DVD1 中
cp -fr /mnt/* /opt/CentOS-6.5-x86_64-bin-DVD1
cp -fr /mnt/.discinfo /opt/CentOS-6.5-x86_64-bin-DVD1/

4, 生成 ks 文件
1, 调用系统命令 system-config-kickstart
2, 根据/root/anaconda-ks.cfg 进行修改
3,[root@localhost ~]# cat anaconda-ks.cfg
# Kickstart file automatically generated by anaconda.

[root@localhost ~]# cat anaconda-ks.cfg
# Kickstart file automatically generated by anaconda.
#version=DEVEL
install
cdrom
text
skipx
lang en_US.UTF-8
keyboard us
network --onboot no --device em1 --bootproto dhcp --noipv6
rootpw  --iscrypted $6$clpZBz31i.86Mufs$3g0/m.AjwAfDbYqVajMBHB/xW8fUvJ55sdWz.aYhC3gWKLdyM1y9wxZeOjZXyDg4M8uechtLY/.Z6ayjo67IS/
firewall --service=ssh
authconfig --enableshadow --passalgo=sha512
selinux --disabled
timezone --utc Asia/Shanghai
bootloader --location=mbr --driveorder=sda --append="crashkernel=auto rhgb quiet"
# The following is the partition information you requested
# Note that any partitions you deleted are not expressed
# here so unless you clear all partitions first, this is
# not guaranteed to work
#clearpart --none
ignoredisk --only-use=sda
clearpart --all --initlabel --drives=sda
part / --fstype=ext4 --grow --maxsize=20480 --asprimary --size=200 --drives=sda
part swap --grow --maxsize=12288 --asprimary --size=200 --drives=sda
part /tmp --fstype=ext4 --grow --maxsize=8096 --size=200 --drives=sda
part /usr --fstype=ext4 --grow --maxsize=8096 --size=200 --drives=sda
part /var --fstype=ext4 --grow --maxsize=8096 --size=200 --drives=sda
repo --name="CentOS"  --baseurl=cdrom:sr0 --cost=100
%packages
@additional-devel
@base
@compat-libraries
@console-internet
@core
@debugging
@development
@dial-up
@directory-client
@british-support
@storage-client-fcoe
@hardware-monitoring
@java-platform
@large-systems
@legacy-unix
@network-file-system-client
@network-tools
@performance
@perl-runtime
@ruby-runtime
@system-management-snmp
@server-platform
@server-policy
@storage-client-multipath
@system-management
@virtualization
@virtualization-client
@virtualization-platform
@virtualization-tools
@workstation-policy
@storage-client-iscsi
libgcrypt-devel
libXinerama-devel
libgudev1-devel
libtopology-devel
libibverbs-devel
libuuid-devel
libblkid-devel
libXmu-devel
xorg-x11-proto-devel
startup-notification-devel
libudev-devel
libgnomeui-devel
libbonobo-devel
libtiff-devel
libXau-devel
libXrandr-devel
popt-devel
gnome-python2-desktop
iptables-devel
libdrm-devel
libcap-devel
libxslt-devel
libnl-devel
libXpm-devel
expat-devel
libglade2-devel
libaio-devel
libusb-devel
gnutls-devel
fuse-devel
libXaw-devel
libhugetlbfs-devel
mtools
pax
oddjob
kernel-doc
sgpio
genisoimage
dos2unix
unix2dos
device-mapper-persistent-data
PyPAM
systemtap-client
systemtap-sdt-devel
dejagnu
ElectricFence
ant
libstdc++-docs
gcc-gnat
expect
mod_dav_svn
perltidy
cmake
imake
babel
ksc
kdewebdev
rpmdevtools
compat-gcc-34
systemtap-server
cvs-inetd
gcc-java
compat-gcc-34-g77
jpackage-utils
bzr
mercurial
chrpath
gcc-objc
rpmlint
gcc-objc++
compat-gcc-34-c++
python-docs
nasm
samba-winbind
certmonger
pam_krb5
krb5-workstation
cups-lpd
talk-server
rsh
dump
telnet-server
finger-server
mksh
rwho
rsh-server
rusers
telnet
tcp_wrappers
finger
ncompress
tftp
rusers-server
krb5-appl-servers
ksh
talk
authd
ebtables
ipset
iptraf
iptstate
wireshark
nmap
perl-LDAP
perl-Frontier-RPC
perl-Date-Calc
perl-suidperl
perl-Date-Manip
perl-Mozilla-LDAP
perl-DBD-SQLite
freeipmi-ipmidetectd
freeipmi-bmc-watchdog
freeipmi
OpenIPMI
qemu-kvm-tools
qemu-guest-agent
libvirt-snmp
fence-virtd-serial
fence-virtd-multicast
libvirt-java
libvirt-cim
fence-virtd-libvirt
perl-Sys-Virt
libguestfs-java
virt-v2v
libguestfs-tools
%end
5,制作ISO 文件
# cd /opt/CentOS-6.5-x86_64-bin-DVD1
# mkisofs -o /opt/CentOS-6.5-x86_64-bin-DVD1-ks.iso -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -joliet-long -R -J -v -T .

mkisofs -o /opt/infocore-OS.iso -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -joliet-long -R -J -v -T .

切记,要把光盘中的“.discinfo”文件拷贝过来,如果没有拷贝此文件,在用光盘安装时
会提示如下错误:“The CentOS CD was not found in any of your CDROM drives.
Please insert the CentOS CD and press OK to retry.”

cp -fr .discinfo /opt/CentOS-6.5-x86_64-bin-DVD1/
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  .discinfo