Skip to contentSkip to conversation

Fix mounting jffs2 by mtd name

PATCH Johannes Stezenbach 1 participant 2 messages Dec 14, 2005 – Dec 16, 2005 Memory technology devices (MTD)

lore
Share & tools
lore
#0 lore raw

Hi,

Busybox mount insists that mtd: refers to a NFS mount:

# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 02000000 00004000 "foo"
# mount mtd:foo /mnt -t jffs2
mount: mtd: Unknown host
mount: nfsmount failed: Connection refused
mount: Mounting mtd:foo on /mnt failed: Invalid argument

I suggest new syntax:

# mount mtd/foo /mnt -t jffs2

Index: fs/jffs2/super.c
===================================================================
RCS file: /home/cvs/mtd/fs/jffs2/super.c,v
retrieving revision 1.112

jffs2/super.c +1 -1
diff -u -p -r1.112 super.c
@@ -208,7 +208,7 @@ static struct super_block *jffs2_get_sb(
 
 	if (dev_name[0] == 'm' && dev_name[1] == 't' && dev_name[2] == 'd') {
 		/* Probably mounting without the blkdev crap */
-		if (dev_name[3] == ':') {
+		if (dev_name[3] == '/') {
 			struct mtd_info *mtd;
 
 			/* Mount by MTD device name */
#1 lore raw
Quoted 10 lines · Johannes Stezenbach

Busybox mount insists that mtd: refers to a NFS mount:

# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 02000000 00004000 "foo"
# mount mtd:foo /mnt -t jffs2
mount: mtd: Unknown host
mount: nfsmount failed: Connection refused
mount: Mounting mtd:foo on /mnt failed: Invalid argument
Quoted 3 lines

I suggest new syntax:

# mount mtd/foo /mnt -t jffs2

OK, I found out this was a bug in the specific version of busybox mount in use here. Up-to-date busybox and util-linux mount seem to be fine.

Silly idea to fix this in the kernel ;-/

Sorry for the noise,
Johannes