Newer
Older
barebox / defaultenv-2 / base / bin / bootargs-root-disk
@Teresa Gámez Teresa Gámez on 26 Jul 2012 465 bytes defaultenv-2: Add bootargs for booting from disk
#!/bin/sh

usage="$0 [OPTIONS]\n -p <partition>\n -t <fstype>"

while getopt "p:t:h" opt; do
	if [ ${opt} = p ]; then
		part=${OPTARG}
	elif [ ${opt} = t ]; then
		fstype=${OPTARG}
	elif [ ${opt} = h ]; then
		echo -e "$usage"
		exit 0
	fi
done

if [ -z "${part}" ]; then
	echo "$0: no partition given"
	exit 1
fi

if [ -z "${fstype}" ]; then
	echo "$0: no filesystem type given"
	exit 1
fi

global.linux.bootargs.root="root=/dev/$part rootfstype=$fstype rootwait"