本文共 2137 字,大约阅读时间需要 7 分钟。
命令段,程序包段,脚本段
指明各种安装前配置,如键盘类型等
命令段中的常见命令:
指明要安装的程序包组或程序包,不安装的程序包等
%packages@^environment group: 指定环境包组,如:@^minimal-environment@group_name packagepackage%end
%pre: 安装前脚本%post: 安装后脚本
[root@C6-56 ~]# cat anaconda-ks.cfg# Kickstart file automatically generated by anaconda.#version=DEVELinstallcdromlang en_US.UTF-8keyboard usnetwork --onboot yes --device eth0 --bootproto dhcprootpw --iscrypted $1$Ngd5nkD3$9aiytDQYX.Rajc29jnGJ11# Reboot after installationrebootfirewall --service=sshauthconfig --useshadow --enablemd5selinux --enforcingtimezone --utc America/Los_Angelesbootloader --location=mbr --driveorder=sda --append="crashkernel=auto rhgb quiet"# Clear the Master Boot Record#zerombr# 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 --all --initlabel#part /boot --fstype=ext4 --size=300#part / --fstype=ext4 --grow --size=3000#part swap --grow --maxsize=1984 --size=1984repo --name="CentOS" --baseurl=cdrom:sr1 --cost=100%packages@Base@Core@Desktop@Fonts@General Purpose Desktop@Internet Browser@Printing client@X Window Systembinutilsgcckernel-develmakepatchpython%end%postif [ -f /boot/grub/menu.lst -a ! -h /boot/grub/menu.lst ]; then cp /boot/grub/menu.lst /boot/grub/menu.lst.bak && sed -i 's/ rhgb//' /boot/grub/menu.lst; fiif [ -f /boot/grub/grub.conf -a ! -h /boot/grub/grub.conf ]; then cp /boot/grub/grub.conf /boot/grub/grub.conf.bak && sed -i 's/ rhgb//' /boot/grub/grub.conf; fiif [ -f /boot/grub2/grub.conf -a ! -h /boot/grub2/grub.conf ]; then cp /boot/grub2/grub.conf /boot/grub2/grub.conf.bak && sed -i 's/ rhgb//' /boot/grub2/grub.conf; fiif [ -f /etc/rc.d/rc.local ]; then cp /etc/rc.d/rc.local /etc/rc.d/rc.local.backup; ficat >>/etc/rc.d/rc.local <
转载地址:http://jrkzz.baihongyu.com/