source: MondoRescue/trunk/tools/mkqemu@ 448

Last change on this file since 448 was 448, checked in by bcornec, 18 years ago

merge -r435:447 $SVN_M/branches/stable

  • Property svn:executable set to *
File size: 1.4 KB
Line 
1#!/bin/bash
2#
3# $Id$
4#
5# Script allowing mondo packages production on various distributions with qemu
6#
7
8if [ _"$1" == _"" ]; then
9 echo "Syntax: mkqemu [mondo version] ([vm].. )"
10 exit -1
11fi
12
13if [ _"$2" == _"" ]; then
14 export SVN_VM="mdk101 mdk102 mdv2006 rhel3 rhel4 rh73 fc4 sles9"
15else
16 export SVN_VM="$2"
17fi
18
19cat > /tmp/mkmondo << EOF
20#!/bin/bash
21
22export SVN_HOME=\$HOME/mondo/svn/branches
23export SVN_SSH="ssh -l bcornec"
24export SVN_EDITOR=vim
25export LANG="C"
26export LANGUAGE="C"
27export LC_ALL="C"
28
29if [ -d \$SVN_HOME/$1 ]; then
30 cd \$SVN_HOME/$1
31 svn up
32 if [ \$? != 0 ]; then
33 echo "Verify SVN installation"
34 exit -1
35 fi
36else
37 mkdir -p \$SVN_HOME
38 cd \$SVN_HOME
39 svn co svn+ssh://bcornec@svn.berlios.de/svnroot/repos/mondorescue/branches/$1 $1
40 if [ \$? != 0 ]; then
41 echo "Verify SVN installation"
42 exit -1
43 fi
44fi
45\$SVN_HOME/$1/tools/mkrpm < /dev/null
46\$SVN_HOME/$1/tools/mkdeliv
47EOF
48
49ipvm=10.0.2.15
50sp=2222
51
52for m in $SVN_VM; do
53 vmp=0
54 if [ ! -f /users/vmplayer/$m.qemu ]; then
55 echo "VM unaccessible. Verify NFS mount"
56 exit -1
57 fi
58 ps auxww | grep qemu | grep -v grep | grep -q /users/vmplayer/$m.qemu
59 if [ $? -ne 0 ]; then
60 # Virtual machine alreday started
61 vmp=1
62 qemu -m 256 -redir tcp:${sp}:${ipvm}:22 /users/vmplayer/$m.qemu &
63 sleep 240
64 fi
65 scp -P $sp /tmp/mkmondo bruno@localhost:
66 ssh -p $sp bruno@localhost "chmod 755 ./mkmondo ; ./mkmondo" | tee /tmp/mkvm.log
67 if [ $vmp -eq 1 ]; then
68 ssh -p $sp root@localhost "halt -p"
69 fi
70done
Note: See TracBrowser for help on using the repository browser.