定制 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.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
|
[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/
本文转自 swq499809608 51CTO博客,原文链接:http://blog.51cto.com/swq499809608/1351635