Release Engineering: Enhance gui PFI to auto-detect xorg or curses
authorMatthew Dillon <dillon@apollo.backplane.com>
Tue, 10 Feb 2009 01:25:32 +0000 (17:25 -0800)
committerMatthew Dillon <dillon@apollo.backplane.com>
Tue, 10 Feb 2009 01:25:32 +0000 (17:25 -0800)
Add an "auto" feature for pfi_frontend and change the default to "auto".
Adjust the gui/usr/local/bin/installer script to accept "auto" and set
pfi_frontend to "xorg" or "curses" based on the existance of the DISPLAY
variable.

nrelease/gui/etc/defaults/pfi.conf
nrelease/gui/usr/local/bin/installer

index edf8028..4f68f0a 100644 (file)
 pfi_rc_actions=""
 
 # Determines which installer frontend to use.  Defaults to "curses";
-# other legal options are "cgi" and "none".
+# other legal options are "xorg", "cgi", and "none".
+#
+# "auto" will select curses or xorg based on the existence of DISPLAY
 
-pfi_frontend="xorg"
+pfi_frontend="auto"
 
 # Determines which installer backend to use.  Typically this is
 # "/usr/sbin/dfuibe_installer", the traditional C backend,
index 9931288..3eb008e 100755 (executable)
@@ -80,6 +80,14 @@ installer_start()
                pfi_frontend=none
        fi
 
+       if [ "X$pfi_frontend" = "Xauto" ]; then
+               if [ "X$DISPLAY" = "X" ]; then
+                       pfi_frontend="curses"
+               else
+                       pfi_frontend="xorg"
+               fi
+       fi
+
        case "X$pfi_frontend" in
        Xqt)
                $pfi_backend -r $RENDEZVOUS -t $pfi_dfui_transport