summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2014-05-08 00:22:26 +0200
committerLudovic Courtès <ludo@gnu.org>2014-05-08 00:22:26 +0200
commitb1995341ce803c396068a6e41f8cd64b09bbf2f6 (patch)
tree2fbec8942b98053db73b315e35d9c57d45620362
parent538cc2e0165a32d3c5de9022f522f37880b60f5d (diff)
linux-initrd: Update /etc/mtab.
* guix/build/linux-initrd.scm (mount-root-file-system): Populate /root/etc/mtab. (mount-file-system): Update ROOT/etc/mtab.
-rw-r--r--guix/build/linux-initrd.scm13
1 files changed, 11 insertions, 2 deletions
diff --git a/guix/build/linux-initrd.scm b/guix/build/linux-initrd.scm
index c09cdeafb4..6dd7c6e958 100644
--- a/guix/build/linux-initrd.scm
+++ b/guix/build/linux-initrd.scm
@@ -228,7 +228,9 @@ UNIONFS."
(lambda args
(format (current-error-port) "exception while mounting '~a': ~s~%"
root args)
- (start-repl))))
+ (start-repl)))
+
+ (copy-file "/proc/mounts" "/root/etc/mtab"))
(define (check-file-system device type)
"Run a file system check of TYPE on DEVICE."
@@ -279,7 +281,14 @@ run a file system check."
(mount source mount-point type (flags->bit-mask flags)
(if options
(string->pointer options)
- %null-pointer))))))
+ %null-pointer))
+
+ ;; Update /etc/mtab.
+ (mkdir-p (string-append root "/etc"))
+ (let ((port (open-output-file (string-append root "/etc/mtab"))))
+ (format port "~a ~a ~a ~a 0 0~%"
+ source mount-point type options)
+ (close-port port))))))
(define (switch-root root)
"Switch to ROOT as the root file system, in a way similar to what