This is a copy of myimage.master script.can you please
tell me how to point the rsync to the riht
imageserver; the imageserver's ip is "137.21.80.197"
and the hostname is "linuxghostserver"(the ip address
works better often)

"#!/bin/sh
#
#   "SystemImager"
#
#   Copyright (C) 1999-2004 Brian Elliott Finley
#
#   $Id: autoinstallscript.template,v 1.17 2004/04/17
14:47:53 brianfinley Exp $
#

# This master autoinstall script was created with
SystemImager v3.4.1

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

get_arch

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

# 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 || shellout

[ -z $IMAGENAME ] && IMAGENAME=myimage
[ -z $OVERRIDES ] && OVERRIDES="myimage"

### 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 ] &&  echo 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 ] &&  echo 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 ] &&  echo 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' `

  # raidstop will not run unless a raidtab file exists
  echo "" >> /etc/raidtab || shellout

  # turn dem pesky raid devices off!
  for RAID_DEVICE in ${RAID_DEVICES}
  do
    DEV="/dev/${RAID_DEVICE}"
    # we don't do a shellout here because, well I
forgot why, but we don't.
    echo "raidstop ${DEV}" && raidstop ${DEV}
  done
fi
#
################################################################################

### BEGIN partition /dev/hdc ###
echo "Partitioning /dev/hdc..."
echo "Old partition table for /dev/hdc:"
parted -s -- /dev/hdc print

# 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.
echo "parted -s -- /dev/hdc mklabel msdos || shellout"
parted -s -- /dev/hdc mklabel msdos || shellout

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


echo "Creating partition /dev/hdc1."
START_MB=$END_OF_LAST_PRIMARY
END_MB=$(echo "scale=3; ($START_MB + 101)" | bc)
echo "parted -s -- /dev/hdc mkpart primary ext2
$START_MB $END_MB || shellout"
parted -s -- /dev/hdc mkpart primary ext2 $START_MB
$END_MB || shellout
END_OF_LAST_PRIMARY=$END_MB
echo parted -s -- /dev/hdc set 1 boot on || shellout
parted -s -- /dev/hdc set 1 boot on || shellout

echo "Creating partition /dev/hdc2."
START_MB=$END_OF_LAST_PRIMARY
END_MB=$(( $DISK_SIZE - 0 ))
echo "parted -s -- /dev/hdc mkpart primary ext2
$START_MB $END_MB || shellout"
parted -s -- /dev/hdc mkpart primary ext2 $START_MB
$END_MB || shellout
END_OF_LAST_PRIMARY=$END_MB
echo parted -s -- /dev/hdc set 2 lvm on || shellout
parted -s -- /dev/hdc set 2 lvm on || shellout

echo "New partition table for /dev/hdc:"
echo "parted -s -- /dev/hdc print"
parted -s -- /dev/hdc print
### END partition /dev/hdc ###



echo "Load additional filesystem drivers."
modprobe reiserfs
modprobe ext2
modprobe ext3
modprobe jfs
modprobe xfs

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

echo "mke2fs -j /dev/hdc1 || shellout"
mke2fs -j /dev/hdc1 || shellout
echo "tune2fs -L /boot /dev/hdc1"
tune2fs -L /boot /dev/hdc1
echo "mkdir -p /a/boot || shellout"
mkdir -p /a/boot || shellout
echo "mount /dev/hdc1 /a/boot -t ext3 -o defaults ||
shellout"
mount /dev/hdc1 /a/boot -t ext3 -o defaults ||
shellout

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

### BEGIN mount proc in image for tools like System
Configurator ###
echo "mkdir -p /a/proc || shellout"
mkdir -p /a/proc || shellout
echo "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 ###

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

    # Use multicast 
    MODULE_NAME="${IMAGENAME}"
    DIR=/a
    RETRY=7
    flamethrower_client
else 
    # Use rsync 
    if [ $NO_LISTING ]; then
        echo "Quietly installing image... "
        start_spinner
    fi
    if [ "${TMPFS_STAGING}" = "yes" ]; then 

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

        echo "rsync -aHS${VERBOSE_OPT}
--exclude=lost+found/ --numeric-ids
${IMAGESERVER}::${IMAGENAME}/ ${DIR}/" 
        rsync -aHS${VERBOSE_OPT} --exclude=lost+found/
--numeric-ids ${IMAGESERVER}::${IMAGENAME}/ ${DIR}/ ||
shellout 

        # Move from staging in tmpfs to disk
        rsync -aHS${VERBOSE_OPT} --exclude=lost+found/
--numeric-ids ${DIR}/ /a/
    else
        echo "rsync -aHS${VERBOSE_OPT}
--exclude=lost+found/ --numeric-ids
${IMAGESERVER}::${IMAGENAME}/ /a/" 
        rsync -aHS${VERBOSE_OPT} --exclude=lost+found/
--numeric-ids ${IMAGESERVER}::${IMAGENAME}/ /a/ ||
shellout 
    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/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_client
    else
        # Use rsync
        echo "rsync -av --numeric-ids
$IMAGESERVER::overrides/$OVERRIDE/ /a/"
        rsync -av --numeric-ids
$IMAGESERVER::overrides/$OVERRIDE/ /a/ || echo
"Override directory $OVERRIDE doesn't seem to exist,
but that may be OK."
    fi
done

beep

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


##################################################################
#
# 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
#
################################################################################


################################################################################
#
#   System Configurator
#
# Configure the client's hardware, network interface,
and boot loader.
#
chroot /a/ systemconfigurator
--excludesto=/etc/systemimager/systemconfig.local.exclude
--configsi --stdin << EOL || shellout
[NETWORK]
HOSTNAME = $HOSTNAME
DOMAINNAME = $DOMAINNAME

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


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


################################################################################
#
#   Unmount filesystems
#
echo "umount /a/proc || shellout"
umount /a/proc || shellout

echo "umount /a/boot || shellout"
umount /a/boot || shellout

echo "umount /a/ || shellout"
umount /a/ || shellout

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


################################################################################
#
#   Tell the image server we're done
#   
rsync $IMAGESERVER::scripts/imaging_complete >
/dev/null 2>&1
#
################################################################################

# Take network interface down
ifconfig eth0 down || shellout

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

beep_incessantly"





        
                
__________________________________ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com


-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
Sisuite-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sisuite-users

Reply via email to