Paste number 149404: linux-container-script

Paste number 149404: linux-container-script
Pasted by: davexunit
When:4 years, 11 months ago
Share:Tweet this! | http://paste.lisp.org/+37A4
Channel:None
Paste contents:
Raw Source | XML | Display As
(define* (linux-container-script os #:key root-dir)
  (mlet* %store-monad
      ((os-drv (operating-system-derivation/container os)))

    (define script
      #~(begin
          (use-modules (guix build utils)
                       (gnu build linux-container))

          (for-each (lambda (dir)
                      (mkdir-p (string-append #$root-dir dir)))
                    '("/run" "/bin" "/etc" "/home"))

          (call-with-container #$root-dir '(("/gnu/store" "/gnu/store"))
            (lambda ()
              (primitive-load (string-append #$os-drv "/boot"))))))

    (gexp->script "run-container.sh" script
                  #:modules '((guix build utils)
                              (guix build syscalls)
                              (gnu build linux-container)))))

This paste has no annotations.

Colorize as:
Show Line Numbers

Lisppaste pastes can be made by anyone at any time. Imagine a fearsomely comprehensive disclaimer of liability. Now fear, comprehensively.