summaryrefslogtreecommitdiffstats
path: root/defaultenv
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2015-02-12 09:15:19 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2015-02-12 09:33:44 +0100
commitcd7feae00b43eeddcaeb229f861d0ddac93f91e2 (patch)
tree0fa95c4b2924fb93deac6e72378b7740fcf7278e /defaultenv
parent341f7d5574514e23ad176ad199c7ee4acc3a96fd (diff)
downloadbarebox-cd7feae00b43eeddcaeb229f861d0ddac93f91e2.tar.gz
defaultenv-2: mtdparts-add: Use new partition parameter
mtd devices now have a partition parameter to create mtd partitions. Use it to simplify the mtdparts-add script. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'defaultenv')
-rw-r--r--defaultenv/defaultenv-2-base/bin/mtdparts-add9
1 files changed, 4 insertions, 5 deletions
diff --git a/defaultenv/defaultenv-2-base/bin/mtdparts-add b/defaultenv/defaultenv-2-base/bin/mtdparts-add
index a0e419e..805e3e2 100644
--- a/defaultenv/defaultenv-2-base/bin/mtdparts-add
+++ b/defaultenv/defaultenv-2-base/bin/mtdparts-add
@@ -26,13 +26,12 @@ if [ -z "${parts}" ]; then
exit
fi
-if [ -e /tmp/mtdparts/${device} ]; then
- delpart /dev/${device}.*
+${device}.partitions="$parts"
+if [ $? != 0 ]; then
+ echo "Failed to add partitions $parts to $device"
+ exit 1
fi
-addpart -n /dev/${device} "$parts" || exit
-mkdir -p /tmp/mtdparts/${device}
-
if [ -n ${kernelname} ]; then
global linux.mtdparts.${device}
global.linux.mtdparts.${device}="${kernelname}:${parts}"