guix-devel
[Top][All Lists]
Advanced

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

Re: Unprivileged /gnu/store with PRoot


From: Pjotr Prins
Subject: Re: Unprivileged /gnu/store with PRoot
Date: Sun, 16 Jul 2017 14:35:14 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

On Fri, May 12, 2017 at 05:53:21PM +0200, Ludovic Court??s wrote:
> One way to work around the problem is to use PRoot, a ptrace(2)-based
> tool to virtualize the file system??.  With the 'proot-static' package I
> just pushed, one can run, say, hwloc, on such a hostile machine by
> sending locally-created packs as well as 'proot':
> 
>   scp $(guix build proot-static)/bin/proot hostile:
>   scp $(guix pack hwloc -S /bin=bin) hostile:hwloc.tgz
> 
> and then on the hostile machine:
> 
>   mkdir ~/.local
>   cd ~/.local
>   tar xf ~/hwloc.tgz
>   cd
>   ./proot -b .local:/ /bin/lstopo
> 
> where 'proot -b .local:/' essentially 'bind-mounts' ~/.local to /.

I took it a bit further and can run guix-daemon in proot:

  https://gitlab.com/pjotrp/guix-notes/blob/master/GUIX-NO-ROOT.org

this means you can install binary packages inside proot and run them. That is
pretty cool already :).

I can also create a build system for building Guix from source. So we
are bootstrapping with our own standard environment.

Now, what I really want to do, from this, is to build packages that get
installed in a non-/gnu/store. E.g., ~/opt/store instead. It should be
possible with the instructions Roel wrote down in 

  https://github.com/UMCUGenetics/guix-additions/blob/master/doc/Deployment.md

but I am failing because it appears the guix-daemon is still linked
against the old store. After

  ./configure --localstatedir=$HOME/opt/var --with-store-dir=$HOME/opt/store 
--prefix=$HOME/opt/local
  make clean
  make guix-daemon
  make install

  ldd ~/opt/local/bin/guix-daemon
        linux-vdso.so.1 (0x00007ffcc4ffb000)
        libsqlite3.so.0 => not found
        libgcrypt.so.20 => not found
        libstdc++.so.6 => 
/gnu/store/b3z4d4zjibqix6pn58q6b1rgfhrarcaq-gcc-7.1.0-lib/lib/libstdc++.so.6 
(0x00007f3c2ecb9000)
        libm.so.6 => 
/gnu/store/rmjlycdgiq8pfy5hfi42qhw3k7p6kdav-glibc-2.25/lib/libm.so.6 
(0x00007f3c2e9a7000)
        libgcc_s.so.1 => 
/gnu/store/b3z4d4zjibqix6pn58q6b1rgfhrarcaq-gcc-7.1.0-lib/lib/libgcc_s.so.1 
(0x00007f3c2e790000)
        libc.so.6 => 
/gnu/store/rmjlycdgiq8pfy5hfi42qhw3k7p6kdav-glibc-2.25/lib/libc.so.6 
(0x00007f3c2e3f1000)
        
/gnu/store/rmjlycdgiq8pfy5hfi42qhw3k7p6kdav-glibc-2.25/lib/ld-linux-x86-64.so.2 
(0x00007f3c2f039000)

Anything I am missing? 

Maybe it is logical but I want to link against $HOME/opt/store/... so I can run 
guix-daemon outside
proot. 

Note it still runs in proot:

   proot -0 -b /proc -b /dev -b /etc -r . -b etc_guix/acl:/etc/guix/acl 
guix/guix-daemon --disable-chroot
      warning: daemon is running as root, so using `--build-users-group' is 
highly recommended
      accepted connection from pid 15774, user user

only now the guix client balks with

   error: failed to run download program 
'/home/user/opt/local/libexec/guix/download': No such file or directory

That file actually exists in the proot environment

   ls -l /home/user/opt/local/libexec/guix/download
   -rwxr-xr-x 1 user 502 281 Jul 16 08:11 
/home/user/opt/local/libexec/guix/download

So close to a solution...

Pj.



reply via email to

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