Reinstall GuixSD from another distribution with chroot (Recover Grub)

2018-02-27 Thread Oleg Pykhalov
Hello Guix,

The following article fixed my boot problem, but I think that it could
be applied to any Grub or UEFI issue on GuixSD.

I broke my ‘grub.cfg’ probably because of a patch from a discussion
about dualbooting [1].  It worked well until I did a ‘reconfigure’
from a Guix builded from Git without applied patch from [1].
--8<---cut here---start->8---
sudo -E ./pre-inst-env\
env GUIX_PACKAGE_PATH=$HOME/src/guix-wigust\
guix system reconfigure $HOME/dotfiles/fiore/magnolia.scm
--8<---cut here---end--->8---

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

I booted to NixOS on another partition of same SSD, with hitting ‘c’
in Grub menu entries and specifying ‘configfile
(hd0,gpt1)/boot/grub/grub.cfg’.  (You could find a partition with ‘ls’
command.)  But the following should work with any distribution booted
from a liveusb, too.

Chrooting into GuixSD system:
--8<---cut here---start->8---
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
--8<---cut here---end--->8---

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.
--8<---cut here---start->8---
source /var/guix/profiles/per-user/YOUR-USER/guix-profile/etc/profile
--8<---cut here---end--->8---

NOTE: Per-user profile was required, because with only ‘/etc/profile’
invoking any ‘guix COMMAND’ I got:
--8<---cut here---start->8---
guix system reconfigure /home/natsu/dotfiles/fiore/magnolia.scm
guix system: error: could not find bootstrap binary 'guile-2.0.9.tar.xz' for 
system 'x86_64-linux'
--8<---cut here---end--->8---

Run a Guix daemon with disabled chroot in background:
--8<---cut here---start->8---
guix-daemon --build-users-group=guixbuild --disable-chroot &
--8<---cut here---end--->8---

Reinstall a system with ‘guix init’:
--8<---cut here---start->8---
/home/YOUR-USER/src/guix/pre-inst-env guix system init /etc/config.scm /

substitute: updating list of substitutes from 'https://mirror.hydra.gnu.org'... 
100.0%
The following derivation will be built:
   /gnu/store/8ac2s3dshanlwqmnqkk7jg88j02q0l1m-grub.cfg.drv
/gnu/store/xqs7x48zkld99xp6m39ad6w4zcvf95sh-system
/gnu/store/6piq5j9f59na07ja2s8w7l4v5b6xgnpr-grub.cfg
/gnu/store/kcw90wxwxfm62i9h45myx1nhyzfy5zqz-grub-efi-2.02
/gnu/store/fw8bzf3ic9z5xnm48a1rgx9a5ld6c81r-bootloader-installer

initializing operating system under '/'...
guix system: warning: initializing the current root file system
populating '/'...
Installing for x86_64-efi platform.
Installation finished. No error reported.
--8<---cut here---end--->8---

NOTE: You probably could do it without ‘pre-inst-env’.

Now you could reboot to GuixSD.

I wish a guide like this to be in the Guix documentation.

Footnotes: 
[1]  https://lists.gnu.org/archive/html/guix-devel/2018-02/msg1.html

Oleg.



Re: guixbuild does not exist???

2018-02-27 Thread Konrad Hinsen
Hi Ricardo and Marius,

Ricardo Wurmus  writes:

> I’m guessing that NSCD is not running.  You might need it on some
> systems.

Marius Bakke  writes:

> This has to do with the recent update to glibc 2.26.  It no longer
> builds the "nss_compat" library, which causes problems on distributions
> that only has 'compat' in /etc/nsswitch.conf.
>
> There is some discussion about it here: .
>
> The workaround is to either install 'nscd', or update nsswitch.conf to
> include 'files' (or similar) as a fallback (for "group" in this case).

Thanks to both of you for the crucial hint. After installing nscd,
I can now again use Guix!

Konrad.



Re: guixbuild does not exist???

2018-02-27 Thread Marius Bakke
Konrad Hinsen  writes:

> Hi Guixers,
>
> Today guix greeted me with a strange error message when I tried to 
> install a package:
>
>guix package: error: build failed: the group `guixbuild' specified in 
> `build-users-group' does not exist
>
> I call this strange because
>   1) The group exists, as do the users guixbuilder01 to guixbuilder10.
>   2) Guix has been working for quite a while on this machine, and 
> nothing spectacular happened since the last use.
>   3) I cannot find any trace of this error message in the Guix source code.
>   4) The guix daemon is running without any sign of trouble.
>
> Any idea of what could be going wrong here?

This has to do with the recent update to glibc 2.26.  It no longer
builds the "nss_compat" library, which causes problems on distributions
that only has 'compat' in /etc/nsswitch.conf.

There is some discussion about it here: .

The workaround is to either install 'nscd', or update nsswitch.conf to
include 'files' (or similar) as a fallback (for "group" in this case).


signature.asc
Description: PGP signature


Re: guixbuild does not exist???

2018-02-27 Thread Ricardo Wurmus

Hi Konrad,

>   guix package: error: build failed: the group `guixbuild' specified
> in `build-users-group' does not exist

I’m guessing that NSCD is not running.  You might need it on some
systems.

--
Ricardo

GPG: BCA6 89B6 3655 3801 C3C6  2150 197A 5888 235F ACAC
https://elephly.net





guixbuild does not exist???

2018-02-27 Thread Konrad Hinsen

Hi Guixers,

Today guix greeted me with a strange error message when I tried to 
install a package:


  guix package: error: build failed: the group `guixbuild' specified in 
`build-users-group' does not exist


I call this strange because
 1) The group exists, as do the users guixbuilder01 to guixbuilder10.
 2) Guix has been working for quite a while on this machine, and 
nothing spectacular happened since the last use.

 3) I cannot find any trace of this error message in the Guix source code.
 4) The guix daemon is running without any sign of trouble.

Any idea of what could be going wrong here?

Konrad.