Subject: Re: Re: amd and smbfs
To: Hauke Fath <hf@spg.tu-darmstadt.de>
From: Joel CARNAT <jcarnat@altran.net>
List: netbsd-users
Date: 04/28/2005 11:52:58
Dans l'épisode précédent (Thu, Apr 28 2005 - 10:31), Hauke Fath nous apprenait que :
> Joel CARNAT wrote:
> >Hi,
> >
> >I would like to mount my SMB shares automatically.
> 
> [...]
> 
> ># cat /etc/amd/smb
> >/defaults      type:=host;rhost:=${key};fs:=${autodir}/${rhost}/root
> >*              host==${key};type:=link;fs:=/
> >host!=${key};opts:=ro,soft,intr,nodev,nosuid,noconn
> >
> >I expected to "cd /mnt/smb/windows; ls" and see the SMB mount point.
> >But this is a conf fro NFS and I don't find how to use smbfs instead of
> >nfs.
> >
> >Anyone would share his SMB map so I can adapt to my things ?
> 
> Amd does not do SMB.
> 
> What it offers, though, is a 'program' map type where you can provide 
> instructions for mounting and unmounting filesystems.
> 
> That said... amd releases have had the annoying habit of 'sanitizing' 
> paths, stripping any 'redundant' slashes in the process. This makes it 
> pretty hard to provide a //server/share string to the SMB mount command.
> 
> The Amd 6.1 release candidate (available as snapshot, or from anoncvs, 
> at www.am-utils.org) ) has an /etc/amd.conf variable 'normalize_slashes' 
> that you set to 'no' to switch off path normalizing.
> 

 OK, I have netbsd-3 with 6.1b5pre installed :)

> With this feature, a map entry for an SMB mount looks like
> 
> smbmnt	-type:=program;rhost:=smbserver;rfs:=smbshare;fs:=/.smbshare \
>         os==netbsdelf2;\
>         mount:="/sbin/mount mount -r -t smbfs -o-N,-I${rhost} 
> //${rhost}/${rfs} ${fs}";\
>         unmount:="/sbin/umount umount ${fs}"
> 

 as I understand map syntax, this makes the non-dynamic mount point
//smbserver/smbshare mounted in /.smbshare, right ?

 I still have two questions :
-> I won't need the fstab anymore, right ?
-> is there a wildcard or variable to indicate the SMBshare ?
   I mean, I would like to "cd /mnt/smb/SMBhost_I_known/SMBshare_I_know"
and it is automagically mounted (aka, not having n smbmnt lines like
above). Mixing your example and /usr/share/examples/amd/net, I ended
with :
################################################################
/defaults
type:=host;rhost:=${key};fs:=${autodir}/${rhost}/${smbshare}
*               host==${key};type:=program;\
                        rfs:=${smbshare};\
                        fs:=${autodir}/${key}/${smbshare};\
                        mount:="/sbin/mount mount -t smbfs -o-N,-I${rhost},-f=0644,-d=0755 //${host}/${rfs} ${fs}";\
                        unmount:="/sbin/umount umount ${fs}"
################################################################

 As I expected, amd goes : Unknown sequence "${smbshare}"

-- 
,-- This mail runs ---------.
`------------ NetBSD/i386 --'