CentOS-6.3-x86_64自定义镜像制作过程

本网站用的阿里云ECS,推荐大家用。自己搞个学习研究也不错

1.下载需要的软件包

使用downloadonly命令下载需要的软件包(只下载不安装),将软件包保存到/rpm目录下:

[root@localhost ~]# mkdir -p /rpm

[root@localhost ~]# yum -y install yum-downloadonly

[root@localhost ~]# yum install –downloadonly –downloaddir=/rpm ntp net-snmp net-snmp-devel net-snmp-utils php-snmp expect mysql-devel mysql-server gcc-c++ make wget kvm libvirt python-virtinst scons ruby-devel ruby-docs ruby-ri flex bison xmlrpc-c-devel

 

2.挂载光盘将原光盘镜像内容同步

[root@localhost ~]# yum -y install createrepo mkisofs rsync

[root@localhost ~]# mkdir -p /data/OS

[root@localhost ~]# mkdir -p /mnt/cdrom

[root@localhost ~]# mount /dev/cdrom /mnt/cdrom

[root@localhost ~]# rsync -a /mnt/cdrom/* /data/OS/

[root@localhost ~]# cp /mnt/cdrom/.discinfo /data/OS/

 

3.将下载的软件包copy到Packages目录下

[root@localhost ~]#cp /mfs/* /data/OS/Packages/

 

4.配置kickstart脚本

[root@localhost ~]#vi /data/OS/isolinux/ks.cfg

# Kickstart file automatically generated by anaconda.

#version=DEVEL
# Install OS instead of upgrade
install

# Use CDROM installation media
cdrom

# Install OS language
lang zh_CN.UTF-8

# Keyboardlanguage
keyboard us

# Install OS Network
network –onboot no –bootproto dhcp –hostname=ezCloud –noipv6
# Root password default is “ezcloud”

rootpw  ezcloud

# Firewall configuration
firewall –disabled

# Firewall configuration
authconfig –enableshadow –passalgo=sha512

# Skip xwindows
skipx

# Selinuxconfiguration
selinux –disabled

# Timezone config
timezone –utc Asia/Shanghai
bootloader –location=mbr

# Clear disk part
clearpart –all –initlabel

# Disk Partition information

part /boot –fstype=ext4 –size=200
part / –fstype=ext4 –size=10240
part swap –size=2048

part /data –fstype=ext4 –grow –size=200

#repo –name=”CentOS”  –baseurl=cdrom:sr0 –cost=100
reboot

%packages –nobase
@core
ntp
vixie-cron
net-snmp-devel
net-snmp-utils
php-snmp
expect
mysql-devel
mysql-server
gcc-c++<

未经允许不得转载:演道网 » CentOS-6.3-x86_64自定义镜像制作过程

赞 (0)
分享到:更多 ()

评论 0

评论前必须登录!

登陆 注册