diff --git a/samples/vboxwrapper/boinc_resolve_1 b/samples/vboxwrapper/boinc_resolve_1 new file mode 100755 index 0000000000..80dd541072 --- /dev/null +++ b/samples/vboxwrapper/boinc_resolve_1 @@ -0,0 +1,3 @@ +#! /bin/sh + +sed 's/..\/..\/projects\///; s/[^\/]*\//\/root\/project\//; s/<\/soft_link>//' $1 | tr -d '\r\n' diff --git a/samples/vboxwrapper/vboxwrapper.cpp b/samples/vboxwrapper/vboxwrapper.cpp index c4ffb8593f..cc7f3b30a4 100644 --- a/samples/vboxwrapper/vboxwrapper.cpp +++ b/samples/vboxwrapper/vboxwrapper.cpp @@ -767,6 +767,13 @@ int main(int argc, char** argv) { pVM->memory_size_mb = memory_size_mb; } + if (pVM->memory_size_mb < MIN_MEMORY_SIZE_MB) { + vboxlog_msg("Memory size %dMB is too small; setting to %dMB", + pVM->memory_size_mb, MIN_MEMORY_SIZE_MB + ); + pVM->memory_size_mb = MIN_MEMORY_SIZE_MB; + } + if (aid.vbox_window && !aid.using_sandbox) { pVM->headless = false; } diff --git a/samples/vboxwrapper/vboxwrapper.h b/samples/vboxwrapper/vboxwrapper.h index 26c2c50e27..ac6259d121 100644 --- a/samples/vboxwrapper/vboxwrapper.h +++ b/samples/vboxwrapper/vboxwrapper.h @@ -19,6 +19,8 @@ #ifndef BOINC_VBOXWRAPPER_H #define BOINC_VBOXWRAPPER_H +#define MIN_MEMORY_SIZE_MB 512 + #define IMAGE_FILENAME_COMPLETE "vm_image.vdi" #define IMAGE_FILENAME "vm_image" #define IMAGE_FILENAME_EXTENSION "vdi" diff --git a/samples/worker/Makefile b/samples/worker/Makefile index 942373cba3..510c210735 100644 --- a/samples/worker/Makefile +++ b/samples/worker/Makefile @@ -1,7 +1,7 @@ CXXFLAGS += -g CXX ?= g++ -WORKER_RELEASE = 1_x86_64-pc-linux-gnu +WORKER_RELEASE = 2_x86_64-pc-linux-gnu PROGS = worker_$(WORKER_RELEASE) diff --git a/samples/worker/worker.cpp b/samples/worker/worker.cpp index a699c69f28..ff217646ef 100644 --- a/samples/worker/worker.cpp +++ b/samples/worker/worker.cpp @@ -18,12 +18,11 @@ // worker - application without BOINC runtime system; // used for testing wrappers. // -// worker [--std] [--file] nsecs +// worker [--nsecs N] infile outfile // -// --std: stdin to stdout -// --file_copy: "in" to "out" -// In both cases, convert to uppercase -// nsecs: use this much CPU time (default 10 sec) +// copy infile to outfile, converting to uppercase +// if infile is 'stdin', use stdin; same for stdout +// --nsecs: use about N sec of CPU time // // THIS PROGRAM CAN'T USE ANY BOINC CODE. That's the whole point. @@ -58,45 +57,49 @@ void copy_uc(FILE* fin, FILE* fout) { } int main(int argc, char** argv) { - FILE* in, *out; - int i, nsec = 10; - bool std = false, file = false; + FILE* in=0, *out=0; + int i, nsecs = 0; char c; for (i=1; iurl // function stage_file($a, $v, $p, $fd) { - global $download_url, $download_dir; + global $download_url, $download_dir, $verbose; $name = $fd->physical_name; $path = "apps/$a/$v/$p/$name"; $dl_path = "$download_dir/$name"; if (is_file($dl_path)) { + if ($verbose) echo "md5 check start\n"; if (md5_file($path) != md5_file($dl_path)) { die ("Error: files $path and $dl_path differ.\nBOINC files are immutable.\nIf you change a file, you must give it a new name.\n"); } + if ($verbose) echo "md5 check end\n"; } else { $subdirs = dirname($name); if ($subdirs) { @@ -214,8 +221,9 @@ function get_api_version($a, $v, $p, $fds) { $sig_gen_confirmed = false; function confirm_sig_gen($name) { - global $sig_gen_confirmed; + global $sig_gen_confirmed, $confirm; + if (!$confirm) return true; if ($sig_gen_confirmed) return true; echo " @@ -238,7 +246,12 @@ function confirm_sig_gen($name) { // process a file // function process_file($a, $v, $p, $name, $fds) { - global $key_dir, $confirm; + global $key_dir, $confirm, $verbose; + + if ($verbose) { + echo "process_file(): $a/$v/$p/$name\n"; + } + $fd = lookup_file($fds, $name); if (!$fd) { $fd = new StdClass; @@ -271,7 +284,9 @@ function process_file($a, $v, $p, $name, $fds) { } } + if ($verbose) echo "stage start\n"; $fd = stage_file($a, $v, $p, $fd); + if ($verbose) echo "stage done\n"; if (!isset($fd->executable)) { $perms = fileperms($path); @@ -422,12 +437,16 @@ function convert_simplexml($x) { } function process_version($a, $v, $p) { - global $confirm; - echo "Found app version directory for: $a $v $p\n"; + global $confirm, $verbose; + if ($verbose) { + echo "Found app version directory for: $a $v $p\n"; + } $app = lookup_app($a); parse_platform_name($p, $platform, $plan_class); if (already_exists($a, $v, $platform, $plan_class)) { - echo " (already exists in database)\n"; + if ($verbose) { + echo " (already exists in database)\n"; + } return; } $vfile = "apps/$a/$v/$p/version.xml"; @@ -556,8 +575,14 @@ function scan_apps() { } } -if (count($argv)>1 && $argv[1]=='--noconfirm') { - $confirm = false; +foreach (array_slice($argv, 1) as $arg) { + if ($arg == '--noconfirm') { + $confirm = false; + } else if ($arg == '--verbose') { + $verbose = true; + } else { + die("unknown arg $arg\n"); + } } scan_apps();