linux kickstart 自动安装

时间:2022-09-17 06:34:14

最近很多业务系统都是linux lnmp平台安装,反复的安装让人觉得很苦恼,仔细钻研了下kickstart 。这里环境是red hat linux 5.8 32位,系统盘中的软件包里包含有kickstart。

1、安装kickstart

#rpm -ivh py-*

#rpm -ivh system-config-kickstart

2、创建应答文件

#platform=x86, AMD64, 鎴?Intel EM64T
# System authorization information
auth --useshadow --enablemd5
# System bootloader configuration
bootloader --append="rhgb quiet" --location=mbr --driveorder=sda
# Partition clearing information
clearpart --none
# Use text mode install
text
# Firewall configuration
firewall --disabled
# Run the Setup Agent on first boot
firstboot --disable
key --skip
# System keyboard
keyboard us
# System language
lang zh_CN
# Installation logging level
logging --level=info
# Use CDROM installation media
cdrom
# Network information
network --bootproto=static --device=eth0 --gateway=192.168.1.254 --ip=192.168.1.100 --nameserver=8.8.8.8 --netmask=255.255.255.0 --onboot=on
# Reboot after installation
reboot
#Root password
rootpw --iscrypted $1$qyoXbT/6$OidbitstRPCrz0Yp4Z9IS.

# SELinux configuration
selinux --disabled
# System timezone
timezone --isUtc Asia/Shanghai
# Install OS instead of upgrade
install
# X Window System configuration information
xconfig --defaultdesktop=GNOME --depth=8 --resolution=640x480 --startxonboot

%packages
@admin-tools
@base
@chinese-support
@core
@development-libs
@development-tools
@dialup
@editors
@gnome-desktop
@games
@graphical-internet
@graphics
@java
@legacy-software-support
@office
@printing
@sound-and-video
@text-internet
@base-x
kexec-tools
iscsi-initiator-utils
fipscheck
device-mapper-multipath
sgpio
libstdc++44-devel
python-dmidecode
gcc44-c++
gcc44-gfortran
imake
libgfortran44
gcc44
emacs
libsane-hpaio
xorg-x11-utils
xorg-x11-server-Xnest
xorg-x11-server-Xvfb

将在root用户目录下生成的ks.cfg文件添加到系统镜像中,并修改光盘中isolinux目录下的isolinux.cfg 的第一行

default linux ks=cdrom:/ks.cfg