summaryrefslogtreecommitdiffstats
path: root/defaultenv-2/base/bin/bootargs-root-ubi
blob: 426033691522a53ef125b7e40aee4f84d2d92276 (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
#!/bin/sh

ubiroot=root
mtd=

usage="$0 [OPTIONS]\n -r <ubiroot> (root)\n -m <mtd>"

while getopt "m:r:h" opt; do
	if [ ${opt} = r ]; then
		ubiroot=${OPTARG}
	elif [ ${opt} = m ]; then
		mtd=${OPTARG}
	elif [ ${opt} = h ]; then
		echo -e "$usage"
		exit 0
	fi
done

if [ -z "$mtd" ]; then
	echo -e "$usage"
	exit 1
fi

global.linux.bootargs.dyn.root="root=ubi0:$ubiroot ubi.mtd=$mtd rootfstype=ubifs"