hwe kernel to fix btrfs-send bug
[automated-distro-installer] / fai-revm
index 30f541995fc98e2e43ebf83c4f01cbf0af767e86..d09bbcc7a986552dccd53dee09a7f8b55dfcc76c 100755 (executable)
--- a/fai-revm
+++ b/fai-revm
@@ -100,8 +100,17 @@ else
     e ./pxe-server $dhcp_arg demohost fai
     sleep 2
   else
-    fai-monitor&
-    boot_arg="--cdrom /a/bin/fai-basefiles/autodiscover.iso"
+    killall fai-monitor &>/dev/null ||:
+    fai-monitor &
+    if [[ ! $BASEFILE_DIR ]]; then
+      BASEFILE_DIR=/tmp
+    fi
+    a=$BASEFILE_DIR/autodiscover.iso
+    b=$BASEFILE_DIR/STRETCH64.tar.gz
+    if [[ ! -e $a || $(stat -c %Y $a) -lt $(stat -c %Y $b) ]]; then
+      e s fai-cd -g $(readlink -f grub.cfg.autodiscover) -f -A $BASEFILE_DIR/autodiscover.iso
+    fi
+    boot_arg="--cdrom $BASEFILE_DIR/autodiscover.iso"
     e fai-redep
     e myfai-chboot default
   fi
@@ -158,7 +167,7 @@ while ! timeout -s 9 10 ssh -oBatchMode=yes root@$name /bin/true; do
   e sleep 5
 done
 unset _errcatch_cleanup
-e pxe-server
+e ./pxe-server $dhcp_arg
 if is_arch_revm; then
   ./arch-init-remote $name
 fi