summaryrefslogtreecommitdiffstats
path: root/defaultenv-2
diff options
context:
space:
mode:
authorTeresa Gámez <t.gamez@phytec.de>2012-07-25 16:42:05 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2012-07-26 12:43:29 +0200
commit63b3a393092ccb3a162f378cb9d89414525a3a81 (patch)
tree7cb19af1077da81222ceae4a40777a408f7e7dbe /defaultenv-2
parent4604923f0c7d4f1954d1cc5dfe0f3a2ef5b9b074 (diff)
downloadbarebox-63b3a393092ccb3a162f378cb9d89414525a3a81.tar.gz
barebox-63b3a393092ccb3a162f378cb9d89414525a3a81.tar.xz
defaultenv-2: Add bootargs for booting from disk
Add support in defaultenv-2 for booting from disk (SD-Card, USB-Stick). Signed-off-by: Teresa Gámez <t.gamez@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'defaultenv-2')
-rw-r--r--defaultenv-2/base/bin/bootargs-root-disk26
1 files changed, 26 insertions, 0 deletions
diff --git a/defaultenv-2/base/bin/bootargs-root-disk b/defaultenv-2/base/bin/bootargs-root-disk
new file mode 100644
index 0000000000..df8750e46d
--- /dev/null
+++ b/defaultenv-2/base/bin/bootargs-root-disk
@@ -0,0 +1,26 @@
+#!/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"