[Zeffie-Users] Restore from CD

Gypsy Rogers gypsy at freeq.com
Mon Feb 6 10:50:03 EST 2006


I've tried to restore onto a blank drive from CD and have been completly
unsuccessful.... It looks like from what I'm seeing on the serial console
that it's not even seeing the hard drive.

This is a RAQ4r with only one drive connected to it.

Below is what I'm seeing on my serial console, that last bit is a loop it
falls into.

Anyone have any clue what might be causing this?

I've tried both the NetBSD restore from CD and the Sun Restore CD

both with the same results



echo /bto-sync/production/3100R_1.155/installer/scripts/safetynet
+ count=9
+ file_fullpath=/bto-sync/production/3100R_1.155/installer/scripts/redhatdir
+ [ -z  ]
+ echo /bto-sync/production/3100R_1.155/installer/scripts/redhatdir
+ count=10
+ file_fullpath=/bto-sync/production/3100R_1.155/installer/scripts/crackdict
+ [ -z  ]
+ echo /bto-sync/production/3100R_1.155/installer/scripts/crackdict
+ count=11
+
file_fullpath=/bto-sync/production/3100R_1.155/installer/scripts/mknetrcscripts
+ [ -z  ]
+ echo /bto-sync/production/3100R_1.155/installer/scripts/mknetrcscripts
+ count=12
+
file_fullpath=/bto-sync/production/3100R_1.155/installer/scripts/set_cmos_bootdev
+ [ -z  ]
+ echo /bto-sync/production/3100R_1.155/installer/scripts/set_cmos_bootdev
+ count=13
+ return 13
+ echo Found 13 script(s) to execute after installation.
Found 13 script(s) to execute after installation.
find_the_packages
+ find_the_packages
+ __find_the_file   /bto-sync/production/3100R_1.155/packages
/test/NOW-20060206.01E575/BASE_PACKAGES
+ local hook=
+ local searched_files=
+ local dir=/bto-sync/production/3100R_1.155/packages
+ local outfile=/test/NOW-20060206.01E575/BASE_PACKAGES
ls -f $dir
++ ls -f /bto-sync/production/3100R_1.155/packages
+ local all_files=.
..
+ local count=0
+ return 0
+ echo Found 0 packages(s) to install at end of build.
Found 0 packages(s) to install at end of build.

# [Why is this here?  Shouldn't it be in `setup_for_install' (suggested by
# Doug).  -ttn, 1999/01/15 21:36:55]
export RPMS=$PROJ_DIR/rpms
+ export RPMS=/bto-sync/production/3100R_1.155/rpms
+ RPMS=/bto-sync/production/3100R_1.155/rpms

# Do the actual install script.  We use `-$-' to pass useful shell flags like
# "-xv" to the subshell.
must $SHELL -$- ./cobalt_install
+ must /bin/sh -vx ./cobalt_install
+ /bin/sh -vx ./cobalt_install
#! /bin/bash
# ID: $Id: cobalt_install,v 1.91 2000/06/15 20:49:22 asun Exp $
# Copyright (C) 1997-1999 Cobalt Networks, Inc.
# All rights reserved.
#
# Description: Script for installing Linux on Cobalt boxes.

. ./ifuncs                              # use the source, luke!
+ . ./ifuncs
# Common -*- shell-script -*- functions for module `installer'
# ID: $Id: ifuncs,v 1.52 2000/05/02 00:35:23 asun Exp $
#
# Copyright (C) 1999 Cobalt Networks, Inc.
# All rights reserved.
#
# This file provides the following functions:
#
#    reverse
#    must
#    set_and_export_TMP_DIR
#    setup_for_install
#    inform
#    find_the_qualify_scripts
#    find_the_before_scripts
#    find_the_core_rpms
#    find_the_after_scripts
#    find_the_packages
#    run_scripts
#    load_packages
#    mount_all_filesystems
#    umount_all_filesystems
#    init_for_GM_yes
#    verify_install
#    do_final_hacks
#
# Notes:
#
# Functions that start with two underscores are considered "file static" and
# should not be used externally (this is why they are omitted from this list).
# See each function header for more info.
#
# Error handling: Functions that cause the entire script flow to terminate
# non-successfully should use "exit 1".

function reverse
# $1 is a single string that is a list of elements.
# Echo a single string that is the reverse of this list.
{
    local ret=""

    for elem in $1 ; do ret="$elem $ret" ; done
    echo "$ret"
}

function must
# $1 is a command.
# $2... are its args.
# If the command is not successful, exit.
{
    "$@" || {
        echo $0: "$@" failed. Terminating.
        exit 1
    }
}

function set_and_export_TMP_DIR
{
    : ${TMP_DIR:=/tmp}
    export TMP_DIR
}

function __export_PRODUCT
# Make sure the important `PRODUCT' env var is defined and exported.
{
    if [ ! -e release_spec -a ! -e release_spec.$PRODUCT -o -z "$PRODUCT" ]
    then
        echo Must set environment variable PRODUCT to be one of these:
        echo release_spec.* | sed 's/release_spec./  /g'
        echo Terminating.
        exit 1
    fi
    export PRODUCT
}

function __set_RELSPEC
# Find the release spec file relevant to the current product,
# and set env var `RELSPEC' to it.
{
    if [ -e release_spec ]; then
        echo Using deprecated release_spec
        echo Using deprecated release_spec
        echo Using deprecated release_spec'   'READ
        echo Using deprecated release_spec
        echo Using deprecated release_spec'   'YOUR
        echo Using deprecated release_spec
        echo Using deprecated release_spec'   'MAIL
        echo Using deprecated release_spec
        echo Using deprecated release_spec'    !!!!'
        echo Using deprecated release_spec
        RELSPEC=release_spec
    else
        RELSPEC=release_spec.${PRODUCT:?}
    fi
}

function __get_list
# $1 is a tag.
{
    # We use sed's `l' command because `__get_list' can be invoked
    # from within backticks, which commits attrocities w/ whitespace.
    # Do not move the initial grep after the sed -- it is first to
    # summarily remove long comments that may be folded by `l' (sigh).
    grep -v '^#' ${RELSPEC:?} \
        | sed -n -e "/%begin $1/,/%end $1/ p" \
        | grep -v '^%'
}

function __set_other_useful_variables
# $1 is the temporary fstab file.
# $2 is the temporary partition table file.
# [This function name sucks.  -ttn, 1999/01/07 01:54:20]
{
    local fstab=$1
    local ptable=$2
    local raidtab=$3
    local mkfs_opts=$4

    # The infamous DOUG string... just provides some info.
    # General Doug is part of company history.
    export DOUG=" "
    export DEVEL

    # Get the project and the path to its repository.
    : ${PROJECT:=fargo}
    : ${PROJ_DIR:=/mnt/$PROJECT}
    export PROJ_DIR

    # See if this is an experimental build.
    : ${EXP_BUILD:=no}
    [ $EXP_BUILD = no ] || DOUG=${DOUG}'Experimental '${EXP_BUILD}' '

    # See if this is a developer build
    # [Is this still used?  -ttn, 1999/01/12 21:31:16]
    : ${DEVEL:=no}
    [ $DEVEL = yes ] && DOUG=$DOUG'Development '

    # Check to make sure we have a legit directory...
    if [ ! -d $PROJ_DIR ]; then
        echo "Project directory $PROJ_DIR not found. Terminating."
        exit 1
    fi

    # Check for the version of the release.
    if [ ! -f ./CVS/Entries ]; then
        echo "Can't find your CVS directory. Terminating."
        exit 1
    fi
    export BUILD=`grep ^/$RELSPEC/ ./CVS/Entries | cut -f3 -d"/"`
    : ${BUILD:=0}

    LANGUAGE=`__get_list Languages`
    RELEASE=`__get_list Release`
    VENDOR=`__get_list Vendor`
    CODENAME=`__get_list Codename`
    TIME_ZONE=`__get_list Timezone`             # Why do we do this?
    LOCALE=`__get_list Locale`
    QUALIFY_SCRIPTS=`__get_list Qualify_Scripts`
    BEFORE_SCRIPTS=`__get_list Before_Scripts`
    AFTER_SCRIPTS=`__get_list After_Scripts`
    PACKAGES=`__get_list Packages`

    __get_list fstab > $fstab
    __get_list mkfs_opts > $mkfs_opts
    __get_list Partition_Table > $ptable
    __get_list raidtab > $raidtab

    CORE_RPMS=`__get_list Core_RPMs`

    echo "Building ${VENDOR:=Cobalt} Linux${DOUG}Release $RELEASE
($CODENAME) build $BUILD for a $PRODUCT in $LANGUAGE"
}

function setup_for_install
# $1 is a filename where a temporary fstab file is written.
# $2 is a filename where a temporary partition table is written.
# $3 is a filename where a temporary raidtab is written.
{
    __export_PRODUCT
    __set_RELSPEC
    __set_other_useful_variables $@
}

function inform
# $1 is the first line of the LCD output.
# $2 is the second line.
# NOTE: Args should be short enough to be viewable on the LCD panel.
{
    echo "$1" "$2"
    [ ${NET_BUILD:=no} = yes ] && /sbin/writelcd "$1" "$2"
    true
}

function __inform_forever
# $1 is a single string that is a list of elements.
# Call `inform' on each successive pair, looping forever w/ 2s pause.
{
    local msg=$1

    while true ; do
        set $msg
        while [ -n "$1" ] ; do
            inform $1 $2
            shift 2
            sleep 2
        done
    done
}

function __find_the_file
# $1 if given is a command, to be executed per script, that takes two
#    arguments: file name and file fullpath.
# $2 is the list of files we want to find.
# $3 is a directory where we search for available files.
# $4 is a filename collecting the fullpath of the file if found.
{
    local hook=$1
    local searched_files=$2
    local dir=$3
    local outfile=$4

    local all_files=`ls -f $dir`
    local count=0

    > $outfile

    for file in $searched_files ; do
        case $all_files in
            *${file}*)
                file_fullpath=$dir/$file
                [ -z "$hook" ] || eval $hook $file $file_fullpath
                echo $file_fullpath >> $outfile
                count=$(( $count+1 ))
                ;;
            *)  
#               __inform_forever "
#                       Cannot-find     $file
#                       In-directory    $dir
#                       PROJ_DIR:       $PROJ_DIR
#                       "
#               exit 1                  # never reached
                while [ ! -e $dir/$file ]; do
                        echo "Cannot-find $file in $dir"
                        sleep 5
                done
                ;;
        esac
    done
    return $count
}

function find_the_qualify_scripts
# $1 if given is a command, to be executed per script, that takes two
#    arguments: script name and script fullpath.
{
    __find_the_file "$1" "$QUALIFY_SCRIPTS" `pwd`/scripts \
        ${TMP_DIR:?}/BASE_QUALIFY_SCRIPTS

    echo "Found $? script(s) to execute prior to drive partitioning."
}

function find_the_before_scripts
# $1 if given is a command, to be executed per script, that takes two
#    arguments: script name and script fullpath.
{
    __find_the_file "$1" "$BEFORE_SCRIPTS" `pwd`/scripts \
        ${TMP_DIR:?}/BASE_BEFORE_SCRIPTS

    echo "Found $? script(s) to execute prior to installation."
}

function find_the_core_rpms
# $1 if given is a command, to be executed per script, that takes two
#    arguments: rpm name and rpm fullpath.
{
    __find_the_file "$1" "$CORE_RPMS" ${PROJ_DIR:?}/rpms \
        ${TMP_DIR:?}/BASE_RPM_LIST

    echo "Found $? rpm(s) for the $PRODUCT."
}

function find_the_after_scripts
# $1 if given is a command, to be executed per script, that takes two
#    arguments: script name and script fullpath.
{
    __find_the_file "$1" "$AFTER_SCRIPTS" `pwd`/scripts \
        ${TMP_DIR:?}/BASE_AFTER_SCRIPTS

    echo "Found $? script(s) to execute after installation."
}

function find_the_packages
# $1 if given is a command, to be executed per script, that takes two
#    arguments: script name and script fullpath.
{
    __find_the_file "$1" "$PACKAGES" ${PROJ_DIR:?}/packages \
        ${TMP_DIR:?}/BASE_PACKAGES

    echo "Found $? packages(s) to install at end of build."
}

function run_scripts
# $1 is a file that lists scripts.  Each script is executed with cwd set
# to MNT_DIR, by a new shell.  If the script is not successful, exit.
{
    local script_list_file=$1
    local saved_cwd=$PWD

    if [ -f $1 ] ; then
        for script in `cat $script_list_file` ; do
            inform "Running script" `basename $script`
            cd $MNT_DIR
            must $SHELL -$- $script
        done
        cd $saved_cwd
    fi
}

function load_packages
# $1 is a file that lists packages.  Each package is copied
# temporarily to the target disk, loaded using cobalt_upgrade and then
# removed.  If any upgrade is unsuccessful, exit.  Else, run
# install.cgi to update the ui page that lists the installed packages.
{
    local package_list_file=$1

    if [ -s $1 ] ; then
        for package in `cat $package_list_file` ; do
            inform "Installing Package" `basename $package`
            must cp $package $MNT_DIR/tmp
            must chroot $MNT_DIR /usr/local/sbin/cobalt_upgrade
/tmp/`basename $package`
            must rm  $MNT_DIR/tmp/`basename $package`
        done
        if [ -x $MNT_DIR/usr/admserv/cgi-bin/.cobalt/install/install.cgi ]; then
                must chroot $MNT_DIR
/usr/admserv/cgi-bin/.cobalt/install/install.cgi < /dev/null
        elif [ -x $MNT_DIR/home/httpd/cgi-bin/cobalt/install/install.cgi ]; then
                must chroot $MNT_DIR
/home/httpd/cgi-bin/cobalt/install/install.cgi < /dev/null
        else
                inform "install.cgi:" "unknown path"
                exit 1
        fi
    fi
}

function mount_all_filesystems
# $1 is the filesystem system list, a single string.
# This list should be in root-first order
{
    local filesystem_list=$1

    if [ $MNT_DIR_CHK = yes -a -e $MNT_DIR ] ; then
        echo "Mount point $MNT_DIR already exists."
        echo "Previous install interrupted?"
        if [ $NET_BUILD = yes ] ; then      # non-interactive
            echo "Terminating."
            exit 1
        else                                # interactive
            echo "Type y and hit RETURN to unmount all filesystems under"
            echo "$MNT_DIR, after which $0 can continue with the build."
            echo -n "Continue? "
            read answer
            if [ "$answer" = y ] ; then
                must umount_all_filesystems "$filesystem_list"
            else
                echo "OK, you must do this manually: unmount each filesystem"
                echo "under $MNT_DIR, including $MNT_DIR,"
                echo "and then rmdir $MNT_DIR."
                echo "Terminating."
                exit 1
            fi
        fi
    fi

    # Mount filesystems
    set $mount_map
    while [ -n "$1" ] ; do
        inform "Mounting $1" "on $2"
        [ -d $2 ] || must mkdir $2
        must mount $1 $2
        shift 2
    done
}

function umount_all_filesystems
# $1 is the filesystem system list, a single string.
# This list should be in root-first order.
{
    local filesystem_list=$1

    # Net builds may not have a writeable /etc/mtab.
    # Unfortunately, we cannot use `test -w' becuase it lies.
    [ ${NET_BUILD:=no} = yes ] && local umount_opts='-n'
  
    for fs in `reverse "$filesystem_list"` ; do
        umount $umount_opts $fs
    done
    [ $NET_BUILD = yes ] || must rmdir $MNT_DIR
}

function __calculate_GM_sumfile
{
    if [ ${GM:=no} = yes ]; then
        inform Calculating sumfile.GM
        echo -n "Golden Master Checksum: "
        ./sumdisk ${MNT_DIR:?} sumfile.GM
        cp ${TMP_DIR:?}/cobalt_error.log cobalt_error.GM
        ./stripid cobalt_error.GM
    fi
}

function init_for_GM_yes
{
    __calculate_GM_sumfile
}

function __indulge_in_manufacturing_paranoia
# If we're doing net build, check for unexpected errors in cobalt_error.log
# This is just general paranoia for manufacturing
{
    ./stripid ${TMP_DIR:?}/cobalt_error.log

    local sum_bld=`sum $TMP_DIR/cobalt_error.log | cut -f1 -d" "`
    local sum_gm=`sum cobalt_error.GM | cut -f1 -d" "`
    if [ $sum_bld -ne $sum_gm ]; then
        inform BUILD FAILED
        rm ${MNT_DIR:?}/boot/vmlinux.gz
        sleep 10000
    fi
}

function __await_verification
{
    while [ -e sum.calc ]; do
        sleep 5
    done
    if [ ! -e sum.OK ]; then
        inform VERIFICATION FAILED
        sleep 10000
    fi
}

function __verify_synchronously
{
    local installer=/nfsroot/${PRODUCT:?}_${BUILD:?}/installer

    rsh tester touch $installer/sum.calc
    ./sumdisk ${MNT_DIR:?} ${TMP_DIR:?}/sumfile

    local sum_gm=`sum sumfile.GM | cut -f1 -d" "`
    local sum_build=`sum $TMP_DIR/sumfile | cut -f1 -d" "`
    if [ $sum_gm -eq $sum_build ]; then
        rsh tester touch $installer/sum.OK
        rsh tester rm $installer/sum.calc
    else
        rsh tester rm $installer/sum.calc
        inform VERIFICATION FAILED
        sleep 10000
    fi
}

function verify_install
{
    if [ ${NET_BUILD:?} = yes -a ${EXP_BUILD:?} = no ]; then
        inform Manufacturing "paranoia check"
        __indulge_in_manufacturing_paranoia
    fi

    if [ $NET_BUILD = yes -a $EXP_BUILD = no -a ! -e sum.OK ]; then
        if [ -e sum.calc ]; then
            inform Awaiting verification
            __await_verification
        else
            inform Verifying release
            __verify_synchronously
        fi
    fi
}

function __2700C_super_hack
# This isn't just a hack, this is a SUPER-hack.  If we're doing a net build,
# and if that netbuild is a production build, and if the product is a 2700C
# (that's a Cache Qube to you and me), then set up the qube to have the IP
# that it currently has from the net build, name it, and set up it's network.
# This is so manufacturing can reboot the qube all the way and verify that
# the build worked.
{
    local host_ip=`/bin/hostname -i`
    local host_name=`nslookup $host_ip | grep Name | cut -f 5 -d" "`

    # use positional parameters to grab the list returned by gawk.
    # the -e option to set keeps it from echoing the environment variables
    # if the ifconfig-gawk combo spits nothing; this would set the positional
    # parameters to null
    set -e `/sbin/ifconfig eth0 | /bin/gawk '/Mask/ {
        split ($0, a, /[: ]+/);
        print a[6], a[8];
    }'`
    local host_bcast=$1;
    local host_nmask=$2;

    set -e `/sbin/route -n | /bin/gawk '
      /eth0/ && !/default/ { print $1; }
      /^0.0.0.0/ { print $2; }'`
    local host_network=$1;
    local host_gateway=$2;

    # Set up /etc/resolv.conf
    cp /etc/resolv.conf ${MNT_DIR:?}/etc/resolv.conf

    # Set up /etc/sysconfig/network
    cat > $MNT_DIR/etc/sysconfig/network <<-EOF

    # Set up /etc/HOSTNAME
    echo $host_name > $MNT_DIR/etc/HOSTNAME

    # Set up /etc/NET-CONFIG
    echo BOOTPROTO=lcd > $MNT_DIR/etc/NET-CONFIG

    # Set up /etc/sysconfig/network-scripts/ifcfg-eth0
    cat > $MNT_DIR/etc/sysconfig/network-scripts/ifcfg-eth0 <<-EOF
}

function do_final_hacks
{
    if [ ${NET_BUILD:?} = yes ]
    then
        if [ ${DESTRUCTIVE:?} = yes ]
        then
            inform lyle super-hack
            __2700C_super_hack
        fi
    fi
}

# ifuncs ends here

: ${MNT_DIR:=/mntdir}
+ : /mntdir
: ${MNT_DIR_CHK:=yes}
+ : no
: ${DEST_DEV:=/dev/hda}
+ : /dev/hda
: ${NET_BUILD:=no}
+ : yes
: ${EXP_BUILD:=no}
+ : no
: ${GM:=no}
+ : no
: ${DESTRUCTIVE:=yes}
+ : yes
: ${RAID:=no}
+ : no

#
# common locations for raid utils
sfdisk="/sbin/sfdisk -f -L -uM"
+ sfdisk=/sbin/sfdisk -f -L -uM
raidstop="/sbin/raidstop"
+ raidstop=/sbin/raidstop
mkraid="/sbin/mkraid"
+ mkraid=/sbin/mkraid

#
# common options used
raid_table="$TMP_DIR/raidtab"
+ raid_table=/test/NOW-20060206.01E575/raidtab
partition_table="$TMP_DIR/ptable"
+ partition_table=/test/NOW-20060206.01E575/ptable
fs_table="$TMP_DIR/fstab"
+ fs_table=/test/NOW-20060206.01E575/fstab
mkfs_opts="$TMP_DIR/mkfs_opts"
+ mkfs_opts=/test/NOW-20060206.01E575/mkfs_opts

rm -f ${TMP_DIR:?}/cobalt_error.log
+ rm -f /test/NOW-20060206.01E575/cobalt_error.log

# Check if that device is mounted right now
# if so, bail out; I'm drivin' this thing
if mount | grep "$DEST_DEV" ; then
    echo "$DEST_DEV is mounted, umount before installing."
    echo "Terminating."
    exit 1
fi
+ mount
+ grep /dev/hda

# describe our situations (by parsing fstab, not hard coding it)
FSTAB_DEV=`awk '/\/dev\/.*1/ {print $1}' < $fs_table | sed -e 's/[0-9]//'`
awk '/\/dev\/.*1/ {print $1}' < $fs_table | sed -e 's/[0-9]//'
++ awk /\/dev\/.*1/ {print $1}
++ sed -e s/[0-9]//
+ FSTAB_DEV=/dev/md

# check for RAID support
if [ $FSTAB_DEV = "/dev/md" ]; then
    RAID=yes
    DEST_DEV=$FSTAB_DEV
    echo Building system with RAID support
    echo WARNING: disk-to-disk builds will not work
fi
+ [ /dev/md = /dev/md ]
+ RAID=yes
+ DEST_DEV=/dev/md
+ echo Building system with RAID support
Building system with RAID support
+ echo WARNING: disk-to-disk builds will not work
WARNING: disk-to-disk builds will not work
echo Destination device: $DEST_DEV
+ echo Destination device: /dev/md
Destination device: /dev/md

awk '/^\/dev\/.*/ {printf("Destination %s partition: %s\n", $2, substr($1,
length($1)))}' < $fs_table
+ awk /^\/dev\/.*/ {printf("Destination %s partition: %s\n", $2, substr($1,
length($1)))}
Destination / partition: 1
Destination swap partition: 6
Destination /var partition: 3
Destination /home partition: 4

# build the filesystem_list out of the supplied fstab
export DEST_DEV MNT_DIR
+ export DEST_DEV MNT_DIR
filesystem_list=`awk '/^\/dev\/.*/ && ! /swap/ {printf ("%s%s ",
ENVIRON["DEST_DEV"], substr($1, length($1)))}' < $fs_table`
awk '/^\/dev\/.*/ && ! /swap/ {printf ("%s%s ", ENVIRON["DEST_DEV"],
substr($1, length($1)))}' < $fs_table
++ awk /^\/dev\/.*/ && ! /swap/ {printf ("%s%s ", ENVIRON["DEST_DEV"],
substr($1, length($1)))}
+ filesystem_list=/dev/md1 /dev/md3 /dev/md4 

# build the mount_map out of the supplied fstab
mount_map=`awk '/^\/dev\/.*/ && ! /swap/ {printf ("%s%s %s%s ",
ENVIRON["DEST_DEV"], substr($1, length($1)), ENVIRON["MNT_DIR"], $2)}' <
$fs_table`
awk '/^\/dev\/.*/ && ! /swap/ {printf ("%s%s %s%s ", ENVIRON["DEST_DEV"],
substr($1, length($1)), ENVIRON["MNT_DIR"], $2)}' < $fs_table
++ awk /^\/dev\/.*/ && ! /swap/ {printf ("%s%s %s%s ", ENVIRON["DEST_DEV"],
substr($1, length($1)), ENVIRON["MNT_DIR"], $2)}
+ mount_map=/dev/md1 /mntdir/ /dev/md3 /mntdir/var /dev/md4 /mntdir/home 

PATH=/sbin:/usr/sbin:$PATH
+ PATH=/sbin:/usr/sbin:/bin:/sbin:/usr/bin:/usr/sbin

# Qualification, before and after scripts use `ROOT'
export ROOT=$MNT_DIR
+ export ROOT=/mntdir
+ ROOT=/mntdir

# Setup the partition table on the disk (yes, this is dangerous)
if [ $DESTRUCTIVE = yes ]; then

    inform Partitioning disk

    #
    # Check for RAID
    if [ $RAID = yes ]; then
  
        #
        # Attempt to stop RAID activity
        for array in 1 6 3 4 5 ; do
            [ -e "/dev/md$array" ] || continue
            $raidstop -c $raid_table /dev/md$array
        done

        #
        # this really should parse the raidtab.
        # <hack> <cough> ... tim?
        for disk in hda hdc ; do
            [ -e /dev/$disk ] || continue
            $sfdisk /dev/$disk < $partition_table
        done

    else

        $sfdisk $DEST_DEV < $partition_table

    fi # RAID

    # Make the filesystems
    cat $fs_table |
        awk '/^\/dev\/.*/ && ! /swap/ {print substr($1, length($1))}' |
        while read fs; do
            filesys="${DEST_DEV}$fs"
            opts=`cat $mkfs_opts | egrep "^$filesys" | cut -f2`
            inform Formatting $filesys

            # Stop if we had RAID drives already
            if [ $RAID = yes ]; then
                $raidstop -c $raid_table $filesys
                $mkraid -q --really-force -c $raid_table $filesys
            fi

            mke2fs -m 0 $opts $filesys
        done

else

    # Qualify old software, mount, test, umount before re-partitioning.
    must mount_all_filesystems "$filesystem_list"
    run_scripts $TMP_DIR/BASE_QUALIFY_SCRIPTS
    must umount_all_filesystems "$filesystem_list"

    # Make the filesystems (except for home)
    cat $fs_table |
        grep -v home |
        awk '/\/dev\/hda/ && ! /swap/ {print substr($1, length($1))}' |
        while read fs; do
            inform Formatting ${DEST_DEV}$fs
            mke2fs -m 0 ${DEST_DEV}$fs
        done

fi # DESTRUCTIVE
+ [ yes = yes ]
+ inform Partitioning disk
+ echo Partitioning disk
Partitioning disk
+ [ yes = yes ]
+ /sbin/writelcd Partitioning disk
+ true
+ [ yes = yes ]
+ [ -e /dev/md1 ]
+ /sbin/raidstop -c /test/NOW-20060206.01E575/raidtab /dev/md1
/dev/md1: No such device
+ [ -e /dev/md6 ]
+ /sbin/raidstop -c /test/NOW-20060206.01E575/raidtab /dev/md6
/dev/md6: No such device
+ [ -e /dev/md3 ]
+ /sbin/raidstop -c /test/NOW-20060206.01E575/raidtab /dev/md3
/dev/md3: No such device
+ [ -e /dev/md4 ]
+ /sbin/raidstop -c /test/NOW-20060206.01E575/raidtab /dev/md4
/dev/md4: No such device
+ [ -e /dev/md5 ]
+ /sbin/raidstop -c /test/NOW-20060206.01E575/raidtab /dev/md5
/dev/md5: No such device
+ [ -e /dev/hda ]
+ /sbin/sfdisk -f -L -uM /dev/hda
/dev/hda: Device not configured

sfdisk: cannot open /dev/hda read-write
+ [ -e /dev/hdc ]
+ /sbin/sfdisk -f -L -uM /dev/hdc
/dev/hdc: No such device

sfdisk: cannot open /dev/hdc read-write
+ cat /test/NOW-20060206.01E575/fstab
+ awk /^\/dev\/.*/ && ! /swap/ {print substr($1, length($1))}
+ read fs
+ filesys=/dev/md1
cat $mkfs_opts | egrep "^$filesys" | cut -f2
++ cat /test/NOW-20060206.01E575/mkfs_opts
++ egrep ^/dev/md1
++ cut -f2
+ opts=
+ inform Formatting /dev/md1
+ echo Formatting /dev/md1
Formatting /dev/md1
+ [ yes = yes ]
+ /sbin/writelcd Formatting /dev/md1
+ true
+ [ yes = yes ]
+ /sbin/raidstop -c /test/NOW-20060206.01E575/raidtab /dev/md1
/dev/md1: No such device
+ /sbin/mkraid -q --really-force -c /test/NOW-20060206.01E575/raidtab /dev/md1
couldn't open device /dev/hda1 -- Device not configured
mkraid: aborted, see the syslog and /proc/mdstat for potential clues.
handling MD device /dev/md1
analyzing super-block
+ mke2fs -m 0 /dev/md1
mke2fs 1.14, 9-Jan-1999 for EXT2 FS 0.5b, 95/08/09
/dev/md1: Invalid argument passed to ext2 library while setting up superblock
+ read fs
+ filesys=/dev/md3
cat $mkfs_opts | egrep "^$filesys" | cut -f2
++ cat /test/NOW-20060206.01E575/mkfs_opts
++ egrep ^/dev/md3
++ cut -f2
+ opts=
+ inform Formatting /dev/md3
+ echo Formatting /dev/md3
Formatting /dev/md3
+ [ yes = yes ]
+ /sbin/writelcd Formatting /dev/md3
+ true
+ [ yes = yes ]
+ /sbin/raidstop -c /test/NOW-20060206.01E575/raidtab /dev/md3
/dev/md3: No such device
+ /sbin/mkraid -q --really-force -c /test/NOW-20060206.01E575/raidtab /dev/md3
couldn't open device /dev/hda3 -- Device not configured
mkraid: aborted, see the syslog and /proc/mdstat for potential clues.
handling MD device /dev/md3
analyzing super-block
+ mke2fs -m 0 /dev/md3
mke2fs 1.14, 9-Jan-1999 for EXT2 FS 0.5b, 95/08/09
/dev/md3: Invalid argument passed to ext2 library while setting up superblock
+ read fs
+ filesys=/dev/md4
cat $mkfs_opts | egrep "^$filesys" | cut -f2
++ cat /test/NOW-20060206.01E575/mkfs_opts
++ egrep ^/dev/md4
++ cut -f2
+ opts=
+ inform Formatting /dev/md4
+ echo Formatting /dev/md4
Formatting /dev/md4
+ [ yes = yes ]
+ /sbin/writelcd Formatting /dev/md4
+ true
+ [ yes = yes ]
+ /sbin/raidstop -c /test/NOW-20060206.01E575/raidtab /dev/md4
/dev/md4: No such device
+ /sbin/mkraid -q --really-force -c /test/NOW-20060206.01E575/raidtab /dev/md4
couldn't open device /dev/hda4 -- Device not configured
mkraid: aborted, see the syslog and /proc/mdstat for potential clues.
handling MD device /dev/md4
analyzing super-block
+ mke2fs -m 0 /dev/md4
mke2fs 1.14, 9-Jan-1999 for EXT2 FS 0.5b, 95/08/09
/dev/md4: Invalid argument passed to ext2 library while setting up superblock
+ read fs

# Setup swap partition
cat $fs_table |
    awk '/\/dev\/.*/ && /swap/ {print substr($1, length($1))}' |
    while read fs; do
        filesys="${DEST_DEV}$fs"
        inform Creating swap $filesys

        # Stop if we had RAID drives already
        if [ $RAID = yes ]; then
            $raidstop -c $raid_table $filesys
            $mkraid -q --really-force -c $raid_table $filesys
        fi

        # initialize and enable swap
        mkswap $filesys
        swapon $filesys
    done
+ cat /test/NOW-20060206.01E575/fstab
+ awk /\/dev\/.*/ && /swap/ {print substr($1, length($1))}
+ read fs
+ filesys=/dev/md6
+ inform Creating swap /dev/md6
+ echo Creating swap
Creating swap
+ [ yes = yes ]
+ /sbin/writelcd Creating swap
+ true
+ [ yes = yes ]
+ /sbin/raidstop -c /test/NOW-20060206.01E575/raidtab /dev/md6
/dev/md6: No such device
+ /sbin/mkraid -q --really-force -c /test/NOW-20060206.01E575/raidtab /dev/md6
couldn't open device /dev/hda6 -- Device not configured
mkraid: aborted, see the syslog and /proc/mdstat for potential clues.
handling MD device /dev/md6
analyzing super-block
+ mkswap /dev/md6
mkswap: error: swap area needs to be at least 40kB
Usage: mkswap [-c] [-v0|-v1] /dev/name [blocks]
+ swapon /dev/md6
swapon: warning: /dev/md6 has insecure permissions 0644, 0600 suggested
swapon: /dev/md6: No such device
+ read fs

# Test mountpoint, mount partitions
must mount_all_filesystems "$filesystem_list"
+ must mount_all_filesystems /dev/md1 /dev/md3 /dev/md4 
+ mount_all_filesystems /dev/md1 /dev/md3 /dev/md4 
+ local filesystem_list=/dev/md1 /dev/md3 /dev/md4 
+ [ no = yes -a -e /mntdir ]
+ set /dev/md1 /mntdir/ /dev/md3 /mntdir/var /dev/md4 /mntdir/home
+ [ -n /dev/md1 ]
+ inform Mounting /dev/md1 on /mntdir/
+ echo Mounting /dev/md1 on /mntdir/
Mounting /dev/md1 on /mntdir/
+ [ yes = yes ]
+ /sbin/writelcd Mounting /dev/md1 on /mntdir/
+ true
+ [ -d /mntdir/ ]
+ must mount /dev/md1 /mntdir/
+ mount /dev/md1 /mntdir/
/dev/md1: Device not configured
mount: you mShutting down Mail Service: sendmail okrm: cannot unlink
`/var/run/sendmail.pid': Read-only file system

rm: cannot unlink `/var/lock/subsys/sendmail': Read-only file system
Stopping INET services: inetd okrm: cannot unlink `/var/run/inetd.pid':
Read-only file system

rm: cannot unlink `/var/lock/subsys/inet': Read-only file system
Stopping cron daemon: crond okrm: cannot unlink `/var/run/crond.pid':
Read-only file system

rm: cannot unlink `/var/lock/subsys/crond': Read-only file system
Stopping httpd 
Stopping random Saving random seed...
rm: cannot unlink `/var/lock/subsys/random': Read-only file system

Shutting down SMB Service: Warning: /boot/System.map has an incorrect kernel
version.
ERROR!Warning: /boot/System.map has an incorrect kernel version.
ERROR!rm: cannot unlink `/var/lock/subsys/smb': Read-only file system

Stopping portmap services: Warning: /boot/System.map has an incorrect kernel
version.
ERROR!
rm: cannot unlink `/var/lock/subsys/portmap': Read-only file system
Stopping nfsfs Unmounting remote filesystems.rm: cannot unlink
`/var/lock/subsys/nfsfs': Read-only file system


Shutting down kernel logger: klogd okrm: cannot unlink `/var/run/klogd.pid':
Read-only file system

Shutting down system logger: syslogd okrm: cannot unlink
`/var/run/syslogd.pid': Read-only file system

rm: cannot unlink `/var/lock/subsys/syslog': Read-only file system
Sending all processes the TERM signal...
INIT: no more processes left in this runlevel
Sending all procmd: recovery thread got woken up ...
esses the KILL smd: recovery thread finished ...
ignal..
mdrecoveryd(6) flushing signals.
Turning off swap
Unmounting file systems
Remounting remaining filesystems (if any) readonly
SYSTEM REBOOTING
stopping all md devices.
disabling network interfaces.
Restarting system.

         Cobalt Networks, Inc. - Connecting the Dots
                  Firmware version 2.3.25

Current date: Mon Feb 06 15:54:50 UTC 2006
ROM build info: Wed Jun 7 22:47:13 PDT 2000 laserbeak.cobalt.com
System serial number: 4H01BM0330170
Memory found: 512 MB
Initializing I2C bus: done
Scanning PCI bus: done
Initializing IDE: done
Initializing SCSI: done
Initializing ethernet: 2 ethernet controllers installed - done
Initializing flash: done
  Flash Bank 0: AMD AM29F080B 1MB
  Flash Bank 1: not installed.
Mounting rom_fs: done
Initializing i18n - language "en": done

Press spacebar to enter ROM mode
Booting default method - From disk

First stage kernel: Decompressing - done

         Cobalt Networks, Inc. - Connecting the Dots
                  Firmware version 2.3.25

Current date: Mon Feb 06 15:55:39 UTC 2006
ROM build info: Wed Jun 7 22:47:13 PDT 2000 laserbeak.cobalt.com
System serial number: 4H01BM0330170
Memory found: 512 MB
Initializing I2C bus: done
Scanning PCI bus: done
Initializing IDE: done
Initializing SCSI: done
Initializing ethernet: 2 ethernet controllers installed - done
Initializing flash: done
  Flash Bank 0: AMD AM29F080B 1MB
  Flash Bank 1: not installed.
Mounting rom_fs: done
Initializing i18n - language "en": done

Press spacebar to enter ROM mode
Booting default method - From disk

First stage kernel: Decompressing - done




More information about the Zeffie-Users mailing list