Ignore:
Timestamp:
May 18, 2006, 12:40:32 AM (14 years ago)
Author:
bcornec
Message:

Build process in 3 steps:

svn2build creates tar files from SVN (works mostly)
build2pkg creates packages from tar files (works mostly)
build2qemu (has to be created from mkqemu) will create packages for all supported virtuel machines

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/stable/tools/mkqemu

    r543 r553  
    33# $Id$
    44#
    5 # Script allowing mondo packages production on various distributions with qemu
     5# Script build packages on various distributions with qemu
    66#
    77
    88if [ _"$1" == _"" ]; then
    9     echo "Syntax: mkqemu [mondo version] ([vm].. )"
     9    echo "Syntax: build2qemu [version-tag [vm1]..|vmx]] )"
    1010    exit -1
    1111fi
    1212
    13 if [ _"$2" == _"" ]; then
    14     export SVN_VM="mdk101 mdk102 mdv2006 rh73 rh9 fc4 fc5 rhel3 rhel4 suse10 sles9 debian31 slackware102 gentoo"
     13. $TOOLHOME/common-env
     14. $TOOLHOME/distro-env
     15
     16# We need to get $VER and $TAG
     17if [ "$1" = "" ]; then
     18    LAST=`cat ${TOPDIR}/LAST`
    1519else
    16     export SVN_VM="$2"
     20    LAST=$1
     21    shift
     22fi
     23VER=`echo $LAST | cut -d- -f1`
     24TAG=`echo $LAST | cut -d- -f2`
     25echo "Working on ${VER}-$TAG"
     26
     27if [ _"$1" == _"" ]; then
     28    VM=`cat ${TOOLHOME}/DISTROS`
     29    VMS=""
     30    for $v in $VM; do
     31        VMS="$VMS `echo $VM | cut -d_ -f1`"
     32    done
     33else
     34    export VMS="$1"
    1735fi
    1836
    19 cat > /tmp/mkmondo << EOF
     37
     38cat > $TMP/mkmondo << EOF
    2039#!/bin/bash
    2140
    22 export SVN_HOME=\$HOME/mondo/svn/branches
    23 export SVN_SSH="ssh -l bcornec"
    24 export SVN_EDITOR=vim
    2541export LANG="C"
    2642export LANGUAGE="C"
    2743export LC_ALL="C"
     44export TOOLHOME=$TOOLHOME
    2845
    29 if [ -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
    36 else
    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
    44 fi
    45 echo \$SVN_VM | grep -q "debian"
    46 if [ \$? -eq 0 ]; then
    47     \$SVN_HOME/$1/tools/mkdeb < /dev/null
    48 else
    49     echo \$SVN_VM | grep -q "slack"
    50     if [ \$? -eq 0 ]; then
    51         \$SVN_HOME/$1/tools/mkslack < /dev/null
    52     else
    53         echo \$SVN_VM | grep -q "gentoo"
    54         if [ \$? -eq 0 ]; then
    55             \$SVN_HOME/$1/tools/mkemerge < /dev/null
    56         else
    57             \$SVN_HOME/$1/tools/mkrpm < /dev/null
    58         fi
    59     fi
    60 fi
    61 \$SVN_HOME/$1/tools/mkdeliv
     46\$TOOLHOME/build2pkg
     47\$TOOLHOME/mkdeliv
    6248EOF
     49chmod 755 $TMP/mkmondo
    6350
    6451ipvm=10.0.2.15
    6552sp=2222
    6653
    67 for m in $SVN_VM; do
     54cd $TOOLHOME/..
     55tar cvfz $TMP/mkmondo.tar.gz $TOOLHOME/tools $TMP/mkmondo $TOPDIR/${VER}-$TAG
     56
     57for m in $VMS; do
    6858    vmp=0
    6959    if [ ! -f /users/vmplayer/$m.qemu ]; then
     
    7868        sleep 300
    7969    fi
    80     scp -P $sp /tmp/mkmondo bruno@localhost:
    81     ssh -p $sp bruno@localhost "chmod 755 ./mkmondo ; ./mkmondo" | tee /tmp/mkvm.log
     70    scp -P $sp $TMP/mkmondo.tar.gz bruno@localhost:
     71    ssh -p $sp bruno@localhost "cd / ; tar xvfz $TMP/mkmondo.tar.gz ; $TMP/mkmondo" | tee $TMP/mkvm.log
    8272    if [ $vmp -eq 1 ]; then
    8373        ssh -p $sp root@localhost "halt -p"
Note: See TracChangeset for help on using the changeset viewer.