Kickstart for BL10e
Updated April 10, 2002
Created April 10, 2002
#Generated by Kickstart Configurator
#Note - Installation Instructions
#Note -
#Note - Modify the bootnet.img floppy so that it either points to ks.cfg on a nfs share,
#Note - or put ks.cfg in the root of the floppy, or put ks.cfg in the /tmp folder in the
#Note - initrd.img file of bootnet.img.
#Note -
#Note - Download site:
#Note - http://www.cpqlinux.com/
#Note -
#Note - Give the bootnet image to the PXE Server if PXE installing.
#Note -
#Note - Create a floppy from the image if booting from USB floppy, example:
#Note -
#Note - linux: dd if=bootnet.img of=/dev/fd0 bs=18k,
#Note - windows: [RH CD]\dosutils\rawrite.exe bootnet.img A:
#Note -
#Note - Note: When booting a floppy image, the floppy may be removed
#Note - anytime after the first two lines complete:
#Note - loading initrd.img..........
#Note - loading vmlinuz.............
#Note -
#Note - What gets installed:
#Note - This automated process (Red Hat Kickstart Installation) installs
#Note - the following major components:
#Note - Red Hat 7.2 - (shipping boxed version)
#Note - +Gnome GUI Interface
#Note - +Kernel Development
#Note - +Netscape
#Note - +openssh
#Note - +vnc
#Note - Health Driver - (latest version from www.compaq.com)
#Note - Foundation Agents - (latest version from www.compaq.com)
#Note - Server Agents - (latest version from www.compaq.com)
#Note - Storage Agents - (latest version from www.compaq.com)
#Note - NIC Agents - (latest version from www.compaq.com)
#Note - Survey - (latest version from www.compaq.com)
#Note -
#Note - Please note that this install script uses the latest software versions
#Note - available at time of install. This means that two different installations
#Note - have the possibility of different software versions being installed.
#Note -
#Note - How can I see what versions of software are installed?
#Note - rpm -qa | grep cma
#Note - rpm -qa | grep cpq
#Note - rpm -qa | grep survey
#Note -
#Note - What Features or Modifications are there?
#Note - Survey init script gets installed (not part of survey package)
#Note - Configures to use the e100 driver instead of the eepro100 driver
#Note - Allows for easy installation of more packages using "mount /mnt/install".
#Note - Date and Time get automatically set during install (uses ntp multicast too)
#Note - Sets up SSH Server for remote access
#Note - Sets up VNC Server for remote access (now removes VNC locks on startup, runs gnome in 800x600)
#Note - Sets up the Serial Console for the BL10e
#Note - Gives overall PASS/FAIL after installation (still under construction)
#Note - Shortened boot timer to 1 second for quick boot times
#Note -
#Note - What Access Methods are Available to Me?
#Note -
#Note - OpenSSH Session:
#Note - ssh ip_addr
#Note -
#Note - VNC Session:
#Note - vncviewer ip_addr:1
#Note - or
#Note - http://ip_addr:5801
#Note -
#Note - Mgmt Session:
#Note - http://ip_addr:2301
#Note - or
#Note - Point the CIM Console to the ip_addr
#Note -
#Note - I am running X-Windows locally, can I run a program on the server and display it locally?
#Note -
#Note - ex 1:
#Note - ssh ip_address "cpqimlview"
#Note -
#Note - ex 2:
#Note - ssh ip_address
#Note - cpqimlview
#Note -
#Note - ex 3:
#Note - xhost +
#Note - ssh/telnet ip_address
#Note - export DISPLAY=MyClientIP:0
#Note - cpqimlview
#Note -
#Note - More Notes:
#Note -
#Note - IP Addresses Used:
#Note -
#Note - mylinuxserver = nfs server which has the RH72 files and is a ntp server (time server)
#Note -
#Note - I have put a #####MODIFY next to each of the sections you may need to check/change.
#Note -
lang en_US
langsupport --default en_US en_US
keyboard us
mouse --emulthree genericps/2
timezone --utc America/Chicago
#####MODIFY - set your root password here, can use "--iscrypted" to hide your password here.
rootpw password
#reboot
text
#####MODIFY - you can choose which style boot loader here
#To Use LILO, use the following command, more changes below
#bootloader --useLilo --linear --location=mbr
#To Use GRUB, use the following command, more changes below
bootloader --location=mbr
install
#####MODIFY - be sure to list your nfs server and directory here
nfs --server mylinuxserver --dir /var/ftp/pub/rh72boxed/i386
clearpart --all --initlabel
network --bootproto dhcp
auth --useshadow --enablemd5
firewall --disabled
xconfig --depth 16 --resolution 800x600 --defaultdesktop=GNOME --card "ATI Rage XL" --videoram 4096 --monitor "PC Brand Super_VGA"
part /boot --fstype ext3 --size 60 --asprimary
part swap --size 1024
part / --fstype ext3 --size 2700 --grow
%pre
##
##Notify user they may remove their floppy, wait 5 seconds for user to see message, then continue. (This is before installation)
##
(
for X in 1 2 3 4 5; do echo; done
echo -e "\033[1;32m************************************\033[0;39m"
for X in 1 2 3 4 5; do
echo -e "\033[1;32m** You may now remove your floppy **\033[0;39m"
done
echo -e "\033[1;32m************************************\033[0;39m"
for X in 1 2 3 4 5; do echo; done
)>/dev/tty1
sleep 5
%packages
@GNOME
@Network Support
@Utilities
@Kernel Development
netscape-common
netscape-navigator
openssh-server
openssh-askpass-gnome
openssh-askpass
vnc
vnc-server
linuxconf
expect
tclx
%post
#####MODIFY - do you need to use a proxy server?
# The following is needed if you must us a proxy server
#export http_proxy=proxy.myproxy.com:8080
##
##Notify user they may remove their floppy. This is at beginning of POST installation - stays on screen through entire POST install.
##
(
for X in `seq 1 25`; do echo -e "\r"; done
echo -e "\r"
for X in 1 2 3 4 5; do echo; done
echo -e "\033[1;32m************************************\033[0;39m\r"
for X in 1 2 3 4 5; do
echo -e "\033[1;32m** You may now remove your floppy **\033[0;39m\r"
done
echo -e "\033[1;32m************************************\033[0;39m\r"
echo -e "\r"
)>/dev/tty1
##
##Give message stating that POST install may take a while.
##
echo -e "The POST install may take a while to complete, final status will show up here when POST install is completed\r" >/dev/tty1
echo -e "Please wait for the final OK prompt...\r" >/dev/tty1
PRODUCT=BL10e
##
## Automatically set current date and time. Configure to run ntp service.
##
cd /etc
(cat ntp.conf |
for X in \
mylinuxserver \
; do
grep -v $X;
echo server $X;
done
)| sed -e 's,^#multicastclient,multicastclient,' >/etc/ntp.conf.1
mv /etc/ntp.conf.1 /etc/ntp.conf
(cat /etc/ntp.conf | grep "^server" | awk '{print $2}' | tr "\n" " " | sed -e 's, *$,,'; echo )> /etc/ntp/step-tickers
chkconfig --level 2345 ntpd on
ps ax | grep -v grep | grep ntpd || (service ntpd start; hwclock --utc --systohc; service ntpd stop)
##
## Get a Date Stamp variable for use in this script.
##
DATE_STAMP="`date`"
##
## Turn on sshd during installation. Also configure to run at boot time. Show our ip address.
##
chkconfig --level 2345 sshd on
service sshd start
echo -e "IP Addr: `ifconfig eth0 | grep inet | awk '{print $2}' | sed -e 's,^.*addr:,,'`\r" >/dev/tty1
##
## Modify /etc/fstab for easy mounting of install directory
## in case more packages need to be installed. Set up for
## NFS, soft mount, no auto mount.
##
mkdir /mnt/install
cat <<EOF>>/etc/fstab
mylinuxserver:/var/ftp/pub/rh72boxed/i386 /mnt/install nfs soft,noauto 0 0
EOF
##
## Starting VNC server for root at boot time. Access by using vncviewer or ip_addr:5801
##
#####MODIFY - you should put your vnc password here. you can always set up your password for VNC later though. TIP: (cat .vnc/passwd | xxd -g 1)
su -c "cd; mkdir .vnc; echo -ne \"\x21\xad...PutYourCorrectConvertedPasswordInTheseQuotes...\x89\" > .vnc/passwd; chmod 0600 .vnc/passwd"
echo "VNCSERVERS=\"1:root\"" >> /etc/sysconfig/vncservers
chkconfig --level 2345 vncserver on
#Fixing rc.sysinit to remove VNC locks
cat /etc/rc.d/rc.sysinit | awk '{gsub("rm -f /tmp/\\.X\\*-lock","rm -f /tmp/.X*-lock\n\n# Delete VNC locks\nrm -rf /tmp/.X*-unix"); print}' >/etc/rc.d/rc.sysinit.1; cat /etc/rc.d/rc.sysinit.1 >/etc/rc.d/rc.sysinit; rm -f /etc/rc.d/rc.sysinit.1
#Fixing /etc/rc.d/init.d/vncserver so that it starts 800x600 sessions
cat /etc/rc.d/init.d/vncserver | awk '{gsub("vncserver :\\${display%%:\\*}\\\\\"\"","vncserver :${display%%:*} -geometry 800x600\\\"\""); print}' >/etc/rc.d/init.d/vncserver.1; cat /etc/rc.d/init.d/vncserver.1 >/etc/rc.d/init.d/vncserver; rm -f /etc/rc.d/init.d/vncserver.1
#Making gnome the default window manager for vnc rather than "twm"
cat /usr/bin/vncserver | sed -e 's,"twm &\\n");,"gnome-session \&\\n");,g' > /tmp/vncserver.tmp; cat /tmp/vncserver.tmp >/usr/bin/vncserver; rm -f /tmp/vncserver.tmp
##
## Shorten boot timer
##
if [ -f /etc/lilo.conf ]; then
cat /etc/lilo.conf | sed -e 's,timeout=50,timeout=10,' >/tmp/lilo.conf.1
cat /tmp/lilo.conf.1 >/etc/lilo.conf
rm /tmp/lilo.conf.1
/sbin/lilo
fi
if [ -f /boot/grub/grub.conf ]; then
cat /boot/grub/grub.conf | sed -e 's,timeout=10,timeout=1,' >/tmp/grub.conf.1
cat /tmp/grub.conf.1 >/boot/grub/grub.conf
rm /tmp/grub.conf.1
fi
##
## Download some useful scripts
##
#mkdir /scripts
#cd /scripts
#for X in \
#cpqhealth_agents_install.sh \
#cpqhealth_agents_remove.sh \
#; do
#wget -N ftp://mylinuxserver/pub/scripts/$X
#done
##
## Use e100 instead of eepro100
##
cat /etc/modules.conf | sed -e 's,eepro100,e100,' > /etc/modules.conf.1
mv /etc/modules.conf.1 /etc/modules.conf
##
## Download Health, Agents, and Survey
##
#
# Preparation
#
mkdir /tmp/download
cd /tmp/download
# If a value is empty then skip it
if [ -z "${!X}" ]; then continue; fi
# Point to and download the "locate" page to locate the latest version of the driver
REDIRECT=${!X}.html
wget http://www.compaq.com/support/files/server/us/locate/$REDIRECT
# Point to and download the web page for the latest version of the driver
REDIRECT_TO=`cat $REDIRECT | grep URL | sed -e 's,^.*URL=\.\./download/,,' -e 's,".*$,,'`
wget http://www.compaq.com/support/files/server/us/download/$REDIRECT_TO
# DOWNLOAD should result in being just one URL to the English version of the driver.
DOWNLOAD="`(cat $REDIRECT_TO | sed --silent '/<noscript>/,/<\/noscript>/p' | awk 'BEGIN {keep=0} /<a href=/{keep=1} /<\/a>/{print; keep=0}; {if(keep == 1){print}}' | sed -e 's,^ *,,' -e 's, *$,,' | tr -d '\n\r'; echo) | awk '{gsub("\</a\>","\</a\>\n"); print}' | grep -v Japanese | grep ftp | sed -e 's,^.*ftp://,ftp://,' -e 's,".*$,,'`"
# This sets up a variable such as HEALTH_DL, FDTN_DL, ... for later installation
export ${X}_DL=`echo $DOWNLOAD | sed -e 's,^.*ftp://,,' -e 's,".*$,,' -e 's,^.*/,,'`
# Download latest driver now
wget --passive-ftp `echo $DOWNLOAD | sed -e 's,^.*"ftp://,ftp://,' -e 's,".*$,,'`
# Cleanup
rm $REDIRECT
rm $REDIRECT_TO
done
for X in $DRIVER_LIST; do
# If a value is empty then skip it
if [ -z "${!X}" ]; then continue; fi
# Y will run through each ..._DL entry.
Y=${X}_DL
# For now, lets print out the value of Y and also do a file listing of Y
echo ${Y} = ${!Y} >> files.txt
ls -ltr ${!Y} >> files.txt
rpm -hUv ${!Y}
done
#
# Unpacking ...
#
for X in *.tgz; do
echo
echo Unpacking $X..........
tar -xzvf $X
done
AGENT_LIST=""
for X in fdtn svr stor nic; do
AGENT_LIST="$AGENT_LIST `ls | grep ^cma.*rpm$ | grep $X`"
done
#
# Installs using RPM...
#
for X in $HEALTH_DL $AGENT_LIST `ls | grep ^survey.*rpm$`; do
echo
echo Installing $X.........
rpm -hUv $X
done
##
## Install Survey init file
##
#Note - No startup script for survey provided, providing my own!
cat <<EOF>/etc/rc.d/init.d/survey
#!/bin/bash
#
# /etc/rc.d/init.d/survey
#
# Starts the survey daemon
#
# chkconfig: 345 99 1
# description: Run the compaq survey daemon
# processname: survey
# Source function library.
. /etc/init.d/functions
##
## Configure LILO/GRUB to show Linux Boot Sequence on both the Serial Console (ttyS0) and Screen #1 (tty1)
##
if [ -f /etc/lilo.conf ]; then
DEFAULT=`cat /etc/lilo.conf | grep default`
cat /etc/lilo.conf | awk "{gsub(\"$DEFAULT\",\"$DEFAULT\nappend=\\\"console=ttyS0,115200 console=tty1\\\"\"); print}" >/etc/lilo.conf.1
mv /etc/lilo.conf.1 /etc/lilo.conf
/sbin/lilo
fi
if [ -f /boot/grub/grub.conf ]; then
cat /boot/grub/grub.conf | awk '{if ($1 ~ /kernel/){print $0 " console=ttyS0,115200 console=tty1"} else {print}}' > /boot/grub/grub.conf.1
mv /boot/grub/grub.conf.1 /boot/grub/grub.conf
fi
##
## Do KUDZU serial fix by making serial port "safe" (SAFE=yes)
##
cat /etc/sysconfig/kudzu | grep -i "^safe=yes" >/dev/null || ( (cat /etc/sysconfig/kudzu | grep -vi "^safe="; echo SAFE=yes) >>/etc/sysconfig/kudzu.new; mv /etc/sysconfig/kudzu.new /etc/sysconfig/kudzu)
##
## Show login prompt on serial port
##
cat /etc/inittab | awk '{gsub("6:2345:respawn:/sbin/mingetty tty6","6:2345:respawn:/sbin/mingetty tty6\n7:2345:respawn:/sbin/agetty 115200 ttyS0 vt100"); print}' >> /etc/inittab.new
mv /etc/inittab.new /etc/inittab
##
## Allow root to login on the serial port
##
cat /etc/securetty | grep "^ttyS0" >/dev/null || echo ttyS0 >> /etc/securetty
#END prevnextindexNEW! Search this Site!: