From b3e72893baad1f5fa3390cee8f24570afdddd750 Mon Sep 17 00:00:00 2001 From: Marcel Ziswiler Date: Wed, 31 Oct 2012 15:21:50 +0100 Subject: colibri_t20: nand: fix NVIDIA partition table parsing If the USR partition we usually mount as root file system could not be found which is e.g. the case for Android make sure mtdparts does not start with a spurious coma separator the kernel would interpret as an empty partition entry. --- board/toradex/common/tegra2_partitions.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/board/toradex/common/tegra2_partitions.c b/board/toradex/common/tegra2_partitions.c index c64d5e7299..9ee4a4519d 100644 --- a/board/toradex/common/tegra2_partitions.c +++ b/board/toradex/common/tegra2_partitions.c @@ -227,14 +227,20 @@ int nvtegra_mtdparts_string(char *output, int size) p = &(pt->partinfo[0]); for (i = 0; (p->id < 128) && (i < TEGRA_MAX_PARTITIONS); i++) { if (p != usr) { + /* add coma separator after previous entries */ + if (j > 0) { + sprintf(buffer + j, ","); + j++; + } + if (strlen(p->name)) - sprintf(buffer + j, ",%uK@%uK(%s)", + sprintf(buffer + j, "%uK@%uK(%s)", p->virtual_size * nand_info->writesize / 1024, p->start_sector * nand_info->writesize / 1024, p->name); else - sprintf(buffer + j, ",%uK@%uK", + sprintf(buffer + j, "%uK@%uK", p->virtual_size * nand_info->writesize / 1024, p->start_sector * -- cgit v1.2.3