Rev 72 | Go to most recent revision | Blame | Last modification | View Log | Download | RSS feed
#!/bin/bash## Fix things during bootup - run first# Executed at the very end of /etc/rc.d/rc.sysinit## Urs Beyerle, PSI#### -----------------------------------------------------------### definitions### -----------------------------------------------------------# dir of mounted /$MOUNTDIR/liveMOUNTDIR=livecd# source functions. /$MOUNTDIR/live/liblinuxlive. /etc/init.d/functions### -----------------------------------------------------------### Get boot parameters### -----------------------------------------------------------# start afs?AFS=$( cmdline_parameter afs )CELL=$( cmdline_value cell )# or force no afs[ $( cmdline_parameter noafs ) ] && AFS=""# start ssh server?SSH=$( cmdline_parameter ssh )# root on NFS?NFSROOT=$( cmdline_value nfsroot )# PSI setup?PSI=$( cmdline_parameter psi )# do not start networkNONET=$( cmdline_parameter nonet )# Are PXE/TFTP and NFS Server the same host ? not uesed any moreONEMASTER=$( cmdline_parameter onemaster )# fast booting ?FASTBOOT=$( cmdline_parameter fastboot )# if run=rdesktop, we do fast bootif [ "$( cmdline_value run )" = "rdesktop" ]; thenFASTBOOT="fastboot"fi# start ntpd ?NTPD=$( cmdline_parameter ntpd )# services on/offSERVICEON=$( cmdline_value serviceon )SERVICEOFF=$( cmdline_value serviceoff )### -----------------------------------------------------------### Main### -----------------------------------------------------------### disable rpcidmapd, if LiveCD mounted over NFSif [ $NFSROOT ]; thenchkconfig rpcidmapd offfi### restore blacklist (modified in runveryfirst)if [ $NFSROOT ]; then[ -e /etc/hotplug/blacklist ] && BLACKLIST_FILE=/etc/hotplug/blacklist[ -e /etc/modprobe.d/blacklist ] && BLACKLIST_FILE=/etc/modprobe.d/blacklistmv -f ${BLACKLIST_FILE}.backup ${BLACKLIST_FILE}fi### get resolv.conf# if we have the LiveCD mounted over NFSif [ $NFSROOT ]; thencp -f /$MOUNTDIR/live/etc/resolv.conf /etc/fi### disable shutdown of network and nfs,# if we have the LiveCD mounted over NFSif [ $NFSROOT ]; thenif [ $ONEMASTER ]; then# "network off" is only necessary,# if PXE/TFTP and NTS server is on same machinechkconfig network offfirm -f /etc/rc.d/rc6.d/K75netfsrm -f /etc/rc.d/rc6.d/K86nfslockrm -f /etc/rc.d/rc6.d/K87portmaprm -f /etc/rc.d/rc6.d/K90networkrm -f /etc/rc.d/rc0.d/K75netfsrm -f /etc/rc.d/rc0.d/K86nfslockrm -f /etc/rc.d/rc0.d/K87portmaprm -f /etc/rc.d/rc0.d/K90networkfi### create AFS mount pointmkdir -p /afs### enable AFS during start up, if given by boot parameterif [ $AFS ]; thenchkconfig afs onfi### disable some services for fast bootingif [ $FASTBOOT ]; thenecho "Fast booting enabled"chkconfig vpnclient_init offchkconfig haldaemon offchkconfig pcmcia offchkconfig ntpd offchkconfig atd offchkconfig cpuspeed offchkconfig gpm offchkconfig messagebus offrm -rf /etc/rc.d/rc3.d/S04kudzu-autorm -rf /etc/rc.d/rc5.d/S04kudzu-autofi### enable ntpd?if [ $NTPD ]; thenchkconfig ntpd onfi### enable SSH server during start up, if given by boot parameterif [ $SSH ]; thenchkconfig sshd onfi### services onif [ -n $SERVICEON ]; thenfor service in `echo "$SERVICEON" | tr ':' ' '`; doif [ -f /etc/init.d/$service ]; thenchkconfig $service onfidonefi### services offif [ -n $SERVICEOFF ]; thenfor service in `echo "$SERVICEOFF" | tr ':' ' '`; doif [ -f /etc/init.d/$service ]; thenchkconfig $service offfidonefi### fix perm of /tmpchmod 1777 /tmp### link /opt -> /usr/opt !ln -s /usr/opt /opt### create homemkdir -p /home### create /scratchmkdir -p /scratchchmod 1777 /scratch### create /dataif [ $PSI ]; thenmkdir -p /datachmod 1777 /datafi### add PSI masterif [ $PSI ]; thenmkdir -p /mnt/masterecho "pxeserv01:/master /mnt/master nfs nfsvers=2,noauto,nolock,ro 0 0" >> /etc/fstabfi### set afs cell, if given by boot parameterif [ $CELL ]; thenecho $CELL > /usr/vice/etc/ThisCellfi