busybox Digest, Vol 45, Issue 14

Guenter lists at gknw.net
Fri Apr 10 05:53:49 UTC 2009


Hi Denys,
Denys Vlasenko schrieb:
> This is bad. I'd like to have busybox mount a drop-in replacement
> to util-linux one. Whenever you have an example of differing
> behavior, report it to the list and/or bug database.
> 
> Provide exact command line and also run both
> mounts under "strace -f -oLOGFILE mount ..."
> and show the logs (or attach them to bug record).
> 
> Bug reports is the only way we can even know you have a problem.
sure, I try - but FTM I cant strace because the embedded system boots
via PXE, and the initrd image has no space left + I have not strace
sources handy to build a version for uClibc.

I have though checked a bit more, and now see that mount does indeed
plugin the mount.cifs on its own once its sitting in /sbin, and once I
have enabled it for busybox :)

So now I can reduce the mount command, and the folowing works on Debian
kernel 2.4.36 with mount 2.14.2 + mount.cifs 1.5:
mount //server/share /mnt/cifs -o user=johndoe

same kernel, same mount.cifs but busybox 1.13.3 mount fails with an
error about unable to mount DSE root - not supported...

so I did replace the mount.cifs helper with a shell script which contains:
#/bin/sh
echo $*
this shows with the above command with Debian mount 2.14.2:
//server/share /mnt/cifs -o rw,user=johndoe

while with busybox 1.13.3 mount this prints:
-o user=johndoe,ip=server \\server\share /mnt/cifs

so I did comment the relevant part in mount.c, and changed the order of
arguments for the mount.cifs so that the -o options apear last instead
if first, and bingo! this makes it work:

--- util-linux/mount.c.orig	2009-02-26 12:47:43.000000000 +0100
+++ util-linux/mount.c	2009-04-10 07:41:52.000000000 +0200
@@ -421,12 +421,12 @@
 			int errno_save = errno;
 			args[0] = xasprintf("mount.%s", mp->mnt_type);
 			rc = 1;
+			args[rc++] = mp->mnt_fsname;
+			args[rc++] = mp->mnt_dir;
 			if (filteropts) {
 				args[rc++] = (char *)"-o";
 				args[rc++] = filteropts;
 			}
-			args[rc++] = mp->mnt_fsname;
-			args[rc++] = mp->mnt_dir;
 			args[rc] = NULL;
 			rc = wait4pid(spawn(args));
 			free(args[0]);
@@ -1622,6 +1622,7 @@
 		rc = 1;
 		// Replace '/' with '\' and verify that unc points to "//server/share".

+/*
 		for (s = mp->mnt_fsname; *s; ++s)
 			if (*s == '/') *s = '\\';

@@ -1639,11 +1640,11 @@
 		dotted = xmalloc_sockaddr2dotted_noport(&lsa->u.sa);
 		ip = xasprintf("ip=%s", dotted);
 		parse_mount_options(ip, &filteropts);
-
 		// compose new unc '\\server-ip\share'
 		// (s => slash after hostname)

 		mp->mnt_fsname = xasprintf("\\\\%s%s", dotted, s);
+*/

sorry for not attaching the patch (was just a c&p from terminal), but
its anyway only a test hack FTM;
will investigate a bit further later ...

Guen.




More information about the busybox mailing list