Home | News | Download | Packages | Forum | Wiki | Github

Xbps-src: building packages inside glibc chroot



I’m running x86_64-musl, and I’m trying to build packages for glibc inside a chroot. Is this possible?

I following the instructions for setting up a glibc chroot here: https://wiki.voidlinux.eu/Musl#Glibc_chroot . Then I git cloned void-packages and ran binary-bootstrap

When I try to build packages inside the glibc chroot I get the following error.

ERROR unshare (Operation not permitted)


It requires a few kernel options:

IIRC they are set in /boot/config-$(uname -r) and require reboot


No those are compile time options.


Where can I learn more about the difference? I’m curious because the changes I did some months ago persist across binary updating from void repos; I can use uunshare without problems, and have not made any manual changes since the last couple of kernel updates.

$ cat /boot/config-4.11.4_1 |


Because we activate those options as compile time.

The file is just there to review the config and maybe use it to recompile the kernel with the same options, but your change alone has no effect at all.


I am using the default kernel for voidlinux x86_64-musl and it has these options configured (I double checked /proc/config.gz, they are all there)

I can build packages in my normal environment as an unprivileged user. The problem is I can’t build packages in my glibc chroot even as root.

Is this even the recommended approach? Is there a better way to build glibc packages on x86_64-musl? My glibc chroot works great for installing and running packages already in the xbps repositories. I’m just having issues building new packages for it.

(de69ja) #7

I was going to suggest modifying the following package in Void repositories to find a solution https://www.archlinux.org/packages/community/any/debootstrap/ … but i noticed from the dependencies that gnupg is included,which made me consider this could be a factor with your own chroot.
Ive appreciated your query though - it illicited a thoughtful read https://github.com/voidlinux/void-packages/issues/4147

./xbps-src -m masterdir-glibc -H hostdir-glibc binary-bootstrap x86_64
./xbps-src -m masterdir-glibc -H hostdir-glibc pkg foo

no extra chroot, no root.


Thanks @Duncaen, that did the trick.

Last time I tried that method I neglected to specify the -H param which is why it didn’t work for me. Works now though, and I can install the packages I built in the glibc chroot

EDIT: I take it back, it wasn’t the -H that fixed it. It was that one of the packages I was trying to build earlier was broken, and I just didn’t build that package this time. This still works for building glibc packages though