xentaur

diff build-xenomips-image @ 18:7d69d81e680c

many copies of config file systems
author igor
date Thu Sep 20 16:50:53 2007 +0300 (2007-09-20)
parents 6d2b4b61733f
children aa20b6252730
line diff
     1.1 --- a/build-xenomips-image	Thu Sep 20 16:34:22 2007 +0300
     1.2 +++ b/build-xenomips-image	Thu Sep 20 16:50:53 2007 +0300
     1.3 @@ -16,7 +16,8 @@
     1.4  
     1.5  # Config FS
     1.6  CONFIG_FS_SIZE=1000k
     1.7 -CONFIG_FS_NAME=${XENOMIPS_IMAGES_DIR}/xenomips-config1.img
     1.8 +CONFIG_FS_NAME=${XENOMIPS_IMAGES_DIR}/xenomips-configXXX.img  # XXX will be automagically substitued with 
     1.9 +CONFIG_FS_NUMBER=5                                            # the number of the Xenomips instance
    1.10  
    1.11  # IOS FS
    1.12  IOS_FS_SIZE=2048k
    1.13 @@ -24,7 +25,7 @@
    1.14  
    1.15  DEBIAN_MIRROR=http://debian.org.ua/debian
    1.16  DISTRO=sid
    1.17 -PACKAGES="openssh-server libc6-xen libelf1 libpcap0.8 screen nfs-common quagga"
    1.18 +PACKAGES="openssh-server libc6-xen libelf1 libpcap0.8 screen nfs-common quagga tcpdump"
    1.19  DYNAMIPS_SOURCES=http://www.ipflow.utc.fr/dynamips/dynamips-0.2.7.tar.gz
    1.20  DYNAMIPS_BUILD_DIR=dynamips/
    1.21  KERNEL_VERSION=`uname -r`
    1.22 @@ -62,7 +63,7 @@
    1.23      cd ${OLD_PWD}
    1.24  }
    1.25  
    1.26 -myecho Preapring Xenomips filesystem
    1.27 +myecho Preparing the Xenomips filesystem
    1.28  dd if=/dev/zero of=${XENOMIPS_FS_NAME} seek=${XENOMIPS_FS_SIZE} bs=1024 count=1
    1.29  mkfs.ext3 -F ${XENOMIPS_FS_NAME}
    1.30  mkdir -p ${WORK_DIR} ${WORK_DIR2}
    1.31 @@ -128,7 +129,7 @@
    1.32  
    1.33  if  echo $CONFIG_FS_BUILD | grep -qi ^y
    1.34  then
    1.35 -    myecho Preapring Xenomips config filesystem
    1.36 +    myecho Preparing the Xenomips config filesystem
    1.37      dd if=/dev/zero of=${CONFIG_FS_NAME} bs=1k count=${CONFIG_FS_SIZE}
    1.38      mkfs.ext3 -F ${CONFIG_FS_NAME}
    1.39  
    1.40 @@ -137,13 +138,18 @@
    1.41      mv ${WORK_DIR2}/quagga ${WORK_DIR}/etc
    1.42      umount ${WORK_DIR}
    1.43  
    1.44 +    myecho Creating $CONFIG_FS_NUMBER copies of the Xenomips config filesystem
    1.45 +    for i in `seq 1 $CONFIG_FS_NUMBER`
    1.46 +    do
    1.47 +        cp ${CONFIG_FS_NAME} `echo ${CONFIG_FS_NAME} | sed s/XXX/$i/`
    1.48 +    done
    1.49  fi
    1.50  
    1.51  
    1.52  if echo $IOS_FS_BUILD | grep -qi ^y
    1.53  then
    1.54 -    myecho Preapring filesystem with IOSes
    1.55 -    dd if=/dev/zero of=${IOS_FS_NAME} bs=1k count=${CONFIG_FS_SIZE}
    1.56 +    myecho Preparing the filesystem with the IOSes
    1.57 +    dd if=/dev/zero of=${IOS_FS_NAME} bs=1k count=1 seek=${CONFIG_FS_SIZE}
    1.58      mkfs.ext3 -F ${IOS_FS_NAME}
    1.59      mount -o loop ${IOS_FS_NAME} ${WORK_DIR}
    1.60      cp ${IOS_DIR}/* ${WORK_DIR}