From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?UTF-8?Q?G=C3=A1bor_Boskovits?= Subject: Re: Half a success with chroot Date: Mon, 12 Mar 2018 20:17:36 +0100 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="001a114c84e4a7f84205673bfec0" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:56241) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1evSx1-0005Jf-96 for help-guix@gnu.org; Mon, 12 Mar 2018 15:17:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1evSwz-00045v-Io for help-guix@gnu.org; Mon, 12 Mar 2018 15:17:39 -0400 Received: from mail-io0-x230.google.com ([2607:f8b0:4001:c06::230]:36269) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1evSwz-00045Y-Bg for help-guix@gnu.org; Mon, 12 Mar 2018 15:17:37 -0400 Received: by mail-io0-x230.google.com with SMTP id e30so12804581ioc.3 for ; Mon, 12 Mar 2018 12:17:37 -0700 (PDT) In-Reply-To: List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-guix-bounces+gcggh-help-guix=m.gmane.org@gnu.org Sender: "Help-Guix" To: t_w_@freenet.de Cc: help-guix --001a114c84e4a7f84205673bfec0 Content-Type: text/plain; charset="UTF-8" 2018-03-12 18:39 GMT+01:00 Thorsten Wilms : > Hi! > > Thanks to mbakke in #guix, I managed to chroot from my comfortable Ubuntu > into the rather naked Guix SD installation, with a few things working, > though it ended with a "cannot pivot old root directory". > > Maybe someone here can improve on it; otherwise see it as a rough note > about the possibilities and limitations. > > Given a Guix SD on /dev/sdb2: > > ```` > sudo mkdir /mnt/guixsd > sudo mount /dev/sdb2 /mnt/guixsd > cd /mnt/guixsd > sudo mount --bind /dev dev > sudo mount --bind /proc proc > sudo mount --bind /sys sys > sudo chroot /mnt/guixsd /run/current-system/profile/bin/bash > => logged in as root, no commands available > source /etc/profile > => at least basic shell commands work, as does `guix package -s banana` > (yes, that does find something!) > ```` > > ```` > # su thorwil > $ guix package -i emacs-bash-completion > bash: guix: command not found > $ source /etc/profile > $ guix package -i emacs-bash-completion > guile: warning: failed to install locale > warning: failed to install locale: Invalid argument > guix package: error: failed to connect to `/var/guix/daemon-socket/socket': > Connection refused > $ exit > ```` > > Oops, starting guix-daemon: > ```` > # guix-daemon --build-users-group=guixbuild & > [1] 4347 > # su thorwil > $ source /etc/profile > $ guix package -i emacs-bash-completion > guile: warning: failed to install locale > warning: failed to install locale: Invalid argument > accepted connection from pid 4350, user thorwil > substitute: guile: warning: failed to install locale > substitute: warning: failed to install locale: Invalid argument > substitute: updating list of substitutes from ' > https://mirror.hydra.gnu.org'... 100.0% > The following package will be installed: > emacs-bash-completion 2.0.0 /gnu/store/7irxjifw4m8sj0if2nj > 0r26vf0n0imsj-emacs-bash-completion-2.0.0 > > substitute: updating list of substitutes from ' > https://mirror.hydra.gnu.org'... 100.0% > The following derivations will be built: > /gnu/store/z55j7zi1hgzyikbmv5gpnbv6sw49j6kw-profile.drv > /gnu/store/yli3x8jscrcy4vicjvqlcd7z2cnyzc9q-gtk-im-modules.drv > /gnu/store/sk4l43zrsjjgrnvbwcayf2lm484pnqxd-fonts-dir.drv > /gnu/store/kk4yd0k0g30fmqwnmrmqv3ygnvl8s2fw-info-dir.drv > /gnu/store/hffz6p320akp7sbqskxrdlxjslld5qpg-gtk-icon-themes.drv > /gnu/store/ac501lz2zg8dc51acdcz457fr32r6r0c-xdg-desktop-database.drv > /gnu/store/2gjkjjrbv8x3xx6xgma2wcaq3xga8wha-xdg-mime-database.drv > /gnu/store/0mxc3m4l8n7l2h5p95s4cmfzhwhqpjbc-ca-certificate-bundle.drv > > /gnu/store/4vgn265kihmk1aayy3rg5h4z00dvlfmy-emacs-bash- > completion-2.0.0.drv > /gnu/store/d3pp0bl6f8ml06yzgm08pnyg3624rlc2-manual-database.drv > 0.0 MB will be downloaded: > /gnu/store/hfc5j4dq387s2iyvz392dja8zc75cvss-emacs-bash-completion-2.0.0 > guile: warning: failed to install locale > warning: failed to install locale: Invalid argument > Downloading https://mirror.hydra.gnu.org/guix/nar/gzip/hfc5j4dq387s2iyvz > 392dja8zc75cvss-emacs-bash-completion-2.0.0... > emacs-bash-completion-2.0.0 31KiB > 5.3MiB/s 00:00 [##################] 100.0% > > guix package: error: build failed: while setting up the build environment: > cannot pivot old root directory onto '/gnu/store/4vgn265kihmk1aayy3 > rg5h4z00dvlfmy-emacs-bash-completion-2.0.0.drv.chroot/real-root':$ > ```` > > Hello! It would be nice to know the error code returned by the pivot_root syscall. It might point to the reason of the failure. Most probably you can get that using strace. Stracing the daemon is possible using strace -fp pid_of_daemon. > -- > Thorsten Wilms > > thorwil's design for free software: > http://thorwil.wordpress.com/ > > --001a114c84e4a7f84205673bfec0 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
2018= -03-12 18:39 GMT+01:00 Thorsten Wilms <t_w_@freenet.de>:
Hi!

Thanks to mbakke in #guix, I managed to chroot from my comfortable Ubuntu i= nto the rather naked Guix SD installation, with a few things working, thoug= h it ended with a "cannot pivot old root directory".

Maybe someone here can improve on it; otherwise see it as a rough note abou= t the possibilities and limitations.

Given a Guix SD on /dev/sdb2:

````
sudo mkdir /mnt/guixsd
sudo mount /dev/sdb2 /mnt/guixsd
cd /mnt/guixsd
sudo mount --bind /dev dev
sudo mount --bind /proc proc
sudo mount --bind /sys sys
sudo chroot /mnt/guixsd /run/current-system/profile/bin/bash
=3D> logged in as root, no commands available
source /etc/profile
=3D> at least basic shell commands work, as does `guix package -s banana= ` (yes, that does find something!)
````

````
# su thorwil
$ guix package -i emacs-bash-completion
bash: guix: command not found
$ source /etc/profile
$ guix package -i emacs-bash-completion
guile: warning: failed to install locale
warning: failed to install locale: Invalid argument
guix package: error: failed to connect to `/var/guix/daemon-socket/socket': Connection refused
$ exit
````

Oops, starting guix-daemon:
````
# guix-daemon --build-users-group=3Dguixbuild &
[1] 4347
# su thorwil
$ source /etc/profile
$ guix package -i emacs-bash-completion
guile: warning: failed to install locale
warning: failed to install locale: Invalid argument
accepted connection from pid 4350, user thorwil
substitute: guile: warning: failed to install locale
substitute: warning: failed to install locale: Invalid argument
substitute: updating list of substitutes from 'https://mirror.hydra.= gnu.org'... 100.0%
The following package will be installed:
=C2=A0 =C2=A0emacs-bash-completion=C2=A0 =C2=A0 =C2=A0 =C2=A0 2.0.0 /gnu/st= ore/7irxjifw4m8sj0if2nj0r26vf0n0imsj-emacs-bash-completion-2.0.0<= br>
substitute: updating list of substitutes from 'https://mirror.hydra.= gnu.org'... 100.0%
The following derivations will be built:
=C2=A0 =C2=A0/gnu/store/z55j7zi1hgzyikbmv5gpnbv6sw49j6kw-profile.drv =C2=A0 =C2=A0/gnu/store/yli3x8jscrcy4vicjvqlcd7z2cnyzc9q-gtk-im-module= s.drv
=C2=A0 =C2=A0/gnu/store/sk4l43zrsjjgrnvbwcayf2lm484pnqxd-fonts-dir.drv=
=C2=A0 =C2=A0/gnu/store/kk4yd0k0g30fmqwnmrmqv3ygnvl8s2fw-info-dir.drv<= br> =C2=A0 =C2=A0/gnu/store/hffz6p320akp7sbqskxrdlxjslld5qpg-gtk-icon-themes.drv
=C2=A0 =C2=A0/gnu/store/ac501lz2zg8dc51acdcz457fr32r6r0c-xdg-desktop-<= wbr>database.drv
=C2=A0 =C2=A0/gnu/store/2gjkjjrbv8x3xx6xgma2wcaq3xga8wha-xdg-mime-database.drv
=C2=A0 =C2=A0/gnu/store/0mxc3m4l8n7l2h5p95s4cmfzhwhqpjbc-ca-certificat= e-bundle.drv

/gnu/store/4vgn265kihmk1aayy3rg5h4z00dvlfmy-emacs-bash-completion= -2.0.0.drv
=C2=A0 =C2=A0/gnu/store/d3pp0bl6f8ml06yzgm08pnyg3624rlc2-manual-d= atabase.drv
0.0 MB will be downloaded:
=C2=A0 =C2=A0/gnu/store/hfc5j4dq387s2iyvz392dja8zc75cvss-emacs-bash-completion-2.0.0
guile: warning: failed to install locale
warning: failed to install locale: Invalid argument
Downloading https://mirror.hydra.gnu.org/guix/nar/gzip/hfc5j4dq387= s2iyvz392dja8zc75cvss-emacs-bash-completion-2.0.0...
=C2=A0emacs-bash-completion-2.0.0=C2=A0 31KiB
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A05.3MiB/s 00:00 [##################] 100.0%

guix package: error: build failed: while setting up the build environment: = cannot pivot old root directory onto '/gnu/store/4vgn265kihmk1aayy3rg5h4z00dvlfmy-emacs-bash-completion-2.0.0.drv.chroot/real-root&= #39;:$
````


Hello! It would be nice = to know the error code returned by the pivot_root syscall. It might point t= o the reason of the failure.
Most probably you can get that using= strace. Stracing the daemon is possible using strace -fp pid_of_daemon.
=C2=A0
<= font color=3D"#888888"> --
Thorsten Wilms

thorwil's design for free software:
http://thorwil.wordpress.com/


--001a114c84e4a7f84205673bfec0--