├── RELEASE-NOTES-en-US.html
├── repodata
│ ├── 1fe6472ba4a4c603142f6c166cf8576540d182b5c23053300bc086a950c39e02-other.sqlite.bz2
│ ├── 34bae2d3c9c78e04ed2429923bc095005af1b166d1a354422c4c04274bae0f59-c6-minimal-x86_64.xml
│ ├── 55794efeb017159652008492a09552561cad4be2652478bfa3fc1e8e2ac12940-other.xml.gz
│ ├── 73c548679e02ace4bb7102d5b92dd97ee224f35de6d198e0f090d409b9731d89-primary.sqlite.bz2
│ ├── ad712ab1d0018477799baa3f9660935dec74cd227724142a4b2a33b63cafe583-filelists.xml.gz
│ ├── ce2d698b9fb1413b668443e88835a0642cea8f387c7f25cc946f56dd93f109bb-c6-minimal-x86_64.xml.gz
│ ├── fc5f6c991238c567b41dd12c19f3e0c1b4a56dce0063020fc7de8339bde0f5f9-filelists.sqlite.bz2
│ ├── ffaba656c4b1c77c844142b80d383bb38e9335b36a8046f56f53747044010304-primary.xml.gz
│ ├── repomd.xml
│ └── TRANS.TBL
├── RPM-GPG-KEY-CentOS-6
├── RPM-GPG-KEY-CentOS-Debug-6
├── RPM-GPG-KEY-CentOS-Security-6
├── RPM-GPG-KEY-CentOS-Testing-6
└── TRANS.TBL
#platform=x86, AMD64, or Intel EM64T
#version=DEVEL
# Firewall configuration
firewall --disabled
# Install OS instead of upgrade
install
# Use CDROM installation media --> 修改这里的安装源
# cdrom
url --url="https://mirrors.aliyun.com/centos/6.9/os/x86_64/"
# 阿里云的镜像源, 可以改为内网http或ftp服务器, 会更快一些
# Root password
rootpw --iscrypted $1$NYOXLNBQ$e7B2.8hPCvCK75U/Jj8hV/
# System authorization information
auth --useshadow --passalgo=sha512
# Use text mode install
text
# System keyboard
keyboard us
# System language
lang en_US
# SELinux configuration
selinux --disabled
# Do not configure the X Window System
skipx
# Installation logging level
logging --level=info
# Reboot after installation
reboot
# System timezone
timezone Asia/Shanghai
# Network information
network --bootproto=dhcp --device=eth0 --onboot=on
# System bootloader configuration
bootloader --location=mbr
# Clear the Master Boot Record
zerombr
# Partition clearing information
clearpart --all --initlabel
# Disk partitioning information
part /boot --fstype="ext4" --size=200
part /home --fstype="ext4" --size=5000
part / --fstype="ext4" --size=10000
part swap --fstype="swap" --size=2048
%post
mkdir /etc/yum.repos.d/bak
mv /etc/yum.repos.d/* /etc/yum.repos.d/bak/
cat > /etc/yum.repos.d/base.repo <<EOF
[base]
name=CentOS-$releasever - Base - 163.com
baseurl=http://mirrors.163.com/centos/6/os/x86_64/
gpgcheck=0
EOF
%end
这里有一个需要注意的地方, 在CentOS7上, 如果kickstart界面的Package页面没有显示, 请修改yum仓库中的[base] 项为 [development] 就可以了
3. 拷贝 上面提到的 isolinux/ 到 任意空目录
[root@centos6 myiso]# cp -r isolinux/ ../autoboot/
[root@centos6 myiso]# cd ..
[root@centos6 auto-centos6]# cd autoboot/
[root@centos6 autoboot]# ls
isolinux
[root@centos6 autoboot]# tree isolinux/ --> 我们所需要的全部文件
isolinux/
├── boot.cat
├── boot.msg
├── grub.conf
├── initrd.img
├── isolinux.bin
├── isolinux.cfg
├── ks
│ ├── ks6_mini.cfg
│ └── ks7_desktop.cfg
├── memtest
├── splash.jpg
├── TRANS.TBL
├── vesamenu.c32
└── vmlinuz
修改过程中要注意, 既然是自动安装, 那么如果原来磁盘有操作系统怎么办?
--> 所以, 我们的默认选项应该为从硬盘启动
[root@centos6 isolinux]# cat isolinux.cfg
default vesamenu.c32
#prompt 1
timeout 600
display boot.msg