unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: ludo@gnu.org (Ludovic Courtès)
To: Pjotr Prins <pjotr.public12@thebird.nl>
Cc: guix-devel@gnu.org
Subject: Self-contained Guix tarball
Date: Sun, 12 Apr 2015 22:07:03 +0200	[thread overview]
Message-ID: <87a8ydt8k8.fsf_-_@gnu.org> (raw)
In-Reply-To: <20150410131420.GB24509@thebird.nl> (Pjotr Prins's message of "Fri, 10 Apr 2015 15:14:20 +0200")


[-- Attachment #1.1: Type: text/plain, Size: 1325 bytes --]

Pjotr Prins <pjotr.public12@thebird.nl> skribis:

> Well yes, you need to install all prerequisites and that is not always
> trivial. Try bootstrapping on an old Centos install, for example.
> Can't even get Docker going there.
>
> It would be nice to have an installable binary tar ball for Guix. Just
> unpack in root and go...

I’ve given that a try since it’s actually quite simple to do.  The
procedure in the attached file produces a self-contained tarball.  It
contains the closure of Guix, as well as /var/guix and an initial
/root/.guix-profile from which one can use the ‘guix’ commands.

I’ve uploaded the result (for x86_64) at:

  http://www.fdn.fr/~lcourtes/software/guix/guix-tarball-0.8.1.1140.tar.lz
  http://www.fdn.fr/~lcourtes/software/guix/guix-tarball-0.8.1.1140.tar.lz.sig
  SHA1: afde62b3e9f97f9ae0c57eaccfaca842b157cd2f

To install Guix on a foreign distro, follow these steps:

  1. Download the tarball (38 MiB.)

  2. As root, run:
       cd /
       tar xf /path/to/guix-tarball-0.8.1.1140.tar.lz
     You need lzip and GNU tar.

  3. Setup the daemon as explained in the manual, and run it from
     /root/.guix-profile/bin/guix-daemon.

And hopefully, that’s it.

I haven’t actually tried it, so feedback is welcome!  :-)

Thanks,
Ludo’.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: tarball creation --]
[-- Type: text/x-scheme, Size: 3477 bytes --]

(use-modules (guix)
             (guix profiles)
             (gnu packages base)
             (gnu packages compression)
             (gnu packages package-management))

(define* (self-contained-tarball #:key (guix guix))
  (mlet %store-monad ((profile (profile-derivation
                                (manifest
                                 (list (package->manifest-entry guix))))))
    (gexp->derivation "guix-tarball.tar.lz"
                      #~(begin
                          (use-modules (guix build store-copy)
                                       (guix build utils)
                                       (gnu build install)
                                       (srfi srfi-26))

                          (define %root
                            (string-append (getcwd) "/root"))
                          (define %root-profile
                            "/var/guix/profiles/per-user/root")

                          (define (mkdir-p* dir)
                            (mkdir-p (string-append %root "/" dir)))

                          (define (symlink* old new)
                            (symlink old (string-append %root "/" new)))

                          (setenv "PATH"
                                  (string-append #$guix "/sbin:"
                                                 #$tar "/bin:" #$lzip "/bin"))

                          ;; Populate the store.
                          (populate-store '("profile") %root)
                          (for-each (cut register-closure %root <>)
                                    '("profile"))

                          ;; 'guix-register' registers profiles as GC roots
                          ;; but the symlink target uses $TMPDIR.  Fix that.
                          (delete-file
                           (string-append %root
                                          "/var/guix/gcroots/profiles"))
                          (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
                                                   "/guix-profile-1-link"))
                          (symlink* (string-append %root-profile
                                                   "/guix-profile-1-link")
                                    (string-append %root-profile
                                                   "/guix-profile"))

                          (mkdir-p* "/root")
                          (symlink* (string-append %root-profile
                                                   "/guix-profile")
                                    "/root/.guix-profile")

                          ;; Create the tarball.  Use GNU format so there's no
                          ;; file name length limitation.
                          (chdir %root)
                          (zero? (system* "tar" "--lzip" "--format=gnu"
                                          "-cvf" #$output ".")))
                      #:references-graphs `(("profile" ,profile))
                      #:modules '((guix build utils)
                                  (guix build store-copy)
                                  (gnu build install)))))

;; (pk (with-store store
;;       (run-with-store store (self-contained-tarball))))

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 818 bytes --]

  parent reply	other threads:[~2015-04-12 20:07 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-10  8:46 Copying whole /gnu/store from USB does not work Pjotr Prins
2015-04-10 11:48 ` Ludovic Courtès
2015-04-10 13:14   ` Pjotr Prins
2015-04-10 13:41     ` David Thompson
2015-04-12 10:28     ` Copying whole /gnu/store from USB does not work (SOLVED) Pjotr Prins
2015-04-12 12:29       ` Ludovic Courtès
2015-04-12 20:07     ` Ludovic Courtès [this message]
2015-04-13  6:54       ` Self-contained Guix tarball Pjotr Prins
2015-04-13  9:57         ` Ludovic Courtès
2015-04-13 10:05           ` Pjotr Prins
2015-04-13 13:29           ` Mark H Weaver
2015-04-14 21:33             ` Ludovic Courtès
2015-04-13 15:47       ` Thompson, David
2015-04-15 21:31       ` Ludovic Courtès
2015-04-16  5:33         ` Pjotr Prins
2015-04-18 21:23           ` Ludovic Courtès
2015-04-19  8:18             ` Pjotr Prins
2015-04-19 20:09               ` Ludovic Courtès
2015-04-19 13:34             ` Taylan Ulrich Bayırlı/Kammer
2015-04-20 20:49               ` Ludovic Courtès
2015-04-21  7:03                 ` Pjotr Prins
2015-04-21  7:19                   ` Pjotr Prins
2015-04-21  8:18                     ` Ludovic Courtès
2015-04-21  8:44                       ` Pjotr Prins
2015-04-21 12:16                         ` Ludovic Courtès
2015-04-21  8:11                   ` Ludovic Courtès
2015-04-21  8:37                     ` Pjotr Prins
2015-04-21 10:08                       ` Ricardo Wurmus
2015-04-21 10:17                         ` Pjotr Prins
2015-04-21 12:08                           ` Andreas Enge
2015-04-21 12:12                       ` Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87a8ydt8k8.fsf_-_@gnu.org \
    --to=ludo@gnu.org \
    --cc=guix-devel@gnu.org \
    --cc=pjotr.public12@thebird.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).