Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Minimal client-only SAMBA
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
jesnow
l33t
l33t


Joined: 26 Apr 2006
Posts: 856

PostPosted: Sun Mar 04, 2007 10:59 pm    Post subject: Minimal client-only SAMBA Reply with quote

Everybody likes Samba, but it's *257 MB* or thereabouts on disk (equery size samba) without dependencies. If you're building a machine for desktop use you don't always need a server, so what about a much more lightweight client-only install?

I googled around and found nothing on this, except for jcifs (cifs implemented in java), which is client only, but depends on having a jdk, which, though probably most people do nowadays, seems like not the right way to go on a minimal machine.

Here's what I did:

On another machine with nearly the same arch as the target machine, I had a working samba installation. Source box was a Via Nehemiah, target was a PII (I like old hardware). I copied over the following files only:

Code:

/usr/sbin/mount.cifs
/usr/sbin/umount.cifs
/usr/bin/mount.cifs
/usr/bin/umount.cifs


And set the following link:

Code:

ln -s /usr/bin/mount.cifs /sbin/mount.cifs


Total files: around about 1 MB

I was surprised that this did the trick, but I was able to mount and use samba shares using:

Code:

mount -tcifs //mybox/mydir /mnt/test


as long as all the other things you need (proper smb.conf configuration on mybox, mountpoint, etc) were set up. I did have to log out and log in again for it to work, until then it would only work by calling mount.cifs directly. Maybe "source /etc/profile && env-update" would have done the trick, but now it just works, and I have no interest in breaking it again for science.

Next I'd like to get nmblookup working so I can browse, but it seems to be dependent on openldap, which is over 3 MB. Maybe next weekend.

Now, would somebody like to write an ebuild that will download the samba tarball, and compile *only* the client bits? That would be great. Or: how about a "client-only" useflag for samba? I think it would be useful for lots of people.

Cheers

Jon.
Back to top
View user's profile Send private message
bWareiWare
n00b
n00b


Joined: 12 Mar 2007
Posts: 4

PostPosted: Mon Mar 12, 2007 3:24 pm    Post subject: CIFS Client Reply with quote

The CIFS VFS documentation:

http://git.kernel.org/gitweb.cgi?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob;h=7b4ac096cd114d34e623bafaed91b85ba4a95e62

Suggests that the mount.cifs client is optional. Dose anyone know how to mount CIFS shares without it? I haven't managed to.

They do provide the mount.cifs and umount.cifs source separately from SAMBA and it seems to compile and work without it.

http://us1.samba.org/samba/cifs/cifs_download.html

This would defiantly be worth an ebuild as logic dictates clients should outnumber servers.
Back to top
View user's profile Send private message
steveL
Watchman
Watchman


Joined: 13 Sep 2006
Posts: 5153
Location: The Peanut Gallery

PostPosted: Wed Mar 14, 2007 3:21 pm    Post subject: Re: CIFS Client Reply with quote

bWareiWare wrote:
They do provide the mount.cifs and umount.cifs source separately from SAMBA and it seems to compile and work without it.

This would defiantly be worth an ebuild as logic dictates clients should outnumber servers.
Well if you have a make file for what you've compiled and got to work, an ebuild is less hassle. IOW get the makefile compiling and installing in Gentoo, and there'll be loads of people to help you make an ebuild. PM me if you want help, although I cannot of course put it in the portage tree. I'd recommend the devmanual as the best resource for learning to write builds. Sunrise overlay is a good place, but I don't know what the turnaround is for builds to make it from there into the tree.

Some users (including me) don't actually like 3rd-party overlays; I was actually going to say I know sunrise is part of gentoo, but it's not a gentoo.org address! Point is the ebuilds are user-contributed so there's always that fear factor at play. My own feeling is I just can't be bothered; there are loads of overlays, with thousands of ebuilds and the ones in the portage tree are enough to cope with. Having said, the distro has been really solid for ages, no b0rkage at all, not even minor stuff. Oh hang on, I had a blocker last month! So yeah, maybe I will get round to adding the layman dir to make.conf again..
Back to top
View user's profile Send private message
bWareiWare
n00b
n00b


Joined: 12 Mar 2007
Posts: 4

PostPosted: Wed Mar 14, 2007 3:33 pm    Post subject: Makefile Reply with quote

It dose not really need a make file. You can build it with "cc mount.cifs.c -o mount.cifs" which equates to "make mount.cifs" even without a Makefile.

The samba ebuild puts mount.cifs in /usr/sbin/mount.cifs and /usr/bin/mount.cifs and a link from /sbin/mount.cifs to /usr/bin/mount.cifs. This seems odd but we might as well do the same.
Back to top
View user's profile Send private message
steveL
Watchman
Watchman


Joined: 13 Sep 2006
Posts: 5153
Location: The Peanut Gallery

PostPosted: Thu Mar 15, 2007 11:05 am    Post subject: Re: Makefile Reply with quote

bWareiWare wrote:
It dose not really need a make file. You can build it with "cc mount.cifs.c -o mount.cifs" which equates to "make mount.cifs" even without a Makefile.
Oh my word! No problem then, but one of the devs is looking at this too, so maybe there'll be some movement on this across the board. What about the umount or is that just a link?
Quote:
The samba ebuild puts mount.cifs in /usr/sbin/mount.cifs and /usr/bin/mount.cifs and a link from /sbin/mount.cifs to /usr/bin/mount.cifs. This seems odd but we might as well do the same.
That's just wrong, the file should simply go in /bin.
Back to top
View user's profile Send private message
jesnow
l33t
l33t


Joined: 26 Apr 2006
Posts: 856

PostPosted: Sun Mar 18, 2007 3:07 am    Post subject: Re: Makefile Reply with quote

I'm glad someone thought of this before I did.

steveL wrote:
bWareiWare wrote:
It dose not really need a make file. You can build it with "cc mount.cifs.c -o mount.cifs" which equates to "make mount.cifs" even without a Makefile.
Oh my word! No problem then, but one of the devs is looking at this too, so maybe there'll be some movement on this across the board. What about the umount or is that just a link?


I think it umount is the same for any fs -- anyway I can umount without
any binary from the samba package.

Quote:

Quote:
The samba ebuild puts mount.cifs in /usr/sbin/mount.cifs and /usr/bin/mount.cifs and a link from /sbin/mount.cifs to /usr/bin/mount.cifs. This seems odd but we might as well do the same.
That's just wrong, the file should simply go in /bin.


but /usr/bin is where the samba package puts them.
Back to top
View user's profile Send private message
steveL
Watchman
Watchman


Joined: 13 Sep 2006
Posts: 5153
Location: The Peanut Gallery

PostPosted: Sun Mar 18, 2007 3:22 am    Post subject: Re: Makefile Reply with quote

jesnow wrote:
Quote:
Quote:
The samba ebuild puts mount.cifs in /usr/sbin/mount.cifs and /usr/bin/mount.cifs and a link from /sbin/mount.cifs to /usr/bin/mount.cifs. This seems odd but we might as well do the same.
That's just wrong, the file should simply go in /bin.

but /usr/bin is where the samba package puts them.

Then the ebuild is b0rked imo, although there may be some sort of mad logic behind it. I'd file a bug and see what laughable yet oh-so cryptic explanation you get ;)

Well according to this post:
Quote:
This is only an app to "tell" the kernel how to mount a volume using the cifs-module. But I'm talking about smbclient which needs a bit more than two files.

I have no idea about all this TBH, I've only ever used samba on a binary distro.
Back to top
View user's profile Send private message
jesnow
l33t
l33t


Joined: 26 Apr 2006
Posts: 856

PostPosted: Tue Mar 20, 2007 8:26 pm    Post subject: Re: Makefile Reply with quote

steveL wrote:
jesnow wrote:
Quote:
Quote:
The samba ebuild puts mount.cifs in /usr/sbin/mount.cifs and /usr/bin/mount.cifs and a link from /sbin/mount.cifs to /usr/bin/mount.cifs. This seems odd but we might as well do the same.
That's just wrong, the file should simply go in /bin.

but /usr/bin is where the samba package puts them.

Then the ebuild is b0rked imo, although there may be some sort of mad logic behind it. I'd file a bug and see what laughable yet oh-so cryptic explanation you get ;)

Well according to this post:
Quote:
This is only an app to "tell" the kernel how to mount a volume using the cifs-module. But I'm talking about smbclient which needs a bit more than two files.

I have no idea about all this TBH, I've only ever used samba on a binary distro.


No, smbclient is obviously something much different. mount.cifs appears to be a single binary that gets installed to two places and linked to two tohers. This looks screwy to me too, but maybe is required for wierd legacy reasons, like it was there in version 0.0.3 and some apps still expect to find it there. Why there are two identical copies of mount.cifs in my tree I can't explain.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum