summaryrefslogtreecommitdiff
path: root/mkfs.ubifs
diff options
context:
space:
mode:
authorDaniel Neukomm <Neukomm@vtxmail.ch>2009-08-11 11:33:23 +0300
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2009-08-11 11:35:46 +0300
commit6eba06c395f72e43505b21f073275bd071782552 (patch)
treea700858fde6844f6ac2d44522ab4ecd6b40c29de /mkfs.ubifs
parent6f659b1ec77f732d26bda92b37a17a822469fc62 (diff)
mkfs.ubifs: correct devtable increment handling
With the device table one can add /dev entries to the root file system image. The device table file contains among others the fields minor, start, increment and count. If there is an entry with minor=0 start=0 increment=32 and count=4 the mkfs.ubifs makes 128 device entries, with minor numbers from 0 to 127. The correct version makes 4 entries with minor number 0,32,64,96. /dev/mtd c 640 0 0 90 0 0 2 7 This gives 14 devices /dev/mtdXX instead of 7 devices. Due to this error mtd_debug info /dev/mtd3 delivers the information of /dev/mtd1 instead of. Signed-off-by: Daniel Neukomm <Neukomm@vtxmail.ch> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Diffstat (limited to 'mkfs.ubifs')
-rw-r--r--mkfs.ubifs/devtable.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/mkfs.ubifs/devtable.c b/mkfs.ubifs/devtable.c
index 236a6e7..dee035d 100644
--- a/mkfs.ubifs/devtable.c
+++ b/mkfs.ubifs/devtable.c
@@ -248,7 +248,7 @@ static int interpret_table_entry(const char *line)
goto out_free;
}
} else {
- int i, num = start + increment * count, len = strlen(name) + 20;
+ int i, num = start + count, len = strlen(name) + 20;
char *nm;
for (i = start; i < num; i++) {
@@ -262,7 +262,7 @@ static int interpret_table_entry(const char *line)
nh_elt->mode = mode;
nh_elt->uid = uid;
nh_elt->gid = gid;
- nh_elt->dev = makedev(major, minor + i - start);
+ nh_elt->dev = makedev(major, minor + (i - start) * increment);
nm = malloc(len);
if (!nm) {