#! /bin/sh # Copyright (C) 2002 University of Southern California. # All rights reserved. # # Redistribution and use in source and binary forms are permitted # provided that the above copyright notice and this paragraph are # duplicated in all such forms and that any documentation, advertising # materials, and other materials related to such distribution and use # acknowledge that the software was developed by the University of # Southern California, Information Sciences Institute. The name of the # University may not be used to endorse or promote products derived # from this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED # WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # $Id: INSTALL.sh.txt,v 1.1 2006/05/13 06:32:14 pingali Exp $ # WARNING! THIS PROCEDURE WILL COMPLETELY BLOW AWAY THE CONTENTS OF AN # EXISTING FREEBSD PARTITION. MAKE SURE YOU HAVE BACKED UP ALL LOCAL # DATA! # Boot from the FreeBSD release CD-ROM. # Choose "skip kernel configuration and continue with installation" # when asked. # On machines with PCMCIA slots, you may be asked "Use PC-card device # as installation media?" Answer "No" if your installation media # (CD-ROM, network) is not hanging off the PCMCIA slot. # # For the Sony VAIOtx use D4000 and IRQ 10 for the PCCARD, # and always do a network install. The CD-ROM does not work. # In the install menu, choose "Custom" for a custom installation. # # Choose "Partition". You may be asked which drive to use, indicate # the correct one. # # (It is possible to use multiple drives for different parts of the # filesystem tree, or to span a filesystem over multiple drives. See # the FAQ.) # Create a slice of appropriate size for your machine; at least # 8GB. (With today's drive sizes, using 16GB should be considered.) # # If you are reinstalling FreeBSD (e.g. upgrading to a newer release), # you MUST delete the old partition completely, before creating a new # one. # # Press "Q" to continue. When asked, choose "BootMgr" to install the # FreeBSD boot manager, if you do not already use another one (like # Lilo or BootMagic.) # Choose "Label". Note: In previous installations, we created three # partitions for /root, /usr and /var. FreeBSD no longer recommends # this for "normal installations". Create partitions in this order: # # 1. swap partition (at least 2*RAM size) # # 2. root file system at mount point "/", using however much # space is left in the slice # # 3. (OPTIONAL) with multiple disks, you can stripe a filesystem # for performance - to do this, create same-sized partitions # on all drives, if possible, in the same location on the drive; # mount points are /1, /2, /3, etc. # # Highlight root file system and press S to enable soft updates (will be # enabled later in any case, but will speed up install process significantly.) # # Press "Q" to continue. # Choose "Distributions". Select "Kern-Developer", answer "No" when # asked to install ports collection. You will probably not need it, # and if/when you do, the one from the CD will be long obsolete # anyway. # # Select "Custom", then select the 4.X "compat*" distribution and # de-select all "Kerberos" (krb*) ones. Select src and when shown the # list of various possible sources select atleast base, include and sys. # # DO NOT select "XFree86" here, we install the newer 4.X release # from ports later during the install! # # Use "X" to pop up from this menu to the top level. # If you're doing a NETWORK install - check your install options # here: login = loginname, password, and distribution name = ANY # Choose "Commit", installation media is "CD-ROM" if asked. Wait. # Choose "Exit", then "Exit Install", remove the CD from the drive and # reboot. # Choose to boot from the "FreeBSD" partition when the boot manager # appears, then wait for the system to come up. At the login prompt, # log in as root (emty password). # If you have a laptop, do # # pccardd -z -f /etc/defaults/pccard.conf # # and see if your network card is supported by the generic kernel. # Configure your primary network interface (XXX = your IP): # # ifconfig 128.9.160.XXX netmask 255.255.240.0 up # Note: pccardd will report which interface to use # # You can also configure via DHCP, if your machine has a DHCP entry # already. # # dhclient # # Try to ping boreas.isi.edu: # # ping 128.9.160.161 # # You MUST be able to reach boreas to continue! # If you have multiple hard drives, you will want to use ccd to stripe # /usr. You will have created multiple partitions to stripe together # already in the sysinstall step above (mout points /1, /2, /3, etc.) # # If so, unmount them and remove them from fstab, then see the FAQ on # how to do this, and continue with these instructions *after* the # RAID array is up. (Otherwise continue now.) # Use ftp to fetch this script to the machine you are installing # now. You can find a current version of this script in # /etc/INSTALL.sh on any machine that is already running the FreeBSD # version you are installing. MAKE SURE YOU ARE USING THE CORRECT # VERSION BEFORE CONTINUING - YOU MAY HAVE TO START OVER OTHERWISE! # # For example, to ftp from hbo: # # # cd /root # # ftp 128.9.160.75 # # Connected to 128.9.160.75. # Name (128.9.160.75:root): larse # Password: XYZ # 230 User larse logged in. # # ftp> cd /etc # ftp> get INSTALL.sh # local: INSTALL.sh remote: INSTALL.sh # 226 Transfer complete. # # To continue the installation, simply execute # # ./INSTALL.sh # # and follow the instructions on the screen. # When you run the script, you will be prompted to edit rc.conf.local. # Create a valid ifconfig line for your interface, either giving it an IP # address, or specify DHCP. # # Use ESC to exit the editor. # Note: System messages printed to the console may destroy the screen. # Refresh before saving if neccessary, to verify correct modifications. # ############################################################################# ######## END OF INSTRUCTIONS ############################################## ############################################################################# release="4.9" # Check out our /etc from CVS, and back up the original one. # mkdir -p /home/xbone mount_nfs -T -r1024 -w1024 128.9.160.161:/home/xbone /home/xbone cvs -d /home/xbone/CVSROOT co -P -d /etc-new FreeBSD-$release-etc mv /etc /etc-old mv /etc-new /etc if [ ! -e /etc-original.tar.bzip2 ]; then tar --create --bzip2 --file /etc-original.tar.bzip2 /etc-old fi /etc/rc.d/etcdb start # Copy the old (installer-generated) fstab over, and modify it. # oldfstab="/etc-old/fstab" fstab="/etc/fstab" # Copy /etc/fstab over, and set noatime on all UFS file systems. # sed -E 's/ufs[[:space:]]+rw[[:space:]]+/ufs rw,noatime /g' \ < $oldfstab > $fstab # Add linprocfs. # # TODO: Check for the existence of linprocfs entry before appending # the line again echo "linproc /compat/linux/proc linprocfs rw 0 0" >> $fstab mkdir -p /proc /compat/linux/proc # Add fstab entry for the machine's NTFS partition with Windows on it. # Also add commented-out entries for all other NTFS and FAT32 slices. # for disk in `ls /dev/[ad][da][0-9]`; do find='\([0-9]\):.*\(0x[0-9a-f]*\).*0x[a-f0-9]*' new='\1:\2' for part in `fdisk -s $disk | tail +3 | sed "s/$find/$new/"`; do nr=`echo "$part" | cut -f1 -d:` type=`echo "$part" | cut -f2 -d:` slice="${disk}s$nr" if [ "$type" = "0x07" ]; then mount_ntfs $slice /mnt #TODO: Check for the windows entry before adding. if [ -d /mnt/WINDOWS -o -d /mnt/WINNT ]; then mkdir -m a+rwx -p /windows echo "$slice /windows "\ " ntfs rw 0 0" >> $fstab else echo "#$slice /ntfs "\ " ntfs rw 0 0" >> $fstab fi umount /mnt elif [ "$type" = "0x0c" ]; then echo "#$slice /msdos "\ " msdos rw 0 0" >> $fstab fi done done # Copy some other files over. for file in ccd.conf shells; do if [ -e /etc-old/$file ]; then cp /etc-old/$file /etc/$file fi done # Action uses a different name for tcsh. echo "/bin/ntcsh" >> /etc/shells # Remove /etc-old now that we copied everything we need over. # rm -rf /etc-old # Edit ISI location (mostly IP address). # isi=/etc/locations/128.9.160.161 cp $isi/rc.conf.local.sample $isi/rc.conf.local ee $isi/rc.conf.local # Link in kernel patch. # menu=`mktemp /tmp/menu-XXXXXX` select=`mktemp /tmp/select-XXXXXX` for item in `ls /etc/KERNEL.patches | grep -v CVS`; do echo -n "$item $item " >> $menu done (dialog --menu "Choose kernel patch for system, or CANCEL for NONE" \ 20 70 12 `cat $menu` > /dev/tty) 2> $select file=`cat $select` if [ "$file" ]; then ln -s /etc/KERNEL.patches/$file /etc/KERNEL.patch.local fi # Link in X11 config file. # truncate -s0 $menu $select for item in `ls /etc/X11/configs | grep -v CVS`; do echo -n "$item $item " >> $menu done (dialog --menu "Choose X11 configuration for system, or CANCEL for NONE" \ 20 70 12 `cat $menu` > /dev/tty) 2> $select file=`cat $select` if [ "$file" ]; then ln -s /etc/X11/configs/$file /etc/X11/XF86Config fi # Update kernel. # if [ ! -e /usr/include-original.tar.bzip2 ]; then tar --verbose --create --bzip2 \ --file /usr/include-original.tar.bzip2 /usr/include fi if [ ! -e /usr/src-original.tar.bzip2 ]; then tar --verbose --create --bzip2 \ --file /usr/src-original.tar.bzip2 /usr/src fi /etc/periodic/daily/920.isi-update-kernel # Update packages. # /etc/periodic/daily/960.isi-update-pkgs # Reboot! # shutdown -r +5 "Installation finished; you may reboot at any time."