gnu: vm: Remove potluck hacks.
* gnu/system/vm.scm (example1): Remove. (example2): Rename to... (system-qemu-image): ... this. Add 'store' parameter, and remove call to 'open-connection'.
This commit is contained in:
parent
a843fe2222
commit
aedb72fbe0
|
@ -38,7 +38,8 @@
|
||||||
#:use-module (srfi srfi-26)
|
#:use-module (srfi srfi-26)
|
||||||
#:use-module (ice-9 match)
|
#:use-module (ice-9 match)
|
||||||
#:export (expression->derivation-in-linux-vm
|
#:export (expression->derivation-in-linux-vm
|
||||||
qemu-image))
|
qemu-image
|
||||||
|
system-qemu-image))
|
||||||
|
|
||||||
|
|
||||||
;;; Commentary:
|
;;; Commentary:
|
||||||
|
@ -342,26 +343,9 @@ It can be used to provide additional files, such as /etc files."
|
||||||
|
|
||||||
|
|
||||||
;;;
|
;;;
|
||||||
;;; Guile 2.0 potluck examples.
|
;;; Stand-alone VM image.
|
||||||
;;;
|
;;;
|
||||||
|
|
||||||
(define (example1)
|
|
||||||
(let ((store #f))
|
|
||||||
(dynamic-wind
|
|
||||||
(lambda ()
|
|
||||||
(set! store (open-connection)))
|
|
||||||
(lambda ()
|
|
||||||
(parameterize ((%guile-for-build (package-derivation store guile-final)))
|
|
||||||
(expression->derivation-in-linux-vm
|
|
||||||
store "vm-test"
|
|
||||||
'(begin
|
|
||||||
(display "hello from boot!\n")
|
|
||||||
(call-with-output-file "/xchg/hello"
|
|
||||||
(lambda (p)
|
|
||||||
(display "world" p)))))))
|
|
||||||
(lambda ()
|
|
||||||
(close-connection store)))))
|
|
||||||
|
|
||||||
(define* (passwd-file store accounts #:key shadow?)
|
(define* (passwd-file store accounts #:key shadow?)
|
||||||
"Return a password file for ACCOUNTS, a list of vectors as returned by
|
"Return a password file for ACCOUNTS, a list of vectors as returned by
|
||||||
'getpwnam'. If SHADOW? is true, then it is a /etc/shadow file, otherwise it
|
'getpwnam'. If SHADOW? is true, then it is a /etc/shadow file, otherwise it
|
||||||
|
@ -389,12 +373,8 @@ is a /etc/passwd file."
|
||||||
(add-text-to-store store (if shadow? "shadow" "passwd")
|
(add-text-to-store store (if shadow? "shadow" "passwd")
|
||||||
contents '()))
|
contents '()))
|
||||||
|
|
||||||
(define (example2)
|
(define (system-qemu-image store)
|
||||||
(let ((store #f))
|
"Return the derivation of a QEMU image of the GNU system."
|
||||||
(dynamic-wind
|
|
||||||
(lambda ()
|
|
||||||
(set! store (open-connection)))
|
|
||||||
(lambda ()
|
|
||||||
(define %pam-services
|
(define %pam-services
|
||||||
;; Services known to PAM.
|
;; Services known to PAM.
|
||||||
(list %pam-other-services
|
(list %pam-other-services
|
||||||
|
@ -471,7 +451,5 @@ is a /etc/passwd file."
|
||||||
("etc-pam.d" ,pam.d)
|
("etc-pam.d" ,pam.d)
|
||||||
("etc-passwd" ,passwd)
|
("etc-passwd" ,passwd)
|
||||||
("etc-shadow" ,shadow))))))
|
("etc-shadow" ,shadow))))))
|
||||||
(lambda ()
|
|
||||||
(close-connection store)))))
|
|
||||||
|
|
||||||
;;; vm.scm ends here
|
;;; vm.scm ends here
|
||||||
|
|
Loading…
Reference in New Issue