Andrea Righi wrote:

OK, standard questions... ;-)

1) can you post the autoinstallscript.conf?
attached

2) can you post the output of the following commands executed in your
golden client:

parted -s /dev/sda print
parted -s /dev/sdb print
parted -s /dev/sdc print
parted -s /dev/sdd print
[EMAIL PROTECTED] ~]# parted -s /dev/sda print
Disk geometry for /dev/sda: 0.000-34732.421 megabytes
Disk label type: msdos
Minor    Start       End     Type      Filesystem  Flags
1          0.031    101.975  primary   ext3        boot
2        101.975  34726.442  primary               lvm
[EMAIL PROTECTED] ~]# parted -s /dev/sdb print
Disk geometry for /dev/sdb: 0.000-34732.421 megabytes
Disk label type: msdos
Minor    Start       End     Type      Filesystem  Flags
1          0.031  34726.442  primary               boot, lvm
[EMAIL PROTECTED] ~]# parted -s /dev/sdc print
Disk geometry for /dev/sdc: 0.000-69464.843 megabytes
Disk label type: msdos
Minor    Start       End     Type      Filesystem  Flags
1          0.031  69460.729  primary               boot, lvm

cat /proc/mdstat
[EMAIL PROTECTED] ~]# cat /proc/mdstat
Personalities :
unused devices: <none>

pvdisplay -c
[EMAIL PROTECTED] ~]# pvdisplay -c
/dev/sda2:VolGroup00:70909952:-1:8:8:-1:32768:1082:3:1079:GopH0U-Wvv9-DZCJ-bCb6-or6b-84X1-Bp20m7 /dev/sdb1::71119692:-1:0:0:-1:0:0:0:0:9CJRoT-xXEj-6t9v-7fGa-0Sms-hCFB-xUFTBt /dev/sdc1::142255512:-1:0:0:-1:0:0:0:0:dzNx3W-ifSL-rO0b-4IZ1-LNRD-TAEB-Bobw4x

vgdisplay -c
[EMAIL PROTECTED] ~]# vgdisplay -c
VolGroup00:r/w:772:-1:0:2:2:-1:0:1:1:35454976:32768:1082:1079:3:6XhN3E-gXde-dj7z-f7NX-CKq6-g3lc-QIbdSs

lvdisplay -c
[EMAIL PROTECTED] ~]# lvdisplay -c
 /dev/VolGroup00/LogVol00:VolGroup00:3:1:-1:1:66650112:1017:-1:0:0:253:0
 /dev/VolGroup00/LogVol01:VolGroup00:3:1:-1:1:4063232:62:-1:0:0:253:1

For all the developers...
-Andrea
PS (for all the developers) maybe we should consider to add a
si_getsnaphot (or a similar name) to get a general snapshot of a system
that a user is trying to install. This new command will generate a
tar.gz containing the stdout/stderr of the above commands (and other
interesting details like systemimager version, kernel, distro used,
etc), so when someone needs support it can simply post the snapshot and
we'll have immediately an overview of the system... I think it can be
very helpful for us for the debugging...

PPS (for Mark) I dunno how many clients are you using for your tests,
but it should be very interesting for us to have a feedback about the
bittorrent transport, in particular we'd like to have some numbers.. to
see if we can tune some default parameters, and if we can really reduce
the installation time with more than "X" clients... if you want to
collaborate let me know... you can win all my help :-) and a low-latency
reply to your mails... :-) yup!

Mark Seger wrote:
I'm not sure if I should be taking this up on the 'users' list, but I'm sure you'll tell me if that's more apropriate! 8-)

Anyhow, now that I have things working solidly on our dl360s, I thought I'd try out our opterons. I started by doing a clean install of rhel4/update3 and this time instead of changed the default disk configuration with disk druid, which got me down a whole different set of problems, I just accepted the default and told the installer to put everything on a single disk.

My first sign of problems was when I did a 'getimage' and at the very end was told:

"Are you satisfied? ([y]/n):
WARNING: LVM partition "/dev/sda2" is not assigned to any group!
WARNING: LVM partition "/dev/sdb1" is not assigned to any group!
WARNING: LVM partition "/dev/sdc1" is not assigned to any group!
WARNING: LVM group "VolGroup00" doesn't have partitions!
Would you like to run the "si_addclients" utility now? (y/[n]):"

I had no way of knowing if this was a big deal or not, but when I tried to load the image onto a different machine, the fun began when my autoinstall script began executing. It did print out what looked like a valid partition table for /sda but then it also said:
"SCSI device dsa: drive cache: write through w/ FUA
 sda: unknown patition table"
however, it did look like it then successfully recreated things, printing out what looked like a valid new table. It also did the exact same thing for sdb an sdc.

It then went into the RAID section and finally into:

Load device mapper driver (for LVM)
device-mapper: 4.5.0-ioctl (2005-10-04) initialised: [EMAIL PROTECTED]
lvcreate -L33325056K -n LogVol00 VolGroup00 || shellout
 Volume group "VolGroup00" doesn't exist
Killing off running processes.

and then it died. I should point out I'm running systemimager-client-3.7.4r3676_arighi-1 on both the client and image server. As usual, let me know what other details you need...

-mark

#!/bin/sh
#
#   "SystemImager"
#
#   $Id: autoinstallscript.template 3672 2006-07-13 10:44:01Z arighi $
#    vi:set filetype=sh:
#
#   Copyright (C) 1999-2006 Brian Elliott Finley
#
#   28.07.2005 Erich Focht : SCSI device detection and generation of
#                            /a/etc/systemconfig/hardware.lst
#
#   David N. Lombard : Disks enumeration and disk editing
#

# This master autoinstall script was created with SystemImager 
v3.7.4r3676_arighi

# Pull in variables left behind by the linuxrc script.
# This information is passed from the linuxrc script on the autoinstall media 
# via /tmp/variables.txt.  Apparently the shell we use in BOEL is not 
# intelligent enough to take a "set -a" parameter.
#
. /tmp/variables.txt

# Load functions and other variables
. /etc/init.d/functions

get_arch

if [ -z $NO_LISTING ]; then
    VERBOSE_OPT="v"
else
    VERBOSE_OPT=""
fi

[ -z $IMAGENAME ] && IMAGENAME=rhel4-U3-dl585
[ -z $OVERRIDES ] && OVERRIDES="rhel4-U3-dl585"

### BEGIN Check to be sure this not run from a working machine ###
# Test for mounted SCSI or IDE disks
mount | grep [hs]d[a-z][1-9] > /dev/null 2>&1
[ $? -eq 0 ] &&  logmsg Sorry.  Must not run on a working machine... && shellout

# Test for mounted software RAID devices
mount | grep md[0-9] > /dev/null 2>&1
[ $? -eq 0 ] &&  logmsg Sorry.  Must not run on a working machine... && shellout

# Test for mounted hardware RAID disks
mount | grep c[0-9]+d[0-9]+p > /dev/null 2>&1
[ $? -eq 0 ] &&  logmsg Sorry.  Must not run on a working machine... && shellout
### END Check to be sure this not run from a working machine ###


################################################################################
#
#   Stop RAID devices before partitioning begins
#
# Q1) Why did they get started in the first place?  
# A1) So we can pull a local.cfg file off a root mounted software RAID system.
#     They may not be started on your system -- they would only be started if
#     you did the stuff in Q3 below.
#
# Q2) Why didn't my local.cfg on my root mounted software RAID work for me 
#     with the standard kernel flavour?
# A2) The standard kernel flavour uses modules for the software RAID drivers --
#     therefore, software RAID is not available at the point in the boot process
#     where BOEL needs to read the local.cfg file.  They are only pulled over 
#     when this script is run, which is, of course, only runnable if it was
#     pulled over the network using the settings that you would have wanted it
#     to get from the local.cfg file, which it couldn't.  Right?
#
# Q3) Whatever.  So how do I make it work with a local.cfg file on my root
#     mounted software RAID?  
# A3) Compile an autoinstall kernel with software RAID, and any other drivers 
#     you might need built in (filesystem, SCSI drivers, etc.).
#
if [ -f /proc/mdstat ]; then
  RAID_DEVICES=` cat /proc/mdstat | grep ^md | sed 's/ .*$//g' `

  # Turn dem pesky raid devices off!
  for RAID_DEVICE in ${RAID_DEVICES}
  do
    DEV="/dev/${RAID_DEVICE}"
    logmsg "mdadm --manage ${DEV} --stop"
    mdadm --manage ${DEV} --stop
  done
fi
#
################################################################################
# BEGIN disk enumeration
#
# Note the kludgey way to get /dev/sd* and /dev/*/c*d* to sort properly...
#
# Parse the correct file depending by the kernel release -AR-
kernel=`uname -r | sed "s/^\(2\.[64]\).*/\1/"`
if [ $kernel = "2.4" ]; then
    diskfile=/proc/partitions
else
    diskfile=/proc/diskstats
fi 

DISKORDER=

[ -z $DISKORDER ] || {
  logmsg enumerate_disks
  order=`echo "$DISKORDER" | sed 's/ /,/g' | sed s/,,*/,/g | sed s/^,//`
  DISKS=0
  cdroms=`cat /proc/sys/dev/cdrom/info | sed -ne "s/^drive 
name:[[:space:]]*//p"`
  while : ; do
    [ -z $order ] && break
    type=`expr $order : '\([^,]*\),' \| $order`
    case $type in
    cciss | ida | rd )
      for dev in `cat $diskfile | sed -ne "s/.*\($type\\/c[0-9]d[0-9]\).*/\1/p" 
| sort -u` ; do
        logmsg " $dev"
        eval DISK$DISKS=/dev/${dev}
        DISKS=`expr $DISKS + 1`
      done
      ;;
    hd | sd )
      for dev in `cat $diskfile | sed -ne "s/.*\($type[a-z]\+\).*/\1/p" | sort 
-u` ; do
        skip=0
        for cdrom in $cdroms; do
            if [ "$dev" = "$cdrom" ]; then
                skip=1
                break
            fi
        done
        if [ $skip -eq 0 ]; then
            logmsg " $dev"
            eval DISK$DISKS=/dev/${dev}
            DISKS=`expr $DISKS + 1`
        fi
      done
      ;;
    * )
      logmsg "type='$type'"
      shellout
      ;;
    esac
    order=`expr $order : '[^,]*,\(.*\)'`
  done
  logmsg DISKS=$DISKS
  [ $DISKS -eq 0 ] && {
    beep
    beep
    logmsg ""
    logmsg "NO DISK DEVICE FILES WERE FOUND.  THIS USUALLY MEANS THE KERNEL DID 
NOT"
    logmsg "RECOGNIZE ANY OF THE ATTACHED DISKS."
    logmsg ""
    logmsg "The kernel boot messages, which preceded this, may indicate why."
    logmsg ""
    logmsg "Reverting to disk configuration specified by image master script."
    DISKORDER=
    logmsg ""
  }
  echo
  beep
}
#
# END disk enumeration
################################################################################

if [ -z $DISKORDER ] ; then
  DISK0=/dev/sda
elif [ -z $DISK0 ] ; then
  echo "Undefined: DISK0"
  shellout
fi
### BEGIN partition $DISK0 ###
logmsg "Partitioning $DISK0..."
logmsg "Old partition table for $DISK0:"
parted -s -- $DISK0 print

# Wipe the MBR (Master Boot Record) clean.
logmsg "dd if=/dev/zero of=$DISK0 bs=512 count=1 || shellout"
dd if=/dev/zero of=$DISK0 bs=512 count=1 || shellout

# Re-read the disk label.
logmsg "blockdev --rereadpt $DISK0"
blockdev --rereadpt $DISK0

# Create disk label.  This ensures that all remnants of the old label, whatever
# type it was, are removed and that we're starting with a clean label.
logmsg "parted -s -- $DISK0 mklabel msdos || shellout"
parted -s -- $DISK0 mklabel msdos || shellout

# Get the size of the destination disk so that we can make the partitions fit 
properly.
DISK_SIZE=`parted -s $DISK0 unit MB print | grep 'Disk geometry for' | sed 
's/^.*-//g' | sed 's/\..*$//' | sed 's/MB//' `
[ -z $DISK_SIZE ] && shellout
if [ "$ARCH" = "alpha" ]; then
    END_OF_LAST_PRIMARY=1
else
    END_OF_LAST_PRIMARY=0
fi


logmsg "Creating partition ${DISK0}1."
START_MB=$END_OF_LAST_PRIMARY
END_MB=$(echo "scale=3; ($START_MB + 101.944)" | bc)
logmsg "parted -s -- $DISK0 mkpart primary $START_MB $END_MB || shellout"
parted -s -- $DISK0 mkpart primary $START_MB $END_MB || shellout
END_OF_LAST_PRIMARY=$END_MB
logmsg parted -s -- $DISK0 set 1 boot on || shellout
parted -s -- $DISK0 set 1 boot on || shellout

logmsg "Creating partition ${DISK0}2."
START_MB=$END_OF_LAST_PRIMARY
END_MB=$(( $DISK_SIZE - 0 ))
logmsg "parted -s -- $DISK0 mkpart primary $START_MB $END_MB || shellout"
parted -s -- $DISK0 mkpart primary $START_MB $END_MB || shellout
END_OF_LAST_PRIMARY=$END_MB
logmsg parted -s -- $DISK0 set 2 lvm on || shellout
parted -s -- $DISK0 set 2 lvm on || shellout

logmsg "New partition table for $DISK0:"
logmsg "parted -s -- $DISK0 print"
parted -s -- $DISK0 print
### END partition $DISK0 ###


if [ -z $DISKORDER ] ; then
  DISK1=/dev/sdb
elif [ -z $DISK1 ] ; then
  echo "Undefined: DISK1"
  shellout
fi
### BEGIN partition $DISK1 ###
logmsg "Partitioning $DISK1..."
logmsg "Old partition table for $DISK1:"
parted -s -- $DISK1 print

# Wipe the MBR (Master Boot Record) clean.
logmsg "dd if=/dev/zero of=$DISK1 bs=512 count=1 || shellout"
dd if=/dev/zero of=$DISK1 bs=512 count=1 || shellout

# Re-read the disk label.
logmsg "blockdev --rereadpt $DISK1"
blockdev --rereadpt $DISK1

# Create disk label.  This ensures that all remnants of the old label, whatever
# type it was, are removed and that we're starting with a clean label.
logmsg "parted -s -- $DISK1 mklabel msdos || shellout"
parted -s -- $DISK1 mklabel msdos || shellout

# Get the size of the destination disk so that we can make the partitions fit 
properly.
DISK_SIZE=`parted -s $DISK1 unit MB print | grep 'Disk geometry for' | sed 
's/^.*-//g' | sed 's/\..*$//' | sed 's/MB//' `
[ -z $DISK_SIZE ] && shellout
if [ "$ARCH" = "alpha" ]; then
    END_OF_LAST_PRIMARY=1
else
    END_OF_LAST_PRIMARY=0
fi


logmsg "Creating partition ${DISK1}1."
START_MB=$END_OF_LAST_PRIMARY
END_MB=$(( $DISK_SIZE - 0 ))
logmsg "parted -s -- $DISK1 mkpart primary $START_MB $END_MB || shellout"
parted -s -- $DISK1 mkpart primary $START_MB $END_MB || shellout
END_OF_LAST_PRIMARY=$END_MB
logmsg parted -s -- $DISK1 set 1 lvm on || shellout
parted -s -- $DISK1 set 1 lvm on || shellout

logmsg "New partition table for $DISK1:"
logmsg "parted -s -- $DISK1 print"
parted -s -- $DISK1 print
### END partition $DISK1 ###


if [ -z $DISKORDER ] ; then
  DISK2=/dev/sdc
elif [ -z $DISK2 ] ; then
  echo "Undefined: DISK2"
  shellout
fi
### BEGIN partition $DISK2 ###
logmsg "Partitioning $DISK2..."
logmsg "Old partition table for $DISK2:"
parted -s -- $DISK2 print

# Wipe the MBR (Master Boot Record) clean.
logmsg "dd if=/dev/zero of=$DISK2 bs=512 count=1 || shellout"
dd if=/dev/zero of=$DISK2 bs=512 count=1 || shellout

# Re-read the disk label.
logmsg "blockdev --rereadpt $DISK2"
blockdev --rereadpt $DISK2

# Create disk label.  This ensures that all remnants of the old label, whatever
# type it was, are removed and that we're starting with a clean label.
logmsg "parted -s -- $DISK2 mklabel msdos || shellout"
parted -s -- $DISK2 mklabel msdos || shellout

# Get the size of the destination disk so that we can make the partitions fit 
properly.
DISK_SIZE=`parted -s $DISK2 unit MB print | grep 'Disk geometry for' | sed 
's/^.*-//g' | sed 's/\..*$//' | sed 's/MB//' `
[ -z $DISK_SIZE ] && shellout
if [ "$ARCH" = "alpha" ]; then
    END_OF_LAST_PRIMARY=1
else
    END_OF_LAST_PRIMARY=0
fi


logmsg "Creating partition ${DISK2}1."
START_MB=$END_OF_LAST_PRIMARY
END_MB=$(( $DISK_SIZE - 0 ))
logmsg "parted -s -- $DISK2 mkpart primary $START_MB $END_MB || shellout"
parted -s -- $DISK2 mkpart primary $START_MB $END_MB || shellout
END_OF_LAST_PRIMARY=$END_MB
logmsg parted -s -- $DISK2 set 1 lvm on || shellout
parted -s -- $DISK2 set 1 lvm on || shellout

logmsg "New partition table for $DISK2:"
logmsg "parted -s -- $DISK2 print"
parted -s -- $DISK2 print
### END partition $DISK2 ###



### BEGIN software-RAID initialization commands -AR- ###
logmsg "Load software RAID modules."
modprobe linear
modprobe raid0
modprobe raid1
modprobe raid5
modprobe raid6
modprobe raid10
### END software-RAID initialization commands ###

logmsg "Load device mapper driver (for LVM)."
modprobe dm-mod

### BEGIN LVM initialization commands -AR- ###
### END LVM initialization commands ###

### BEGIN LVM groups creation commands -AR- ###
### END LVM groups creation commands ###

### BEGIN LVM volumes creation commands -AR- ###
logmsg "lvcreate  -L33325056K -n LogVol00 VolGroup00 || shellout"
lvcreate  -L33325056K -n LogVol00 VolGroup00 || shellout
logmsg "lvscan > /dev/null; lvchange -a y /dev/VolGroup00/LogVol00 || shellout"
lvscan > /dev/null; lvchange -a y /dev/VolGroup00/LogVol00 || shellout
logmsg "lvcreate  -L2031616K -n LogVol01 VolGroup00 || shellout"
lvcreate  -L2031616K -n LogVol01 VolGroup00 || shellout
logmsg "lvscan > /dev/null; lvchange -a y /dev/VolGroup00/LogVol01 || shellout"
lvscan > /dev/null; lvchange -a y /dev/VolGroup00/LogVol01 || shellout
### END LVM volumes creation commands ###

logmsg "Load additional filesystem drivers."
modprobe ext2
modprobe ext3
modprobe fat
modprobe jfs
modprobe reiserfs
modprobe vfat
modprobe xfs

### BEGIN swap and filesystem creation commands ###
logmsg "mke2fs -j /dev/VolGroup00/LogVol00 || shellout"
mke2fs -j /dev/VolGroup00/LogVol00 || shellout
logmsg "mkdir -p /a/ || shellout"
mkdir -p /a/ || shellout
logmsg "mount /dev/VolGroup00/LogVol00 /a/ -t ext3 -o defaults || shellout"
mount /dev/VolGroup00/LogVol00 /a/ -t ext3 -o defaults || shellout

logmsg "mke2fs -j ${DISK0}1 || shellout"
mke2fs -j ${DISK0}1 || shellout
logmsg "tune2fs -L /boot ${DISK0}1"
tune2fs -L /boot ${DISK0}1
logmsg "mkdir -p /a/boot || shellout"
mkdir -p /a/boot || shellout
logmsg "mount ${DISK0}1 /a/boot -t ext3 -o defaults || shellout"
mount ${DISK0}1 /a/boot -t ext3 -o defaults || shellout

### END swap and filesystem creation commands ###

### BEGIN mount proc in image for tools like System Configurator ###
logmsg "mkdir -p /a/proc || shellout"
mkdir -p /a/proc || shellout
logmsg "mount proc /a/proc -t proc -o defaults || shellout"
mount proc /a/proc -t proc -o defaults || shellout
### END mount proc in image for tools like System Configurator ###

if [ ! $kernel = "2.4" ]; then
### BEGIN mount sysfs in image for tools that might be run during chroot ###
logmsg "mkdir -p /a/sys || shellout"
mkdir -p /a/sys || shellout
logmsg "mount sysfs /a/sys -t sysfs -o defaults || shellout"
mount sysfs /a/sys -t sysfs -o defaults || shellout
### END mount sysfs in image for tools that might be run during chroot ###
fi

################################################################################
#
#   Lay the image down on the freshly formatted disk(s)
#
if [ ! -z $MONITOR_SERVER ]; then
    start_report_task
fi

if [ ! -z $FLAMETHROWER_DIRECTORY_PORTBASE ]; then 

    # Use multicast 
    MODULE_NAME="${IMAGENAME}"
    DIR=/a
    RETRY=7
    FLAMETHROWER_TARPIPE=y
    flamethrower_client
    if [ ! -z $MONITOR_SERVER ]; then
        stop_report_task 101
    fi
elif [ ! -z $BITTORRENT_STAGING ]; then
    # Use BitTorrent
    if [ -f "${TORRENTS_DIR}/image-${IMAGENAME}.tar.gz.torrent" ]; then
        bittorrent_tarball="image-${IMAGENAME}.tar.gz"
        compress='z'
    elif [ -f "${TORRENTS_DIR}/image-${IMAGENAME}.tar.torrent" ]; then
        bittorrent_tarball="image-${IMAGENAME}.tar"
        compress=''
    else
        logmsg "error: cannot find a valid torrent file for the image 
${IMAGENAME}"
        shellout
    fi
    # Download image from peers
    logmsg "Start downloading image using torrent ${bittorrent_tarball}.torrent"
    logmsg ""
    logmsg "--> INFO: remember to start 
/etc/init.d/systemimager-server-bittorrent on the image server!"
    logmsg ""
    bittorrent_get_file ${TORRENTS_DIR}/${bittorrent_tarball}.torrent 
${BITTORRENT_STAGING}
    if [ ! -z $MONITOR_SERVER ]; then
        stop_report_task 101
    fi
    # Extract image.
    logmsg "Extracting image from ${bittorrent_tarball} ..."
    (cd /a/ && tar -x${VERBOSE_OPT}${compress}Spf 
${BITTORRENT_STAGING}/${bittorrent_tarball} > /dev/console) || shellout
    rm -f ${BITTORRENT_STAGING}/${bittorrent_tarball}
    unset bittorrent_tarball
else 
    # Use rsync 
    if [ $NO_LISTING ]; then
        logmsg "Quietly installing image... "
        start_spinner
    fi
    if [ "${TMPFS_STAGING}" = "yes" ]; then 

        # Deposit image into tmpfs
        DIR=/tmp/tmpfs_staging
        logmsg
        logmsg "TMPFS_STAGING=${TMPFS_STAGING} -- Staging in ${DIR}"
        mkdir -p ${DIR}

        logmsg "rsync -aHS${VERBOSE_OPT} --exclude=lost+found/ --numeric-ids 
${IMAGESERVER}::${IMAGENAME}/ ${DIR}/" 
        rsync -aHS${VERBOSE_OPT} --exclude=lost+found/ --exclude=/proc/* 
--numeric-ids \
              ${IMAGESERVER}::${IMAGENAME}/ ${DIR}/ > /dev/console || shellout 

        if [ ! -z $MONITOR_SERVER ]; then
            stop_report_task 101
        fi

        # Move from staging in tmpfs to disk
        rsync -aHS${VERBOSE_OPT} --exclude=lost+found/ --numeric-ids ${DIR}/ 
/a/ > /dev/console || shellout
    else
        logmsg "rsync -aHS${VERBOSE_OPT} --exclude=lost+found/ 
--exclude=/proc/* --numeric-ids ${IMAGESERVER}::${IMAGENAME}/ /a/" 
        rsync -aHS${VERBOSE_OPT} --exclude=lost+found/ --exclude=/proc/* 
--numeric-ids ${IMAGESERVER}::${IMAGENAME}/ /a/ > /dev/console || shellout 
        if [ ! -z $MONITOR_SERVER ]; then
            stop_report_task 101
        fi
    fi
fi 

beep

#
################################################################################


if [ $NO_LISTING ]; then
    stop_spinner
fi

# Leave notice of which image is installed on the client
echo $IMAGENAME > /a/etc/systemimager/IMAGE_LAST_SYNCED_TO || shellout

### BEGIN generate new fstab file from autoinstallscript.conf ###
cat <<'EOF' > /a/etc/fstab
# This file is edited by fstab-sync - see 'man fstab-sync' for details
/dev/VolGroup00/LogVol00        /       ext3    defaults        1       1
LABEL=/boot     /boot   ext3    defaults        1       2
none    /dev/pts        devpts  gid=5,mode=620  0       0
none    /dev/shm        tmpfs   defaults        0       0
none    /proc   proc    defaults        0       0
none    /sys    sysfs   defaults        0       0
/dev/VolGroup00/LogVol01        swap    swap    defaults        0       0
/dev/hda        /media/cdrom    auto    pamconsole,exec,noauto,managed  0       0
/dev/fd0        /media/floppy   auto    pamconsole,exec,noauto,managed  0       0
EOF
### END generate new fstab file from autoinstallscript.conf ###

################################################################################
#
#   Process override directories
#
for OVERRIDE in $OVERRIDES
do
    if [ ! -z $FLAMETHROWER_DIRECTORY_PORTBASE ]; then
        # Use multicast
        MODULE_NAME="override_${OVERRIDE}"
        DIR=/a
        RETRY=7
        FLAMETHROWER_TARPIPE=y
        flamethrower_client
    elif [ ! -z $BITTORRENT_STAGING ]; then
        # Use BitTorrent
        if [ -f "${TORRENTS_DIR}/override-${OVERRIDE}.tar.gz.torrent" ]; then
            bittorrent_tarball="override-${OVERRIDE}.tar.gz"
            compress='z'
        elif [ -f "${TORRENTS_DIR}/override-${OVERRIDE}.tar.torrent" ]; then
            bittorrent_tarball="override-${OVERRIDE}.tar"
            compress=''
        else
            bittorrent_tarball=""
            logmsg "warning: cannot find a valid torrent file for override 
${OVERRIDE}"
        fi
        if [ ! -z $bittorrent_tarball ]; then
            logmsg "Start downloading override using torrent 
${bittorrent_tarball}.torrent"
            logmsg ""
            logmsg "--> INFO: remember to start 
/etc/init.d/systemimager-server-bittorrent on the image server!"
            logmsg ""
            # Download override from peers
            bittorrent_get_file ${TORRENTS_DIR}/${bittorrent_tarball}.torrent 
${BITTORRENT_STAGING}
            # Extract override.
            logmsg "Extracting override from ${bittorrent_tarball} ..."
            (cd /a/ && tar -x${VERBOSE_OPT}${compress}Spf 
${BITTORRENT_STAGING}/${bittorrent_tarball} > /dev/console) || shellout
            rm -f ${BITTORRENT_STAGING}/${bittorrent_tarball}
        else
            # Use rsync
            logmsg "trying to download override ${OVERRIDE} with rsync..."
            logmsg "rsync -av --numeric-ids $IMAGESERVER::overrides/$OVERRIDE/ 
/a/"
            rsync -av --numeric-ids $IMAGESERVER::overrides/$OVERRIDE/ /a/ > 
/dev/console || logmsg "Override directory $OVERRIDE doesn't seem to exist, but 
that may be OK."
        fi
        unset bittorrent_tarball
    else
        # Use rsync
        logmsg "rsync -av --numeric-ids $IMAGESERVER::overrides/$OVERRIDE/ /a/"
        rsync -av --numeric-ids $IMAGESERVER::overrides/$OVERRIDE/ /a/ > 
/dev/console || logmsg "Override directory $OVERRIDE doesn't seem to exist, but 
that may be OK."
    fi
done

beep

#
################################################################################

################################################################################
# BEGIN disk edits
#
[ -z $DISKORDER ] || {
  echo "Editing files for actual disk configuration..."
  echo " /dev/sda -> $DISK0"
  echo " /dev/sdb -> $DISK1"
  echo " /dev/sdc -> $DISK2"
  for file in /etc/fstab /etc/systemconfig/systemconfig.conf 
/boot/grub/menu.lst /etc/lilo.conf /etc/grub.conf; do
    [ -f /a/$file ] || continue
    echo " $file"
    cp /a/$file /a/$file.image
    cat /a/$file.image |
    sed s:/dev/sdc:%DISK2%:g |
    sed s:/dev/sdb:%DISK1%:g |
    sed s:/dev/sda:%DISK0%:g |
    sed s:%DISK0%:$DISK0:g |
    sed s:%DISK1%:$DISK1:g |
    sed s:%DISK2%:$DISK2:g |
    cat > /a/$file
  done
  echo
  beep
}
#
# END disk edits
################################################################################


##################################################################
#
# Uncomment the line below to leave your hostname blank.
# Certain distributions use this as an indication to take on the
# hostname provided by a DHCP server.  The default is to have
# SystemConfigurator assign your clients the hostname that
# corresponds to the IP address the use during the install.
# (If you used to use the static_dhcp option, this is your man.)
#
#HOSTNAME=""


################################################################################
#
# mount /dev /a/dev -o bind if needed
#
#not needed for this image
#
################################################################################


################################################################################
#
#   Detect scsi hardware and include the device IDs into the hardware.lst
#   file used by systemconfigurator. Do nothing if the hardware.lst file
#   already exists (which is a sign that it has been already prepared).
#   Would be shorter if discover could return numerical device IDs...
#
if [ ! -f /a/etc/systemconfig/hardware.lst ]; then
   SCSI_MODS=`discover -f "%m\n" scsi | grep -v ide-scsi | uniq`
   for MOD in $SCSI_MODS; do
      DEVID=`grep $MOD /proc/bus/pci/devices | cut -f 2 | sort | uniq`
      for MYDEV in $DEVID; do
         VENDOR=`echo $MYDEV | cut -b 1-4`
         MODEL=`echo $MYDEV | cut -b 5-8`
         echo "$VENDOR $MODEL scsi $MOD" >> /a/etc/systemconfig/hardware.lst
         echo "Added SCSI device $VENDOR:$MODEL using module $MOD to 
hardware.lst"
      done
   done
fi
#
################################################################################

################################################################################
#
#   System Configurator
#
# Configure the client's hardware, network interface, and boot loader.
#

# Create an /etc/mtab file with appropriate entries
cat /etc/mtab | grep -v '/dev/ram' | grep -v -E '^\/dev\s+\/a\/dev\s' | sed 
's,/a/*,/,g' | sort -u > /a/etc/mtab

[ -z $DEVICE ] && DEVICE=eth0
chroot /a/ systemconfigurator 
--excludesto=/etc/systemimager/systemconfig.local.exclude --configsi --stdin << 
EOL || shellout
[NETWORK]
HOSTNAME = $HOSTNAME
DOMAINNAME = $DOMAINNAME

[INTERFACE0]
DEVICE = eth0
TYPE = dhcp
EOL
#
################################################################################


################################################################################
#
#   Post Install Scripts
#
run_post_install_scripts
#
################################################################################

################################################################################
#
#   Save virtual console session in the imaged client
#
if [ ! -z $MONITOR_SERVER ]; then
    if [ "x$MONITOR_CONSOLE" = "xyes" ]; then 
        [ ! -d /a/root ] && mkdir -p /a/root
        cp -f /tmp/si_monitor.log /a/root/si_monitor.log
    fi
fi

#
################################################################################


################################################################################
#
#   Unmount filesystems
#
if [ ! $kernel = "2.4" ]; then
logmsg "umount /a/sys || shellout"
umount /a/sys || shellout
fi

logmsg "umount /a/proc || shellout"
umount /a/proc || shellout

logmsg "umount /a/boot || shellout"
umount /a/boot || shellout

logmsg "umount /a/ || shellout"
umount /a/ || shellout

#
################################################################################


################################################################################
#
#   Tell the image server we are done
#   
rsync $IMAGESERVER::scripts/imaging_complete > /dev/null 2>&1
logmsg "Imaging completed"
#
################################################################################

if [ ! -z $MONITOR_SERVER ]; then
    # Report the 'imaged' state to the monitor server.
    send_monitor_msg "status=100"
    if [ "x$MONITOR_CONSOLE" = "xyes" ]; then 
        # Print some empty lines and sleep some seconds to give time to
        # the virtual console to get last messages.
        # XXX: this is a dirty solution, we should find a better way to
        # sync last messages... -AR-
        logmsg ""
        logmsg ""
        logmsg ""
        sleep 10
    fi
fi

# Take network interface down
[ -z $DEVICE ] && DEVICE=eth0
ifconfig $DEVICE down || shellout

# Announce completion (even for non beep-incessantly --post-install options)
beep 3

# reboot the autoinstall client
shutdown -r now
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Sisuite-devel mailing list
Sisuite-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sisuite-devel

Reply via email to