diff options
author | Reto Buerki <reet@codelabs.ch> | 2012-12-09 09:49:04 +0100 |
---|---|---|
committer | Tobias Brunner <tobias@strongswan.org> | 2013-01-17 16:54:54 +0100 |
commit | b24d3ed5fc5ad891d7d210bba9b94dbe0a1468ff (patch) | |
tree | f62e508f4e1e8514def5e845d82d73204afb6f10 /testing/scripts | |
parent | f241f46d88f06393e8dd4e8f0a9a444c7f9c2059 (diff) | |
download | strongswan-b24d3ed5fc5ad891d7d210bba9b94dbe0a1468ff.tar.bz2 strongswan-b24d3ed5fc5ad891d7d210bba9b94dbe0a1468ff.tar.xz |
Test availability of required commands
Diffstat (limited to 'testing/scripts')
-rwxr-xr-x | testing/scripts/build-baseimage | 2 | ||||
-rwxr-xr-x | testing/scripts/build-guestkernel | 2 | ||||
-rwxr-xr-x | testing/scripts/build-umlhostfs | 2 | ||||
-rwxr-xr-x | testing/scripts/build-umlrootfs | 2 | ||||
-rwxr-xr-x | testing/scripts/function.sh | 10 |
5 files changed, 18 insertions, 0 deletions
diff --git a/testing/scripts/build-baseimage b/testing/scripts/build-baseimage index c73c45430..31205bf20 100755 --- a/testing/scripts/build-baseimage +++ b/testing/scripts/build-baseimage @@ -6,6 +6,8 @@ echo "Building base image" [ `id -u` -eq 0 ] || die "You must be root to run $0" +check_commands debootstrap mkfs.ext3 qemu-img qemu-nbd sfdisk + # additional packages EXTRAS=build-essential,gperf,libgmp-dev,libldap2-dev,libcurl4-openssl-dev,libxml2-dev,libtspi-dev,libsqlite3-dev,openssh-server,tcpdump,psmisc,openssl,vim,sqlite3,conntrack,gdb,cmake,libxerces-c2-dev,libltdl-dev,liblog4cxx10-dev,libboost-thread-dev,libboost-system-dev,git-core SERVICES="isc-dhcp-server apache2 slapd" diff --git a/testing/scripts/build-guestkernel b/testing/scripts/build-guestkernel index 2fbe658a1..84633bcd7 100755 --- a/testing/scripts/build-guestkernel +++ b/testing/scripts/build-guestkernel @@ -6,6 +6,8 @@ echo "Building guest kernel version $KERNELVERSION" [ -f "$KERNELCONFIG" ] || die "Kernel config $KERNELCONFIG not found" +check_commands bunzip2 bzcat make wget + mkdir -p $BUILDDIR cd $BUILDDIR diff --git a/testing/scripts/build-umlhostfs b/testing/scripts/build-umlhostfs index 1028ef266..f53410385 100755 --- a/testing/scripts/build-umlhostfs +++ b/testing/scripts/build-umlhostfs @@ -26,6 +26,8 @@ HOSTSDIR=$PWD/hosts [ -f $BASE ] || die "Base image $BASE not found" [ -f $HOSTDIR ] || die "Hosts directory $HOSTSDIR not found" +check_commands qemu-img qemu-nbd + load_qemu_nbd mkdir -p $BUILDDIR diff --git a/testing/scripts/build-umlrootfs b/testing/scripts/build-umlrootfs index c67e4d557..0f8781c25 100755 --- a/testing/scripts/build-umlrootfs +++ b/testing/scripts/build-umlrootfs @@ -22,6 +22,8 @@ echo "Building root image" [ -f "$ROOTFS" ] || die "Root image $ROOTFS not found" +check_commands qemu-nbd + load_qemu_nbd mkdir -p $ROOTFSDIR diff --git a/testing/scripts/function.sh b/testing/scripts/function.sh index d72708246..2a801a7a5 100755 --- a/testing/scripts/function.sh +++ b/testing/scripts/function.sh @@ -148,6 +148,16 @@ load_qemu_nbd() fi } +# check if given commands exist in $PATH +# $* - commands to check +check_commands() +{ + for i in $* + do + command -v $i >/dev/null || { die "Required command $i not found"; exit 1; } + done +} + ############################################# # search and replace strings throughout a # whole directory |