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

Re: sbuild on hurd-amd64...



Hi,

Quoting Samuel Thibault (2025-09-06 07:52:42)
> Johannes Schauer Marin Rodrigues, le sam. 06 sept. 2025 03:08:50 +0200, a ecrit:
> > > > Also, can we tell mmdebstrap to use the normal chroot instead of
> > > > fakechroot? chroot() is not a privileged operation in the Hurd.
> > > Oh, I wasn't aware of that!
> > 
> > Yes. If you have privileges to chroot(), you can just use --mode=root.
> 
> But currently none of the expected ways work as non-root:
> 
> $ mmdebstrap --mode=root --variant=required --keyring=/usr/share/keyrings/debian-ports-archive-keyring.gpg '' foo.tar.gz 'deb http://deb.debian.org/debian-ports unreleased main' 'deb http://deb.debian.org/debian-ports/ unstable main'
> E: need to be root

Would/should the above work as the non-root user on hurd? Because it'd be easy
to either special-case the check for $EFFECTIVE_USER_ID and/or by adding an
option --skip=check/root which disables this check.

> with additionnal fakeroot-hurd:
> $ fakeroot-hurd mmdebstrap --mode=root --variant=required --keyring=/usr/share/keyrings/debian-ports-archive-keyring.gpg '' foo.tar.gz 'deb http://deb.debian.org/debian-ports unreleased main' 'deb http://deb.debian.org/debian-ports/ unstable main' 
> Undefined subroutine &main::SYS_capget called at /usr/bin/mmdebstrap line 6081.
> /bin/fakeauth: Error 255 for child 23498
> /bin/settrans: Error 255 for child 23497

This is because in Linux it is possible to be uid 0 but still not be able to
mount anything. The above uses the capget and later the prctl syscalls to
figure out whether mounting is possible or not.

We can do multiple things here:

 * it seems there is no capget on hurd, so mmdebstrap should not even attempt
   this codepath on hurd
 * similar to the above, a --skip=check/canmount option can be added to
   skip the check manually
 * instead, maybe a different check can/should be performed on hurd but i
   don't know enough hurd to implement this

> $ mmdebstrap --mode=fakeroot --variant=required --keyring=/usr/share/keyrings/debian-ports-archive-keyring.gpg '' foo.tar.gz 'deb http://deb.debian.org/debian-ports unreleased main' 'deb http://deb.debian.org/debian-ports/ unstable main' 
> E: need working fakechroot binary
> 
> on GNU/Hurd it should be using chroot instead of using the fragile
> fakechroot. I had tried to create a hurdish fakechroot that just calls
> chroot(), but apparently mmdebstrap is expecting various fakechroot
> environment variables, I didn't easily manage to find out what.

Instead of you creating a fakechroot for hurd which is close enough to the
fakechroot on linux, lets instead fix mmdebstrap to do the right thing on
hurd out-of-the-box. I'll gladly accept patches!

> fakeroot-tcp/sysv is indeed difficult to fix. fakeroot-hurd, however, is
> based on the auth partial subhurd, which thus just works.
>
> So in the end one can just use fakeroot-hurd + chroot.

Oooh, it's a different fakeroot! Yes, my complaints are only about fakeroot
with tcp/sysv.

I can easily implement the --skip=... options mentioned above but I'll need
help with adding hurd-specific things. If you have the time/energy/motivation
I gladly accept patches either via mail, via a salsa MR or via a MR in the
upstream git forge: https://gitlab.mister-muffin.de/josch/mmdebstrap

For the latter, I'd need to manually create an account for you. I disabled
account creation because I'm unable to keep up with cleaning up the spam
created either by AI bots or by exploited workers somewhere...

Thanks!

cheers, josch

Attachment: signature.asc
Description: signature


Reply to: