Red Hat Training

A Red Hat training course is available for Red Hat Satellite

第 7 章 使​​​用​​​ Kickstart

很​​​显​​​然​​​,最​​​好​​​是​​​在​​​最​​​初​​​建​​​立​​​系​​​统​​​时​​​修​​​改​​​其​​​配​​​置​​​。​​​对​​​于​​​已​​​经​​​有​​​效​​​使​​​用​​​ kickstart 的​​​客​​​户​​​,最​​​好​​​使​​​用​​​引​​​导​​​程​​​序​​​脚​​​本​​​完​​​成​​​此​​​过​​​程​​​。​​​
完​​​成​​​所​​​有​​​配​​​置​​​工​​​作​​​后​​​,系​​​统​​​仍​​​可​​​能​​​使​​​用​​​ up2date 和​​​ rhn_register RPM 自​​​带​​​的​​​ rhnreg_ks 工​​​具​​​在​​​本​​​地​​​ Red Hat Network 服​​​务​​​器​​​进​​​行​​​注​​​册​​​。​​​本​​​章​​​讨​​​论​​​的​​​是​​​如​​​何​​​正​​​确​​​使​​​用​​​ rhnreg_ks 注​​​册​​​系​​​统​​​。​​​
rhnreg_ks 工​​​具​​​程​​​序​​​使​​​用​​​ 激​​​活​​​码​​​(activation keys) 来​​​进​​​行​​​注​​​册​​​、​​​获​​​得​​​权​​​利​​​并​​​将​​​系​​​统​​​订​​​阅​​​到​​​特​​​定​​​的​​​频​​​道​​​。​​​要​​​了​​​解​​​更​​​多​​​关​​​于​​​激​​​活​​​码​​​的​​​信​​​息​​​,请​​​参​​​阅​​​《​​​Red Hat Network Management 参​​​考​​​指​​​南​​​》​​​中​​​的​​​Red Hat Update Agent 和​​​ RHN 网​​​站​​​这​​​两​​​章​​​。​​​
以​​​下​​​这​​​个​​​带​​​有​​​注​​​释​​​的​​​ kickstart 文​​​件​​​是​​​一​​​个​​​如​​​何​​​配​​​置​​​一​​​个​​​系​​​统​​​使​​​用​​​ Red Hat Network 的​​​示​​​例​​​。​​​
# Generic 7.2 kickstart for laptops in the Widget Corporation (widgetco)

# Standard kickstart options for a network-based install. For an
# explanation of these options, consult the Red Hat Linux Customization 
# Guide.

lang en_US
langsupport --default en_US en_US
keyboard defkeymap
network --bootproto dhcp
install
url --url ftp://ftp.widgetco.com/pub/redhat/linux/7.2/en/os/i386
zerombr yes
clearpart --all
part /boot	 --size 128 --fstype ext3 --ondisk hda
part /			 --size 2048 --grow --fstype ext3 --ondisk hda
part /backup --size 1024 --fstype ext3 --ondisk hda
part swap		--size 512 --ondisk hda
bootloader --location mbr
timezone America/New_York
rootpw --iscrypted $1$78Jnap82Hnd0PsjnC8j3sd2Lna/Hx4.
auth --useshadow --enablemd5 --krb5realm .COM --krb5kdc auth.widgetco.com \
	--krb5adminserver auth.widgetco.com
mouse --emulthree genericps/2
xconfig --card "S3 Savage/MX" --videoram 8192	--resolution 1024x768 \
	--depth 16 --defaultdesktop=GNOME --startxonboot --noprobe \
	 --hsync 31.5-48.5 --vsync 40-70

reboot

# Define a standard set of packages.	Note: Red Hat Network client 
# packages are found in Base.	This is quite a minimal set of packages;
# your mileage may vary.

%packages
@ Base
@ Utilities
@ GNOME
@ Laptop Support
@ Dialup Support
@ Software Development
@ Graphics and Image Manipulation
@ Games and Entertainment
@ Sound and Multimedia Support


# Now for the interesting part.

%post
( # Note that we run the entire %post section as a subshell for logging.

# Remember that nifty one-line command for the bootstrap script that we
# went through? This is an ideal place for it. And assuming that the
# script has been properly configured, it should prepare the system
# fully for usage of local Red Hat Network Servers.

wget -O- http://proxy-or-sat.example.com/pub/bootstrap_script | /bin/bash

# The following is an example of the usage of rhnreg_ks, the kickstart
# utility for rhn_register. This demonstrates the usage of the 
# --activationkey flag, which describes an activation key. For example,
# this activation key could be set up in the Web interface to join this 
# system to the "Laptops" group and the local Widgetco "Laptop Software" 
# channel. Note that this section applies only to Proxy users, as this 
# step is handled by the Satellite bootstrap script. 
#
# For more information about activation keys, consult the Red Hat Network
# Management Reference Guide.

/usr/sbin/rhnreg_ks --activationkey=6c933ea74b9b002f3ac7eb99619d3374

# End the subshell and capture any output to a post-install log file.
) 1>/root/post_install.log 2>&1