summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2014-07-22 16:57:57 +0200
committerLudovic Courtès <ludo@gnu.org>2014-07-22 16:59:10 +0200
commita69576ea858863574252cbefbcef91db98773d60 (patch)
tree34d35034f906c84d98cc3bbfe6daee743cb5332f
parent7cb9666dd05ba4f039a151c5189a533139f26109 (diff)
system: Add '%devtmpfs-file-system' for udev, and '%base-file-systems'.
Suggested by Adam Pribyl <pribyl@lowlevel.cz>. * gnu/services/base.scm (udev-service)[requirement]: Add 'file-system-/dev'. * gnu/system/file-systems.scm (%devtmpfs-file-system, %base-file-systems): New variables. * gnu/system/install.scm (installation-services)[file-systems]: Use %base-file-systems. * build-aux/hydra/demo-os.scm (file-systems): Likewise. * doc/guix.texi (System Installation): Show %BASE-FILE-SYSTEMS in the example. (Using the Configuration System): Likewise. (File Systems): Document %base-file-systems, %devtmpfs-file-system, %binary-format-file-system, and %fuse-control-file-system.
-rw-r--r--build-aux/hydra/demo-os.scm14
-rw-r--r--doc/guix.texi37
-rw-r--r--gnu/services/base.scm9
-rw-r--r--gnu/system/file-systems.scm18
-rw-r--r--gnu/system/install.scm5
5 files changed, 67 insertions, 16 deletions
diff --git a/build-aux/hydra/demo-os.scm b/build-aux/hydra/demo-os.scm
index 89b67aabe35..9164500d703 100644
--- a/build-aux/hydra/demo-os.scm
+++ b/build-aux/hydra/demo-os.scm
@@ -44,13 +44,13 @@
44 (file-systems 44 (file-systems
45 ;; We provide a dummy file system for /, but that's OK because the VM build 45 ;; We provide a dummy file system for /, but that's OK because the VM build
46 ;; code will automatically declare the / file system for us. 46 ;; code will automatically declare the / file system for us.
47 (list (file-system 47 (cons* (file-system
48 (mount-point "/") 48 (mount-point "/")
49 (device "dummy") 49 (device "dummy")
50 (type "dummy")) 50 (type "dummy"))
51 ;; %fuse-control-file-system ; needs fuse.ko 51 ;; %fuse-control-file-system ; needs fuse.ko
52 ;; %binary-format-file-system ; needs binfmt.ko 52 ;; %binary-format-file-system ; needs binfmt.ko
53 )) 53 %base-file-systems))
54 54
55 (users (list (user-account 55 (users (list (user-account
56 (name "guest") 56 (name "guest")
diff --git a/doc/guix.texi b/doc/guix.texi
index fb6f897bb25..2b05a75be40 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -2826,10 +2826,11 @@ only a root account would look like this:
2826 ;; Assuming /dev/sdX is the target hard disk, and /dev/sdX1 the 2826 ;; Assuming /dev/sdX is the target hard disk, and /dev/sdX1 the
2827 ;; target root file system. 2827 ;; target root file system.
2828 (bootloader (grub-configuration (device "/dev/sdX"))) 2828 (bootloader (grub-configuration (device "/dev/sdX")))
2829 (file-systems (list (file-system 2829 (file-systems (cons (file-system
2830 (device "/dev/sdX1") 2830 (device "/dev/sdX1")
2831 (mount-point "/") 2831 (mount-point "/")
2832 (type "ext4"))))) 2832 (type "ext4"))
2833 %base-file-systems)))
2833@end example 2834@end example
2834 2835
2835@noindent 2836@noindent
@@ -2925,10 +2926,11 @@ kernel, initial RAM disk, and boot loader looks like this:
2925 (locale "fr_FR.UTF-8") 2926 (locale "fr_FR.UTF-8")
2926 (bootloader (grub-configuration 2927 (bootloader (grub-configuration
2927 (device "/dev/sda"))) 2928 (device "/dev/sda")))
2928 (file-systems (list (file-system 2929 (file-systems (cons (file-system
2929 (device "/dev/sda1") ; or partition label 2930 (device "/dev/sda1") ; or partition label
2930 (mount-point "/") 2931 (mount-point "/")
2931 (type "ext3")))) 2932 (type "ext3"))
2933 %base-file-systems))
2932 (users (list (user-account 2934 (users (list (user-account
2933 (name "alice") 2935 (name "alice")
2934 (password "") 2936 (password "")
@@ -3055,6 +3057,32 @@ errors before being mounted.
3055@end table 3057@end table
3056@end deftp 3058@end deftp
3057 3059
3060The @code{(gnu system file-systems)} exports the following useful
3061variables.
3062
3063@defvr {Scheme Variable} %base-file-systems
3064These are essential file systems that are required on normal systems,
3065such as @var{%devtmpfs-file-system} (see below.) Operating system
3066declarations should always contain at least these.
3067@end defvr
3068
3069@defvr {Scheme Variable} %devtmpfs-file-system
3070The @code{devtmpfs} file system to be mounted on @file{/dev}. This is a
3071requirement for udev (@pxref{Base Services, @code{udev-service}}).
3072@end defvr
3073
3074@defvr {Scheme Variable} %binary-format-file-system
3075The @code{binfmt_misc} file system, which allows handling of arbitrary
3076executable file types to be delegated to user space. This requires the
3077@code{binfmt.ko} kernel module to be loaded.
3078@end defvr
3079
3080@defvr {Scheme Variable} %fuse-control-file-system
3081The @code{fusectl} file system, which allows unprivileged users to mount
3082and unmount user-space FUSE file systems. This requires the
3083@code{fuse.ko} kernel module to be loaded.
3084@end defvr
3085
3058@node User Accounts 3086@node User Accounts
3059@subsection User Accounts 3087@subsection User Accounts
3060 3088
@@ -3245,6 +3273,7 @@ passed to @command{guix-daemon}.
3245Run @var{udev}, which populates the @file{/dev} directory dynamically. 3273Run @var{udev}, which populates the @file{/dev} directory dynamically.
3246@end deffn 3274@end deffn
3247 3275
3276
3248@node Networking Services 3277@node Networking Services
3249@subsubsection Networking Services 3278@subsubsection Networking Services
3250 3279
diff --git a/gnu/services/base.scm b/gnu/services/base.scm
index ae12c8e93d5..42e232c9ac2 100644
--- a/gnu/services/base.scm
+++ b/gnu/services/base.scm
@@ -473,8 +473,13 @@ passed to @command{guix-daemon}."
473 (with-monad %store-monad 473 (with-monad %store-monad
474 (return (service 474 (return (service
475 (provision '(udev)) 475 (provision '(udev))
476 (requirement '(root-file-system)) 476
477 (documentation "Populate the /dev directory.") 477 ;; Udev needs /dev to be a 'devtmpfs' mount so that new device
478 ;; nodes can be added: see
479 ;; <http://www.linuxfromscratch.org/lfs/view/development/chapter07/udev.html>.
480 (requirement '(root-file-system file-system-/dev))
481
482 (documentation "Populate the /dev directory, dynamically.")
478 (start #~(lambda () 483 (start #~(lambda ()
479 (define udevd 484 (define udevd
480 (string-append #$udev "/libexec/udev/udevd")) 485 (string-append #$udev "/libexec/udev/udevd"))
diff --git a/gnu/system/file-systems.scm b/gnu/system/file-systems.scm
index 7852a6ab261..0c2021d7b41 100644
--- a/gnu/system/file-systems.scm
+++ b/gnu/system/file-systems.scm
@@ -30,7 +30,10 @@
30 file-system-options 30 file-system-options
31 31
32 %fuse-control-file-system 32 %fuse-control-file-system
33 %binary-format-file-system)) 33 %binary-format-file-system
34 %devtmpfs-file-system
35
36 %base-file-systems))
34 37
35;;; Commentary: 38;;; Commentary:
36;;; 39;;;
@@ -72,4 +75,17 @@
72 (type "binfmt_misc") 75 (type "binfmt_misc")
73 (check? #f))) 76 (check? #f)))
74 77
78(define %devtmpfs-file-system
79 ;; /dev as a 'devtmpfs' file system, needed for udev.
80 (file-system
81 (device "none")
82 (mount-point "/dev")
83 (type "devtmpfs")
84 (check? #f)))
85
86(define %base-file-systems
87 ;; List of basic file systems to be mounted. Note that /proc and /sys are
88 ;; currently mounted by the initrd.
89 (list %devtmpfs-file-system))
90
75;;; file-systems.scm ends here 91;;; file-systems.scm ends here
diff --git a/gnu/system/install.scm b/gnu/system/install.scm
index 18fd587ead9..d4a32609ba4 100644
--- a/gnu/system/install.scm
+++ b/gnu/system/install.scm
@@ -117,10 +117,11 @@ Use Alt-F2 for documentation.
117 (file-systems 117 (file-systems
118 ;; Note: the disk image build code overrides this root file system with 118 ;; Note: the disk image build code overrides this root file system with
119 ;; the appropriate one. 119 ;; the appropriate one.
120 (list (file-system 120 (cons (file-system
121 (mount-point "/") 121 (mount-point "/")
122 (device "gnu-disk-image") 122 (device "gnu-disk-image")
123 (type "ext4")))) 123 (type "ext4"))
124 %base-file-systems))
124 125
125 (users (list (user-account 126 (users (list (user-account
126 (name "guest") 127 (name "guest")