xentaur

diff files/xenomips.sh @ 61:6471afbee150

*** empty log message ***
author igor
date Mon Dec 03 08:36:13 2007 +0200 (2007-12-03)
parents 65e80fabc89c
children cf823d27b029
line diff
     1.1 --- a/files/xenomips.sh	Thu Oct 25 17:59:28 2007 +0300
     1.2 +++ b/files/xenomips.sh	Mon Dec 03 08:36:13 2007 +0200
     1.3 @@ -1,13 +1,23 @@
     1.4  #!/bin/sh
     1.5  
     1.6 +XENOMIPS=''
     1.7 +grep -qi xenomips /proc/cmdline && XENOMIPS=`cat /proc/cmdline | sed 's/.*xenomips="//; s/".*//'`
     1.8 +
     1.9  case $1 in
    1.10      start)
    1.11          if grep -qi xenomips /proc/cmdline
    1.12          then 
    1.13 -            DYNAMIPS_WORKDIR="/xenomips/config"
    1.14 -            DYNAMIPS_ARGS=`cat /proc/cmdline | sed 's/.*xenomips="//; s/".*//'`
    1.15 -            cd "$DYNAMIPS_WORKDIR"
    1.16 -            screen -e '^xx' -d -m sh -c "while true; do dynamips $DYNAMIPS_ARGS ; done"
    1.17 +            WORKDIR="/xenomips/config/dynamips"
    1.18 +            if echo $XENOMIPS | grep -q ^./pemu
    1.19 +            then
    1.20 +                WORKDIR="/xenomips/config/pixemu"
    1.21 +                PIXOS=`echo $XENOMIPS | sed 's/.* //'`
    1.22 +                XENOMIPS=`echo $XENOMIPS | sed 's/ [^ ]*$//'`
    1.23 +                cp /xenomips/config/pixemu/pemu.ini.ORIG /xenomips/config/pixemu/pemu.ini
    1.24 +                sed -i -e "s@FLASH@$PIXOS@" /xenomips/config/pixemu/pemu.ini
    1.25 +            fi
    1.26 +            cd "$WORKDIR"
    1.27 +            screen -e '^xx' -d -m sh -c "while true; do $XENOMIPS ; done"
    1.28          else
    1.29              /etc/init.d/quagga start
    1.30              screen -e '^xx' -d -m sh -c 'while true; do vtysh; done'
    1.31 @@ -16,7 +26,7 @@
    1.32      stop)
    1.33          if grep -qi xenomips /proc/cmdline
    1.34          then 
    1.35 -            kill $(ps aux | grep  dynamips | awk '{print $2}')
    1.36 +            kill $(ps aux | egrep "pemu|dynamips" |  awk '{print $2}')
    1.37          else
    1.38              /etc/init.d/quagga stop
    1.39          fi