Adding debian version 2.0~a1-1.
[live-boot-grml.git] / scripts / live-bottom / 22serialtty
1 #!/bin/sh
2
3 #set -e
4
5 # initramfs-tools header
6
7 PREREQ=""
8
9 prereqs()
10 {
11         echo "${PREREQ}"
12 }
13
14 case "${1}" in
15         prereqs)
16                 prereqs
17                 exit 0
18                 ;;
19 esac
20
21 # live-boot header
22
23 # this bottom script currently only works with upstart
24 if [ ! -d /root/etc/init ]
25 then
26         exit 0
27 fi
28
29 . /scripts/live-functions
30
31 # live-boot script
32
33 for ARGUMENT in $(cat /proc/cmdline)
34 do
35         case ${ARGUMENT} in
36                 serialtty=*)
37                         tty="${ARGUMENT#serialtty=}"
38
39                         log_begin_msg "Setting up a serial tty..."
40
41 cat > /root/etc/init/${tty}.conf <<EOF
42 start on stopped rc RUNLEVEL=[2345]
43 stop on runlevel [!2345]
44
45 respawn
46 exec /sbin/getty -L 115200 ${tty} vt100
47 EOF
48
49                         log_end_msg
50                         ;;
51         esac
52 done