Added support for changing mellanox mlx4 devices to ethernet to use them as 10g
[bootimage-initfs.git] / etc / startup.sh
1 #!/bin/ash -l
2
3 . /etc/library.sh
4
5 # only really run this once, if the file exists we drop to a shell instead
6 # this allows us to respawn from inittab
7 if [ -e /tmp/ranonce ];
8 then
9         exec /bin/ash
10 fi
11
12 touch /tmp/ranonce
13
14
15 ARGS=""
16
17 echo "" > /tmp/cmdline.dat
18 for i in `cat /proc/cmdline`
19 do
20         case ${i}
21         in
22                 *=*)
23                         KEY=`echo ${i} | cut -d"=" -f1`
24                         VALUE=`echo ${i} | cut -d"=" -f2`
25
26                         if [ "${KEY}" != "" ];
27                         then
28                                 export _${KEY}="${VALUE}"
29                                 echo "_${KEY}='${VALUE}'" >> /tmp/cmdline.dat
30                         fi
31                 ;;
32         esac
33 done
34
35 if [ "${_sshpasswd}" != "" ]
36 then
37         #echo "root:${_sshpasswd}" | /usr/sbin/chpasswd
38         echo "ssh:${_sshpasswd}" | /usr/sbin/chpasswd
39
40         /usr/sbin/dropbear -p :22 > /var/log/sshd.log 2>&1
41         cd /tmp/screens
42         ln -s S-root S-ssh
43 fi
44
45 . /etc/hardware.sh
46
47 if [ "${_startup}" = "" ]
48 then
49         echo "A startup option must be specified on the kernel command line"
50         exit
51 fi
52
53 if [ ! -f /etc/${_startup}/startup.sh ]
54 then
55         echo "Can't find the startup option specified on the kernel command line"
56         exit
57 else
58         /etc/${_startup}/startup.sh
59 fi