Cross debootstrap without root rights

2020-02-09 Thread Christoph Müllner
Hi Debian users,

I'd like to run the second stage of debootstrap without root rights,
but for another architecture (host is x86_64 and target is arm64).

I know how to do all that with root rights (i.e qemu-aarch64-static works
perfectly here,
also, I can recommend using qemu-debootstrap), but I can't figure out a way
how to do
that without root rights.

I was expecting that fakechroot and fakeroot will do the necessary "magic"
to make chroot work for my use-case, but that's not the case (I need to
have libfakeroot.so
and libfakechroot.so in the target rootfs, but I could not find a reliable
way to get them in).

I found some emails in the archives about similar use cases (from ~10 years
ago).
But I failed to identify the solution in those cases.

Therefore I'd like to ask if anyone has a solution for my use case or some
hints/pointers.

Thanks,
Christoph


Re: Cross debootstrap without root rights

2020-02-09 Thread Christoph Müllner
Hi Jonas,

thanks for the pointer.
I was hoping for a solution like mmdebstrap.
Will give it a try or will at least use it as inspiration.

Thanks a lot,
Christoph


On Sun, Feb 9, 2020 at 1:25 PM Jonas Smedegaard  wrote:

> Hi Christoph,
>
> Quoting Christoph Müllner (2020-02-09 12:54:56)
> > I'd like to run the second stage of debootstrap without root rights,
> > but for another architecture (host is x86_64 and target is arm64).
> >
> > I know how to do all that with root rights (i.e qemu-aarch64-static
> > works perfectly here, also, I can recommend using qemu-debootstrap),
> > but I can't figure out a way how to do that without root rights.
> >
> > I was expecting that fakechroot and fakeroot will do the necessary
> > "magic" to make chroot work for my use-case, but that's not the case
> > (I need to have libfakeroot.so and libfakechroot.so in the target
> > rootfs, but I could not find a reliable way to get them in).
> >
> > I found some emails in the archives about similar use cases (from ~10
> > years ago). But I failed to identify the solution in those cases.
> >
> > Therefore I'd like to ask if anyone has a solution for my use case or
> > some hints/pointers.
>
> Have a look at mmdebstrap!
>
> The author of that tool - Johannes Schauer - has long fought for ways to
> eliminate the need for being root to bootstrap Debian, and mmdebstrap is
> as I understand it the state of the art of that!
>
>
>  - Jonas
>
> --
>  * Jonas Smedegaard - idealist & Internet-arkitekt
>  * Tlf.: +45 40843136  Website: http://dr.jones.dk/
>
>  [x] quote me freely  [ ] ask before reusing  [ ] keep private
>


Re: Cross debootstrap without root rights

2020-02-09 Thread Christoph Müllner
Hi Hector,

thanks for the pointer to debos.
That tool seems to fit quite well (especially the ability to invoke user
scripts for customizations),
although access to /dev/kvm is quite some price to pay (but already much
much better than root rights).

Thanks a lot,
Christoph

On Sun, Feb 9, 2020 at 6:14 PM Hector Oron  wrote:
>
> Hello Christoph,
>
> Missatge de Christoph Müllner  del dia dg., 9
> de febr. 2020 a les 12:55:
>
> > I was expecting that fakechroot and fakeroot will do the necessary
"magic"
> > to make chroot work for my use-case, but that's not the case (I need to
have libfakeroot.so
> > and libfakechroot.so in the target rootfs, but I could not find a
reliable way to get them in).
> >
> > I found some emails in the archives about similar use cases (from ~10
years ago).
> > But I failed to identify the solution in those cases.
>
> Nowadays I use debos if I need to create rootless filesystems, you can
> read the following article to get an idea how it works:
> https://ekaia.org/blog/2018/07/03/introducing-debos/
>
> Regards
> --
>  Héctor Orón  -.. . -... .. .- -.   -.. . ...- . .-.. --- .--. . .-.


Re: Cross debootstrap without root rights

2020-02-10 Thread Christoph Müllner
Hi Josch,

[I did not get your email, I just saw it in the mail archives...]

thanks for the overview and the reference to the bug ticket.
I've succeeded with the fakechroot/fakeroot approach and got the required
inspiration for setting LD_LIBRARY_PATH from your tool and
https://bugs.debian.org/855234 <https://bugs.debian.org/829134>
(libsystemd-shared wanted to be found as well).

Thanks for your help,
Christoph

Hi,
>
> (please CC me, I'm not subscribed to d-user@l.d.o)
>
> Quoting Christoph Müllner (2020-02-09 12:54:56)
> > I'd like to run the second stage of debootstrap without root rights, but
> for
> > another architecture (host is x86_64 and target is arm64).
> >
> > I know how to do all that with root rights (i.e qemu-aarch64-static works
> > perfectly here, also, I can recommend using qemu-debootstrap), but I
> can't
> > figure out a way how to do that without root rights.
> >
> > I was expecting that fakechroot and fakeroot will do the necessary
> "magic" to
> > make chroot work for my use-case, but that's not the case (I need to have
> > libfakeroot.so and libfakechroot.so in the target rootfs, but I could not
> > find a reliable way to get them in).
> >
> > I found some emails in the archives about similar use cases (from ~10
> years
> > ago).  But I failed to identify the solution in those cases.
> >
> > Therefore I'd like to ask if anyone has a solution for my use case or
> some
> > hints/pointers.
>
> yes, there are several solutions. Either:
>
> a) You can use mmdebstrap which is a debootstrap replacement that focuses
> on
>not requiring superuser privileges and has foreign architecture support
>built in:
>
>$ mmdebstrap --arch=arm64 unstable debian-unstable.tar
>
> b) There is a proof-of-concept that allows one to run debootstrap with
>unprivileged usernamespaces here: https://bugs.debian.org/829134 This
> will
>probably also work with --second-stage
>
> c) Getting fakechroot and fakeroot to work with foreign architectures is
> tricky
>and requires the right libfakechroot.so being installed and several
>environment variables to be set differently. You can have a look at how
>    mmdebstrap does this so that you can maybe replicate that for
> debootstrap:
>https://sources.debian.org/src/mmdebstrap/0.6.0-4/mmdebstrap/#L1942
>
> Thanks!
>
> cheers, josch
>
> On Sun, Feb 9, 2020 at 12:54 PM Christoph Müllner 
> wrote:
>
>> Hi Debian users,
>>
>> I'd like to run the second stage of debootstrap without root rights,
>> but for another architecture (host is x86_64 and target is arm64).
>>
>> I know how to do all that with root rights (i.e qemu-aarch64-static works
>> perfectly here,
>> also, I can recommend using qemu-debootstrap), but I can't figure out a
>> way how to do
>> that without root rights.
>>
>> I was expecting that fakechroot and fakeroot will do the necessary "magic"
>> to make chroot work for my use-case, but that's not the case (I need to
>> have libfakeroot.so
>> and libfakechroot.so in the target rootfs, but I could not find a
>> reliable way to get them in).
>>
>> I found some emails in the archives about similar use cases (from ~10
>> years ago).
>> But I failed to identify the solution in those cases.
>>
>> Therefore I'd like to ask if anyone has a solution for my use case or
>> some hints/pointers.
>>
>> Thanks,
>> Christoph
>>
>>