summaryrefslogtreecommitdiffstats
path: root/arch/arm/boards/at91sam9m10g45ek/env/bin/menu_boot
blob: d0b1396de984e3b00902cfb32598dcf123afc6bf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/sh

. /env/config

while getopt "k:r:i:m:" Option
do
if [ ${Option} = k ]; then
	kernel_loc=${OPTARG}
elif [ ${Option} = r ]; then
	rootfs_loc=${OPTARG}
elif [ ${Option} = i ]; then
	ip=${OPTARG}
elif [ ${Option} = m ]; then
	mode=${OPTARG}
else
fi
done

boot_opt=

if [ x$mode != x ]; then
	boot_opt="-m ${mode}"
else
	if [ x$kernel_loc != x ]; then
		boot_opt="-k ${kernel_loc}"
	fi
	if [ x$kernel_loc != x ]; then
		boot_opt="-r ${rootfs_loc}"
	fi
fi

boot ${boot_opt} -i ${ip}

echo -n "boot error: Hit any key to return to the menu: "
timeout -a 3
menu -s -m boot
exit 1