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@xxxxxxxxxxxxxx> --- defaultenv/defaultenv-2-base/bin/mtdparts-add | 9 ++++----- 1 file 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}" -- 2.1.4 _______________________________________________ barebox mailing list barebox@xxxxxxxxxxxxxxxxxxx http://lists.infradead.org/mailman/listinfo/barebox