diff options
author | Mark H Weaver <mhw@netris.org> | 2015-09-22 16:38:48 -0400 |
---|---|---|
committer | Mark H Weaver <mhw@netris.org> | 2015-09-22 16:38:48 -0400 |
commit | bd90127ad43d08c39e5bd592d03f7c0a4c683afe (patch) | |
tree | c840851273e349cb0aee31cb5958acdf093c819a /gnu/build/linux-boot.scm | |
parent | 5f20553dee3fbc924b0cafb54ac215b0d3bf344c (diff) | |
parent | 430505eba33b7bb59fa2d22e0f21ff317cbc320d (diff) | |
download | guix-bd90127ad43d08c39e5bd592d03f7c0a4c683afe.tar.gz |
Merge branch 'master' into core-updates
Diffstat (limited to 'gnu/build/linux-boot.scm')
-rw-r--r-- | gnu/build/linux-boot.scm | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/gnu/build/linux-boot.scm b/gnu/build/linux-boot.scm index 3081a93a97..30d6570b04 100644 --- a/gnu/build/linux-boot.scm +++ b/gnu/build/linux-boot.scm @@ -48,7 +48,7 @@ ;;; Code: (define* (mount-essential-file-systems #:key (root "/")) - "Mount /proc and /sys under ROOT." + "Mount /dev, /proc, and /sys under ROOT." (define (scope dir) (string-append root (if (string-suffix? "/" root) @@ -60,6 +60,10 @@ (mkdir (scope "proc"))) (mount "none" (scope "proc") "proc") + (unless (file-exists? (scope "dev")) + (mkdir (scope "dev"))) + (mount "none" (scope "dev") "devtmpfs") + (unless (file-exists? (scope "sys")) (mkdir (scope "sys"))) (mount "none" (scope "sys") "sysfs")) @@ -71,7 +75,7 @@ (unless (file-exists? target) (mkdir target)) (mount dir target "" MS_MOVE))) - '("/proc" "/sys"))) + '("/dev" "/proc" "/sys"))) (define (linux-command-line) "Return the Linux kernel command line as a list of strings." @@ -100,7 +104,7 @@ with the given MAJOR number, starting with MINOR." (define* (make-essential-device-nodes #:key (root "/")) "Make essential device nodes under ROOT/dev." - ;; The hand-made udev! + ;; The hand-made devtmpfs/udev! (define (scope dir) (string-append root @@ -255,7 +259,8 @@ UNIONFS." (mount "none" "/rw-root" "tmpfs") ;; We want read-write /dev nodes. - (make-essential-device-nodes #:root "/rw-root") + (mkdir-p "/rw-root/dev") + (mount "none" "/rw-root/dev" "devtmpfs") ;; Make /root a union of the tmpfs and the actual root. Use ;; 'max_files' to set a high RLIMIT_NOFILE for the unionfs process @@ -385,9 +390,6 @@ to it are lost." (unless (configure-qemu-networking) (display "network interface is DOWN\n"))) - ;; Make /dev nodes. - (make-essential-device-nodes) - ;; Prepare the real root file system under /root. (unless (file-exists? "/root") (mkdir "/root")) @@ -405,10 +407,6 @@ to it are lost." #:volatile-root? volatile-root?) (mount "none" "/root" "tmpfs")) - (unless (file-exists? "/root/dev") - (mkdir "/root/dev") - (make-essential-device-nodes #:root "/root")) - ;; Mount the specified file systems. (for-each mount-file-system (remove root-mount-point? mounts)) |