启动菜单ISO
boot:linux ks=http://websrv/ks.cfg
ks.cfg
url --url=ftp://websrv2/pub/
全功能ISO
1.备相关文件,yum源
cp -r /misc/cd /app/fulliso
Paste_Image.pngrm -rf /app/fulliso/repodata/*
#cp /misc/cd/repodata/43d8fd068164b0f042845474d6a22262798b9f0d1f49ad1bf9f95b953089777d-c6-x86_64-comps.xml /app/fulliso/repodata/
cd /app/fulliso
#createrepo -g repodata/43d8fd068164b0f042845474d6a22262798b9f0d1f49ad1bf9f95b953089777d-c6-x86_64-comps.xml ./ 以repodata为组生成yum包
find /app/fulliso -name TRANS.TBL -exec rm {} ;
2.准备ks应答文件文件
mv anaconda-ks.cfg /app/fulliso/ks.cfg
这里我在系统自带的应答文件作了修改,有几种安装方式就有几个应答大文件
vim /app/fulliso/ks6.cfg
# Kickstart file automatically generated by anaconda.
#version=DEVEL
install
cdrom
lang en_US.UTF-8
keyboard us
network --onboot yes --device eth0 --bootproto dhcp --noipv6
rootpw --iscrypted $6$hfb25YOYZDU3YZTl$VxTkHGGJGGBbr59OPnY5kTJzvJ9hb9NRwrh5FMHLIAlXh9VQ74PYoK7QzPWYN0zaJrm3mv/IP0fDkHxFglNi6/
firewall --service=ssh
authconfig --enableshadow --passalgo=sha512
selinux --disabled
timezone 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
zerombr 如果是旧的物理磁盘,清空mbr
clearpart --all 清理所有分区
text 以文本的方式安装
reboot 重启
part /boot --fstype=ext4 --size=1000
part / --fstype=ext4 --size=50000
part /app --fstype=ext4 --size=40000
part swap --size=2048
#repo --name="CentOS" --baseurl=cdrom:sr0 --cost=100
%packages
@base
@core
@debugging
@basic-desktop
@desktop-debugging
@desktop-platform
@directory-client
@fonts
@general-desktop
@graphical-admin-tools
@input-methods
@internet-applications
@internet-browser
@java-platform
@kde-desktop
@legacy-x
@network-file-system-client
@office-suite
@print-client
@remote-desktop-clients
@server-platform
@server-policy
@workstation-policy
@x11
mtools
pax
python-dmidecode
oddjob
wodim
sgpio
genisoimage
device-mapper-persistent-data
abrt-gui
qt-mysql
samba-winbind
certmonger
pam_krb5
krb5-workstation
xterm
xorg-x11-xdm
libXmu
rdesktop
%end
%post
创建yum仓库
rm -rf /etc/yum.repos.d/*
cat > /etc/yum.repos.d/base.repo <<eof
[base]
name=base
baseurl=file:///misc/cd
gpgcheck=0
eof
%end
3.定制启动菜单
vim /app/fulliso/isolinux/isolinux.cfg
default vesamenu.c32
#prompt 1
timeout 600
display boot.msg
menu background splash.jpg
menu title Welcome to CentOS Automatic Install!
menu color border 0 #ffffffff #00000000
menu color sel 7 #ffffffff #ff000000
menu color title 0 #ffffffff #00000000
menu color tabmsg 0 #ffffffff #00000000
menu color unsel 0 #ffffffff #00000000
menu color hotsel 0 #ff000000 #ffffffff
menu color hotkey 7 #ffffffff #ff000000
menu color scrollbar 0 #ffffffff #00000000
label desktop
menu label Install an ^desktop system
kernel vmlinuz
append initrd=initrd.img ks=cdrom:/ks6.cfg
label mini
menu label Install an m^ini system
kernel vmlinuz
append initrd=initrd.img ks=cdrom:/ks6-mini.cfg
label manual
menu label ^Manual install an system
kernel vmlinuz
append initrd=initrd.img
label local
menu label Boot from ^local drive
menu default
localboot 0xffff
4.制作ISO文件
mkisofs -R -J -T -v --no-emul-boot --boot-load-size 4 --boot-info-table -V "CentOS 6.9 autoinstall" -b isolinux/isolinux.bin -c isolinux/boot.cat -o /root/centos6.iso /app/fulliso/
网友评论