[Libguestfs] [PATCH 53/61] p2v-sysv.ks: nogui startup, View log option on fail

Maros Zatko mzatko at redhat.com
Wed Feb 12 14:31:05 UTC 2014


---
 p2v/image-builder/p2v-sysv.ks | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/p2v/image-builder/p2v-sysv.ks b/p2v/image-builder/p2v-sysv.ks
index 75baff2..294a36d 100644
--- a/p2v/image-builder/p2v-sysv.ks
+++ b/p2v/image-builder/p2v-sysv.ks
@@ -25,7 +25,9 @@ again=$(mktemp)
 
 while [ -f "$again" ]; do
     if [[ $(cat /proc/cmdline) =~ "p2v_nogui=true" ]] ; then
-      /usr/bin/openvt -c 1 /usr/bin/virt-p2v-launcher 2>&1 | tee -a $Xlog
+      /usr/bin/openvt -c 1 -f -- bash -c "
+/usr/bin/virt-p2v-launcher -nogui 2>&1 | tee -a $Xlog
+"
     else
       /usr/bin/xinit /usr/bin/virt-p2v-launcher > $Xlog 2>&1
     fi
@@ -41,7 +43,8 @@ echo virt-p2v-launcher failed
 select c in \
     \"Try again\" \
     \"Debug\" \
-    \"Power off\"
+    \"Power off\" \
+    \"View log\"
 do
     if [ \"\$c\" == Debug ]; then
         echo Output was written to $Xlog
@@ -50,6 +53,9 @@ do
         bash -l
     elif [ \"\$c\" == \"Power off\" ]; then
         rm $again
+    elif [ \"\$c\" == \"View log\" ]; then
+        TERM=xterm less /tmp/X.log
+        continue
     fi
     break
 done
-- 
1.8.3.1




More information about the Libguestfs mailing list