[pisa-src] r2492 - in trunk/tools/testbed/pisa-testbed_vms/plugins/extern: . hipl hipl/build hipl/prepare openwrt openwrt/build openwrt/prepare pisa pisa/build pisa/prepare

  • From: Samuel Richter <samuel.richter@xxxxxxxxxxxxxx>
  • To: pisa-src@xxxxxxxxxxxxx
  • Date: Sun, 03 Apr 2011 18:40:32 +0200

Author: richter
Date: Sun Apr  3 18:40:32 2011
New Revision: 2492

Log:
add plugins to build hipl, pisa and openwrt to virtual testbed

Added:
   trunk/tools/testbed/pisa-testbed_vms/plugins/extern/
   trunk/tools/testbed/pisa-testbed_vms/plugins/extern/hipl/
   trunk/tools/testbed/pisa-testbed_vms/plugins/extern/hipl/build
   trunk/tools/testbed/pisa-testbed_vms/plugins/extern/hipl/prepare
   trunk/tools/testbed/pisa-testbed_vms/plugins/extern/openwrt/
   trunk/tools/testbed/pisa-testbed_vms/plugins/extern/openwrt/build
   trunk/tools/testbed/pisa-testbed_vms/plugins/extern/openwrt/prepare
   trunk/tools/testbed/pisa-testbed_vms/plugins/extern/pisa/
   trunk/tools/testbed/pisa-testbed_vms/plugins/extern/pisa/build
   trunk/tools/testbed/pisa-testbed_vms/plugins/extern/pisa/prepare

Added: trunk/tools/testbed/pisa-testbed_vms/plugins/extern/hipl/build
==============================================================================
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ trunk/tools/testbed/pisa-testbed_vms/plugins/extern/hipl/build      Sun Apr 
 3 18:40:32 2011        (r2492)
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+build_hipl(){
+    echo "building hipl"
+    # collect all classes of nodes that have the hipl class
+    grep -l hipl "$BUILD_PATH"/*_classes | xargs cat | sort | uniq | while 
read -r PKG_CLASS; do
+        case $PKG_CLASS in
+
+            debian|ubuntu_live)
+                echo "making hipl deb"
+                cd "$HIPL_PATH"
+                make deb
+                ;;
+            opkg|openwrt)
+                cd "$OPENWRT_PATH"
+                make package/hipl/install
+                ;;
+        esac
+    done
+}

Added: trunk/tools/testbed/pisa-testbed_vms/plugins/extern/hipl/prepare
==============================================================================
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ trunk/tools/testbed/pisa-testbed_vms/plugins/extern/hipl/prepare    Sun Apr 
 3 18:40:32 2011        (r2492)
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+prepare_hipl(){
+    [ "$HIPL_PATH" ] || HIPL_PATH="$BUILD_PATH/hipl/trunk"
+    echo "preparing hipl using hipl-tree in $HIPL_PATH"
+    if ! [ -d "$HIPL_PATH" ]; then
+        echo "downloading ..."
+        mkdir -p "$HIPL_PATH"
+        bzr co lp:hipl "$HIPL_PATH"
+        cd "$HIPL_PATH"
+        autoreconf -i
+    fi
+    cd "$HIPL_PATH"
+    ./configure && make -j dist
+}

Added: trunk/tools/testbed/pisa-testbed_vms/plugins/extern/openwrt/build
==============================================================================
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ trunk/tools/testbed/pisa-testbed_vms/plugins/extern/openwrt/build   Sun Apr 
 3 18:40:32 2011        (r2492)
@@ -0,0 +1,22 @@
+#!/bin/sh
+
+build_openwrt(){
+    grep -l openwrt "$BUILD_PATH"/*_classes | xargs cat | sort | uniq | while 
read -r NODE_TYPE; do
+        case $NODE_TYPE in
+            linksys)
+                cmp -s 
$TESTBED_PATH/plugins/extern/openwrt/dot_config_$NODE_TYPE 
$OPENWRT_PATH/.config ||
+                    cp 
$TESTBED_PATH/plugins/extern/openwrt/dot_config_$NODE_TYPE $OPENWRT_PATH/.config
+                make V=99 > make.log
+                cp 
$OPENWRT_PATH/bin/ar71xx/openwrt-ar71xx-wrt160nl-squashfs.bin \
+                    $TESTBED_PATH/bin/openwrt-$NODE-$NODE_TYPE-squashfs.bin
+                ;;
+            vbox)
+                cmp -s 
$TESTBED_PATH/plugins/extern/openwrt/dot_config_$NODE_TYPE 
$OPENWRT_PATH/.config ||
+                    cp 
$TESTBED_PATH/plugins/extern/openwrt/dot_config_$NODE_TYPE $OPENWRT_PATH/.config
+                make V=99 > make.log
+                cp `ls -t $OPENWRT_PATH/bin/x86/*.vdi | head -1` \
+                    $TESTBED_PATH/bin/openwrt-$NODE-$NODE_TYPE.vdi
+                ;;
+        esac
+    done
+}

Added: trunk/tools/testbed/pisa-testbed_vms/plugins/extern/openwrt/prepare
==============================================================================
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ trunk/tools/testbed/pisa-testbed_vms/plugins/extern/openwrt/prepare Sun Apr 
 3 18:40:32 2011        (r2492)
@@ -0,0 +1,35 @@
+#!/bin/sh
+
+prepare_openwrt(){
+    echo "preparing openwrt ..."
+    if ! [ -d "${OPENWRT_PATH:?}" ]; then
+        echo "downloading ..."
+        mkdir -p "$OPENWRT_PATH"
+        svn co svn://svn.openwrt.org/openwrt/tags/backfire_10.03 
"$OPENWRT_PATH"
+    fi
+
+    mkdir -p "$OPENWRT_PATH/dl"
+    rsync "${PISA_PATH}/pisa*.tar.gz" "${OPENWRT_PATH}/dl"
+    rsync "${HIPL_PATH}/hipl*.tar.gz" "${OPENWRT_PATH}/dl"
+
+    mkdir -p "$OPENWRT_PATH/package"
+    rsync -Lr --delete --exclude=.svn "$HIPL_PATH/packaging/openwrt/hipl" 
"$OPENWRT_PATH/package/"
+    sed -i -e "s/init\.d/no-init\.d/g" "$OPENWRT_PATH/package/hipl/Makefile"
+
+    rsync -Lr --delete --exclude=.svn "$PISA_PATH/openwrt/package/pisa" 
"$OPENWRT_PATH/package/"
+    sed -i -e "s/PKG_VERSION:=.*/PKG_VERSION:=$PISA_VERSION/" 
"$OPENWRT_PATH/package/pisa/Makefile"
+    sed -i -e "s/init\.d/no-init\.d/g" "$OPENWRT_PATH/package/pisa/Makefile"
+
+    "$OPENWRT_PATH/scripts/feeds" update > /dev/null
+    "$OPENWRT_PATH/scripts/feeds" install iw ipsec-tools libconfig 
libnetfilter-queue libxml2 ntpclient tcpdump stunnel webif iperf > /dev/null
+
+    cd "$OPENWRT_PATH"
+    for patch in "$PISA_PATH"/openwrt/patches/*.patch; do
+        patch --dry-run --batch --forward --strip=0 --input=$patch > /dev/null 
&&
+        patch --batch --strip=0 --input=$patch
+    done
+
+    mkdir -p "$OPENWRT_PATH/files"
+    rsync -Lr --delete --exclude=.svn 
"$PISA_PATH/openwrt/router-configurations/pisa-testbed" "$OPENWRT_PATH/files/"
+
+}

Added: trunk/tools/testbed/pisa-testbed_vms/plugins/extern/pisa/build
==============================================================================
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ trunk/tools/testbed/pisa-testbed_vms/plugins/extern/pisa/build      Sun Apr 
 3 18:40:32 2011        (r2492)
@@ -0,0 +1,19 @@
+#!/bin/sh
+
+build_pisa(){
+    # collect all classes of nodes that have the pisa class
+    grep -l pisa "$BUILD_PATH"/*_classes | xargs cat | sort | uniq | while 
read -r PKG_CLASS; do
+        case $PKG_CLASS in
+
+            debian|ubuntu_live)
+                cd "$PISA_PATH"
+                make deb
+                ;;
+            opkg|openwrt)
+                cd "$OPENWRT_PATH"
+                make package/pisa/install
+                cp bin/*/packages/pisa-* "$TESTBED_PATH/bin/"
+                ;;
+        esac
+    done
+}

Added: trunk/tools/testbed/pisa-testbed_vms/plugins/extern/pisa/prepare
==============================================================================
--- /dev/null   00:00:00 1970   (empty, because file is newly added)
+++ trunk/tools/testbed/pisa-testbed_vms/plugins/extern/pisa/prepare    Sun Apr 
 3 18:40:32 2011        (r2492)
@@ -0,0 +1,16 @@
+#!/bin/sh
+
+prepare_pisa(){
+    [ "$PISA_PATH" ] || PISA_PATH="$BUILD_PATH/pisa/trunk"
+    echo "preparing pisa ..."
+    if ! [ -d "$PISA_PATH" ]; then
+        echo "downloading ..."
+        mkdir -p "$PISA_PATH"
+        svn checkout svn+ssh://$USER@pride/srv/projects/pisa/svn/trunk 
"$PISA_PATH"
+        cd "$PISA_PATH"
+        autoreconf -i
+    fi
+    cd "$PISA_PATH"
+    echo "using pisa-tree in $PISA_PATH"
+    ./configure && make -j dist
+}
-- 
This is the pisa developer mailing list. Please also subscribe to the main pisa 
list at:
//www.freelists.org/list/pisa

Other related posts:

  • » [pisa-src] r2492 - in trunk/tools/testbed/pisa-testbed_vms/plugins/extern: . hipl hipl/build hipl/prepare openwrt openwrt/build openwrt/prepare pisa pisa/build pisa/prepare - Samuel Richter