[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Chrooting into GuixSD

From: Ludovic Courtès
Subject: Re: Chrooting into GuixSD
Date: Sat, 16 Jun 2018 17:43:37 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux)


Thorsten Wilms <address@hidden> 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…


reply via email to

[Prev in Thread] Current Thread [Next in Thread]