fixup initial faiserver bootstrap & small bugs
[automated-distro-installer] / fai-revm
index b3e2dec00e9de641d0bd9b676ef265e3f6fff930..2361ecf662848c825205e65149be54ad96600467 100755 (executable)
--- a/fai-revm
+++ b/fai-revm
@@ -36,10 +36,12 @@ disk_count=2
 script_dir=$(dirname $(readlink -f "$BASH_SOURCE"))
 
 if [[ $script_dir == /a/bin/* ]]; then
-    rm -rf /a/tmp/fai2
+    # Copy our script elsewhere so we can develop it
+    # and save it at the same time it's running
+    rm -rf /tmp/faifreeze
     mkdir -p /a/tmp
-    cp -ar /a/bin/fai /a/tmp/fai2
-    exec /a/tmp/fai2/${BASH_SOURCE##*/} "$@"
+    cp -ar /a/bin/fai /tmp/faifreeze
+    exec /tmp/faifreeze/${BASH_SOURCE##*/} "$@"
 fi
 
 cd $script_dir
@@ -57,7 +59,7 @@ if is_arch_revm; then
     # via osinfo-query os. guessing arch is closest to latest fedora.
     variant=fedora22
 else
-    ./pxe-server fai &
+    ./pxe-server -a fai &
     sleep 2
     if $redeploy; then
         ./fai-redep
@@ -91,7 +93,7 @@ fi
 # uniq is to stop gtk-warning spam
 s virt-install --os-variant $variant  -n $name --pxe -r 2048 --vcpus 1 \
   ${disk_arg[*]} -w bridge=br0,mac=52:54:00:9c:ef:ad \
-  --graphics spice,listen=0.0.0.0 $console_arg |& grep -v '^$' | uniq &
+  --graphics spice,listen=0.0.0.0 $console_arg |& grep -v '^ *$' | uniq &
 
 if [[ $SSH_CLIENT ]]; then
     fg