[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] gnu: Allow nfs filesystems to be automatically mounted.
From: |
Ludovic Courtès |
Subject: |
Re: [PATCH] gnu: Allow nfs filesystems to be automatically mounted. |
Date: |
Thu, 24 Nov 2016 17:08:37 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) |
John Darrington <address@hidden> skribis:
> It's also instructive to experiment a bit by running a command like:
>
> sudo strace mount -v :/export/junk -o addr=192.168.0.125 /mnt
> in which one can see the system call:
> mount(":/export/junk", "/mnt", "nfs", MS_MGC_VAL, "addr=192.168.0.125") = 0
Oooh, in that case the patch makes perfect sense. Thanks for
explaining!
> diff --git a/gnu/build/file-systems.scm b/gnu/build/file-systems.scm
> index 0d55e91..c6fc784 100644
> --- a/gnu/build/file-systems.scm
> +++ b/gnu/build/file-systems.scm
> @@ -481,7 +481,21 @@ run a file system check."
> (call-with-output-file mount-point (const #t)))
> (mkdir-p mount-point))
>
> - (mount source mount-point type flags options)
> + (mount source mount-point type flags
> + (cond
> + ((string-match "^nfs.*" type)
> + (let* ((host (car (string-split source #\:)))
> + (aa (car (getaddrinfo host #f)))
> + (sa (addrinfo:addr aa))
> + (inet-addr (inet-ntop (sockaddr:fam sa)
> + (sockaddr:addr sa))))
> + (string-append "addr="
> + inet-addr
> + (if options
> + (string-append "," options)
> + ""))))
> + (else
> + options)))
Could we write it as:
(if (string-prefix? "nfs" type)
(mount-nfs source mount-point type flags options)
(mount source mount-point type flags options))
and have a separate:
(define (mount-nfs source mount-point type flags options)
…)
?
Also, the code above must be changed to use ‘match’ instead of ‘car’.
It should be (getaddrinfo host "nfs") instead of (getaddrinfo host #f).
I’m assuming the syntax for SOURCE doesn’t allow one to specify a TCP
port. Is this correct?
Thanks,
Ludo’.
- Re: [PATCH 1/4] gnu: Separate util-linux into three packages., (continued)
- Re: [PATCH 1/4] gnu: Separate util-linux into three packages., Ludovic Courtès, 2016/11/13
- Re: [PATCH 1/4] gnu: Separate util-linux into three packages., John Darrington, 2016/11/13
- Re: [PATCH 1/4] gnu: Separate util-linux into three packages., Ludovic Courtès, 2016/11/14
- Re: [PATCH 1/4] gnu: Separate util-linux into three packages., John Darrington, 2016/11/14
- Re: [PATCH 1/4] gnu: Separate util-linux into three packages., Ludovic Courtès, 2016/11/15
- mount syscall, John Darrington, 2016/11/16
- Re: mount syscall, Ludovic Courtès, 2016/11/17
- [PATCH] gnu: Allow nfs filesystems to be automatically mounted., John Darrington, 2016/11/22
- Re: [PATCH] gnu: Allow nfs filesystems to be automatically mounted., Ludovic Courtès, 2016/11/23
- Re: [PATCH] gnu: Allow nfs filesystems to be automatically mounted., John Darrington, 2016/11/23
- Re: [PATCH] gnu: Allow nfs filesystems to be automatically mounted.,
Ludovic Courtès <=
- [PATCH] gnu: Allow nfs file systems to be automatically mounted., John Darrington, 2016/11/26
- Re: [PATCH] gnu: Allow nfs file systems to be automatically mounted., Ludovic Courtès, 2016/11/26
- Re: [PATCH] gnu: Allow nfs file systems to be automatically mounted., John Darrington, 2016/11/26
- Re: [PATCH] gnu: Allow nfs file systems to be automatically mounted., Ludovic Courtès, 2016/11/28
- Re: [PATCH] gnu: Allow nfs file systems to be automatically mounted., John Darrington, 2016/11/28
- Re: [PATCH] gnu: Allow nfs file systems to be automatically mounted., Ludovic Courtès, 2016/11/28
- Re: [PATCH] gnu: Allow nfs file systems to be automatically mounted., John Darrington, 2016/11/29
- Re: [PATCH] gnu: Allow nfs file systems to be automatically mounted., Ludovic Courtès, 2016/11/29