;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2018, 2019 Ludovic Courtès ;;; Copyright © 2016 Chris Marusich ;;; ;;; This file is part of GNU Guix. ;;; ;;; GNU Guix is free software; you can redistribute it and/or modify it ;;; under the terms of the GNU General Public License as published by ;;; the Free Software Foundation; either version 3 of the License, or (at ;;; your option) any later version. ;;; ;;; GNU Guix is distributed in the hope that it will be useful, but ;;; WITHOUT ANY WARRANTY; without even the implied warranty of ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;;; GNU General Public License for more details. ;;; ;;; You should have received a copy of the GNU General Public License ;;; along with GNU Guix. If not, see . (define-module (gnu build install) #:use-module (guix build utils) #:use-module (guix build store-copy) #:use-module (srfi
aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/packages/marst.scm')
0 files changed, 0 insertions, 0 deletions
("/var/guix/gcroots/booted-system" -> "/run/booted-system") ("/var/guix/gcroots/current-system" -> "/run/current-system") ("/var/guix/gcroots/profiles" -> "/var/guix/profiles") (directory "/bin") (directory "/tmp" 0 0 #o1777) ; sticky bit (directory "/var/tmp" 0 0 #o1777) (directory "/var/lock" 0 0 #o1777) (directory "/home" 0 0))) (define (populate-root-file-system system target) "Make the essential non-store files and directories on TARGET. This includes /etc, /var, /run, /bin/sh, etc., and all the symlinks to SYSTEM." (for-each (cut evaluate-populate-directive <> target) (directives (%store-directory))) ;; Add system generation 1. (let ((generation-1 (string-append target "/var/guix/profiles/system-1-link"))) (let try () (catch 'system-error (lambda () (symlink system generation-1)) (lambda args ;; If GENERATION-1 already exists, overwrite it. (if (= EEXIST (system-error-errno args)) (begin (delete-file generation-1) (try)) (apply throw args))))))) (define %root-profile "/var/guix/profiles/per-user/root") (define* (install-database-and-gc-roots root database profile #:key (profile-name "guix-profile")) "Install DATABASE, the store database, under directory ROOT. Create PROFILE-NAME and have it link to PROFILE, a store item." (define (scope file) (string-append root "/" file)) (define (mkdir-p* dir) (mkdir-p (scope dir))) (define (symlink* old new) (symlink old (scope new))) (install-file database (scope "/var/guix/db/")) (chmod (scope "/var/guix/db/db.sqlite") #o644) (mkdir-p* "/var/guix/profiles") (mkdir-p* "/var/guix/gcroots") (symlink* "/var/guix/profiles" "/var/guix/gcroots/profiles") ;; Make root's profile, which makes it a GC root. (mkdir-p* %root-profile) (symlink* profile (string-append %root-profile "/" profile-name "-1-link")) (symlink* (string-append profile-name "-1-link") (string-append %root-profile "/" profile-name))) (define* (populate-single-profile-directory directory #:key profile closure (profile-name "guix-profile") database) "Populate DIRECTORY with a store containing PROFILE, whose closure is given in the file called CLOSURE (as generated by #:references-graphs.) DIRECTORY is initialized to contain a single profile under /root pointing to PROFILE. When DATABASE is true, copy it to DIRECTORY/var/guix/db and create DIRECTORY/var/guix/gcroots and friends. PROFILE-NAME is the name of the profile being created under /var/guix/profiles, typically either \"guix-profile\" or \"current-guix\". This is used to create the self-contained tarballs with 'guix pack'." (define (scope file) (string-append directory "/" file)) (define (mkdir-p* dir) (mkdir-p (scope dir))) (define (symlink* old new) (symlink old (scope new))) ;; Populate the store. (populate-store (list closure) directory) (when database (install-database-and-gc-roots directory database profile #:profile-name profile-name)) (match profile-name ("guix-profile" (mkdir-p* "/root") (symlink* (string-append %root-profile "/guix-profile") "/root/.guix-profile")) ("current-guix" (mkdir-p* "/root/.config/guix") (symlink* (string-append %root-profile "/current-guix") "/root/.config/guix/current")) (_ #t))) ;;; install.scm ends here