From mboxrd@z Thu Jan 1 00:00:00 1970 From: "pelzflorian (Florian Pelz)" Subject: bug#36054: [wishlist] Simplify chrooting into installed system from install image Date: Sun, 2 Jun 2019 14:33:33 +0200 Message-ID: <20190602123333.cjeqmrwz6be7uykd@pelzflorian.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([209.51.188.92]:44620) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hXPpI-0002Yo-1l for bug-guix@gnu.org; Sun, 02 Jun 2019 08:43:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hXPpG-00078V-DO for bug-guix@gnu.org; Sun, 02 Jun 2019 08:43:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:54343) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hXPpG-00077x-7C for bug-guix@gnu.org; Sun, 02 Jun 2019 08:43:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hXPpG-0006Nv-3r for bug-guix@gnu.org; Sun, 02 Jun 2019 08:43:02 -0400 Sender: "Debbugs-submit" Resent-Message-ID: Received: from eggs.gnu.org ([209.51.188.92]:44418) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hXPof-0002Pd-Gd for bug-guix@gnu.org; Sun, 02 Jun 2019 08:42:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hXPg9-00078a-Co for bug-guix@gnu.org; Sun, 02 Jun 2019 08:33:38 -0400 Received: from pelzflorian.de ([5.45.111.108]:47332 helo=mail.pelzflorian.de) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hXPg8-00073p-OY for bug-guix@gnu.org; Sun, 02 Jun 2019 08:33:37 -0400 Received: from pelzflorian.localdomain (unknown [5.45.111.108]) by mail.pelzflorian.de (Postfix) with ESMTPSA id D84D036003D for ; Sun, 2 Jun 2019 14:33:33 +0200 (CEST) Content-Disposition: inline List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: "bug-Guix" To: 36054@debbugs.gnu.org When bootloader installation fails or when the installed bootloader does not allow selecting old generations (like the U-Boot bootloader), chrooting may become necessary to repair a broken Guix system. Guix should offer officially supported instructions in the manual and perhaps more tooling for chrooting into an installed Guix System from a Guix install USB/DVD/SD (and perhaps from a foreign distro) to enable debugging. Arch has . They offer an official arch-chroot script to chroot into an Arch system (it is shipped with their install image) as well as documentation for chrooting without the script. Their documentation for chrooting without the arch-chroot script also works on Guix, but some more steps are required: * Mounting the (perhaps encrypted) drive with the broken Guix System. This is not part of Arch=E2=80=99 chroot instructions, but could perhap= s be part of a more interactive guix-chroot script, since Guix=E2=80=99 targ= et audience is different from Arch=E2=80=99s. Note that the name given to cryptsetup must be the same as specified in /etc/config.scm if one wishes to reconfigure from the chroot. * When following the instructions from the Arch wiki (without rebinding /run), I can chroot into /run/current-system/profile/bin/bash. What if the user wants a different shell and not bash? This perhaps could be selectable in an (interactive?) guix-chroot script. * Afterwards a Guix daemon must be started in the chroot to use Guix from within such a chroot. * The /run/current-system/profile/etc/profile, ~/.guix-profile/etc/profile and ~/.config/guix/current/etc/profile need to be sourced to use the installed system=E2=80=99s Guix profile. * Networking automatically works for me in the chroot without needing to follow any Arch wiki instructions to get it working, but I do not know if that is always the case. Note that for me reconfiguring did not work when chrooting from a Debian live image into Guix because GRUB claimed to have no crypto support. I needed to chroot from the Guix install image for reconfiguring. Perhaps the environment visible to GRUB is not pure. What do you think? Is a guix-chroot script a good idea? I do not know how to write one. Do you think only chroot instructions in the manual are a better solution? They should explain all the above steps though, I believe. Regards, Florian