9
0
Fork 0

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>
This commit is contained in:
Sascha Hauer 2015-02-12 09:15:19 +01:00
parent 341f7d5574
commit cd7feae00b
1 changed files with 4 additions and 5 deletions

View File

@ -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}"