source: branches/stable/tools/backupqemu @ 1334

Last change on this file since 1334 was 1334, checked in by bruno, 12 years ago
  • Add a test env (local for laptop + QEMU based)
  • creates qemu-env for reuse of code
  • Property svn:executable set to *
File size: 1.1 KB
Line 
1#!/bin/bash
2#
3# $Id$
4#
5# Test mondo in a virtual machine with qemu
6#
7
8(
9dname=`dirname $0`
10prem=`echo $dname |cut -c1`
11if [ _${prem} = _"/" ]; then
12        export TOOLHOME=$dname
13else
14        export TOOLHOME=${PWD}/$dname
15fi
16
17. $TOOLHOME/common-env
18. $TOOLHOME/distro-env
19. $TOOLHOME/qemu-env
20
21if [ _"$1" = _"" ]; then
22    echo "Syntax: backupqemu vm"
23    exit -1
24else
25    m=$1
26fi
27
28demodir=/home/bruno/demo-mondo
29h=test-mondo
30
31cat > $TMPDIR/test-mondo << EOF
32#!/bin/bash
33
34d=/users/svg
35mkdir -p \$d
36mount ${iph}:$demodir \$d
37mkdir -p \$d/tmp-$h \$d/scratch-$h \$d/images
38/usr/sbin/mondoarchive -n ${iph}:$demodir -G -F -N -O -E "/usr/share/doc /usr/src /home /users /var/log" -d images -s 4300m -T \$d/tmp-$h -S \$d/scratch-$h -p $h-$m
39umount \$d
40EOF
41chmod 755 $TMPDIR/test-mondo
42scp -P $sp $TMPDIR/test-mondo bruno@localhost:
43ssh -p $sp localhost "export PATH=/sbin:/usr/sbin:$PATH ; sudo ./test-mondo"
44
45mkdir -p $demodir/mnt
46sudo mount -o loop $demodir/images/$h-$m-1.iso $demodir/mnt
47sudo cp $demodir/mnt/vmlinuz $demodir/k
48sudo cp $demodir/mnt/initrd.img $demodir/i
49sudo umount $demodir/mnt
50) 2>&1 | tee /tmp/backupqemu.log
Note: See TracBrowser for help on using the repository browser.