#!/bin/sh DYNAMIPS_BUILD=no XENOMIPS_FS_BUILD=yes CONFIG_FS_BUILD=no IOS_FS_BUILD=yes XENOMIPS_DIR="files/" XENOMIPS_IMAGES_DIR="/xen/images/" IOS_DIR="ios/" SSH_OPEN_KEY=files/id_dsa.pub #Xenomips FS XENOMIPS_FS_SIZE=2048k # size in 1k blocks XENOMIPS_FS_NAME=${XENOMIPS_IMAGES_DIR}/xenomips1.img # Config FS CONFIG_FS_SIZE=1000k CONFIG_FS_NAME=${XENOMIPS_IMAGES_DIR}/xenomips-configXXX.img # XXX will be automagically substitued with CONFIG_FS_NUMBER=5 # the number of the Xenomips instance # IOS FS IOS_FS_SIZE=2048k IOS_FS_NAME=${XENOMIPS_IMAGES_DIR}/xenomips-ios1.img DEBIAN_MIRROR=http://debian.osdn.org.ua/debian DISTRO=sid PACKAGES="openssh-server libc6-xen libelf1 libpcap0.8 screen nfs-common quagga tcpdump" DYNAMIPS_SOURCES=http://www.ipflow.utc.fr/dynamips/dynamips-0.2.7.tar.gz DYNAMIPS_BUILD_DIR=dynamips/ KERNEL_VERSION=`uname -r` WORK_DIR=${XENOMIPS_FS_NAME%%.img} WORK_DIR2=/tmp/xenomips-build myecho() { echo '**************************' echo "$@" echo '**************************' } build_and_install_dynamips() { OLD_PWD="`pwd`" DESTDIR=${WORK_DIR}/usr if echo $DYNAMIPS_BUILD | grep -qi ^y then rm -rf ${DYNAMIPS_BUILD_DIR}/ mkdir -p ${DYNAMIPS_BUILD_DIR}/ cd ${DYNAMIPS_BUILD_DIR}/ wget $DYNAMIPS_SOURCES tar xfz dynamips*tar* cd dynamips*/ perl -p -i -e s@^PCAP_LIB=.*@PCAP_LIB=-lpcap@ Makefile make else cd ${DYNAMIPS_BUILD_DIR}/dynamips*/ fi make install DESTDIR=${DESTDIR} cd ${OLD_PWD} } myecho Preparing the Xenomips filesystem dd if=/dev/zero of=${XENOMIPS_FS_NAME} seek=${XENOMIPS_FS_SIZE} bs=1024 count=1 mkfs.ext3 -F ${XENOMIPS_FS_NAME} mkdir -p ${WORK_DIR} ${WORK_DIR2} mount -o loop ${XENOMIPS_FS_NAME} ${WORK_DIR} debootstrap ${DISTRO} ${WORK_DIR} ${DEBIAN_MIRROR} cat <