unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH] gnu: file-system-shepherd-service: Use mount-file-system.
@ 2016-11-29 18:33 John Darrington
  2016-11-30 12:51 ` Ludovic Courtès
  0 siblings, 1 reply; 5+ messages in thread
From: John Darrington @ 2016-11-29 18:33 UTC (permalink / raw)
  To: guix-devel; +Cc: John Darrington

* gnu/services/base.scm (file-system-shepherd-service): Use mount-file-system
instead of manually mounting the file system.
---
 gnu/services/base.scm | 38 +++++++++-----------------------------
 1 file changed, 9 insertions(+), 29 deletions(-)

diff --git a/gnu/services/base.scm b/gnu/services/base.scm
index afbecdb..d909693 100644
--- a/gnu/services/base.scm
+++ b/gnu/services/base.scm
@@ -252,6 +252,8 @@ FILE-SYSTEM."
         (device  (file-system-device file-system))
         (type    (file-system-type file-system))
         (title   (file-system-title file-system))
+        (flags   (file-system-flags file-system))
+        (options (file-system-options file-system))
         (check?  (file-system-check? file-system))
         (create? (file-system-create-mount-point? file-system))
         (dependencies (file-system-dependencies file-system)))
@@ -264,34 +266,12 @@ FILE-SYSTEM."
                            ,@(map dependency->shepherd-service-name dependencies)))
             (documentation "Check, mount, and unmount the given file system.")
             (start #~(lambda args
-                       ;; FIXME: Use or factorize with 'mount-file-system'.
-                       (let ((device (canonicalize-device-spec #$device '#$title))
-                             (flags  #$(mount-flags->bit-mask
-                                        (file-system-flags file-system))))
-                         #$(if create?
-                               #~(mkdir-p #$target)
-                               #~#t)
-                         #$(if check?
-                               #~(begin
-                                   ;; Make sure fsck.ext2 & co. can be found.
-                                   (setenv "PATH"
-                                           (string-append
-                                            #$e2fsprogs "/sbin:"
-                                            "/run/current-system/profile/sbin:"
-                                            (getenv "PATH")))
-                                   (check-file-system device #$type))
-                               #~#t)
-
-                         (mount device #$target #$type flags
-                                #$(file-system-options file-system))
-
-                         ;; For read-only bind mounts, an extra remount is
-                         ;; needed, as per <http://lwn.net/Articles/281157/>,
-                         ;; which still applies to Linux 4.0.
-                         (when (and (= MS_BIND (logand flags MS_BIND))
-                                    (= MS_RDONLY (logand flags MS_RDONLY)))
-                           (mount device #$target #$type
-                                  (logior MS_BIND MS_REMOUNT MS_RDONLY))))
+		       #$(if create?
+			     #~(mkdir-p #$target)
+			     #~#t)
+		       (mount-file-system
+			`(#$device #$title #$target #$type #$flags #$options
+				   #$check?) #:root "/")
                        #t))
             (stop #~(lambda args
                       ;; Normally there are no processes left at this point, so
@@ -305,7 +285,7 @@ FILE-SYSTEM."
 
             ;; We need an additional module.
             (modules `(((gnu build file-systems)
-                        #:select (check-file-system canonicalize-device-spec))
+                        #:select (mount-file-system))
                        ,@%default-modules)))))))
 
 (define file-system-service-type
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] gnu: file-system-shepherd-service: Use mount-file-system.
  2016-11-29 18:33 [PATCH] gnu: file-system-shepherd-service: Use mount-file-system John Darrington
@ 2016-11-30 12:51 ` Ludovic Courtès
  2016-12-02 11:32   ` John Darrington
  0 siblings, 1 reply; 5+ messages in thread
From: Ludovic Courtès @ 2016-11-30 12:51 UTC (permalink / raw)
  To: John Darrington; +Cc: guix-devel

John Darrington <jmd@gnu.org> skribis:

> * gnu/services/base.scm (file-system-shepherd-service): Use mount-file-system
> instead of manually mounting the file system.

[...]

> +		       #$(if create?
> +			     #~(mkdir-p #$target)
> +			     #~#t)

#~#t is equivalent to #t.

> +		       (mount-file-system
> +			`(#$device #$title #$target #$type #$flags #$options
> +				   #$check?) #:root "/")
>                         #t))

#t must be align with the parent of “(mount-file-system”.

If you confirmed that at least “make check-system TESTS=basic” passes,
fine with me.

Thank you!

Ludo’.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] gnu: file-system-shepherd-service: Use mount-file-system.
  2016-11-30 12:51 ` Ludovic Courtès
@ 2016-12-02 11:32   ` John Darrington
  2016-12-02 16:44     ` David Craven
  2016-12-04 21:12     ` Ludovic Courtès
  0 siblings, 2 replies; 5+ messages in thread
From: John Darrington @ 2016-12-02 11:32 UTC (permalink / raw)
  To: Ludovic Court??s; +Cc: guix-devel, John Darrington

[-- Attachment #1: Type: text/plain, Size: 1189 bytes --]

On Wed, Nov 30, 2016 at 01:51:23PM +0100, Ludovic Court??s wrote:
     John Darrington <jmd@gnu.org> skribis:
     
     > * gnu/services/base.scm (file-system-shepherd-service): Use mount-file-system
     > instead of manually mounting the file system.
     
     [...]
     
     > +		       #$(if create?
     > +			     #~(mkdir-p #$target)
     > +			     #~#t)
     
     #~#t is equivalent to #t.
     
     > +		       (mount-file-system
     > +			`(#$device #$title #$target #$type #$flags #$options
     > +				   #$check?) #:root "/")
     >                         #t))
     
     #t must be align with the parent of ???(mount-file-system???.
     
     If you confirmed that at least ???make check-system TESTS=basic??? passes,
     fine with me.
     

Perhaps somebody who already has a copy of qemu in their store could check that
for me?

Currently I cannot run any system tests because of bug #25036

J'



-- 
Avoid eavesdropping.  Send strong encrypted email.
PGP Public key ID: 1024D/2DE827B3 
fingerprint = 8797 A26D 0854 2EAB 0285  A290 8A67 719C 2DE8 27B3
See http://sks-keyservers.net or any PGP keyserver for public key.


[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] gnu: file-system-shepherd-service: Use mount-file-system.
  2016-12-02 11:32   ` John Darrington
@ 2016-12-02 16:44     ` David Craven
  2016-12-04 21:12     ` Ludovic Courtès
  1 sibling, 0 replies; 5+ messages in thread
From: David Craven @ 2016-12-02 16:44 UTC (permalink / raw)
  To: John Darrington; +Cc: guix-devel, John Darrington

> Perhaps somebody who already has a copy of qemu in their store could check that
> for me?

I tested it and pushed...

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] gnu: file-system-shepherd-service: Use mount-file-system.
  2016-12-02 11:32   ` John Darrington
  2016-12-02 16:44     ` David Craven
@ 2016-12-04 21:12     ` Ludovic Courtès
  1 sibling, 0 replies; 5+ messages in thread
From: Ludovic Courtès @ 2016-12-04 21:12 UTC (permalink / raw)
  To: John Darrington; +Cc: guix-devel, John Darrington

John Darrington <john@darrington.wattle.id.au> skribis:

> On Wed, Nov 30, 2016 at 01:51:23PM +0100, Ludovic Court??s wrote:
>      John Darrington <jmd@gnu.org> skribis:
>      
>      > * gnu/services/base.scm (file-system-shepherd-service): Use mount-file-system
>      > instead of manually mounting the file system.
>      
>      [...]
>      
>      > +		       #$(if create?
>      > +			     #~(mkdir-p #$target)
>      > +			     #~#t)
>      
>      #~#t is equivalent to #t.
>      
>      > +		       (mount-file-system
>      > +			`(#$device #$title #$target #$type #$flags #$options
>      > +				   #$check?) #:root "/")
>      >                         #t))
>      
>      #t must be align with the parent of ???(mount-file-system???.
>      
>      If you confirmed that at least ???make check-system TESTS=basic??? passes,
>      fine with me.
>      
>
> Perhaps somebody who already has a copy of qemu in their store could check that
> for me?

hydra.gnu.org has a copy.  :-)

Anyway, thanks for pushing this!

Ludo’.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-12-04 21:12 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-29 18:33 [PATCH] gnu: file-system-shepherd-service: Use mount-file-system John Darrington
2016-11-30 12:51 ` Ludovic Courtès
2016-12-02 11:32   ` John Darrington
2016-12-02 16:44     ` David Craven
2016-12-04 21:12     ` Ludovic Courtès

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).