xbps-src: chroot building pkgs without being root

22 views
Skip to first unread message

Juan RP

unread,
Jan 16, 2010, 12:34:46 AM1/16/10
to xb...@googlegroups.com
Hi,

some hours ago I added code to xbps-src to be able to use your
ordinary user to install packages in the chroot. This is acomplished
currently by using 'capchroot' from Arch Linux.

I'll copy & paste the comment from current xbps-src.conf that
explains all that stuff:

#
# Build packages with your unprivileged user in the chroot
# via capchroot. The only required steps with privileges are
# the bind mounts, a helper script (xbps-src-chroot-helper) needs
# to be run with sudo for this task.
#
# fakeroot is only used for the installation stage via the helper
# script xbps-src-doinst-helper.
#
# capchroot allows ordinary users to use the chroot(2) syscall.
# To make this work, uncomment this option and run the following
# commands (as root):
#
# $ setcap cap_sys_chroot=ep /usr/bin/capchroot
# $ echo "/path/to/masterdir $(whoami)" >> /etc/capchroot.allow
#
#XBPS_USE_CAPCHROOT=yes

I've built (and tested a live image) successfully xbps-base-chroot,
xbps-base-system, xorg, xfce4, firefox and other packages.

So to use it, install capchroot, edit /etc/capchroot.allow,
set the path to your xbps masterdir, add your user/group to it
and uncomment XBPS_USE_CAPCHROOT from xbps-src.conf. You won't
have to use sudo anymore, the only stuff that requires sudo
access is the helper that bind mounts the directories into
the chroot (xbps-src-chroot-helper).

Enjoy!

Reply all
Reply to author
Forward
0 new messages