diff options
author | Marcel Ziswiler <marcel.ziswiler@toradex.com> | 2012-10-31 15:21:50 +0100 |
---|---|---|
committer | Marcel Ziswiler <marcel.ziswiler@toradex.com> | 2012-10-31 15:21:50 +0100 |
commit | b3e72893baad1f5fa3390cee8f24570afdddd750 (patch) | |
tree | 3dd86874b957b7c5368c59f651eac66ea7d5032c | |
parent | 104aecadc34ec12d14bad0ad71d2b88c59ae9dd8 (diff) |
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.
-rw-r--r-- | board/toradex/common/tegra2_partitions.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/board/toradex/common/tegra2_partitions.c b/board/toradex/common/tegra2_partitions.c index c64d5e7299c..9ee4a4519d9 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 * |