unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: ludo@gnu.org (Ludovic Courtès)
To: Thorsten Wilms <t_w_@freenet.de>
Cc: Guix-devel <guix-devel@gnu.org>
Subject: Re: Chrooting into GuixSD
Date: Sat, 16 Jun 2018 17:43:37 +0200	[thread overview]
Message-ID: <87a7rupwie.fsf@gnu.org> (raw)
In-Reply-To: <911b3265-dd96-7223-9825-f46cc8615a09@freenet.de> (Thorsten Wilms's message of "Fri, 15 Jun 2018 20:20:01 +0200")

Hi!

Thorsten Wilms <t_w_@freenet.de> skribis:

> Well, I tried:
>
>   cd /path/to/guixsd
>   chroot . /run/current-system/profile/bin/bash
>   source /etc/profile
>   guile /run/current-system/boot

[...]

> In ./gnu/build/linux-boot.scm:
>      90:3  2 (linux-command-line)
> In ice-9/ports.scm:
>    439:11  1 (call-with-input-file "/proc/cmdline" #<procedure get-?> ?)
> In unknown file:
>            0 (open-file "/proc/cmdline" "r" #:encoding #f # #f)
>
> ERROR: In procedure open-file:
> In procedure open-file: No such file or directory: "/proc/cmdline"
> ---
>
> I _guess_ if I'd bind proc, I would then find out dev and sys has to
> be taken care of, too, leading back to what I had already.

Indeed.  This is normally taken care of by the ‘init’ script that’s in
the initrd.  A crude way to do that would be:

  guile --no-auto-compile \
    $(guix build $(guix gc -R $(guix gc --derivers $(readlink -f /run/current-system/))|grep -e '-init\.drv$'))

The ‘guix’ commands won’t work initially in the chroot though.
Alternately, you could extract the initrd somewhere:

  gunzip -c /target/run/current-system/initrd | cpio -iv

and run:

  guile --no-auto-compile ./init

Then again we could also just arrange for ‘guix system build’ to include
an ‘enter’ script that would do everything needed to chroot into the
system.  Food for thought…

Ludo’.

      reply	other threads:[~2018-06-16 15:43 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-13  4:04 Chrooting into GuixSD swedebugia
2018-06-13  7:13 ` Hartmut Goebel
2018-06-13  8:13   ` Nils Gillmann
2018-06-13 10:09     ` Thorsten Wilms
2018-06-14 12:18       ` Nils Gillmann
2018-06-14 13:04         ` Ricardo Wurmus
2018-06-14 14:29           ` Oleg Pykhalov
2018-06-14 15:01             ` Ricardo Wurmus
2018-06-15 10:21               ` swedebugia
2018-07-05  8:55                 ` Chris Marusich
2018-06-15 15:01       ` Ludovic Courtès
2018-06-15 18:20         ` Thorsten Wilms
2018-06-16 15:43           ` Ludovic Courtès [this message]

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=87a7rupwie.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=guix-devel@gnu.org \
    --cc=t_w_@freenet.de \
    /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).