unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
From: ludo@gnu.org (Ludovic Courtès)
To: Oleg Pykhalov <go.wigust@gmail.com>
Cc: help-guix@gnu.org
Subject: Re: Reinstall GuixSD from another distribution with chroot (Recover Grub)
Date: Fri, 02 Mar 2018 14:51:26 +0100	[thread overview]
Message-ID: <87sh9iegbl.fsf@gnu.org> (raw)
In-Reply-To: <87d10piq3n.fsf@gmail.com> (Oleg Pykhalov's message of "Wed, 28 Feb 2018 09:29:48 +0300")

Hi Oleg,

Thanks for sharing your tips.

Oleg Pykhalov <go.wigust@gmail.com> skribis:

> I got a ‘grub.cfg’ with following entries for all system generations:
>
> menuentry "GNU with Linux-Libre 4.15.6 (beta)" {
>   search --label --set magnolia-root
> }

How did you end up with that?  :-)

> Chrooting into GuixSD system:
>
> mkdir /tmp/guixsd
> sudo mount /dev/sda2 /tmp/guixsd # GuixSD partition
> sudo mount -t proc none /tmp/guixsd/proc
> sudo mount -t sysfs sys /tmp/guixsd/sys
> sudo mount -o bind /dev /tmp/guixsd/dev
> sudo mount /dev/sda1 /tmp/guixsd/boot/efi # UEFI partition with ‘EFI’ directory inside
> sudo chroot /tmp/guixsd /bin/sh
>
>
> You need to “source” a Bash profile with environment variables which
> will setup an environment as was GuixSD (such as ‘PATH’ to find
> executables).  The thing is if you make a ‘source /etc/profile’ then
> you cannot get YOUR-USER's profile PATH environment variable.  Because
> of that “source” only a ‘per-user’ profile.
>
> source /var/guix/profiles/per-user/YOUR-USER/guix-profile/etc/profile

Looking at this, I thought we should be able to do a better job to start
an already installed GuixSD, for instance by providing a script that
boots the system.

Actually, I suspect that something like this would work:

  cd /tmp/guixsd
  chroot . /gnu/store/…/bin/guile /run/current-system/boot

With a bit of work, we could make it as simple as:

  /tmp/guixsd/run/current-system/spawn

or similar.

Thoughts?

Ludo’.

      reply	other threads:[~2018-03-02 13:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-28  6:29 Reinstall GuixSD from another distribution with chroot (Recover Grub) Oleg Pykhalov
2018-03-02 13:51 ` 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=87sh9iegbl.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=go.wigust@gmail.com \
    --cc=help-guix@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.
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).