################################################################ The script build-deb-RaQ-base.sh will install Debian on a drive in a Linux PC The drive may be hdb, hdc, or hdd. To use; mount a target drive in the PC boot Linux on the PC create a directory /home/Cobalt-MIPS. or change variable buildDIR in the script to a directory of your choice. cd to the buildDIR, /home/Cobalt-MIPS execute wget http://fsn.raqware.com/Debian/build-base-2.4.27/build-deb-RaQ-base.sh this will download the build script It may be adventageous to download these files also, although the script will download if they are not present. If you choose to do all the downloads before running the script; execute wget http://fsn.raqware.com/Debian/build-base-2.4.27/deb-RaQ-base-0.02.tgz execute wget http://fsn.raqware.com/Debian/build-base-2.4.27/deb-RaQ-base-0.02.tgz.asc execute md5sum deb-RaQ-base-0.02.tgz | cmp deb-RaQ-base-0.02.tgz.asc The md5sun should yield no output if md5sum of the image is OK Check that build-deb-RaQ-base.sh is executable execute ./build-deb-RaQ-base.sh drive Where 'drive' is hdb, hdc, or hdd When the process completes, shutdowm the PC, remove the target drive and install in your Cobalt MIPS system. There is an option at the end to use 'dhcp' to configure networking So, should work on Qube-2700, not tested though. See http://fsn.raqware.com/Debian/SetupRaQDebian for hints on setup Feel free to change the script to your requirements...... A copy of the script build-deb-RaQ-base.sh follows, but best to download as above... ################# this is the script ################## et this variable to the version to install VERSION=deb-RaQ-base-0.02.tgz buildDIR=/home/Cobalt-MIPS mountDIR=$buildDIR/image URL=http://fsn.raqware.com/Debian/build-base-2.4.27 echo "=========================================================" echo "This script will install a Debian Base System for;" echo " Cobalt MIPS servers with serial console port" echo "" echo "Directories are created in Cobalt-MIPS at;" echo " $buildDIR/image where /dev/hdx2 will be mounted" echo " $buildDIR/image/boot where /dev/hdx1 will be mounted" echo " $buildDIR/image/home where /dev/hdx5 will be mounted" echo " Where in hdx 'x' is the drive arguement the target drive" echo "Drive image is stored /home/$VERSION" echo "" echo "Credits to the debian-mips development team" echo " Particularly Peter Horton and Martin Michlmayr" echo "" echo "Script developed by Front Street Networks - RaQware" echo "please send comments to gwaugh@frontstreetnetworks.com" echo "========================================================" echo "" echo "install log at $buildDIR/install.log" LOG=$buildDIR/install.log echo "Building Debian MIPS system `date`" > $LOG # Check if arguement provided # if [ ! $1 ] then echo "" echo "Oops! arguement missing" echo "Usage: `basename $0` hdb, hdc or hdd" echo "" exit 1 fi # # Check if arguement is valid and setup drive variables if [ $1 == hdb ] then drive=/dev/hdb drive1=/dev/hdb1 drive2=/dev/hdb2 drive3=/dev/hdb3 drive5=/dev/hdb5 elif [ $1 == hdc ] then drive=/dev/hdc drive1=/dev/hdc1 drive2=/dev/hdc2 drive3=/dev/hdc3 drive5=/dev/hdc5 elif [ $1 == hdd ] then drive=/dev/hdd drive1=/dev/hdd1 drive2=/dev/hdd2 drive3=/dev/hdd3 drive5=/dev/hdd5 else echo"" echo "Usage `basename $0` drive-argument" echo "Oops! drive arguement must be: hdb, hdc, or hdd" echo "" exit 1 fi echo "" echo "=============================================================" echo "Are you sure you want to install Debian on Hard Drive $drive" echo "Any data currently on the drive $drive will be destroyed" echo "=============================================================" echo "" # # check user input for y/n for continue # TESTIN=0 while [ $TESTIN == 0 ]; do echo -n "Continue (y/n): " read ACCEPT if [ $ACCEPT == "y" ]; then TESTIN=1 elif [ $ACCEPT == "n" ]; then TESTIN=1 echo "Aborting the install at your request" exit 0 fi done # # Checking if image exist on this system" # echo "Checking if drive image exist on this system" if [ -f /home/$VERSION ] then echo "file $VERSION exist" else echo "" echo "Attempting to get file $VERSION" cd /home wget $URL/$VERSION if [ -f /home/$VERSION ] then echo "" echo "download of $VERSION successful" echo "" else echo "" echo "download of $VERSION failed" echo "Option is download $VERSION from http://fsn.raqware.com" echo "and install in this system in directory /home" echo "" exit fi fi echo "" # # create partitions on drive # part1 = 100MB (boot) # part2 = 4000MB (root) # part3 = 256MB (swap) # part4 = Extended # part5 = rest of drive (home) echo "creating partitons on $drive" if sfdisk $drive -uM <> $LOG 2>&1 0,100,L ,4000,L ,256,S ,,E ,,L EOF then echo "partitions created successfully" else echo "failed to create partitions on $drive" echo "perhaps partitions are mounted (in-use)" exit fi # # format drive # part1 ext2, part2 ext3, part5 swap, part6 ext3 # echo "" echo "formating $drive partitions" echo "Formating $drive2 ext3 root file system" mkfs.ext3 $drive2 >> $LOG 2>&1 echo "done" echo "Formating $drive5 ext3 home file system" mkfs.ext3 $drive5 >> $LOG 2>&1 echo "done" echo "Formating $drive1 ext2 boot file system" mkfs.ext2 -r 0 $drive1 >> $LOG 2>&1 echo "done" echo "Creating $drive3 swap partition" mkswap $drive3 >> $LOG 2>&1 echo "done" # # Mount the required partitions 1/2/5 # if [ -d $buildDir ]; then echo "" echo "===============================================" echo "WARNING about to remove directory $nountDiR" echo "And Create new clean directory $mountDIR" echo "===============================================" echo"" TESTIN=0 while [ $TESTIN == 0 ]; do echo -n "Continue (y/n)" read ACCEPT if [ $ACCEPT == "y" ]; then TESTIN=a echo "Removing Directory $mountDIR" rm -rf $mountDIR elif [ $ACCEPT == "n" ]; then TESTIN=1 echo "Aborting the install at your request" exit 0 fi done fi echo "Creating Directory $mountDIR" if mkdir $mountDIR >> $LOG 2>&1 then echo "directory $mountDIR created" else echo "make dir $mountDIR failed" exit 1 fi echo "" echo "Mounting $drive2 root partition $mountDIR.............." mount $drive2 $mountDIR echo "Creating directory $mountDIR/boot ....................." mkdir $mountDIR/boot echo "Mounting $drive1 boot partition $mountDIR/boot ........" mount $drive1 $mountDIR/boot echo "Creating directory $mountDIR/home ....................." mkdir $mountDIR/home echo "Mounting $drive5 home partition $mountDIR/home ........" mount $drive5 $mountDIR/home echo "" mount | grep $drive >> $LOG 2>&1 # # write the drive partitions 1,2 and 5 # echo "" echo "Writing the Debian drive image to $drive" echo "This will take several minutes" tar -xzpsf $VERSION echo "********************************************************" echo "If your Cobalt MIPS server does not have a serial port select y below. This will allow a dhcp server to set the IP address for the server. Make sure the network has a dhcp server. Then access the server via SSH and configure as desred" echo "user admin pass admin then su - to root" echo "*******************************************************" TESTIN=0 while [ $TESTIN == 0 ]; do echo -n "Use dhcp server (y/n): " read ACCEPT if [ $ACCEPT == "y" ]; then TESTIN=1 cd e/ cp etc/network/interfaces.dhcp etc/network/interfaces cp etc/inittab.dhcp etc/inittab cd ../ elif [ $ACCEPT == "n" ]; then TESTIN=1 echo "Server is using static IP" echo "login to the console port and edit /etc/network/interfaces" echo "to setup the network" fi done # # umount the drive partitions # echo "" echo " unmounting partitions for $drive" umount $drive1 umount $drive5 umount $drive2 echo "Removing directory $mountDIR" rm -rf $mountDIR # # Finished # echo "" echo "===============================================================" echo "Install of Debian Base System on $drive is complete" echo "Shutdown the system, remove $drive and install in the RaQ" echo "" echo "In the Cobalt tradition username: admin/root and password: admin" echo "Edit /etc/apt/sources.list and choose a Debian Mirror close to you" echo "Wise to run \"apt-get update\" and \"apt-get dist-upgrade\"" echo " and change the passwords for admin and root" echo "================================================================" exit 0