# ***************************************************************************** # Warning, this file is autogenerated from the associated .src. Do not edit !!! # ***************************************************************************** # Server autopart Kickstart # See file:///software/redhat/9/RH-DOCS/rhl-cg-en-9/s1-kickstart2-options.html # 2003/08/08 v1.0 #System language lang en_US #Language modules to install langsupport --default en_US fr_FR #System keyboard keyboard us # mouse (could be autodetected if we omit the specification) mouse msintellips/2 #System timezone timezone --utc America/Los_Angeles #Reboot after installation reboot #Use text mode install text # Forcing a DPT card over onboard AIC SCSI if it crashes the machine # (boot with noprobe on the command line) #device scsi dpt_i2o #Use interactive kickstart installation method # Ok, there's a bug in anaconda: interactive with no partitioning will fail # However non interactive with no partitioning seems to work -- Marc #interactive #System bootloader configuration bootloader --location=mbr #Install Red Hat Linux instead of upgrade install #Clear the Master Boot Record zerombr yes #Use DHCP networking network --bootproto dhcp --device=eth0 #System authorization information auth --useshadow --enablemd5 --enableldap --ldapserver=ldap.corp.company.com --ldapbasedn=dc=google,dc=com --enableldapauth #Firewall configuration #firewall --medium firewall --disabled # Where we get the distro from # Special hack load grhat machines from (potentially) another filer than # the main one url --url http://apt/rhbase/9/ # Root password # If you update this, you should also update 20030512_1911_PwdSudo_Srv rootpw --iscrypted "$1$aaaaaaaa$vvvvvvvvvvvvvvvvvvvvvv" # Clear all partitions from the first disk (see %pre) %include /tmp/clearpart # One disk config part / --fstype ext3 --size 1000 --asprimary part /safe --fstype ext3 --size 1000 --asprimary part swap --fstype swap --size 2000 part /usr --fstype ext3 --size 8000 part pv.01 --fstype ext3 --size 17000 --grow # LVM configuration so that we can resize /var and /usr/local later volgroup sysvg pv.01 # There is a bug in the RH installer if you create an LV that's too big. # You'll need to grow it later logvol /usr/local --vgname=sysvg --size -1 --grow --maxsize=50000 --name=usrlocal logvol /var --vgname=sysvg --size=8000 --name=var # This is a bogus partition to create a space buffer in case the drive is small # and /usr/local took all the remaining space logvol /freespacetouse --vgname=sysvg --size=8000 --name=freespacetouse skipx %packages --resolvedeps #@Windows File Server #@DNS Name Server #@FTP Server #@SQL Database Server #@News Server @Text-based Internet @Authoring and Publishing @Server Configuration Tools @Web Server @Mail Server @Network Servers @Development Tools @Kernel Development @Administration Tools @System Tools @Printing Support @X Software Development @Editors # Those are kind of useful and may not be installed by default on servers # installs. Yep, some may pull a bunch of dependencies rsync ethereal ethereal-gnome # Config Tools, handy for those not familiar with RH redhat-config-users redhat-config-network redhat-switch-printer # xauth and other X11 clients one might want XFree86 # You need vim/gvim, you just do :) vim-X11 vim-enhanced # kerberos gnome-kerberos krb5-workstation # Misc openldap-clients hwbrowser mc redhat-lsb mysql-devel # Why is this not already pulled by the install? They are so useful... lynx elinks nc zsh sash gv vnc-server vnc # All perl modules perl-Archive-Tar perl-Bit-Vector perl-BSD-Resource perl-CGI perl-Compress-Zlib perl-CPAN perl-Crypt-SSLeay perl-Date-Calc perl-DateManip perl-DBD-MySQL perl-DBD-Pg perl-DB_File perl-DBI perl-Devel-Symdump perl-Digest-HMAC perl-Digest-SHA1 perl-File-MMagic perl-Filter perl-Filter-Simple perl-Frontier-RPC perl-HTML-Parser perl-HTML-Tagset perl-Inline perl-libwww-perl perl-libxml-enno perl-libxml-perl perl-Net-DNS perl-NKF perl-Parse-RecDescent perl-Parse-Yapp perl-PDL perl-RPM2 perl-SGMLSpm perl-suidperl perl-TermReadKey perl-Text-Kakasi perl-TimeDate perl-Time-HiRes perl-URI perl-XML-Dumper perl-XML-Encoding perl-XML-Grove perl-XML-Parser perl-XML-Twig ImageMagick-perl # compat stuff # db3 compat-db # I scanned all the uninstalled RH9 RPMS and figured those could be useful -Marc busybox dictd dmalloc ElectricFence expect expect-devel expectk festival festival-devel ftpcopy gd-progs hexedit ImageMagick-c++ ImageMagick-c++-devel ImageMagick-devel iptables-ipv6 iptraf kernel-utils kinput2-canna-wnn6 knm_new libungif-progs lm_sensors-devel lslk lv mdadm mgetty mtx ncftp ncompress nkf nmh open openssl096 openssl096b pmake procinfo python-docs python-optik python-tools readline41 recode recode-devel subversion symlinks sysreport sysstat tftp tftp-server tree unarj usbview words # vim:set syntax=sh: %pre # Bad magic to create initlabel regardless of IDE or SCSI, for one drive # installs or raid 1 two drive installs if [ `cat /proc/partitions | grep 'hda ' | wc -l` -gt 0 ]; then echo "clearpart --drives=hda --initlabel" > /tmp/clearpart echo "clearpart --drives=hda,hdc --initlabel" > /tmp/clearpart.dual echo "IDE drive detected" elif [ `cat /proc/partitions | grep 'sda ' | wc -l` -gt 0 ]; then echo "clearpart --drives=sda --initlabel" > /tmp/clearpart echo "clearpart --drives=sda,sdb --initlabel" > /tmp/clearpart.dual echo "SCSI drive detected" else chvt 3 for i in 1 2 3 4 5 6 do echo "Fatal error: can't detect ide or scsi from /proc/partitions (pause $i out of 6)" cat /proc/partitions sleep 10 done echo "Warning: installation continuing without clearpart, results are unpreditible" fi # The RH installer should do that for us, but I'll leave this here just in case #if ! lsmod | grep -q nfs; then # echo "Trying to load NFS support for getupdates install logging" # cd /tmp # zcat /modules/modules.cgz | cpio -i # cd *BOOT # insmod ./sunrpc.o # insmod ./lockd.o # insmod ./nfs.o # cd .. # rm -rf *BOOT #else # echo "NFS support loaded, getupdates can use that, nothing to do..." #fi #vim:set syntax=sh:sw=4:sts=4: # anaconda will kill post if it takes too long or seems to hang (not quite # sure what algorithm they use). Since getupdates can possibly hang if one # of the updates in there is buggy, make sure that everything that needs # to get run shows up before that -- Marc %post cd /; /bin/mv /tmp /var/tmp; ln -s var/tmp/tmp tmp PATH=/usr/local/scripts:/bin:/sbin:/usr/bin:/usr/sbin:$PATH LOG=/tmp/post.log CMDLINE=/proc/cmdline # For debugging, we can read from a file too CMDLINE2=/tmp/cmdline touch $CMDLINE2 chvt 3 # ugly trick to send stdout and stderr to the log file and see them # on the screen exec 3>&1 >$LOG 2>&1 tail -f $LOG >&3 & log () { DATE=`date "+%Y/%m/%d %H:%M:%S ($$)"` echo "$DATE: $1" } die () { DATE=`date "+%Y/%m/%d %H:%M:%S ($$)"` echo "$DATE DIE: $1" # Let the admin log in and figure out what's happening before the reboot /etc/init.d/sshd start sleep $2 /etc/init.d/sshd stop # In case $2 is 0, we need 1 sec for tail to pick up the message sleep 1 test -d /auto/software && umount /auto/software [ -x /etc/init.d/sshd ] && /etc/init.d/sshd stop killall tail exit 1 } mkdir -p /auto/software # If we are debugging, we run this more than once test -e /software || ln -s /auto/software /software [ -x /etc/init.d/sshd ] && /etc/init.d/sshd start log "=== Start Postinstall ===" mkdir /usr/local/scripts mkdir /var/lib/grhat # create file so that corphost knows a fresh install when it sees it touch /var/lib/grhat/.corphost_newinstall > /etc/sysconfig/getupdates # Lets you specify the domain if you need to with !! instead of the whole # thing (saves on the characters in the char buffer for kernel arguments DOMAIN=corp.company.com # Those variables are used both here and inside getupdates once the machine # is up and running, so we read them here and save their values in # /etc/sysconfig/getupdates if they are non default # TARGET is something like wksgold # NFS loads are made from $NFSHOST:/$NFSUPDPATH/$TARGD/ # HTTP loads are made from http://$HTTPUPDPATH/$TARGD/ # PROTOCOL defaults to http but you can set to nfs for VAR in TARGET NFSHOST NFSUPDPATH HTTPUPDPATH TARGD PROTOCOL do var=`echo $VAR | sed 's/\(.*\)/\L\1/'` VALUE=`cat $CMDLINE $CMDLINE2 | grep "$var=." | tail -1 | sed -e "s/.*$var=//" -e "s/ .*//" -e "s/\!\!/$DOMAIN/"` if [ z"$VALUE" != z ]; then eval `echo "$VAR=$VALUE"` log "Got $VAR=$VALUE from kernel command line" echo "$VAR=$VALUE" >> /etc/sysconfig/getupdates else log "Didn't get $VAR from kernel command line" fi done if [ -z "$TARGET" ]; then # Note that because of our krb setup, if the install dies in the wrong # place (and that window is big), it is likely that sshd will not # let you log in afterall. Oh well... die "target= not given on kernel command line, fatal, rebooting in 10mn" 600 fi [ -z "$TARGD" ] && TARGD="/grhat/targets" if [ -z "${PROTOCOL}" ]; then # Little trick to make PROTOCOL default to the one used to retreive the # kickstart image (which doesn't mean you can't kickstart from http and # install from NFS: just set PROTOCOL in that case) PROTOCOL=`cat $CMDLINE $CMDLINE2 | grep 'ks=.' | tail -1 | sed -e "s/.*ks=//" -e "s/:.*//"` if [ -z "${PROTOCOL}" ]; then log "LOGWARNING: Couldn't read protocol from cmdline, defaulting to http" PROTOCOL=http else log "Assumed PROTOCOL $PROTOCOL from ks kernel command line" fi if [ "$PROTOCOL" != nfs -a "$PROTOCOL" != http ]; then die "Fatal: No support for protocol $PROTOCOL, rebooting in 10mn" 600 fi # This one, we want in the config file no matter what (we won't write # all the other values if they are default) echo "PROTOCOL=$PROTOCOL" >> /etc/sysconfig/getupdates fi # If you do multiple runs during debugging, those are already present # and immutable chattr -i /var/lib/grhat/funcs /usr/local/scripts/getupdates /usr/local/bin/shlock 2>/dev/null if [ "$PROTOCOL" = http ]; then if [ -z "$HTTPUPDPATH" ]; then HTTPUPDPATH="http://apt/" log "httpupdpath unset in kernel command line" log "defaulting to $HTTPUPDPATH" fi BASETREE="$HTTPUPDPATH/$TARGD/$TARGET/links/" KERMODTREE="$HTTPUPDPATH/$TARGD/../ks.cfg/modules/`uname -r`/" log "Got httpupdpath from kernel command line" log "Retreiving updates from $BASETREE" pushd /tmp file=shlock; wget $BASETREE/$file; mv $file /usr/local/bin file=getupdates; wget $BASETREE/$file; mv $file /usr/local/scripts file=funcs; wget $BASETREE/$file; mv $file /var/lib/grhat popd # The RH installer should do that for us, but I'll leave this here # just in case if ! /sbin/lsmod | grep -q nfs; then log "Trying to load NFS support for getupdates install logging" file=sunrpc.o; wget $KERMODTREE/$file; /sbin/insmod -f $file file=lockd.o; wget $KERMODTREE/$file; /sbin/insmod -f $file file=nfs.o; wget $KERMODTREE/$file; /sbin/insmod -f $file else log "NFS support loaded, getupdates can use that" fi else if [ -z "$NFSHOST" -o -z "$NFSUPDPATH" ]; then NFSHOST=software.nfs NFSUPDPATH=/software log "nfshost and/or nfsswpath unset in kernel command line" log "defaulting to NFS from $NFSHOST:$NFSUPDPATH" fi BASETREE=/auto/software/$TARGD/$TARGET/links/ log "Retreiving updates from $BASETREE via NFS" mount -o ro,nolock $NFSHOST:$NFSUPDPATH /auto/software cp $BASETREE/shlock /usr/local/bin cp $BASETREE/funcs /var/lib/grhat/funcs cp $BASETREE/getupdates /usr/local/scripts fi chmod 755 /var/lib/grhat/funcs /usr/local/scripts/getupdates /usr/local/bin/shlock # This is for getupdates to know the files came from us, not RH chattr +i /var/lib/grhat/funcs /usr/local/scripts/getupdates /usr/local/bin/shlock if ! /usr/local/scripts/getupdates --firstload; then die "getupdates exited with error code, rebooting in 10mn" 600 fi echo test -d /auto/software && umount /auto/software log "=== Post Install Done ===" [ -x /etc/init.d/sshd ] && /etc/init.d/sshd stop # Give time to tail so that it can get and display its output sleep 1 killall tail #service registerhost start_noreboot