#! /bin/csh -f # # script for setting up "graphics3" # # # install RedHat 7.3 # Mouse: Generic 5-button # Custom # Partition with 3x2048 swaps, "/boot"=100MB and rest in "/" # use LILO # install "Everything" # graphical login # copy the root passwordless login info tcsh ssh root@192.168.1.1 "tar cf - .ssh .ssh2" | tar xvf - # should have to enter password here # doing this for the first time? # F-secure ssh-keygen2 echo "Key id_dsa_2048_a.pub" > .ssh2/authorization echo "IdKey id_dsa_2048_a" > .ssh2/identification # OpenSSH ssh-keygen -t dsa cp .ssh/id_dsa.pub .ssh/authorized_keys2 # copy global files from server cd / set files = ( /etc/hosts /etc/passwd /etc/shadow /etc/group /etc/resolv.conf /etc/mosix.map ) foreach file ( $files ) if(-e $file) cp -p $file ${file}.orig end ssh 192.168.1.1 "cd / ; tar cf - $files" | tar xvf - pwconv # enable rsh, rlogin, rexec echo "+" >! /etc/hosts.equiv foreach file ( `grep -l rhosts /etc/pam.d/*` ) cp ${file} ${file}.orig awk '/rhosts/{$0=$0 " no_rhosts promiscuous"} {print}' ${file}.orig >! $file end # create needed directories for NFS ln -sf /home/programs /programs mkdir /data /data2 /data3 /data4 if (-e /local) chmod a+rwxt /local cp -p /etc/fstab /etc/fstab.orig cat << EOF >> /etc/fstab /dev/sdb /data4 ext3 defaults 1 2 server:/home /home nfs rw,wsize=8096,rsize=8096,soft,intr,bg,tcp server:/data /data nfs rw,wsize=8096,rsize=8096,soft,intr,bg,tcp graphics1:/data2 /data2 nfs rw,wsize=8096,rsize=8096,soft,intr,bg graphics2:/data3 /data3 nfs rw,wsize=8096,rsize=8096,soft,intr,bg graphics3:/data4 /data4 nfs rw,wsize=8096,rsize=8096,soft,intr,bg EOF mkdir /dvdrom mkdir /floppy mount -a cat << EOF >! /etc/exports /data4 192.168.0.0/255.255.0.0(rw,insecure,no_root_squash) EOF # make sure we keep good time rdate -s cgsrv.als.lbl.gov ; hwclock -w cp -p /etc/ntp.conf /etc/ntp.conf.orig cat << EOF >> /etc/ntp.conf server cgsrv.als.lbl.gov server usno.pa-x.dec.com server time.nist.gov server tick.ucla.edu EOF cp -p /etc/rc.local /etc/rc.local.orig cat << EOF >> /etc/rc.local # fix the damn clock rdate -s cgsrv.als.lbl.gov hwclock -w EOF # set up printer printconf-tui # set up runlevel chkconfig amandaidx off chkconfig amanda off chkconfig amd off chkconfig amidxtape off chkconfig anacron on chkconfig apmd off chkconfig arpwatch off chkconfig atd on chkconfig autofs off chkconfig bcm5820 off chkconfig bgpd off chkconfig bootparamd off chkconfig chargen off chkconfig chargen-udp off chkconfig comsat off chkconfig crond on chkconfig daytime on chkconfig daytime-udp on chkconfig dbskkd-cdb off chkconfig dhcpd off chkconfig echo on chkconfig echo-udp on chkconfig eklogin off chkconfig finger on chkconfig gated off chkconfig gpm on chkconfig gssftp off chkconfig httpd off chkconfig identd on chkconfig imap off chkconfig imaps off chkconfig innd off chkconfig ipchains off chkconfig ipop2 off chkconfig ipop3 off chkconfig iptables off chkconfig irda off chkconfig iscsi off chkconfig isdn off chkconfig junkbuster off chkconfig kadmin off chkconfig kdcrotate off chkconfig keytable on chkconfig klogin off chkconfig kprop off chkconfig krb524 off chkconfig krb5kdc off chkconfig krb5-telnet off chkconfig kshell off chkconfig kudzu on chkconfig ldap off chkconfig linuxconf on chkconfig linuxconf-web off chkconfig lpd on chkconfig mars-nwe off chkconfig mcserv off chkconfig mysqld off chkconfig named off chkconfig netfs on chkconfig network on chkconfig nfslock on chkconfig nfs on chkconfig nscd on chkconfig ntalk on chkconfig ntpd on chkconfig ospf6d off chkconfig ospfd off chkconfig pcmcia off chkconfig pop3s off chkconfig portmap on chkconfig postgresql off chkconfig pxe off chkconfig radvd off chkconfig random on chkconfig rarpd off chkconfig rawdevices on chkconfig reconfig on chkconfig rexec on chkconfig rhnsd off chkconfig ripd off chkconfig ripngd off chkconfig rlogin on chkconfig routed off chkconfig rsh on chkconfig rstatd on chkconfig rsync on chkconfig rusersd on chkconfig rwalld on chkconfig rwhod on chkconfig sendmail on chkconfig sgi_fam on chkconfig smb off chkconfig snmpd off chkconfig squid off chkconfig sshd on chkconfig swat off chkconfig syslog on chkconfig talk on chkconfig telnet on chkconfig tftp on chkconfig time on chkconfig time-udp on chkconfig tux off chkconfig ups off chkconfig vncserver off chkconfig wine off chkconfig wu-ftpd off chkconfig xfs on chkconfig xinetd on chkconfig ypbind off chkconfig yppasswdd off chkconfig ypserv off chkconfig ypxfrd off chkconfig zebra off ntsysv # downgrade gcc # upgrade the compiler #wget http://mirrors.rcn.net/pub/sourceware/gcc/releases/gcc-3.2/gcc-3.2.tar.gz cd /usr/src tar xzvf /programs/install/gcc-2.95*.tar.gz cd gcc-* ./configure --prefix /usr make make install # install F-secure SSH # cd /programs/install # wget ftp://ftp.ssh.com/pub/ssh/ssh-1.2.33.tar.gz # wget ftp://ftp.ssh.com/pub/ssh/ssh-3.2.3.tar.gz cd /usr/src rm -f ssh-1* tar xzvf /programs/install/ssh-1.2.33.tar.gz cd ssh-1* ./configure --prefix /usr make make install cd /usr/src rm -rf ssh-3* tar xzvf /programs/install/ssh-3.2.3.tar.gz cd ssh-3* ./configure --prefix /usr make make install # edit the config files echo "Ssh1Compatibility yes" >> /etc/ssh2/ssh2_config echo "Ssh1InternalEmulation no" >> /etc/ssh2/ssh2_config echo "Ssh1Path /usr/bin/ssh1" >> /etc/ssh2/ssh2_config echo "Ssh1Compatibility yes" >> /etc/ssh2/sshd2_config echo "Sshd1Path /usr/sbin/sshd1" >> /etc/ssh2/sshd2_config # upgrate openssh #cd /usr/src #tar xzvf /programs/install/openssh-*.tar.gz #cd openssh-* #./configure --prefix=/usr #make #make install #echo "CloseOnSIGCHLD yes" >> /etc/ssh/sshd_config # get Xdiff installed cp /programs/install/xdiff/xdiff /usr/X11R6/bin/ cp /programs/install/xdiff/XDiff /usr/X11R6/lib/X11/app-defaults/ # prepare for touch screen chmod a+rw /dev/ttyS0 chmod a+rw /dev/ttyS1 # copy the RH7.2 library (why do we need this?) scp crush:/usr/lib/libstdc++.so.3 /usr/lib scp crush:/lib/libgcc_s.so.1 /lib # upgrade the kernel set Version = 2.4.22 cp -p /etc/lilo.conf /etc/lilo.conf.orig set root = `awk -F "[=\t ]" '$1=="default"{label=$2} $2=="label" && $3==label{++default} default!="" && $2=="root"{print $3;exit}' /etc/lilo.conf.orig` awk '/default/{$0="default=linux-2422"} {print}' /etc/lilo.conf.orig >! /etc/lilo.conf cat << EOF >> /etc/lilo.conf image=/boot/vmlinuz-$Version label=linux-2422 initrd=/boot/initrd-${Version}.img read-only root=/dev/sdb6 append="hda=ide-scsi" EOF #wget http://www.kernel.org/pub/linux/kernel/v2.4/linux-${version}.tar.gz cd /usr/src bunzip2 -c /programs/install/linux-${Version}*.tar.bz2 |\ tar xvf - rm -f linux-2.4 ln -sf linux-${Version} linux-2.4 cd linux-2.4 cp /usr/src/linux-*/configs/kernel-*-athlon-smp.config .config make clean make menuconfig # turn on TCP nfs # turn on USB mouse # turn on Intel gigabit (e1000) echo "CONFIG_HIGHMEM=y" >> .config echo "CONFIG_HIGHIO=y" >> .config # turn on 3com gigabit (tg3) echo "CONFIG_TIGON3=m" >> .config # turn on intel gigabit (e1000) echo "CONFIG_E1000=m" >> .config # turn on TCP nfs echo "CONFIG_NFSD_TCP=y" >> .config # turn on all IEEE1394 options echo "CONFIG_IEEE1394_ETH1394=m" >> .config echo "CONFIG_IEEE1394_DV1394=m" >> .config echo "CONFIG_IEEE1394_CMP=m" >> .config echo "CONFIG_IEEE1394_AMDTP=m" >> .config echo "CONFIG_IEEE1394_VERBOSEDEBUG=y" >> .config # turn on all NTFS options echo "CONFIG_NTFS_FS=y" >> .config echo "CONFIG_NTFS_RW=y" >> .config # save and exit make menuconfig # patch samba for large file support patch -p1 < /programs/install/samba/01-smbfs-2.4.18-lfs.patch # also need to update smbmount make dep make make modules make modules_install make install cd /usr/src/linux-2.4 gunzip -c /boot/initrd-${Version}.img > initrd.img mount -o loop initrd.img /mnt vi /mnt/linuxrc # make sure 3w-xxxx loads before aic7xxx umount /mnt gzip -c initrd.img > /boot/initrd-${Version}.img lilo # reverse the SCSI IDs in /etc/fstab cp /etc/fstab /etc/fstab.old cat /etc/fstab.old |\ awk '{gsub("/dev/sda","/dev/sdx");\ gsub("/dev/sdb","/dev/sda");\ gsub("/dev/sdx","/dev/sdb");\ print}' |\ cat >! /etc/fstab # fix the network card assignments cd /etc/sysconfig/network-scripts awk '/eth0/{print "DEVICE=eth2";next} {print}' ifcfg-eth0 >! ifcfg-eth2 awk '/eth1/{print "DEVICE=eth0";next} {print}' ifcfg-eth1 >! ifcfg-eth0 cd /etc cp -p modules.conf modules.conf.orig awk '/eth2/{$NF="tg3"} {print}' modules.conf.orig >! modules.conf reboot # upgrade the nVidia drivers cd /programs/install/nvidia ./NVIDIA-Linux* #rpm -e NVIDIA_GLX #rpm -e NVIDIA_kernel #set SSDID = `lspci -n | awk '{print $4}' | awk -F ":" '/^10de/{print $NF}'` #wget http://download.nvidia.com/XFree86_40/1.0-4191/NVIDIA_GLX-1.0-4191.i386.rpm #wget http://download.nvidia.com/XFree86_40/1.0-4191/NVIDIA_kernel-1.0-4191.rh72up.athlon.rpm #rpm --rebuild NVIDIA_kernel-1.0-4191.src.rpm #rpm -ivh /usr/src/redhat/RPMS/i386/NVIDIA_kernel-*.i386.rpm #rpm -ivh NVIDIA_GLX-1.0-4191.i386.rpm cp /etc/X11/XF86Config-4 /etc/X11/XF86Config-4.original cat /etc/X11/XF86Config-4.original |\ awk '$1=="Driver" && $2 == "\"nv\"" {print "\t Driver \"nvidia\"";next} \ $1=="Driver" && $2 == "\"vesa\"" {print "\t Driver \"nvidia\"";next} \ $1=="Load" && $2 == "\"GLcore\"" {$0= "#" $0}\ $1=="Load" && $2 == "\"dri\"" {$0= "#" $0}\ {print}' |\ cat > /etc/X11/XF86Config-4 # may also have to edit refresh rates of monitor chmod a+rw /dev/nvidiactl chmod a+rw /dev/nvidia0 # prevent the lockup-on-paging problem #echo '\tappend="mem=nopentium"' >> /etc/lilo.conf #/sbin/lilo # install MOSIX #wget 'http://prdownloads.sourceforge.net/openmosix/openmosix-kernel-smp-2.4.20-openmosix2.athlon.rpm?use_mirror=easynews' #wget 'http://prdownloads.sourceforge.net/openmosix/openmosix-tools-0.2.4-1.i386.rpm?use_mirror=easynews' rpm -i /programs/install/openmosix-kernel-*${Version}*.rpm /programs/install/openmosix-tools-*${Version}*.rpm cp /etc/lilo.conf /tmp/lilo.conf awk '/default/{$0="default=mosix"} {print}' /tmp/lilo.conf >! /etc/lilo.conf cat << EOF >> /etc/lilo.conf image=/boot/vmlinuz-openmosix label=mosix root=$root initrd=/boot/initrd-${Version}.img read-only root=/dev/sdb6 append="hda=ide-scsi" EOF lilo # configure mosix echo "1 192.168.2.1 16" >> /etc/mosix.map #install that 3ware monitoring program #wget http://www.3ware.com/download/Escalade7000Series/7.5.3/7.5.3Linux3DM.zip cd /usr/src/ mkdir 3dm cd 3dm unzip /programs/install/3ware_7.5.3Linux3DM.zip chmod a+x install.3dm ./install.3dm # answer defaults to all questions