[or-cvs] r16184: Automated win32 build process for Qemu and utils with WinPca (in torvm/trunk: . build build/win32 build/win32/files build/win32/patches build/win32/scripts)

coderman at seul.org coderman at seul.org
Fri Jul 25 03:36:04 UTC 2008


Author: coderman
Date: 2008-07-24 23:36:03 -0400 (Thu, 24 Jul 2008)
New Revision: 16184

Added:
   torvm/trunk/build/win32/
   torvm/trunk/build/win32/Makefile
   torvm/trunk/build/win32/files/
   torvm/trunk/build/win32/files/autorun.inf
   torvm/trunk/build/win32/files/buildall.sh
   torvm/trunk/build/win32/files/fstab
   torvm/trunk/build/win32/files/hdd.img.gz
   torvm/trunk/build/win32/files/install.bat
   torvm/trunk/build/win32/patches/
   torvm/trunk/build/win32/patches/qemu-winpcap-0.9.1.patch
   torvm/trunk/build/win32/scripts/
   torvm/trunk/build/win32/scripts/download.sh
Modified:
   torvm/trunk/Makefile
   torvm/trunk/README
Log:
Automated win32 build process for Qemu and utils with WinPcap patch

Modified: torvm/trunk/Makefile
===================================================================
--- torvm/trunk/Makefile	2008-07-25 01:06:04 UTC (rev 16183)
+++ torvm/trunk/Makefile	2008-07-25 03:36:03 UTC (rev 16184)
@@ -109,7 +109,12 @@
 	fi
 
 buildw32src: buildkern
-	@echo "buildw32src does not yet create an ISO with build setup. XXX"
+	@cd build/win32; \
+	time su $(BUSER) -c "( $(MAKE) )"; \
+	if (( $$? != 0 )); then \
+		echo "ERROR: Unable to create win32 build ISO image." >&2; \
+		exit 1; \
+	fi
 
 package: buildw32src buildvmiso
 	@echo "package build target does not do anything with build products yet. XXX"

Modified: torvm/trunk/README
===================================================================
--- torvm/trunk/README	2008-07-25 01:06:04 UTC (rev 16183)
+++ torvm/trunk/README	2008-07-25 03:36:03 UTC (rev 16184)
@@ -1,5 +1,6 @@
 Transparent Tor Proxy Virtual Machine
 
+
 See the doc/ directory for design and implementation details and the LICENSE
 file for rights and terms.
 
@@ -10,3 +11,17 @@
 Run 'make' to build the VM kernel image and Windows build ISO image. Once the
 Windows build is done a complete Tor virtual machine package should be zipped
 up ready for distribution.
+
+
+Some files of interest:
+
+./build/kamikaze/x86-uclibc-vm/bin/openwrt-x86-vmlinuz
+> this is the Linux kernel and initramfs used in the VM.
+
+./build/iso/vm.iso
+> this is a bootable ISO using the kernel above.
+
+./build/win32/w32build.iso
+> this is the automated win32 build ISO for Qemu.  Once everything is built
+> the Qemu program and libraries will be placed in C:\Tor_VM
+

Added: torvm/trunk/build/win32/Makefile
===================================================================
--- torvm/trunk/build/win32/Makefile	                        (rev 0)
+++ torvm/trunk/build/win32/Makefile	2008-07-25 03:36:03 UTC (rev 16184)
@@ -0,0 +1,200 @@
+# Copyright (C) 2008  The Tor Project, Inc.
+# See LICENSE file for rights and terms.
+
+SHELL=/bin/bash
+export SHELL
+DLCMD=scripts/download.sh
+
+ifeq (,$(WDLDIR))
+	WDLDIR=dl
+endif
+ifeq (,$(ISODIR))
+	ISODIR=iso
+endif
+
+# various utilities are downloaded and packaged into an ISO image
+# with an autorun.inf that launches a build of all the win32 parts.
+# 
+ZLIB_F=zlib-1.2.3-bin.zip
+ZLIB_URL=http://downloads.sourceforge.net/gnuwin32/zlib-1.2.3-bin.zip?modtime=1122324542&big_mirror=1
+ZLIB_SUM=becbcaf5076e307e743b1edc6a5645849eba9ebc
+
+GZIP_F=gzip-1.3.12-1-bin.zip
+GZIP_URL=http://downloads.sourceforge.net/gnuwin32/gzip-1.3.12-1-bin.zip?modtime=1213401872&big_mirror=1
+GZIP_SUM=69901b7a58e324e39653d4282deaf5ab5bb5c07f
+
+BZIP2_F=bzip2-1.0.5-bin.zip
+BZIP2_URL=http://downloads.sourceforge.net/gnuwin32/bzip2-1.0.5-bin.zip?modtime=1206045010&big_mirror=1
+BZIP2_SUM=618ba51d3d6838e71a922febf717471b7d5f54e2
+
+LIBARCH_F=libarchive-2.4.12-1-bin.zip
+LIBARCH_URL=http://downloads.sourceforge.net/gnuwin32/libarchive-2.4.12-1-bin.zip?modtime=1215347767&big_mirror=1
+LIBARCH_SUM=02eb2fe2200705d0067f03780c6d65f51ae69e42
+
+BINUTILS_F=binutils-2.18.50-20080109-2.tar.gz
+BINUTILS_URL=http://downloads.sourceforge.net/mingw/binutils-2.18.50-20080109-2.tar.gz?modtime=1206567544&big_mirror=1
+BINUTILS_SUM=4a47e75604765f671ca233bb503f1ca67fd93af0
+
+GCCORE_F=gcc-core-3.4.5-20060117-3.tar.gz
+GCCORE_URL=http://downloads.sourceforge.net/mingw/gcc-core-3.4.5-20060117-3.tar.gz?modtime=1209046227&big_mirror=1
+GCCORE_SUM=1ba77819f5749954fda080c0137af359a09760fc
+
+GPP_F=gcc-g++-3.4.5-20060117-3.tar.gz
+GPP_URL=http://downloads.sourceforge.net/mingw/gcc-g%2B%2B-3.4.5-20060117-3.tar.gz?modtime=1209046244&big_mirror=1
+GPP_SUM=1d31f990d4027f171ab8c55374bec815a46c16dd
+
+MINGWRUN_F=mingw-runtime-3.14.tar.gz
+MINGWRUN_URL=http://downloads.sourceforge.net/mingw/mingw-runtime-3.14.tar.gz?modtime=1198749088&big_mirror=1
+MINGWRUN_SUM=ebd523dff5cb5bc476124a283b3ba9781f907fea
+
+MINGWUTIL_F=mingw-utils-0.3.tar.gz
+MINGWUTIL_URL=http://downloads.sourceforge.net/mingw/mingw-utils-0.3.tar.gz?modtime=1077362266&big_mirror=1
+MINGWUTIL_SUM=7ae32742ece1e89978784634aed824775cf47336
+
+MAKE_F=mingw32-make-3.81-20080326-3.tar.gz
+MAKE_URL=http://downloads.sourceforge.net/mingw/mingw32-make-3.81-20080326-3.tar.gz?modtime=1212658958&big_mirror=1
+MAKE_SUM=86ab2ddffdd2df6245856bb0dd50fbd8ba372767
+
+W32API_F=w32api-3.11.tar.gz
+W32API_URL=http://downloads.sourceforge.net/mingw/w32api-3.11.tar.gz?modtime=1198748420&big_mirror=1
+W32API_SUM=0969cde19c3a85012b4924cb49cf2e9ef3d1b6df
+
+MSYS_F=MSYS-1.0.11-20071204.tar.bz2
+MSYS_URL=http://downloads.sourceforge.net/mingw/MSYS-1.0.11-20071204.tar.bz2?modtime=1196807934&big_mirror=1
+MSYS_SUM=9a1207b04ffaf8880c58de643609e4deed3e1563
+
+MSYSCORE_F=msysCORE-1.0.11-2007.01.19-1.tar.bz2
+MSYSCORE_URL=http://downloads.sourceforge.net/mingw/msysCORE-1.0.11-2007.01.19-1.tar.bz2?modtime=1169214215&big_mirror=1
+MSYSCORE_SUM=65870650914925dfd8451a9452bff3cdb8320221
+
+BASH_F=bash-3.1-MSYS-1.0.11-1.tar.bz2
+BASH_URL=http://downloads.sourceforge.net/mingw/bash-3.1-MSYS-1.0.11-1.tar.bz2?modtime=1195140582&big_mirror=1
+BASH_SUM=a440bb5a6e2edfe703b67877c7e7e48504aad6dc
+
+DIFFUTIL_F=diffutils-2.8.7-MSYS-1.0.11-1.tar.bz2
+DIFFUTIL_URL=http://downloads.sourceforge.net/mingw/diffutils-2.8.7-MSYS-1.0.11-1.tar.bz2?modtime=1196332674&big_mirror=1
+DIFFUTIL_SUM=a34f0470674b6bb807e505839a477f9b9c70facf
+
+LIBTOOL_F=libtool1.5-1.5.25a-1-bin.tar.bz2
+LIBTOOL_URL=http://downloads.sourceforge.net/mingw/libtool1.5-1.5.25a-1-bin.tar.bz2?modtime=1190250326&big_mirror=1
+LIBTOOL_SUM=7e7206011471dbe79f5298d76ea9530288b2a6dd
+
+MINIRES_F=minires-1.01-1-MSYS-1.0.11-1.tar.bz2
+MINIRES_URL=http://downloads.sourceforge.net/mingw/minires-1.01-1-MSYS-1.0.11-1.tar.bz2?modtime=1206482214&big_mirror=1
+MINIRES_SUM=c077e08cce446656ff0c0b3f30a327652f9c9986
+
+MSYSZLIB_F=zlib-1.2.3-MSYS-1.0.11-1.tar.bz2
+MSYSZLIB_URL=http://downloads.sourceforge.net/mingw/zlib-1.2.3-MSYS-1.0.11-1.tar.bz2?modtime=1206455079&big_mirror=1
+MSYSZLIB_SUM=dff1a110b165d7ba4d7804b1c2f4a023823eec90
+
+SSL_F=openssl-0.9.8g-1-MSYS-1.0.11-2-dll098.tar.gz
+SSL_URL=http://downloads.sourceforge.net/mingw/openssl-0.9.8g-1-MSYS-1.0.11-2-dll098.tar.gz?modtime=1206734099&big_mirror=1
+SSL_SUM=eba5f37fdec2982727556a3dbb5ea6fd04296b76
+
+SSH_F=openssh-4.7p1-MSYS-1.0.11-1-bin.tar.gz
+SSH_URL=http://downloads.sourceforge.net/mingw/openssh-4.7p1-MSYS-1.0.11-1-bin.tar.gz?modtime=1206734972&big_mirror=1
+SSH_SUM=bf1617bf43de198cea7c197621494baec9520bcb
+
+ZLIBSRC_F=zlib-1.2.3.tar.gz
+ZLIBSRC_URL=http://www.zlib.net/zlib-1.2.3.tar.gz
+ZLIBSRC_SUM=60faeaaf250642db5c0ea36cd6dcc9f99c8f3902
+
+PTHREADS_F=pthreads-w32-2-8-0-release.tar.gz
+PTHREADS_URL=ftp://sourceware.org/pub/pthreads-win32/pthreads-w32-2-8-0-release.tar.gz
+PTHREADS_SUM=da8371cb20e8e238f96a1d0651212f154d84a9ac
+
+SDL_F=SDL-1.2.13.tar.gz
+SDL_URL=http://www.libsdl.org/release/SDL-1.2.13.tar.gz
+SDL_SUM=51fcaa3e1d5c01fd813ea08688780f86b19cf539
+
+WPCAP_F=WinPcap_4_1_beta4.exe
+WPCAP_URL=http://www.winpcap.org/install/bin/WinPcap_4_1_beta4.exe
+WPCAP_SUM=25a56a70f9f285bc029220393f01177da5b02bb6
+
+WPD_F=WpdPack_4_1_beta4.zip
+WPD_URL=http://www.winpcap.org/install/bin/WpdPack_4_1_beta4.zip
+WPD_SUM=fa5255dc1a36ff47999d5b60aeadcf8ff9fb44cd
+
+QEMU_F=qemu-0.9.1.tar.gz
+QEMU_URL=http://bellard.org/qemu/qemu-0.9.1.tar.gz
+QEMU_SUM=630ea20b5989f0df00128de7f7be661c573ed041
+
+
+ALLFILES=$(ZLIB_F) $(GZIP_F) $(BZIP2_F) $(LIBARCH_F) $(BINUTILS_F) $(GCCORE_F) $(GPP_F) $(MINGWRUN_F) $(MINGWUTIL_F) $(MAKE_F) $(W32API_F) $(MSYS_F) $(MSYSCORE_F) $(BASH_F) $(DIFFUTIL_F) $(LIBTOOL_F) $(MINIRES_F) $(MSYSZLIB_F) $(SSL_F) $(SSH_F) $(ZLIBSRC_F) $(PTHREADS_F) $(SDL_F) $(WPCAP_F) $(WPD_F) $(QEMU_F)
+
+default all: downloads extract buildiso runinstall
+
+downloads: Makefile
+	@if [ ! -e $(WDLDIR)/$(ZLIB_F) ]; then $(DLCMD) "$(ZLIB_URL)" $(ZLIB_SUM) "$(WDLDIR)/$(ZLIB_F)"; fi
+	@if [ ! -e $(WDLDIR)/$(GZIP_F) ]; then $(DLCMD) "$(GZIP_URL)" $(GZIP_SUM) "$(WDLDIR)/$(GZIP_F)"; fi
+	@if [ ! -e $(WDLDIR)/$(BZIP2_F) ]; then $(DLCMD) "$(BZIP2_URL)" $(BZIP2_SUM) "$(WDLDIR)/$(BZIP2_F)"; fi
+	@if [ ! -e $(WDLDIR)/$(LIBARCH_F) ]; then $(DLCMD) "$(LIBARCH_URL)" $(LIBARCH_SUM) "$(WDLDIR)/$(LIBARCH_F)"; fi
+	@if [ ! -e $(WDLDIR)/$(BINUTILS_F) ]; then $(DLCMD) "$(BINUTILS_URL)" $(BINUTILS_SUM) "$(WDLDIR)/$(BINUTILS_F)"; fi
+	@if [ ! -e $(WDLDIR)/$(GCCORE_F) ]; then $(DLCMD) "$(GCCORE_URL)" $(GCCORE_SUM) "$(WDLDIR)/$(GCCORE_F)"; fi
+	@if [ ! -e $(WDLDIR)/$(GPP_F) ]; then $(DLCMD) "$(GPP_URL)" $(GPP_SUM) "$(WDLDIR)/$(GPP_F)"; fi
+	@if [ ! -e $(WDLDIR)/$(MINGWRUN_F) ]; then $(DLCMD) "$(MINGWRUN_URL)" $(MINGWRUN_SUM) "$(WDLDIR)/$(MINGWRUN_F)"; fi
+	@if [ ! -e $(WDLDIR)/$(MINGWUTIL_F) ]; then $(DLCMD) "$(MINGWUTIL_URL)" $(MINGWUTIL_SUM) "$(WDLDIR)/$(MINGWUTIL_F)"; fi
+	@if [ ! -e $(WDLDIR)/$(MAKE_F) ]; then $(DLCMD) "$(MAKE_URL)" $(MAKE_SUM) "$(WDLDIR)/$(MAKE_F)"; fi
+	@if [ ! -e $(WDLDIR)/$(W32API_F) ]; then $(DLCMD) "$(W32API_URL)" $(W32API_SUM) "$(WDLDIR)/$(W32API_F)"; fi
+	@if [ ! -e $(WDLDIR)/$(MSYS_F) ]; then $(DLCMD) "$(MSYS_URL)" $(MSYS_SUM) "$(WDLDIR)/$(MSYS_F)"; fi
+	@if [ ! -e $(WDLDIR)/$(MSYSCORE_F) ]; then $(DLCMD) "$(MSYSCORE_URL)" $(MSYSCORE_SUM) "$(WDLDIR)/$(MSYSCORE_F)"; fi
+	@if [ ! -e $(WDLDIR)/$(BASH_F) ]; then $(DLCMD) "$(BASH_URL)" $(BASH_SUM) "$(WDLDIR)/$(BASH_F)"; fi
+	@if [ ! -e $(WDLDIR)/$(DIFFUTIL_F) ]; then $(DLCMD) "$(DIFFUTIL_URL)" $(DIFFUTIL_SUM) "$(WDLDIR)/$(DIFFUTIL_F)"; fi
+	@if [ ! -e $(WDLDIR)/$(LIBTOOL_F) ]; then $(DLCMD) "$(LIBTOOL_URL)" $(LIBTOOL_SUM) "$(WDLDIR)/$(LIBTOOL_F)"; fi
+	@if [ ! -e $(WDLDIR)/$(MINIRES_F) ]; then $(DLCMD) "$(MINIRES_URL)" $(MINIRES_SUM) "$(WDLDIR)/$(MINIRES_F)"; fi
+	@if [ ! -e $(WDLDIR)/$(MSYSZLIB_F) ]; then $(DLCMD) "$(MSYSZLIB_URL)" $(MSYSZLIB_SUM) "$(WDLDIR)/$(MSYSZLIB_F)"; fi
+	@if [ ! -e $(WDLDIR)/$(SSL_F) ]; then $(DLCMD) "$(SSL_URL)" $(SSL_SUM) "$(WDLDIR)/$(SSL_F)"; fi
+	@if [ ! -e $(WDLDIR)/$(SSH_F) ]; then $(DLCMD) "$(SSH_URL)" $(SSH_SUM) "$(WDLDIR)/$(SSH_F)"; fi
+	@if [ ! -e $(WDLDIR)/$(ZLIBSRC_F) ]; then $(DLCMD) "$(ZLIBSRC_URL)" $(ZLIBSRC_SUM) "$(WDLDIR)/$(ZLIBSRC_F)"; fi
+	@if [ ! -e $(WDLDIR)/$(PTHREADS_F) ]; then $(DLCMD) "$(PTHREADS_URL)" $(PTHREADS_SUM) "$(WDLDIR)/$(PTHREADS_F)"; fi
+	@if [ ! -e $(WDLDIR)/$(SDL_F) ]; then $(DLCMD) "$(SDL_URL)" $(SDL_SUM) "$(WDLDIR)/$(SDL_F)"; fi
+	@if [ ! -e $(WDLDIR)/$(WPCAP_F) ]; then $(DLCMD) "$(WPCAP_URL)" $(WPCAP_SUM) "$(WDLDIR)/$(WPCAP_F)"; fi
+	@if [ ! -e $(WDLDIR)/$(WPD_F) ]; then $(DLCMD) "$(WPD_URL)" $(WPD_SUM) "$(WDLDIR)/$(WPD_F)"; fi
+	@if [ ! -e $(WDLDIR)/$(QEMU_F) ]; then $(DLCMD) "$(QEMU_URL)" $(QEMU_SUM) "$(WDLDIR)/$(QEMU_F)"; fi
+
+extract: downloads $(addprefix $(WDLDIR)/, $(ALLFILES))
+	@if [ -d $(ISODIR) ]; then \
+		echo "Removing previous ISO build directory."; \
+		rm -rf $(ISODIR) >/dev/null 2>&1; \
+	fi; \
+	mkdir -p $(ISODIR)/dl/src; \
+	mkdir $(ISODIR)/bin; \
+	mkdir $(ISODIR)/add; \
+	if [ -e ../iso/vm.iso ]; then \
+		cp ../iso/vm.iso $(ISODIR)/add; \
+	fi; \
+	if [ -e ../iso/vm-isosrc/kernels/boot ]; then \
+		cp ../iso/vm-isosrc/kernels/boot $(ISODIR)/add/vmlinuz; \
+	fi; \
+	cp files/autorun.inf files/install.bat $(ISODIR)/; \
+	cp files/hdd.img.gz $(ISODIR)/add/; \
+	gzip -d $(ISODIR)/add/hdd.img.gz; \
+	cp files/fstab $(ISODIR)/bin/; \
+	cp files/buildall.sh $(ISODIR)/dl/src; \
+	cp patches/qemu-winpcap-0.9.1.patch $(ISODIR)/dl/src; \
+	unzip $(WDLDIR)/$(ZLIB_F) -d $(ISODIR)/ bin/zlib1.dll; \
+	unzip $(WDLDIR)/$(GZIP_F) -d $(ISODIR)/ bin/gzip.exe; \
+	unzip $(WDLDIR)/$(BZIP2_F) -d $(ISODIR)/ bin/bzip2.exe bin/bzip2.dll; \
+	tar jxf $(WDLDIR)/$(BASH_F) bin/bash.exe bin/sh.exe; mv bin/* $(ISODIR)/bin/;rmdir bin; \
+	tar jxf $(WDLDIR)/$(MSYS_F) bin/msys-1.0.dll bin/mount.exe bin/ps.exe; mv bin/* $(ISODIR)/bin/;rmdir bin; \
+	unzip $(WDLDIR)/$(LIBARCH_F) -d $(ISODIR)/ bin/bsdtar.exe bin/libarchive2.dll; \
+	cp $(addprefix $(WDLDIR)/, $(ALLFILES)) $(ISODIR)/dl/; \
+	unzip $(WDLDIR)/$(WPD_F); tar cf $(ISODIR)/dl/src/WpdPack_4_1_beta4.tar WpdPack; gzip -9 $(ISODIR)/dl/src/WpdPack_4_1_beta4.tar; rm -rf WpdPack; \
+	mv $(ISODIR)/dl/$(PTHREADS_F) $(ISODIR)/dl/src/; \
+	mv $(ISODIR)/dl/$(QEMU_F) $(ISODIR)/dl/src/; \
+	mv $(ISODIR)/dl/$(SDL_F) $(ISODIR)/dl/src/; \
+	mv $(ISODIR)/dl/$(ZLIBSRC_F) $(ISODIR)/dl/src/;
+
+buildiso: extract
+	@if [ -f w32build.iso ]; then \
+		rm -f w32build.iso; \
+	fi; \
+	export ODIR=`pwd`; \
+	( 	cd $(ISODIR); \
+		mkisofs -hide-rr-moved -pad -l -o $$ODIR/w32build.iso -r -J .; \
+	); if (( $$? != 0 )); then exit 1; fi
+
+runinstall: buildiso
+	@echo "NOTICE: This feature is not yet automated.  Please load the ISO into a Windows systems to start the build."
+
+.PHONY: downloads extract buildiso runinstall

Added: torvm/trunk/build/win32/files/autorun.inf
===================================================================
--- torvm/trunk/build/win32/files/autorun.inf	                        (rev 0)
+++ torvm/trunk/build/win32/files/autorun.inf	2008-07-25 03:36:03 UTC (rev 16184)
@@ -0,0 +1,2 @@
+[autorun]
+open=install.bat

Added: torvm/trunk/build/win32/files/buildall.sh
===================================================================
--- torvm/trunk/build/win32/files/buildall.sh	                        (rev 0)
+++ torvm/trunk/build/win32/files/buildall.sh	2008-07-25 03:36:03 UTC (rev 16184)
@@ -0,0 +1,95 @@
+#!/bin/bash
+export PATH=.:/usr/local/bin:/usr/bin:/bin:/mingw/bin:/c/WINDOWS/system32:/c/WINDOWS:/c/WINDOWS/System32/Wbem
+export LD_LIBRARY_PATH=/usr/local/lib:/usr/lib:/lib:/mingw/lib
+export ddir=/c/Tor_VM
+mkdir $ddir
+
+
+echo "Building pthreads-w32 ..."
+cd /usr/src
+tar zxvf pthreads-w32-2-8-0-release.tar.gz
+mv pthreads-w32-2-8-0-release pthreads-w32
+cd pthreads-w32
+make GC
+if (( $? != 0 )); then
+  echo "ERROR: pthreads-32 build failed." >&2
+  exit 1
+fi
+cp pthreadGC2.dll $ddir/
+
+
+echo "Building SDL library ..."
+cd /usr/src
+tar zxvf SDL-1.2.13.tar.gz
+mv SDL-1.2.13 SDL
+cd SDL
+./configure --prefix=/usr
+if (( $? != 0 )); then
+  echo "ERROR: SDL configure failed." >&2
+  exit 1
+fi
+make
+if (( $? != 0 )); then
+  echo "ERROR: SDL build failed." >&2
+  exit 1
+fi
+make install
+cp /usr/bin/SDL.dll $ddir/
+
+
+echo "Extracting WinPcap developer files ..."
+cd /usr/src
+tar zxvf WpdPack_4_1_beta4.tar.gz
+
+
+echo "Building zlib ..."
+tar zxvf zlib-1.2.3.tar.gz
+cd zlib-1.2.3
+./configure --prefix=/usr
+if (( $? != 0 )); then
+  echo "ERROR: zlib configure failed." >&2
+  exit 1
+fi
+make
+if (( $? != 0 )); then
+  echo "ERROR: zlib build failed." >&2
+  exit 1
+fi
+make install
+
+
+echo "Building qemu ..."
+cd /usr/src
+tar zxvf qemu-0.9.1.tar.gz
+cd qemu-0.9.1
+patch -p1 < ../qemu-winpcap-0.9.1.patch 2> /dev/null
+if (( $? != 0 )); then
+  echo "ERROR: Qemu patch failed." >&2
+  exit 1
+fi
+./configure --prefix=/usr --interp-prefix=qemu-%M \
+  --enable-uname-release="Tor VM 2.6-alpha i386" \
+  --disable-werror \
+  --disable-kqemu \
+  --disable-system \
+  --disable-vnc-tls \
+  --extra-cflags="-DHAVE_INTSZ_TYPES -I. -I.. -I/usr/include -I/usr/local/include -I/usr/src/WpdPack/Include -I/usr/src/pthreads-w32 -I/usr/include/SDL" \
+  --extra-ldflags="-L/usr/lib -L/usr/local/lib -L/usr/src/WpdPack/Lib -L/usr/src/pthreads-w32" \
+  --target-list=i386-softmmu
+if (( $? != 0 )); then
+  echo "ERROR: Qemu configure failed." >&2
+  exit 1
+fi
+make
+if (( $? != 0 )); then
+  echo "ERROR: qemu build failed." >&2
+  exit 1
+fi
+cp i386-softmmu/qemu.exe $ddir/
+cp pc-bios/bios.bin $ddir/
+cp pc-bios/vgabios.bin $ddir/
+cp pc-bios/vgabios-cirrus.bin $ddir/
+cp /d/add/* $ddir/
+
+echo "DONE."
+exit 0

Added: torvm/trunk/build/win32/files/fstab
===================================================================
--- torvm/trunk/build/win32/files/fstab	                        (rev 0)
+++ torvm/trunk/build/win32/files/fstab	2008-07-25 03:36:03 UTC (rev 16184)
@@ -0,0 +1,2 @@
+C:/MinGW /mingw
+C:/msys/1.0 /

Added: torvm/trunk/build/win32/files/hdd.img.gz
===================================================================
(Binary files differ)


Property changes on: torvm/trunk/build/win32/files/hdd.img.gz
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: torvm/trunk/build/win32/files/install.bat
===================================================================
--- torvm/trunk/build/win32/files/install.bat	                        (rev 0)
+++ torvm/trunk/build/win32/files/install.bat	2008-07-25 03:36:03 UTC (rev 16184)
@@ -0,0 +1,63 @@
+REM
+set ISODRV=D:\
+set DDRV=C:\
+set DDIR=MinGW
+set MDIR=msys
+set MVER=1.0
+
+IF EXIST %DDRV%%DDIR% GOTO NOINSTALL
+
+cd /d %DDRV%
+md %DDIR%
+cd %DDIR%
+md bin
+cd /d %ISODRV%
+cd bin
+copy *.* %DDRV%%DDIR%\bin\
+cd /d %DDRV%
+set PATH=%DDRV%%DDIR%\bin;%PATH%
+md %MDIR%
+cd %MDIR%
+md %MVER%
+cd %MVER%
+md dl
+cd /d %ISODRV%
+cd dl
+copy *.* %DDRV%%MDIR%\%MVER%\dl\
+cd /d %DDRV%
+cd %MDIR%\%MVER%\dl\
+bzip2 -d *.bz2
+gzip -d *.gz
+cd /d %DDRV%
+cd %MDIR%\%MVER%
+bsdtar xvf dl\msysCORE-1.0.11-2007.01.19-1.tar
+bsdtar xvf dl\mingw-runtime-3.14.tar
+bsdtar xvf dl\bash-3.1-MSYS-1.0.11-1.tar
+bsdtar xvf dl\mingw32-make-3.81-20080326-3.tar
+bsdtar xvf dl\binutils-2.18.50-20080109-2.tar
+bsdtar xvf dl\diffutils-2.8.7-MSYS-1.0.11-1.tar
+bsdtar xvf dl\gcc-core-3.4.5-20060117-3.tar
+bsdtar xvf dl\gcc-g++-3.4.5-20060117-3.tar
+bsdtar xvf dl\libtool1.5-1.5.25a-1-bin.tar
+bsdtar xvf dl\w32api-3.11.tar
+cd /d %ISODRV%
+cd bin
+copy fstab %DDRV%%MDIR%\%MVER%\etc\
+cd /d %DDRV%
+cd %MDIR%\%MVER%\
+md src
+cd /d %ISODRV%
+cd dl\src
+copy *.* %DDRV%%MDIR%\%MVER%\src\
+cd %MDIR%\%MVER%
+set PATH=%DDRV%%MDIR%\%MVER%\bin;%DDRV%%MDIR%\%MVER%;%PATH%
+set BUILDER=/usr/src/buildall.sh
+set WD=C:\msys\1.0\bin\
+set PATH=%WD%;%PATH%
+
+%WD%bash %BUILDER%
+EXIT
+
+:NOINSTALL
+ECHO "Found existing install directories.  Delete any previous install targets and try again."
+EXIT

Added: torvm/trunk/build/win32/patches/qemu-winpcap-0.9.1.patch
===================================================================
--- torvm/trunk/build/win32/patches/qemu-winpcap-0.9.1.patch	                        (rev 0)
+++ torvm/trunk/build/win32/patches/qemu-winpcap-0.9.1.patch	2008-07-25 03:36:03 UTC (rev 16184)
@@ -0,0 +1,455 @@
+diff -Naur qemu-0.9.1-orig/Makefile.target qemu-0.9.1-mod/Makefile.target
+--- qemu-0.9.1-orig/Makefile.target	2008-01-06 19:38:41.000000000 +0000
++++ qemu-0.9.1-mod/Makefile.target	2008-07-23 05:03:59.572327704 +0000
+@@ -237,7 +237,7 @@
+ LIBS+=-lz
+ endif
+ ifdef CONFIG_WIN32
+-LIBS+=-lwinmm -lws2_32 -liphlpapi
++LIBS+=-lwinmm -lws2_32 -liphlpapi -lpthreadGC2 -lpacket -lwpcap
+ endif
+ ifdef CONFIG_SOLARIS
+ LIBS+=-lsocket -lnsl -lresolv
+diff -Naur qemu-0.9.1-orig/configure qemu-0.9.1-mod/configure
+--- qemu-0.9.1-orig/configure	2008-01-06 19:38:42.000000000 +0000
++++ qemu-0.9.1-mod/configure	2008-07-22 01:29:15.000000000 +0000
+@@ -600,7 +600,7 @@
+ #undef main /* We don't want SDL to override our main() */
+ int main( void ) { return SDL_Init (SDL_INIT_VIDEO); }
+ EOF
+-        if $cc -o $TMPE ${OS_CFLAGS} `$sdl_config --cflags 2> /dev/null` $TMPC `$sdl_config --libs 2> /dev/null` 2> /tmp/qemu-$$-sdl-config.log ; then
++        if $cc -o $TMPE ${OS_CFLAGS} ${CFLAGS} `$sdl_config --cflags 2> /dev/null` $TMPC ${LDFLAGS} `$sdl_config --libs 2> /dev/null` 2> /tmp/qemu-$$-sdl-config.log ; then
+             _sdlversion=`$sdl_config --version | sed 's/[^0-9]//g'`
+             if test "$_sdlversion" -lt 121 ; then
+                 sdl_too_old=yes
+@@ -883,7 +883,10 @@
+ fi
+ if test "$slirp" = "yes" ; then
+   echo "CONFIG_SLIRP=yes" >> $config_mak
++  echo "CONFIG_PCAP=yes" >> $config_mak
++  echo "PCAP_LIBS=-lpthreadGC2 -lpacket -lwpcap" >> $config_mak
+   echo "#define CONFIG_SLIRP 1" >> $config_h
++  echo "#define CONFIG_PCAP 1" >> $config_h
+ fi
+ if test "$adlib" = "yes" ; then
+   echo "CONFIG_ADLIB=yes" >> $config_mak
+diff -Naur qemu-0.9.1-orig/dyngen-exec.h qemu-0.9.1-mod/dyngen-exec.h
+--- qemu-0.9.1-orig/dyngen-exec.h	2008-01-06 19:38:42.000000000 +0000
++++ qemu-0.9.1-mod/dyngen-exec.h	2008-07-23 04:22:31.743310528 +0000
+@@ -32,6 +32,7 @@
+    host headers do not allow that. */
+ #include <stddef.h>
+ 
++#ifndef HAVE_INTSZ_TYPES
+ typedef unsigned char uint8_t;
+ typedef unsigned short uint16_t;
+ typedef unsigned int uint32_t;
+@@ -62,9 +63,6 @@
+ #endif
+ #endif
+ 
+-/* XXX: This may be wrong for 64-bit ILP32 hosts.  */
+-typedef void * host_reg_t;
+-
+ #define INT8_MIN		(-128)
+ #define INT16_MIN		(-32767-1)
+ #define INT32_MIN		(-2147483647-1)
+@@ -78,6 +76,11 @@
+ #define UINT32_MAX		(4294967295U)
+ #define UINT64_MAX		((uint64_t)(18446744073709551615))
+ 
++#endif /* HAVE_INTSZ_TYPES */
++
++/* XXX: This may be wrong for 64-bit ILP32 hosts.  */
++typedef void * host_reg_t;
++
+ #ifdef _BSD
+ typedef struct __sFILE FILE;
+ #else
+diff -Naur qemu-0.9.1-orig/vl.c qemu-0.9.1-mod/vl.c
+--- qemu-0.9.1-orig/vl.c	2008-01-06 19:38:42.000000000 +0000
++++ qemu-0.9.1-mod/vl.c	2008-07-22 06:44:51.077588952 +0000
+@@ -3858,6 +3858,326 @@
+ 
+ #endif /* CONFIG_SLIRP */
+ 
++/////////////////////////////////////////////////////////////////////////////
++#ifdef CONFIG_PCAP
++#define HAVE_U_INT8_T
++#define HAVE_U_INT16_T
++#define HAVE_U_INT32_T
++#define HAVE_U_INT64_T
++#include <pcap.h>
++#include <string.h>
++char pcap_devicename[64];
++
++#if defined(_WIN32)
++#include <winreg.h>
++#endif
++
++#include <pthread.h>
++
++static VLANClientState *pcap_vc;
++pcap_t* pcaphandle;
++static void pcap_receive(void *opaque, const uint8_t *buf, int size);
++char* eth_getname_bydesc(char* desc, char* name);
++char* eth_getname(int number, char* name);
++void eth_callback(u_char *user, struct pcap_pkthdr *phdr, u_char *pdata);
++void *pcap_send(void *threadid);
++int eth_open(char* name);
++
++#define ADAPTER_KEY "SYSTEM\\CurrentControlSet\\Control\\Class\\{4D36E972-E325-11CE-BFC1-08002BE10318}"
++#define NETWORK_CONNECTIONS_KEY "SYSTEM\\CurrentControlSet\\Control\\Network\\{4D36E972-E325-11CE-BFC1-08002BE10318}"
++#define DEVICE_PREFIX "\\Device\\NPF_"
++
++static int get_net_device_guid(
++    char *name,
++    int name_size,
++    char *actual_name,
++    int actual_name_size)
++{
++    LONG status;
++    HKEY control_net_key;
++    DWORD len;
++    int i = 0;
++    int stop = 0;
++
++    status = RegOpenKeyEx(
++        HKEY_LOCAL_MACHINE,
++        NETWORK_CONNECTIONS_KEY,
++        0,
++        KEY_READ,
++        &control_net_key);
++
++    if (status != ERROR_SUCCESS) {
++        return -1;
++    }
++
++    while (!stop)
++    {
++        char enum_name[256];
++        char connection_string[256];
++        HKEY connection_key;
++        char name_data[256];
++        DWORD name_type;
++        const char name_string[] = "Name";
++
++        len = sizeof (enum_name);
++        status = RegEnumKeyEx(
++            control_net_key,
++            i,
++            enum_name,
++            &len,
++            NULL,
++            NULL,
++            NULL,
++            NULL);
++
++        if (status == ERROR_NO_MORE_ITEMS)
++            break;
++        else if (status != ERROR_SUCCESS) {
++            return -1;
++        }
++
++        snprintf(connection_string,
++             sizeof(connection_string),
++             "%s\\%s\\Connection",
++             NETWORK_CONNECTIONS_KEY, enum_name);
++
++        status = RegOpenKeyEx(
++            HKEY_LOCAL_MACHINE,
++            connection_string,
++            0,
++            KEY_READ,
++            &connection_key);
++
++        if (status == ERROR_SUCCESS) {
++            len = sizeof (name_data);
++            status = RegQueryValueEx(
++                connection_key,
++                name_string,
++                NULL,
++                &name_type,
++                name_data,
++                &len);
++
++            if (status != ERROR_SUCCESS || name_type != REG_SZ) {
++                    return -1;
++            }
++            else {
++                if (actual_name) {
++                    if (strcmp(name, name_data) != 0) {
++                        fprintf(stderr, "pcap: %s does not match requested %s (guid: %s)\n", name, name_data, enum_name);
++                        RegCloseKey (connection_key);
++                        ++i;
++                        continue;
++                    }
++                    else {
++                        snprintf(actual_name, actual_name_size, "%s%s", DEVICE_PREFIX, enum_name);
++                        fprintf(stderr, "pcap: matched requested %s to guid: %s\n", name_data, enum_name);
++                    }
++                }
++                stop = 1;
++            }
++
++            RegCloseKey (connection_key);
++        }
++        ++i;
++    }
++
++    RegCloseKey (control_net_key);
++
++    if (stop == 0)
++        return -1;
++
++    return 0;
++}
++
++static int net_pcap_init(VLANState *vlan)
++{
++    pcap_vc = qemu_new_vlan_client(vlan,pcap_receive,NULL,NULL);
++    snprintf(pcap_vc->info_str,sizeof(pcap_vc->info_str),"pcap redirector");
++    char dev_guid[256];
++    *dev_guid = 0;
++    if (get_net_device_guid (pcap_devicename, sizeof(pcap_devicename), dev_guid, sizeof(dev_guid))) {
++        fprintf(stderr, "qemu: could not set up pcap bridge to alias: %s\n", pcap_devicename);
++        exit(1);
++    }
++    eth_open(dev_guid);
++
++    pthread_attr_t attr;
++    pthread_t threads;
++    int rc;
++    rc=pthread_create (&threads,NULL,pcap_send,NULL);
++    pthread_attr_destroy(&attr);
++    return 0;
++}
++
++int wtf=0;
++unsigned char mymac[8];
++
++static void pcap_receive(void *opaque, const uint8_t *buf, int size)
++{
++    // XXX use wtf to drop the 1st packet.
++    //cheesy hack to not 'read' my own packets.  we gobble the 1st packet
++    if(wtf==0)
++    {
++	memset(mymac,0x0,8);
++	memcpy(mymac,(u_char*)buf+6,6);
++	wtf++;
++    }
++    else{
++        pcap_sendpacket((pcap_t*)pcaphandle, (u_char*)buf, size);
++    }
++}
++
++void *pcap_send(void *threadid)
++{
++    int sel_ret;
++    struct timeval timeout;
++    timeout.tv_sec = 0;
++    timeout.tv_usec = 200*1000;
++    int status;
++
++    while(pcaphandle)
++    {
++        fd_set setl;
++        FD_ZERO(&setl);
++        status = pcap_dispatch((pcap_t*)pcaphandle, 1, &eth_callback, NULL);
++    }
++}
++
++void eth_callback(u_char *user, struct pcap_pkthdr *phdr, u_char *pdata)
++{
++    if(phdr->len<1501)
++    {
++        // XXX omit recieving own packets.  need to improve this patch
++        if(memcmp(mymac,(u_char*)pdata+6,6)) {
++            qemu_send_packet(pcap_vc, pdata, phdr->len);
++        }
++    }
++}
++
++#define ETH_PROMISC 1
++#define PCAP_READ_TIMEOUT 15
++
++int eth_open(char* name)
++{
++    const int bufsz = (BUFSIZ < 1520) ? 1520 : BUFSIZ;
++    char errbuf[PCAP_ERRBUF_SIZE];
++    char temp[1024];
++    char* savname = name;
++    int num;
++    char* msg;
++
++    /* translate name of type "ethX" to real device name */
++    if ((strlen(name) == 4)
++        && (tolower(name[0]) == 'e')
++        && (tolower(name[1]) == 't')
++        && (tolower(name[2]) == 'h')
++        && isdigit(name[3])) {
++
++        num = atoi(&name[3]);
++        savname = eth_getname(num, temp);
++    }
++    if (savname == 0) /* didn't translate */
++        return -1;
++
++    /* attempt to connect device */
++    memset(errbuf, 0, sizeof(errbuf));
++    pcaphandle = (void*) pcap_open_live(savname, bufsz, ETH_PROMISC, PCAP_READ_TIMEOUT, errbuf);
++    if (!pcaphandle) { /* try non-promisc open device */
++        pcaphandle = (void*) pcap_open_live(savname, bufsz, 0, PCAP_READ_TIMEOUT, errbuf);
++        if (!pcaphandle) { /* cannot open device */
++            msg = "Eth: pcap_open_live error - %s\r\n";
++            fprintf (stderr, msg, errbuf);
++            exit (1);
++        }
++        msg = "Eth: opened non-promisc %s\r\n";
++        fprintf (stderr, msg, savname);
++    } else {
++        msg = "Eth: opened promisc %s\r\n";
++        fprintf (stderr, msg, savname);
++    }
++
++#if !defined(HAS_PCAP_SENDPACKET) && defined (xBSD) && !defined (__APPLE__)
++    /* Tell the kernel that the header is fully-formed when it gets it.
++    This is required in order to fake the src address. */
++    {
++        int one = 1;
++        ioctl(pcap_fileno(dev->pcaphandle), BIOCSHDRCMPLT, &one);
++    }
++#endif /* xBSD */
++#if defined (USE_READER_THREAD)
++    {
++        pthread_attr_t attr;
++
++        ethq_init (&dev->read_queue, 200); /* initialize FIFO queue */
++        pthread_mutex_init (&dev->lock, NULL);
++        pthread_attr_init(&attr);
++        pthread_attr_setscope(&attr, PTHREAD_SCOPE_SYSTEM);
++        pthread_create (&dev->reader_thread, &attr, _pcap_send, (void *)dev);
++        pthread_attr_destroy(&attr);
++    }
++#else /* !defined (USE_READER_THREAD */
++#ifdef USE_SETNONBLOCK
++    /* set ethernet device non-blocking so pcap_dispatch() doesn't hang */
++    if (pcap_setnonblock (dev->pcaphandle, 1, errbuf) == -1) {
++        msg = "Eth: Failed to set non-blocking: %s\r\n";
++        printf (msg, errbuf);
++    }
++#endif
++#endif /* !defined (USE_READER_THREAD */
++    return 0;
++}
++
++#define ETH_MAX_DEVICE 10
++char* eth_getname_bydesc(char* desc, char* name)
++{
++    // ETH_LIST list[ETH_MAX_DEVICE];
++    struct slist {
++        int num;
++        char name[50];
++        char desc[50];
++    }list[10];
++    int count = 1;//eth_devices(ETH_MAX_DEVICE, list);
++    int i;
++    int j=strlen(desc);
++
++    for (i=0; i<count; i++) {
++        int found = 1;
++        int k = strlen(list[i].desc);
++
++        if (j != k) continue;
++        for (k=0; k<j; k++)
++            if (tolower(list[i].desc[k]) != tolower(desc[k]))
++        found = 0;
++        if (found == 0) continue;
++
++        /* found a case-insensitive description match */
++        strcpy(name, list[i].name);
++        return name;
++    }
++    /* not found */
++    return 0;
++}
++
++char* eth_getname(int number, char* name)
++{
++    //ETH_LIST list[ETH_MAX_DEVICE];
++    struct slist {
++        int num;
++        char name[50];
++        char desc[50];
++    }list[10];
++    int count =1;// eth_devices(ETH_MAX_DEVICE, list);
++
++    if (count < number) return 0;
++    strcpy(name, list[number].name);
++    return name;
++}
++#endif //CONFIG_PCAP
++//////////////////////////////////////////////////////////////////////////////
++
++/////////////////////////////////////////////////////////////////////////////
++
+ #if !defined(_WIN32)
+ 
+ typedef struct TAPState {
+@@ -4733,6 +5053,14 @@
+         ret = net_slirp_init(vlan);
+     } else
+ #endif
++#ifdef CONFIG_PCAP
++if (!strcmp(device, "pcap")) {
++       if (get_param_value(buf, sizeof(buf),"devicename",p)){
++               pstrcpy(pcap_devicename,sizeof(pcap_devicename),buf);
++       }
++ret = net_pcap_init(vlan);
++} else
++#endif
+ #ifdef _WIN32
+     if (!strcmp(device, "tap")) {
+         char ifname[64];
+@@ -7551,6 +7879,9 @@
+            "                connect the user mode network stack to VLAN 'n' and send\n"
+            "                hostname 'host' to DHCP clients\n"
+ #endif
++#ifdef CONFIG_PCAP
++              "-net pcap[,vlan=n],devicename=name\n"
++#endif
+ #ifdef _WIN32
+            "-net tap[,vlan=n],ifname=name\n"
+            "                connect the host TAP network interface to VLAN 'n'\n"
+@@ -7656,9 +7987,6 @@
+     QEMU_OPTION_pflash,
+     QEMU_OPTION_boot,
+     QEMU_OPTION_snapshot,
+-#ifdef TARGET_I386
+-    QEMU_OPTION_no_fd_bootchk,
+-#endif
+     QEMU_OPTION_m,
+     QEMU_OPTION_nographic,
+     QEMU_OPTION_portrait,
+@@ -7746,9 +8074,6 @@
+     { "pflash", HAS_ARG, QEMU_OPTION_pflash },
+     { "boot", HAS_ARG, QEMU_OPTION_boot },
+     { "snapshot", 0, QEMU_OPTION_snapshot },
+-#ifdef TARGET_I386
+-    { "no-fd-bootchk", 0, QEMU_OPTION_no_fd_bootchk },
+-#endif
+     { "m", HAS_ARG, QEMU_OPTION_m },
+     { "nographic", 0, QEMU_OPTION_nographic },
+     { "portrait", 0, QEMU_OPTION_portrait },
+@@ -8355,11 +8680,6 @@
+ 		drive_add("file=\"%s\"," FD_ALIAS, optarg,
+ 		          popt->index - QEMU_OPTION_fda);
+                 break;
+-#ifdef TARGET_I386
+-            case QEMU_OPTION_no_fd_bootchk:
+-                fd_bootchk = 0;
+-                break;
+-#endif
+             case QEMU_OPTION_no_code_copy:
+                 code_copy_enabled = 0;
+                 break;

Added: torvm/trunk/build/win32/scripts/download.sh
===================================================================
--- torvm/trunk/build/win32/scripts/download.sh	                        (rev 0)
+++ torvm/trunk/build/win32/scripts/download.sh	2008-07-25 03:36:03 UTC (rev 16184)
@@ -0,0 +1,72 @@
+#!/bin/bash
+# Copyright (C) 2008  The Tor Project, Inc.
+# See LICENSE file for rights and terms.
+
+if (( $# != 3 )); then
+  echo "Usage: `basename $0` SrcURL SHA1 DestPath" >&2
+  exit 1
+fi
+SRCURL="$1"
+SUMEXPECTED="$2"
+SAVEAS="$3"
+DLTMP="${SAVEAS}.dltmp"
+
+# get an sha1 digest using sha1sum or gpg and store in $SHA1OUT
+export ZEROSHA1=da39a3ee5e6b4b0d3255bfef95601890afd80709
+cmdsum () {
+  sha1sum=`which sha1sum`
+  if (( $? != 0 )); then
+    return 1
+  fi
+  SHA1OUT=`$sha1sum "$1" | sed 's/ .*//'`
+  return 0
+}
+
+gpgsum () {
+  gpgbin=`which gpg`
+  if (( $? != 0 )); then
+    return 1
+  fi
+  SHA1OUT=`$gpgbin --print-md sha1 "$1" 2>/dev/null | sed 's/.*: //' | sed 's/[^0-9A-F]//g' | tr -t '[:upper:]' '[:lower:]'`
+  return 0
+}
+
+dfunc=
+cmdsum /dev/null
+if (( $? == 0 )); then
+  if [[ "$SHA1OUT" == "$ZEROSHA1" ]]; then
+    dfunc=cmdsum
+  fi
+fi
+if [ -z "$dfunc" ]; then
+  gpgsum /dev/null
+  if (( $? == 0 )); then
+    if [[ "$SHA1OUT" == "$ZEROSHA1" ]]; then
+      dfunc=gpgsum
+    fi
+  fi 
+fi
+if [ -z "$dfunc" ]; then
+  echo "ERROR: Unable to find suitable sha1sum utility.  Please install sha1sum or gpg." >&2
+  exit 1
+fi
+
+echo "Retrieving $SRCURL ..."
+wget --no-check-certificate -t5 --timeout=20 $WGET_OPTIONS -O "$DLTMP" "$SRCURL"
+if (( $? != 0 )); then
+  echo "ERROR: Could not retrieve file $SRCURL" >&2
+  if [ -f "$DLTMP" ]; then
+    rm -f "$DLTMP"
+  fi
+  exit 1
+fi
+$dfunc "$DLTMP"
+if [[ "$SHA1OUT" != "$SUMEXPECTED" ]]; then
+  echo "ERROR: Digest for file `basename $DLTMP` does not match." >&2
+  echo "       Expected $SUMEXPECTED but got $SHA1OUT instead." >&2
+  rm -f "$DLTMP"
+  exit 1
+fi
+mv "$DLTMP" "$SAVEAS"
+echo "SHA-1 Digest verified OK for `basename $SAVEAS`"
+exit 0


Property changes on: torvm/trunk/build/win32/scripts/download.sh
___________________________________________________________________
Name: svn:executable
   + *



More information about the tor-commits mailing list