/[livecd-tools]/trunk/livecd-functions.sh
Gentoo

Contents of /trunk/livecd-functions.sh

Parent Directory Parent Directory | Revision Log Revision Log


Revision 106 - (show annotations) (download) (as text)
Wed Jun 14 14:48:07 2006 UTC (8 years, 6 months ago) by wolf31o2
File MIME type: text/x-sh
File size: 16430 byte(s)
Add a check to determine the location of iwconfig so it works on older and newer versions of wireless-tools.  This is for bug #136497.

1 #!/bin/bash
2 # Copyright 1999-2005 Gentoo Foundation
3 # Distributed under the terms of the GNU General Public License v2
4 # $Header: /var/cvsroot/gentoo/src/livecd-tools/livecd-functions.sh,v 1.24 2006/06/14 14:48:07 wolf31o2 Exp $
5
6 # Global Variables:
7 # CDBOOT -- is booting off CD
8 # LIVECD_CONSOLE -- console that is specified to kernel commandline
9 # -- (ttyS0, tty1, etc). Only defined if passed to kernel
10 # LIVECD_CONSOLE_BAUD -- console baudrate specified
11 # LIVECD_CONSOLE_PARITY -- console parity specified
12 # LIVECD_CONSOLE_DATABITS -- console databits specified
13
14 source /sbin/functions.sh
15
16 livecd_parse_opt() {
17 case "$1" in
18 *\=*)
19 echo "$1" | cut -f2 -d=
20 ;;
21 esac
22 }
23
24 livecd_check_root() {
25 if [ "$(whoami)" != "root" ]
26 then
27 echo "ERROR: must be root to continue"
28 return 1
29 fi
30 }
31
32 livecd_get_cmdline() {
33 echo "0" > /proc/sys/kernel/printk
34 CMDLINE="$(cat /proc/cmdline)"
35 export CMDLINE
36 }
37
38 no_gl() {
39 einfo "If you have a card that you know is supported by either the ATI or"
40 einfo "NVIDIA binary drivers, please file a bug with the output of lspci"
41 einfo "on http://bugs.gentoo.org so we can resolve this."
42 GLTYPE=xorg-x11
43 }
44
45 ati_gl() {
46 einfo "ATI card detected."
47 GLTYPE=ati
48 }
49
50 nv_gl() {
51 einfo "NVIDIA card detected."
52 GLTYPE=nvidia
53 }
54
55 nv_no_gl() {
56 einfo "NVIDIA card detected."
57 echo
58 einfo "This card is not supported by the latest version of the NVIDIA"
59 einfo "binary drivers. Switching to the X server's driver instead."
60 GLTYPE=xorg-x11
61 sed -i 's/nvidia/nv/' /etc/X11/xorg.conf
62 }
63
64 get_video_cards() {
65 [ -x /sbin/lspci ] && VIDEO_CARDS="$(/sbin/lspci | grep VGA)"
66 [ -x /usr/sbin/lspci ] && VIDEO_CARDS="$(/usr/sbin/lspci | grep VGA)"
67 NUM_CARDS="$(echo ${VIDEO_CARDS} | wc -l)"
68 if [ ${NUM_CARDS} -eq 1 ]
69 then
70 NVIDIA=$(echo ${VIDEO_CARDS} | grep "nVidia Corporation")
71 ATI=$(echo ${VIDEO_CARDS} | grep "ATI Technologies")
72 if [ -n "${NVIDIA}" ]
73 then
74 NVIDIA_CARD=$(echo ${NVIDIA} | awk 'BEGIN {RS=" "} /(NV|nv|G)[0-9]+/ {print $1}' | cut -d. -f1 | sed 's/ //' | sed 's:[^0-9]::g')
75 # NVIDIA Model reference:
76 # http://en.wikipedia.org/wiki/Comparison_of_NVIDIA_Graphics_Processing_Units
77 if [ -n "${NVIDIA_CARD}" ]
78 then
79 if [ $(echo ${NVIDIA_CARD} | cut -dV -f2) -ge 17 ]
80 then
81 nv_gl
82 elif [ $(echo ${NVIDIA_CARD} | cut -dG -f2) -ge 70 ]
83 then
84 nv_gl
85 elif [ $(echo ${NVIDIA_CARD} | cut -dV -f2) -eq 11 ]
86 then
87 nv_gl
88 else
89 nv_no_gl
90 fi
91 else
92 no_gl
93 fi
94 elif [ -n "${ATI}" ]
95 then
96 ATI_CARD=$(echo ${ATI} | awk 'BEGIN {RS=" "} /(R|RV|RS)[0-9]+/ {print $1}')
97 if [ $(echo ${ATI_CARD} | grep S) ]
98 then
99 ATI_CARD_S=$(echo ${ATI_CARD} | cut -dS -f2)
100 elif [ $(echo ${ATI_CARD} | grep V) ]
101 then
102 ATI_CARD_V=$(echo ${ATI_CARD} | cut -dV -f2)
103 else
104 ATI_CARD=$(echo ${ATI_CARD} | cut -dR -f2)
105 fi
106 if [ -n "${ATI_CARD_S}" ] && [ ${ATI_CARD_S} -ge 350 ]
107 then
108 ati_gl
109 elif [ -n "${ATI_CARD_V}" ] && [ ${ATI_CARD_V} -ge 250 ]
110 then
111 ati_gl
112 elif [ -n "${ATI_CARD}" ] && [ ${ATI_CARD} -ge 200 ]
113 then
114 ati_gl
115 else
116 no_gl
117 fi
118 else
119 no_gl
120 fi
121 fi
122 }
123
124 livecd_config_wireless() {
125 cd /tmp/setup.opts
126 [ -x /usr/sbin/iwconfig ] && iwconfig=/usr/sbin/iwconfig
127 [ -x /sbin/iwconfig ] && iwconfig=/sbin/iwconfig
128 dialog --title "SSID" --inputbox "Please enter your SSID, or leave blank for selecting the nearest open network" 20 50 2> ${iface}.SSID
129 SSID="$(cat ${iface}.SSID)"
130 if [ -n "${SSID}" ]
131 then
132 dialog --title "WEP (Part 1)" --menu "Does your network use encryption?" 20 60 7 1 "Yes" 2 "No" 2> ${iface}.WEP
133 WEP="$(cat ${iface}.WEP)"
134 case ${WEP} in
135 1)
136 dialog --title "WEP (Part 2)" --menu "Are you entering your WEP key in HEX or ASCII?" 20 60 7 1 "HEX" 2 "ASCII" 2> ${iface}.WEPTYPE
137 WEP_TYPE="$(cat ${iface}.WEPTYPE)"
138 case ${WEP_TYPE} in
139 1)
140 dialog --title "WEP (Part 3)" --inputbox "Please enter your WEP key in the form of XXXX-XXXX-XX for 64-bit or XXXX-XXXX-XXXX-XXXX-XXXX-XXXX-XX for 128-bit" 20 50 2> ${iface}.WEPKEY
141 WEP_KEY="$(cat ${iface}.WEPKEY)"
142 if [ -n "${WEP_KEY}" ]
143 then
144 ${iwconfig} ${iface} essid "${SSID}"
145 ${iwconfig} ${iface} key "${WEP_KEY}"
146 fi
147 ;;
148 2)
149 dialog --title "WEP (Part 3)" --inputbox "Please enter your WEP key in ASCII form. This should be 5 or 13 characters for either 64-bit or 128-bit encryption, repectively" 20 50 2> ${iface}.WEPKEY
150 WEP_KEY="$(cat ${iface}.WEPKEY)"
151 if [ -n "${WEP_KEY}" ]
152 then
153 ${iwconfig} ${iface} essid "${SSID}"
154 ${iwconfig} ${iface} key "s:${WEP_KEY}"
155 fi
156 ;;
157 esac
158 ;;
159 2)
160 ${iwconfig} ${iface} essid "${SSID}"
161 ${iwconfig} ${iface} key off
162 ;;
163 esac
164 fi
165 }
166
167 livecd_write_wireless_conf() {
168 cd /tmp/setup.opts
169 SSID="$(cat ${iface}.SSID)"
170 if [ -n "${SSID}" ]
171 then
172 echo "# This wireless configuration file was built by net-setup" > /etc/conf.d/wireless
173 WEP="$(cat ${iface}.WEPTYPE)"
174 case ${WEP} in
175 1)
176 WEP_TYPE="$(cat ${iface}.WEPTYPE)"
177 if [ -n "${WEP_TYPE}" ]
178 then
179 WEP_KEY="$(cat ${iface}.WEPKEY)"
180 if [ -n "${WEP_KEY}" ]
181 then
182 SSID_TRANS="$(echo ${SSID//[![:word:]]/_})"
183 case ${WEP_TYPE} in
184 1)
185 echo "key_${SSID_TRANS}=\"${WEP_KEY} enc open\"" >> /etc/conf.d/wireless
186 ;;
187 2)
188 echo "key_${SSID_TRANS}=\"s:${WEP_KEY} enc open\"" >> /etc/conf.d/wireless
189 ;;
190 esac
191 fi
192 fi
193 ;;
194 2)
195 :
196 ;;
197 esac
198 echo "preferred_aps=( \"${SSID}\" )" >> /etc/conf.d/wireless
199 echo "associate_order=\"forcepreferredonly\"" >> /etc/conf.d/wireless
200 fi
201 }
202
203 livecd_config_ip() {
204 cd /tmp/setup.opts
205 dialog --title "TCP/IP setup" --menu "You can use DHCP to automatically configure a network interface or you can specify an IP and related settings manually. Choose one option:" 20 60 7 1 "Use DHCP to auto-detect my network settings" 2 "Specify an IP address manually" 2> ${iface}.DHCP
206 DHCP="$(cat ${iface}.DHCP)"
207 case ${DHCP} in
208 1)
209 /sbin/dhcpcd -n -t 10 -h $(hostname) ${iface} &
210 ;;
211 2)
212 dialog --title "IP address" --inputbox "Please enter an IP address for ${iface}:" 20 50 "192.168.1.1" 2> ${iface}.IP
213 IP="$(cat ${iface}.IP)"
214 BC_TEMP="$(echo $IP|cut -d . -f 1).$(echo $IP|cut -d . -f 2).$(echo $IP|cut -d . -f 3).255"
215 dialog --title "Broadcast address" --inputbox "Please enter a Broadcast address for ${iface}:" 20 50 "${BC_TEMP}" 2> ${iface}.BC
216 BROADCAST="$(cat ${iface}.BC)"
217 dialog --title "Network mask" --inputbox "Please enter a Network Mask for ${iface}:" 20 50 "255.255.255.0" 2> ${iface}.NM
218 NETMASK="$(cat ${iface}.NM)"
219 dialog --title "Gateway" --inputbox "Please enter a Gateway for ${iface} (hit enter for none:)" 20 50 2> ${iface}.GW
220 GATEWAY="$(cat ${iface}.GW)"
221 dialog --title "DNS server" --inputbox "Please enter a name server to use (hit enter for none:)" 20 50 2> ${iface}.DNS
222 DNS="$(cat ${iface}.DNS)"
223 /sbin/ifconfig ${iface} ${IP} broadcast ${BROADCAST} netmask ${NETMASK}
224 if [ -n "${GATEWAY}" ]
225 then
226 /sbin/route add default gw ${GATEWAY} dev ${iface} netmask 0.0.0.0 metric 1
227 fi
228 if [ -n "${DNS}" ]
229 then
230 dialog --title "DNS Search Suffix" --inputbox "Please enter any domains which you would like to search on DNS queries (hit enter for none:)" 20 50 2> ${iface}.SUFFIX
231 SUFFIX="$(cat ${iface}.SUFFIX)"
232 echo "nameserver ${DNS}" > /etc/resolv.conf
233 if [ -n "${SUFFIX}" ]
234 then
235 echo "search ${SUFFIX}" >> /etc/resolv.conf
236 fi
237 fi
238 ;;
239 esac
240 }
241
242 livecd_write_net_conf() {
243 cd /tmp/setup.opts
244 echo "# This network configuration was written by net-setup" > /etc/conf.d/net
245 DHCP="$(cat ${iface}.DHCP)"
246 case ${DHCP} in
247 1)
248 echo "iface_${iface}=\"dhcp\"" >> /etc/conf.d/net
249 ;;
250 2)
251 IP="$(cat ${iface}.IP)"
252 BROADCAST="$(cat ${iface}.BC)"
253 NETMASK="$(cat ${iface}.NM)"
254 GATEWAY="$(cat ${iface}.GW)"
255 if [ -n "${IP}" -a -n "${BROADCAST}" -a -n "${NETMASK}" ]
256 then
257 echo "iface_eth0=\"${IP} broadcast ${BROADCAST} netmask ${NETMASK}\"" >> /etc/conf.d/net
258 if [ -n "${GATEWAY}" ]
259 then
260 echo "gateway=\"${iface}/${GATEWAY}\"" >> /etc/conf.d/net
261 fi
262 fi
263 ;;
264 esac
265 }
266
267 get_ifmac() {
268 local iface=$1
269
270 # Example: 00:01:6f:e1:7a:06
271 cat /sys/class/net/${iface}/address
272 }
273
274
275 get_ifdriver() {
276 local iface=$1
277
278 # Example: ../../../bus/pci/drivers/forcedeth (wanted: forcedeth)
279 local if_driver="$(readlink /sys/class/net/${iface}/device/driver)"
280 basename ${if_driver}
281 }
282
283 get_ifbus() {
284 local iface=$1
285
286 # Example: ../../../bus/pci (wanted: pci)
287 # Example: ../../../../bus/pci (wanted: pci)
288 # Example: ../../../../../../bus/usb (wanted: usb)
289 local if_bus="$(readlink /sys/class/net/${iface}/device/bus)"
290 basename ${if_bus}
291 }
292
293 get_ifproduct() {
294 local iface=$1
295 local bus="$(get_ifbus ${iface})"
296 local if_pciaddr
297 local if_devname
298 local if_usbpath
299 local if_usbmanufacturer
300 local if_usbproduct
301
302 if [[ ${bus} == "pci" ]]; then
303 # Example: ../../../devices/pci0000:00/0000:00:0a.0 (wanted: 0000:00:0a.0)
304 # Example: ../../../devices/pci0000:00/0000:00:09.0/0000:01:07.0 (wanted: 0000:01:07.0)
305 if_pciaddr="$(readlink /sys/class/net/${iface}/device)"
306 if_pciaddr="$(basename ${if_pciaddr})"
307
308 # Example: 00:0a.0 Bridge: nVidia Corporation CK804 Ethernet Controller (rev a3)
309 # (wanted: nVidia Corporation CK804 Ethernet Controller)
310 if_devname="$(lspci -s ${if_pciaddr})"
311 if_devname="${if_devname#*: }"
312 if_devname="${if_devname%(rev *)}"
313 fi
314
315 if [[ ${bus} == "usb" ]]; then
316 if_usbpath="$(readlink /sys/class/net/${iface}/device)"
317 if_usbpath="/sys/class/net/${iface}/$(dirname ${if_usbpath})"
318 if_usbmanufacturer="$(< ${if_usbpath}/manufacturer)"
319 if_usbproduct="$(< ${if_usbpath}/product)"
320
321 [[ -n ${if_usbmanufacturer} ]] && if_devname="${if_usbmanufacturer} "
322 [[ -n ${if_usbproduct} ]] && if_devname="${if_devname}${if_usbproduct}"
323 fi
324
325 if [[ ${bus} == "ieee1394" ]]; then
326 if_devname="IEEE1394 (FireWire) Network Adapter";
327 fi
328
329 echo ${if_devname}
330 }
331
332 get_ifdesc() {
333 local iface=$1
334 desc="$(get_ifproduct ${iface})"
335 if [[ -n ${desc} ]]; then
336 echo $desc
337 return;
338 fi
339
340 desc="$(get_ifdriver ${iface})"
341 if [[ -n ${desc} ]]; then
342 echo $desc
343 return;
344 fi
345
346 desc="$(get_ifmac ${iface})"
347 if [[ -n ${desc} ]]; then
348 echo $desc
349 return;
350 fi
351
352 echo "Unknown"
353 }
354
355 show_ifmenu() {
356 local old_ifs="${IFS}"
357 local opts
358 IFS="
359 "
360 for ifname in $(/sbin/ifconfig -a | grep "^[^ ]"); do
361 ifname="${ifname%% *}"
362 [[ ${ifname} == "lo" ]] && continue
363 opts="${opts} ${ifname} '$(get_ifdesc ${ifname})'"
364 done
365 IFS="${old_ifs}"
366
367 if ! eval dialog --menu \"Please select the interface that you wish to configure from the list below:\" 0 0 0 $opts 2>iface; then
368 exit
369 fi
370
371 iface="$(< iface)"
372 }
373
374 show_ifconfirm() {
375 local iface=$1
376 local if_mac="$(get_ifmac ${iface})"
377 local if_driver="$(get_ifdriver ${iface})"
378 local if_bus="$(get_ifbus ${iface})"
379 local if_product="$(get_ifproduct ${iface})"
380
381 local text="Details for network interface ${iface} are shown below.\n\nInterface name: ${iface}\n"
382 [[ -n ${if_product} ]] && text="${text}Device: ${if_product}\n"
383 [[ -n ${if_mac} ]] && text="${text}MAC address: ${if_mac}\n"
384 [[ -n ${if_driver} ]] && text="${text}Driver: ${if_driver}\n"
385 [[ -n ${if_bus} ]] && text="${text}Bus type: ${if_bus}\n"
386 text="${text}\nIs this the interface that you wish to configure?"
387
388 if ! dialog --title "Interface details" --yesno "${text}" 15 70; then
389 result="no"
390 else
391 result="yes"
392 fi
393 }
394
395 livecd_console_settings() {
396 # scan for a valid baud rate
397 case "$1" in
398 300*)
399 LIVECD_CONSOLE_BAUD=300
400 ;;
401 600*)
402 LIVECD_CONSOLE_BAUD=600
403 ;;
404 1200*)
405 LIVECD_CONSOLE_BAUD=1200
406 ;;
407 2400*)
408 LIVECD_CONSOLE_BAUD=2400
409 ;;
410 4800*)
411 LIVECD_CONSOLE_BAUD=4800
412 ;;
413 9600*)
414 LIVECD_CONSOLE_BAUD=9600
415 ;;
416 14400*)
417 LIVECD_CONSOLE_BAUD=14400
418 ;;
419 19200*)
420 LIVECD_CONSOLE_BAUD=19200
421 ;;
422 28800*)
423 LIVECD_CONSOLE_BAUD=28800
424 ;;
425 38400*)
426 LIVECD_CONSOLE_BAUD=38400
427 ;;
428 57600*)
429 LIVECD_CONSOLE_BAUD=57600
430 ;;
431 115200*)
432 LIVECD_CONSOLE_BAUD=115200
433 ;;
434 esac
435 if [ "${LIVECD_CONSOLE_BAUD}" = "" ]
436 then
437 # If it's a virtual console, set baud to 38400, if it's a serial
438 # console, set it to 9600 (by default anyhow)
439 case ${LIVECD_CONSOLE} in
440 tty[0-9])
441 LIVECD_CONSOLE_BAUD=38400
442 ;;
443 *)
444 LIVECD_CONSOLE_BAUD=9600
445 ;;
446 esac
447 fi
448 export LIVECD_CONSOLE_BAUD
449
450 # scan for a valid parity
451 # If the second to last byte is a [n,e,o] set parity
452 local parity
453 parity=$(echo $1 | rev | cut -b 2-2)
454 case "$parity" in
455 [neo])
456 LIVECD_CONSOLE_PARITY=$parity
457 ;;
458 esac
459 export LIVECD_CONSOLE_PARITY
460
461 # scan for databits
462 # Only set databits if second to last character is parity
463 if [ "${LIVECD_CONSOLE_PARITY}" != "" ]
464 then
465 LIVECD_CONSOLE_DATABITS=$(echo $1 | rev | cut -b 1)
466 fi
467 export LIVECD_CONSOLE_DATABITS
468 return 0
469 }
470
471 livecd_read_commandline() {
472 livecd_get_cmdline || return 1
473
474 for x in ${CMDLINE}
475 do
476 case "${x}" in
477 cdroot)
478 CDBOOT="yes"
479 export CDBOOT
480 ;;
481 cdroot\=*)
482 CDBOOT="yes"
483 export CDBOOT
484 ;;
485 console\=*)
486 local live_console
487 live_console=$(livecd_parse_opt "${x}")
488
489 # Parse the console line. No options specified if
490 # no comma
491 LIVECD_CONSOLE=$(echo ${live_console} | cut -f1 -d,)
492 if [ "${LIVECD_CONSOLE}" = "" ]
493 then
494 # no options specified
495 LIVECD_CONSOLE=${live_console}
496 else
497 # there are options, we need to parse them
498 local livecd_console_opts
499 livecd_console_opts=$(echo ${live_console} | cut -f2 -d,)
500 livecd_console_settings ${livecd_console_opts}
501 fi
502 export LIVECD_CONSOLE
503 ;;
504 esac
505 done
506 return 0
507 }
508
509 livecd_fix_inittab() {
510 if [ "${CDBOOT}" = "" ]
511 then
512 return 1
513 fi
514
515 # Create a backup
516 cp -f /etc/inittab /etc/inittab.old
517
518 # Comment out current getty settings
519 sed -i -e '/^c[0-9]/ s/^/#/' /etc/inittab
520 sed -i -e '/^s[01]/ s/^/#/' /etc/inittab
521
522 # SPARC & HPPA console magic
523 if [ "${HOSTTYPE}" = "sparc" -o "${HOSTTYPE}" = "hppa" -o "${HOSTTYPE}" = "ppc64" ]
524 then
525 # Mount openprom tree for user debugging purposes
526 if [ "${HOSTTYPE}" = "sparc" ]
527 then
528 mount -t openpromfs none /proc/openprom
529 fi
530
531 # SPARC serial port A, HPPA mux / serial
532 if [ -c "/dev/ttyS0" ]
533 then
534 LIVECD_CONSOLE_BAUD=$(stty -F /dev/ttyS0 speed)
535 echo "s0:12345:respawn:/sbin/agetty -nl /bin/bashlogin ${LIVECD_CONSOLE_BAUD} ttyS0 vt100" >> /etc/inittab
536 fi
537 # HPPA software PDC console (K-models)
538 if [ "${LIVECD_CONSOLE}" = "ttyB0" ]
539 then
540 mknod /dev/ttyB0 c 11 0
541 LIVECD_CONSOLE_BAUD=$(stty -F /dev/ttyB0 speed)
542 echo "b0:12345:respawn:/sbin/agetty -nl /bin/bashlogin ${LIVECD_CONSOLE_BAUD} ttyB0 vt100" >> /etc/inittab
543 fi
544 # FB / STI console
545 if [ -c "/dev/vc/1" -o -c "/dev/tts/1" -o -c "/dev/tty2" ]
546 then
547 MODEL_NAME=$(cat /proc/cpuinfo |grep "model name"|sed 's/.*: //')
548 if [ "${MODEL_NAME}" = "UML" ]
549 then
550 for x in 0 1 2 3 4 5 6
551 do
552 echo "c${x}:12345:respawn:/sbin/mingetty --noclear --autologin root tty${x}" >> /etc/inittab
553 done
554 else
555 for x in 1 2 3 4 5 6
556 do
557 echo "c${x}:12345:respawn:/sbin/mingetty --noclear --autologin root tty${x}" >> /etc/inittab
558 done
559 fi
560 fi
561 if [ -c "/dev/hvc0" ]
562 then
563 einfo "Adding hvc console to inittab"
564 echo "s0:12345:respawn:/sbin/agetty -nl /bin/bashlogin 9600 hvc0 vt320" >> /etc/inittab
565 fi
566
567
568 # The rest...
569 else
570 if [ "${LIVECD_CONSOLE}" = "tty0" -o "${LIVECD_CONSOLE}" = "" ]
571 then
572 for x in 1 2 3 4 5 6
573 do
574 echo "c${x}:12345:respawn:/sbin/agetty -nl /bin/bashlogin 38400 tty${x} linux" >> /etc/inittab
575 done
576 else
577 einfo "Adding ${LIVECD_CONSOLE} console to inittab"
578 echo "s0:12345:respawn:/sbin/agetty -nl /bin/bashlogin ${LIVECD_CONSOLE_BAUD} ${LIVECD_CONSOLE} vt100" >> /etc/inittab
579 fi
580 fi
581
582 # EFI-based machines should automatically hook up their console lines
583 if dmesg | grep -q '^Adding console on'
584 then
585 dmesg | grep '^Adding console on' | while read x; do
586 line=`echo "$x" | cut -d' ' -f4`
587 id=e`echo "$line" | grep -o '.\{1,3\}$'`
588 [ "${line}" = "${LIVECD_CONSOLE}" ] && continue # already setup above
589 case "$x" in
590 *options\ \'[0-9]*) speed=`echo "$x" | sed "s/.*options '//; s/[^0-9].*//"` ;;
591 *) speed=9600 ;; # choose a default, only matters if it is serial
592 esac
593 echo "$id:12345:respawn:/sbin/agetty -nl /bin/bashlogin ${speed} ${line} vt100" >> /etc/inittab
594 done
595 fi
596
597 # force reread of inittab
598 kill -HUP 1
599 return 0
600 }

Properties

Name Value
svn:eol-style native
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.20