all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: David Craven <david@craven.ch>
To: David Braun <Guix-box@snkmail.com>
Cc: guix-devel <guix-devel@gnu.org>
Subject: Re: How to boot GuixSD in LXD
Date: Sun, 18 Dec 2016 20:27:41 +0100	[thread overview]
Message-ID: <CAL1_imnTMRmydTjQCJA-KjjhLK+=Wn-A=gE2xqOGc5DMNDoFsA@mail.gmail.com> (raw)
In-Reply-To: <10922-1482015184-113309@sneakemail.com>

Hi David,

I'm not familiar with LXD, so it might be helpful if you could share
more details of how you created the LXD image.

> Now when I attempt to launch the image, LXD fails when it tries to start
> /sbin/init and can't find it.  I understand that GuixSD uses Shepherd
> instead of init.  What's the best way for me to configure the image so that
> LXD can start it?  Perhaps I should create a symlink at /sbin/init that
> points to shepherd

That sounds like it could work. I believe what you are looking for is
the boot script contained in a system derivation. If you used guix
system init to create the LXD image, you can find it by running $(guix
system build etc/config.scm)/boot.

> but I'm not sure if I should take the initrd into account as well.

LXD looks like it's based on containers, so the initrd shouldn't be
needed. The initrd's main task is to load the root file system and
then load the boot script that is passed through the --load argument
to the initrd from grub. So you should be able to skip the kernel
loading and the initrd and jump right into the boot script that starts
shepherd.

Part of grub.cfg:
menuentry "GNU with Linux-Libre 4.8.12 (beta)" {
  search --label --set gnu-disk-image
  linux /gnu/store/90nmdrl491nyhsy7ar1zczvz5wgqlymh-linux-libre-4.8.12/bzImage
  --root=gnu-disk-image
  --system=/gnu/store/qd2zplli61dnjawzfanagh5sikwlbz9m-system
  --load=/gnu/store/qd2zplli61dnjawzfanagh5sikwlbz9m-system/boot
  console=ttyS0
  initrd /gnu/store/70shm14ywkydvp5f5lbzhl4wshkamwz4-base-initrd/initrd
}

The boot script:
(eval-when (expand load eval) (set! %load-path (cons
"/gnu/store/gi2zry48hdsr87yvasc3nv7niixab8lw-module-import"
%load-path)) (set! %load-compiled-path (cons
"/gnu/store/dz6yx4q81zb3pxvysblfd68lgwrya9a2-module-import-compiled"
%load-compiled-path)))(begin (begin (use-modules (guix build utils))
(letrec-syntax ((fail-safe (syntax-rules () ((_ exp rest ...) (begin
(catch (quote system-error) (lambda () exp) (const #f)) (fail-safe
rest ...))) ((_) #t)))) (fail-safe (delete-file-recursively "/tmp")
(delete-file-recursively "/var/run") (mkdir "/tmp") (chmod "/tmp"
1023) (mkdir "/var/run") (chmod "/var/run" 493)))) (primitive-load
"/gnu/store/xs63km6mqdkxdbwqkvbk2ryccaq80971-activate") (begin
(false-if-exception (delete-file "/run/booted-system")) (symlink
(readlink "/run/current-system") "/run/booted-system") (let loop ((fd
3)) (when (< fd 1024) (false-if-exception (close-fdes fd)) (loop (+ 1
fd)))) (execl (string-append
"/gnu/store/qfax650mynyx9x8wm8lq8w7fp82kkfc6-shepherd-0.3.2"
"/bin/shepherd") "shepherd" "--config"
"/gnu/store/i5cqh5kx4mmz616aqp9g8qkcq9v7fszg-shepherd.conf")))

HTH

  reply	other threads:[~2016-12-18 19:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-17 22:49 How to boot GuixSD in LXD David Braun
2016-12-18 19:27 ` David Craven [this message]
2016-12-19 14:24   ` Ludovic Courtès
2016-12-22 22:37     ` David Braun
2016-12-22 22:36   ` David Braun

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

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

  git send-email \
    --in-reply-to='CAL1_imnTMRmydTjQCJA-KjjhLK+=Wn-A=gE2xqOGc5DMNDoFsA@mail.gmail.com' \
    --to=david@craven.ch \
    --cc=Guix-box@snkmail.com \
    --cc=guix-devel@gnu.org \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.