#!/bin/sh DYNAMIPS_BUILD=yes XENOMIPS_FS_BUILD=yes CONFIG_FS_BUILD=yes IOS_FS_BUILD=yes process_args() { true } XENOMIPS_DIR="files/" XENOMIPS_IMAGES_DIR="/xentaur/images/" IOS_DIR="/xentaur/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=10 # the number of the Xenomips instance # IOS FS IOS_FS_SIZE=2048k IOS_FS_NAME=${XENOMIPS_IMAGES_DIR}/xenomips-ios1.img DEBIAN_MIRROR=http://127.0.0.1:9999/debian DISTRO=lenny PACKAGES="udev openssh-server libc6-xen libelf1 libpcap0.8 screen nfs-common quagga tcpdump telnet ntpdate hping3 ntp nmap netcat socat" DYNAMIPS_SOURCES=http://www.ipflow.utc.fr/dynamips/dynamips-0.2.7.tar.gz DYNAMIPS_BUILD_DIR=dynamips/ PIXEMU_SOURCES=http://xgu.ru/download/pemu_public2007-07-02.tar.bz2 PIXEMU_BUILD_DIR=dynamips/ KERNEL_VERSION="2.6.26-2-xen-686 2.6.18-6-xen-686" #`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} } build_and_install_pixemu() { DESTDIR=${WORK_DIR}/usr/local/pixemu mkdir -p $DESTDIR cp /home/igor/pemu/pemu/* $DESTDIR } if [ $(id -u) != 0 ] then echo You are not root. echo Please, log in as root or run the script with sudo ecit 1 fi if echo $XENOMIPS_FS_BUILD | grep -qi ^y then 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} mount -o loop ${XENOMIPS_FS_NAME} ${WORK_DIR} debootstrap ${DISTRO} ${WORK_DIR} ${DEBIAN_MIRROR} cat <