3 # installer - start installer frontend and backend as per pfi config.
4 # $Id: installer,v 1.20 2005/04/13 03:32:16 cpressey Exp $
12 $pfi_backend -r $RENDEZVOUS -t $TRANSPORT >/dev/null 2>&1
27 # Console start sequence:
28 # - Backend (and all other logging) goes to console (ttyv0)
29 # - curses frontend starts on ttyv1.
30 # - Uses vidcontrol -s 2 to switch to ttyv1 once the frontend is up.
32 echo -n "Starting installer. "
34 if [ -r /etc/defaults/pfi.conf ]; then
35 . /etc/defaults/pfi.conf
38 if [ -r /etc/pfi.conf ]; then
39 echo "Reading /etc/pfi.conf ..."
42 echo "/etc/pfi.conf not found, starting interactive install."
45 # We can set up any install variables and such
46 # here by examining pfi_* variables.
48 if [ "X$pfi_run" != "X" ]; then
53 case "X$pfi_dfui_transport" in
55 RENDEZVOUS="installer"
61 echo "Unsupported DFUI transport '$pfi_dfui_transport'."
66 if [ "X$pfi_frontend" = "Xauto" ]; then
67 if [ "X$DISPLAY" = "X" ]; then
68 if [ "X$LIVECD" = "X" ]; then
69 pfi_frontend="curseslog"
71 pfi_frontend="cursesvty"
74 pfi_frontend="cursesx11"
78 case "X$pfi_frontend" in
80 $pfi_backend -r $RENDEZVOUS -t $pfi_dfui_transport
84 $pfi_backend -r $RENDEZVOUS -t $pfi_dfui_transport
88 ps auwwwxxx > /tmp/ps.txt
89 if grep -q dfuife_curses /tmp/ps.txt; then
90 # Frontend is already running.
92 ESCDELAY=$pfi_curses_escdelay \
93 /usr/sbin/dfuife_curses \
95 -t $pfi_dfui_transport \
96 -b /usr/share/installer/fred.txt \
97 2>/dev/ttyv0 <$TTY >$TTY &
101 vidcontrol -s 2 </dev/ttyv0
105 -t $pfi_dfui_transport
108 killall dfuife_curses
109 vidcontrol -s 1 </dev/ttyv0
112 ps auwwwxxx > /tmp/ps.txt
113 if grep -q dfuife_curses /tmp/ps.txt; then
114 # Frontend is already running.
116 ESCDELAY=$pfi_curses_escdelay \
117 /usr/sbin/dfuife_curses \
119 -t $pfi_dfui_transport \
120 -b /usr/share/installer/fred.txt \
121 2>/tmp/dfuife_curses.log <$TTY >$TTY &
128 -t $pfi_dfui_transport \
132 killall -q dfuife_curses
135 ps auwwwxxx > /tmp/ps.txt
136 if grep -q dfuife_curses /tmp/ps.txt; then
137 echo "Frontend is already running"
139 ESCDELAY=$pfi_curses_escdelay \
140 /usr/sbin/dfuife_curses \
142 -t $pfi_dfui_transport \
143 -b /usr/share/installer/fred.txt \
144 >$TTY_INST <$TTY_INST 2>&1 &
148 $pfi_backend -r $RENDEZVOUS -t $pfi_dfui_transport
151 killall dfuife_curses
157 echo "Unknown installer frontend '$pfi_frontend'."
166 $pfi_shutdown_command
175 if [ $# -gt 1 ]; then
176 echo "usage: installer [source_directory]"
180 # Check if we are booted from a LiveCD, DVD etc. ttyv1 isn't configured in
181 # this case, so use that as a clue for now.
183 _ttyv1=`grep -w "^ttyv1" /etc/ttys`
184 if [ -z "$_ttyv1" ]; then
188 elif [ $# = 1 -a -d $1 ]; then
190 TTY=/dev/`w | awk '{ print $2 }' | tail -n1`
193 TTY=/dev/`w | awk '{ print $2 }' | tail -n1`
196 ps auwwwxxx > /tmp/ps.txt
197 if grep -q dfuibe_installer /tmp/ps.txt; then
198 # Installer is already running. Log in normally.
205 ### END of installer ###