Newer
Older
barebox / arch / arm / boards / at91sam9m10g45ek / env / bin / menu_boot
@Jean-Christophe PLAGNIOL-VILLARD Jean-Christophe PLAGNIOL-VILLARD on 11 Apr 2012 583 bytes at91sam9m10g45ek: add boot menu support
#!/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