Kickstart f14 generic server.ks

From AN!Wiki
Jump to: navigation, search

 AN!Wiki :: Kickstart f14 generic server.ks

Below is a Fedora 14 x86_64 kickstart script suitable for PXE servers that is designed to for use on servers. It strips down the standard Fedora 14 package list to save space and minimize potential problems.

It also implements a rudimentary script that detects HP Proliant storage controllers, one or two old-style /dev/hdX drives and one through six /dev/sdX drives. When two drives are found, a software RAID level 1 array is made. When three or more drives are found, a software RAID level 5 array is made.

Updated: Nov. 07, 2010.

# Kickstart file created by Digimer
# Email:     digimer@alteeve.com
# Updated:   Nov. 07, 2010
# Based on:  Fedora 14
# Spin Name: AN!Cluster
# Spin Ver.: 0.2.003
# Note:      Generic server install (most user-apps removed)
 
### Setup values.
# Doing a full install.
install
 
# This is the web server with the installation image. For more information on
# setting up a PXE and web server, see: 
# - https://alteeve.com/index.php/Setting_Up_a_PXE_Server_in_Fedora
url --url=http://10.255.0.1/f14/x86_64/img/
 
# Set the language and keyboard to en_US, UTF-8. Adjust as needed.
lang en_US.UTF-8
keyboard us
 
# Set the timezone to Eastern Standard/Daylight Time. To get your preferred
# time zone, run 'tzselect'. When finished, looks for the line like:
# - Therefore TZ='America/Toronto' will be used.
# Take the value in "TZ='...'" and use it below.
timezone --utc America/Toronto
 
# This sets the (first) ethernet device. There is currently no way to map
# device names to physical interfaces. For this reason, I use DHCP for install
# and configure the network manually post-install.
network --device eth0 --bootproto dhcp --onboot yes --hostname generic.alteeve.com
 
# This is the root user's password, which is "initial". To change this, set the
# password you want for a user on an existing system. Once set, look in
# '/etc/shadow' for the line starting with the user name whom you set the
# password for. Here is an example for the user 'digimer':
# digimer:$6$YEoLNxHI$cu/673fGD/BPqfJ1RCd0F6ZRqHhkfbI6HPdy1YuKBoxA6AW7eyyWC2NmkQ/czP1dzXfBn5uJbdn/HR84i.WhO1:14896:0:99999:7:::
# The part to copy below falls between the first and second ':' character.
authconfig --enableshadow --enablemd5
rootpw --iscrypted $6$0riSEDMyCvHPdhCv$lvuhEOqU2yo9szCJHtAsVUK3maHyWlpZmVi6PCRkrOfifL/38J7SaGUopehv/rzwQvhqxNla/jPvD10uwuPY4/
 
# In a production system, you will likely want to enable a firewall and
# SELinux. Given that this script is likely to be used while learning though,
# I turn them both off to reduce potential problems. Please be sure to build a
# firewall (Shorewall is good) and to re-enable SELinux as final steps before
# going into production. This way you will be able to focus on resolving issues
# specific to firewalling and SELinux without wondering if problems are caused
# by the general configuration.
firewall --disabled
selinux --disabled
 
# Given how often I rebuild machines, I like to pre-define the initial user and
# thus skip 'firstboot' to save time.
firstboot --disable
 
# Setup the first user. I use 'iplink', the system name used by Interlink, the
# main company I contract for, with the same "initial" password. Please see the
# 'rootpw' option above for information on changing this to the password you
# prefer.
user --name=iplink --iscrypted --password=$6$0riSEDMyCvHPdhCv$lvuhEOqU2yo9szCJHtAsVUK3maHyWlpZmVi6PCRkrOfifL/38J7SaGUopehv/rzwQvhqxNla/jPvD10uwuPY4/
 
# Reboot after the install completes rather than waiting for the user to
# manually reboot.
reboot
 
# This runs a script (below) that generates the partitioning information
# depending on a rudamentary test for available storage devices.
%include /tmp/part-include
 
# These options allow me to disable and enable services. Given that we're
# building servers, I particularly like to replace 'NetworkManager' with the
# simpler, and more static, 'network' service. If you want to add additional
# services, seperate the service names with commans. (ie: foo,bar,baz).
services --disabled NetworkManager,iptables,iptables,ip6tables
services --enabled network
 
# This is the stripped down package list. Most "Desktop" applications are
# removed and some server-related groups and packages are added.
%packages
@admin-tools
@base
@core
@editors
@fonts
@gnome-desktop
@graphical-internet
@hardware-support
@online-docs
@sound-and-video
@system-tools
@text-internet
@base-x
system-config-network
mtools
iscsi-initiator-utils
gpgme
bridge-utils
jfsutils
hdparm
createrepo
lzop
radeontool
PackageKit-command-not-found
enca
ntpdate
xsel
fuse
virt-top
gdm
xfsprogs
-ModemManager
-NetworkManager
-NetworkManager-glib
-geoclue
-pywebkitgtk
-rhythbox
-webkitgtk
-brasero
-brasero-libs
-sound-juicer
-fetchmail
-totem
-totem-mozplugin
-totem-nautilus
-gstreamer-plugins-bad-free
-gnome-dvb-daemon
-gstreamer-plugins-base
-gnome-applets
-gstreamer-plugins-good
-gstreamer-python
-gstreamer-rtsp
-gnome-user-share
-httpd
-httpd-tools
-slv2
-jack-audio-connection-kit
-mobile-broadband-provider-info
-mutt
-procmail
-sendmail
-pulseaudio
-alsa-plugins-pulseaudio
-blueman
-bluez
-pulseaudio-module-bluetooth
-pulseaudio-utils
-samba-client
-samba-common
-samba-winbind-clients
-gvfs-smb
-libsmbclient
-schroedinger
-sox
-speex
-icedax
-libshout
-vorbis-tools
-xfce4-notifyd
-fedora-release-notes
-ccid
-coolkey
-unix2dos
-irda-utils
-wqy-zenhei-fonts
-lohit-assamese-fonts
-lohit-bengali-fonts
-lklug-fonts
-paratype-pt-sans-fonts
-kacst-book-fonts
-kacst-digital-fonts
-kacst-pen-fonts
-sil-abyssinica-fonts
-kacst-decorative-fonts
-jomolhari-fonts
-kacst-letter-fonts
-lohit-kannada-fonts
-khmeros-base-fonts
-paktype-tehreer-fonts
-kacst-titlel-fonts
-kacst-naskh-fonts
-vlgothic-fonts
-kacst-art-fonts
-kacst-poster-fonts
-lohit-gujarati-fonts
-paktype-naqsh-fonts
-thai-scalable-waree-fonts
-lohit-devanagari-fonts
-smc-meera-fonts
-kacst-office-fonts
-kacst-farsi-fonts
-kacst-one-fonts
-kacst-qurn-fonts
-lohit-telugu-fonts
-sil-padauk-fonts
-lohit-punjabi-fonts
-lohit-tamil-fonts
-kacst-title-fonts
-kacst-screen-fonts
-lohit-oriya-fonts
-cheese
-vinagre
-gok
-gnome-backgrounds
-compiz-gnome
-nautilus-sendto
-gnome-bluetooth
-deja-dup
-NetworkManager-pptp
-NetworkManager-openconnect
-NetworkManager-gnome
-gnote
-gnome-user-docs
-simple-scan
-gnome-games
-gnome-screensaver
-pulseaudio-module-x11
-gnome-pilot
-shotwell
-gvfs-gphoto2
-pulseaudio-module-gconf
-gnome-color-manager
-eog
-NetworkManager-openvpn
-NetworkManager-vpnc
-gdm-user-switch-applet
-mousetweaks
-brasero-nautilus
-caribou
-orca
-evolution
-empathy
-transmission-gtk
-evolution-help
-nspluginwrapper
-pino
-java-1.6.0-openjdk-plugin
-printer-filters
-ivtv-firmware
-openconnect
-NetworkManager-openconnect
-openldap-clients
-zisofs-tools
-BackupPC
-jigdo
-NetworkManager-openvpn
-NetworkManager-vpnc
-zsh
-bonnie++
-openswan
-system-config-printer
-setroubleshoot
-cups-pk-helper
 
### Script to setup partitions.
%pre --log=/tmp/ks-preinstall.log
 
#!/bin/sh
 
# Prepare the disks in the script below. It checks '/proc/partitions' to see
# what configuration to use.
 
### Some detection.
if grep -q "cciss/c0d0" /proc/partitions; then
	### No RAID is needed at the software level, it's managed by the controller.
cat >> /tmp/part-include <<END
zerombr
clearpart --linux --drives=cciss/c0d0
ignoredisk --only-use=cciss/c0d0
bootloader --location=mbr --driveorder=cciss/c0d0 --append=""
 
part     /boot --fstype ext3 --size=256   --asprimary
part     swap  --fstype swap --size=4096  --asprimary
part     /     --fstype ext3 --size=40960 --asprimary
END
elif grep -q "cciss/c1d0" /proc/partitions; then
	### No RAID is needed at the software level, it's managed by the controller.
cat >> /tmp/part-include <<END
zerombr
clearpart --linux --drives=cciss/c1d0
ignoredisk --only-use=cciss/c1d0
bootloader --location=mbr --driveorder=cciss/c1d0 --append=""
 
part     /boot --fstype ext3 --size=256   --asprimary
part     swap  --fstype swap --size=4096  --asprimary
part     /     --fstype ext3 --size=40960 --asprimary
END
elif grep -q hdb /proc/partitions; then
	### /dev/hdX RAID 1
cat >> /tmp/part-include <<END
zerombr
clearpart --all --initlabel --drives=hda,hdb
ignoredisk --only-use=hda,hdb
bootloader  --location=mbr --driveorder=hda,hdb
 
# /boot
part raid.01 --ondisk=sda --asprimary --size=256
part raid.02 --ondisk=sdb --asprimary --size=256
# /
part raid.11 --ondisk=sda --asprimary --size=40960
part raid.12 --ondisk=sdb --asprimary --size=40960
# <swap>
part raid.21 --ondisk=sda --asprimary --size=4096
part raid.22 --ondisk=sdb --asprimary --size=4096
 
# Format /boot and /.
raid /boot --fstype=ext3 --level=1 --device=md0 raid.01 raid.02
raid /     --fstype=ext3 --level=1 --device=md1 raid.11 raid.12
raid swap  --fstype=swap --level=1 --device=md2 raid.21 raid.22
END
elif grep -q hda /proc/partitions; then
	### /dev/hda single
cat >> /tmp/part-include <<END
zerombr
clearpart --linux --drives=hda
ignoredisk --only-use=hda
bootloader --location=mbr --driveorder=hda --append=""
 
part     /boot --fstype ext3 --size=256   --asprimary
part     swap  --fstype swap --size=4096  --asprimary
part     /     --fstype ext3 --size=40960 --asprimary
END
elif grep -q sdf /proc/partitions; then
	### /dev/sdX RAID - This should be the majority.
	# 6-Drive RAID 5 w/ 1 hot spare
cat >> /tmp/part-include <<END
zerombr
clearpart --all --initlabel --drives=sda,sdb,sdc,sdd,sde,sdf
ignoredisk --only-use=sda,sdb,sdc,sdd,sde,sdf
bootloader --location=mbr --driveorder=sda,sdb,sdc,sdd,sde,sdf --append=""
 
## This will create a 6-drive RAID 5 array.
# The '/boot' partition. A little nuts at 6x RAID 1 but meh, what else would I
# use the 256MB parts for?
part raid.01 --size=256 --ondisk=sda
part raid.02 --size=256 --ondisk=sdb
part raid.03 --size=256 --ondisk=sdc
part raid.04 --size=256 --ondisk=sdd
part raid.05 --size=256 --ondisk=sde
part raid.06 --size=256 --ondisk=sdf
 
# The swap partition. Set to RAID 5, so it's actually ~5GB. It's RAID'ed and
# not individual parts because a loss of swap can still brind down a system.
part raid.11 --size=1024 --ondisk=sda
part raid.12 --size=1024 --ondisk=sdb
part raid.13 --size=1024 --ondisk=sdc
part raid.14 --size=1024 --ondisk=sdd
part raid.15 --size=1024 --ondisk=sde
part raid.16 --size=1024 --ondisk=sdf
 
# This is the main '/' partition for 'dom0'. The remainder of the disk space
# will be hand-crafted into a RAID 5 partition post install for either DRBD or
# iSCSI.
part raid.21 --size=10240 --ondisk=sda
part raid.22 --size=10240 --ondisk=sdb
part raid.23 --size=10240 --ondisk=sdc
part raid.24 --size=10240 --ondisk=sdd
part raid.25 --size=10240 --ondisk=sde
part raid.26 --size=10240 --ondisk=sdf
 
# RAID configure.
raid /boot --fstype=ext3 --level=1 --spares=1 --device=md0 raid.01 raid.02 raid.03 raid.04 raid.05 raid.06
raid swap                --level=5 --spares=1 --device=md1 raid.11 raid.12 raid.13 raid.14 raid.15 raid.16
raid /     --fstype=ext4 --level=5 --spares=1 --device=md2 raid.21 raid.22 raid.23 raid.24 raid.25 raid.26
END
elif grep -q sde /proc/partitions; then
	### /dev/sdX RAID - This should be the majority.
	# 5-Drive RAID 5
cat >> /tmp/part-include <<END
zerombr
clearpart --all --initlabel --drives=sda,sdb,sdc,sdd,sde
ignoredisk --only-use=sda,sdb,sdc,sdd,sde
bootloader --location=mbr --driveorder=sda,sdb,sdc,sdd,sde --append=""
 
 
## This will create a 5-drive RAID 5 array.
# The '/boot' partition. A little nuts at 6x RAID 1 but meh, what else would I
# use the 256MB parts for?
part raid.01 --size=256 --ondisk=sda
part raid.02 --size=256 --ondisk=sdb
part raid.03 --size=256 --ondisk=sdc
part raid.04 --size=256 --ondisk=sdd
part raid.05 --size=256 --ondisk=sde
 
# The swap partition. Set to RAID 5, so it's actually ~5GB. It's RAID'ed and
# not individual parts because a loss of swap can still brind down a system.
part raid.11 --size=1024 --ondisk=sda
part raid.12 --size=1024 --ondisk=sdb
part raid.13 --size=1024 --ondisk=sdc
part raid.14 --size=1024 --ondisk=sdd
part raid.15 --size=1024 --ondisk=sde
 
# This is the main '/' partition for 'dom0'. The remainder of the disk space
# will be hand-crafted into a RAID 5 partition post install for either DRBD or
# iSCSI.
part raid.21 --size=10240 --ondisk=sda
part raid.22 --size=10240 --ondisk=sdb
part raid.23 --size=10240 --ondisk=sdc
part raid.24 --size=10240 --ondisk=sdd
part raid.25 --size=10240 --ondisk=sde
 
# RAID configure.
raid /boot --fstype=ext3 --level=1 --device=md0 raid.01 raid.02 raid.03 raid.04 raid.05
raid swap                --level=5 --device=md1 raid.11 raid.12 raid.13 raid.14 raid.15
raid /     --fstype=ext4 --level=5 --device=md2 raid.21 raid.22 raid.23 raid.24 raid.25
END
elif grep -q sdd /proc/partitions; then
	### /dev/sdX RAID - This should be the majority.
	# 4-Drive RAID 5
cat >> /tmp/part-include <<END
zerombr
clearpart --all --initlabel --drives=sda,sdb,sdc,sdd
ignoredisk --only-use=sda,sdb,sdc,sdd
bootloader --location=mbr --driveorder=sda,sdb,sdc,sdd --append=""
 
## This will create a 4-drive RAID 5 array.
# The '/boot' partition. A little nuts at 6x RAID 1 but meh, what else would I
# use the 256MB parts for?
part raid.01 --size=256 --ondisk=sda
part raid.02 --size=256 --ondisk=sdb
part raid.03 --size=256 --ondisk=sdc
part raid.04 --size=256 --ondisk=sdd
 
# The swap partition. Set to RAID 5, so it's actually ~8GB. It's RAID'ed and
# not individual parts because a loss of swap can still brind down a system.
part raid.11 --size=2048 --ondisk=sda
part raid.12 --size=2048 --ondisk=sdb
part raid.13 --size=2048 --ondisk=sdc
part raid.14 --size=2048 --ondisk=sdd
 
# This is the main '/' partition for 'dom0'. The remainder of the disk space
# will be hand-crafted into a RAID 5 partition post install for either DRBD or
# iSCSI.
part raid.21 --size=20480 --ondisk=sda
part raid.22 --size=20480 --ondisk=sdb
part raid.23 --size=20480 --ondisk=sdc
part raid.24 --size=20480 --ondisk=sdd
 
# RAID configure.
raid /boot --fstype=ext3 --level=1 --device=md0 raid.01 raid.02 raid.03 raid.04
raid swap                --level=5 --device=md1 raid.11 raid.12 raid.13 raid.14
raid /     --fstype=ext4 --level=5 --device=md2 raid.21 raid.22 raid.23 raid.24
END
elif grep -q sdc /proc/partitions; then
	### /dev/sdX RAID - This should be the majority.
	# 3-Drive RAID 5
cat >> /tmp/part-include <<END
zerombr
clearpart --all --initlabel --drives=sda,sdb,sdc
ignoredisk --only-use=sda,sdb,sdc
bootloader --location=mbr --driveorder=sda,sdb,sdc --append=""
 
## This will create a 3-drive RAID 5 array.
# The '/boot' partition. A little nuts at 6x RAID 1 but meh, what else would I
# use the 256MB parts for?
part raid.01 --size=256 --ondisk=sda
part raid.02 --size=256 --ondisk=sdb
part raid.03 --size=256 --ondisk=sdc
 
# The swap partition. Set to RAID 5, so it's actually ~4GB. It's RAID'ed and
# not individual parts because a loss of swap can still brind down a system.
part raid.11 --size=2048 --ondisk=sda
part raid.12 --size=2048 --ondisk=sdb
part raid.13 --size=2048 --ondisk=sdc
 
# This is the main '/' partition for 'dom0'. The remainder of the disk space
# will be hand-crafted into a RAID 5 partition post install for either DRBD or
# iSCSI.
part raid.21 --size=20480 --ondisk=sda
part raid.22 --size=20480 --ondisk=sdb
part raid.23 --size=20480 --ondisk=sdc
 
# RAID configure.
raid /boot --fstype=ext3 --level=1 --device=md0 raid.01 raid.02 raid.03
raid swap                --level=5 --device=md1 raid.11 raid.12 raid.13
raid /     --fstype=ext4 --level=5 --device=md2 raid.21 raid.22 raid.23
END
elif grep -q sdb /proc/partitions; then
	### /dev/sdX RAID - This should be the majority.
	# 2-Drive RAID 1
cat >> /tmp/part-include <<END
zerombr
clearpart --all --initlabel --drives=sda,sdb
ignoredisk --only-use=sda,sdb
bootloader  --location=mbr --driveorder=sda,sdb
 
# /boot
part raid.01 --ondisk=sda --asprimary --size=256
part raid.02 --ondisk=sdb --asprimary --size=256
# /
part raid.11 --ondisk=sda --asprimary --size=40960
part raid.12 --ondisk=sdb --asprimary --size=40960
# <swap>
part raid.21 --ondisk=sda --asprimary --size=4096
part raid.22 --ondisk=sdb --asprimary --size=4096
 
# Format /boot and /.
raid /boot --fstype=ext3 --level=1 --device=md0 raid.01 raid.02
raid /     --fstype=ext3 --level=1 --device=md1 raid.11 raid.12
raid swap  --fstype=swap --level=1 --device=md2 raid.21 raid.22
END
elif grep -q sda /proc/partitions; then
	### /dev/sda Single drive, or hardware RAID
cat >> /tmp/part-include <<END
zerombr
clearpart --linux --drives=sda
ignoredisk --only-use=sda
bootloader --location=mbr --driveorder=sda --append=""
 
part     /boot --fstype ext3 --size=256   --asprimary
part     swap  --fstype swap --size=4096  --asprimary
part     /     --fstype ext3 --size=40960 --asprimary
END
fi
 
%end

 

Any questions, feedback, advice, complaints or meanderings are welcome.
Us: Alteeve's Niche! Support: Mailing List IRC: #clusterlabs on Freenode   © Alteeve's Niche! Inc. 1997-2019
legal stuff: All info is provided "As-Is". Do not use anything here unless you are willing and able to take responsibility for your own actions.
Personal tools
Namespaces

Variants
Actions
Navigation
projects
Toolbox