Skip to content
Snippets Groups Projects
Commit b1995341 authored by Ludovic Courtès's avatar Ludovic Courtès
Browse files

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.
parent 538cc2e0
No related branches found
No related tags found
No related merge requests found
...@@ -228,7 +228,9 @@ (define* (mount-root-file-system root type ...@@ -228,7 +228,9 @@ (define* (mount-root-file-system root type
(lambda args (lambda args
(format (current-error-port) "exception while mounting '~a': ~s~%" (format (current-error-port) "exception while mounting '~a': ~s~%"
root args) root args)
(start-repl)))) (start-repl)))
(copy-file "/proc/mounts" "/root/etc/mtab"))
(define (check-file-system device type) (define (check-file-system device type)
"Run a file system check of TYPE on DEVICE." "Run a file system check of TYPE on DEVICE."
...@@ -279,7 +281,14 @@ (define flags->bit-mask ...@@ -279,7 +281,14 @@ (define flags->bit-mask
(mount source mount-point type (flags->bit-mask flags) (mount source mount-point type (flags->bit-mask flags)
(if options (if options
(string->pointer 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) (define (switch-root root)
"Switch to ROOT as the root file system, in a way similar to what "Switch to ROOT as the root file system, in a way similar to what
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment