xentaur

diff build-xenomips-image @ 64:baf0c3300c19

update tags
author convert-repo
date Sun Jun 29 09:03:52 2008 +0000 (2008-06-29)
parents 0d56a515a5f6
children cf823d27b029
line diff
     1.1 --- a/build-xenomips-image	Thu Oct 25 21:43:58 2007 +0300
     1.2 +++ b/build-xenomips-image	Sun Jun 29 09:03:52 2008 +0000
     1.3 @@ -30,9 +30,11 @@
     1.4  
     1.5  DEBIAN_MIRROR=ftp://debian.org.ua/debian
     1.6  DISTRO=etch
     1.7 -PACKAGES="openssh-server libc6-xen libelf1 libpcap0.8 screen nfs-common quagga tcpdump telnet ntpdate hping3 ntpd nmap netcat socat"
     1.8 +PACKAGES="openssh-server libc6-xen libelf1 libpcap0.8 screen nfs-common quagga tcpdump telnet ntpdate hping3 ntp nmap netcat socat"
     1.9  DYNAMIPS_SOURCES=http://www.ipflow.utc.fr/dynamips/dynamips-0.2.7.tar.gz
    1.10  DYNAMIPS_BUILD_DIR=dynamips/
    1.11 +PIXEMU_SOURCES=http://xgu.ru/download/pemu_public2007-07-02.tar.bz2
    1.12 +PIXEMU_BUILD_DIR=dynamips/
    1.13  KERNEL_VERSION=`uname -r`
    1.14  
    1.15  
    1.16 @@ -68,6 +70,14 @@
    1.17      cd ${OLD_PWD}
    1.18  }
    1.19  
    1.20 +build_and_install_pixemu()
    1.21 +{
    1.22 +    DESTDIR=${WORK_DIR}/usr/local/pixemu
    1.23 +    mkdir -p $DESTDIR
    1.24 +    cp /home/igor/pemu/pemu/* $DESTDIR
    1.25 +}
    1.26 +
    1.27 +
    1.28  if [ $(id -u) != 0 ]
    1.29  then
    1.30      echo You are not root.
    1.31 @@ -126,7 +136,7 @@
    1.32  mv /etc/quagga /etc/quagga.ORIG
    1.33  ln -s /xenomips/config/etc/quagga /etc/quagga
    1.34  
    1.35 -mkdir -p /xenomips/{ios,config,dynamips} /var/lib/xenomips /root/.ssh
    1.36 +mkdir -p /xenomips/{ios,config} /var/lib/xenomips /root/.ssh
    1.37  
    1.38  cat <<PROFILE >> /root/.profile
    1.39  TERM=linux
    1.40 @@ -147,6 +157,9 @@
    1.41      chmod 600  ${WORK_DIR}/root/.ssh/authorized_keys
    1.42  
    1.43      build_and_install_dynamips
    1.44 +    build_and_install_pixemu
    1.45 +    kill $(lsof +D ${WORK_DIR} | awk '{print $2}' | grep -v PID)
    1.46 +    pkill ntpd
    1.47      umount ${WORK_DIR}
    1.48  fi
    1.49  
    1.50 @@ -159,6 +172,7 @@
    1.51      cp -a ${WORK_DIR}/etc/quagga.ORIG ${WORK_DIR2}/quagga
    1.52      perl -i -p -e 's/=no/=yes/' ${WORK_DIR2}/quagga/daemons
    1.53      touch ${WORK_DIR2}/quagga/{zebra,bgpd,ospfd,ripd,ripngd,ospf6d,isisd}.conf
    1.54 +    cp -a ${WORK_DIR}/usr/local/pixemu ${WORK_DIR2}/pixemu
    1.55      umount ${WORK_DIR}
    1.56  
    1.57      myecho Preparing the Xenomips config filesystem
    1.58 @@ -166,12 +180,14 @@
    1.59      mkfs.ext3 -F ${CONFIG_FS_NAME}
    1.60  
    1.61      mount -o loop ${CONFIG_FS_NAME} ${WORK_DIR}
    1.62 -    mkdir -p ${WORK_DIR}/etc
    1.63 +    mkdir -p ${WORK_DIR}/{dynamips,etc}
    1.64      mv ${WORK_DIR2}/quagga ${WORK_DIR}/etc
    1.65 +    mv ${WORK_DIR2}/pixemu ${WORK_DIR}/
    1.66 +    dd if=/dev/zero of=${WORK_DIR}/pixemu/FLASH bs=1k count=16k
    1.67      umount ${WORK_DIR}
    1.68  
    1.69      myecho Creating $CONFIG_FS_NUMBER copies of the Xenomips config filesystem
    1.70 -    for i in `seq 1 $CONFIG_FS_NUMBER`
    1.71 +    for i in `seq 0 $CONFIG_FS_NUMBER`
    1.72      do
    1.73          cp ${CONFIG_FS_NAME} `echo ${CONFIG_FS_NAME} | sed s/XXX/$i/`
    1.74      done