#!/bin/sh DYNAMIPS_BUILD=yes XENOMIPS_FS_BUILD=yes CONFIG_FS_BUILD=yes IOS_FS_BUILD=yes XENOMIPS_DIR="files/" XENOMIPS_IMAGES_DIR="../xenomips-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-config1.img # IOS FS IOS_FS_SIZE=2048k IOS_FS_NAME=${XENOMIPS_IMAGES_DIR}/xenomips-ios1.img DEBIAN_MIRROR=http://debian.org.ua/debian DISTRO=sid PACKAGES="openssh-server libc6-xen libelf1 libpcap0.8 screen nfs-common quagga" 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 build_and_install_dynamips() { OLD_PWD="`pwd`" DESTDIR=`pwd`/${WORK_DIR} 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} } dd if=/dev/zero of=${XENOMIPS_FS_NAME} count=${XENOMIPS_FS_SIZE} bs=1024 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 <