[pacman-dev] [RFC] adding a --sysroot option

Allan McRae allan at archlinux.org
Wed Nov 30 01:51:03 UTC 2016

On 30/11/16 01:58, Andrew Gregory wrote:
> pacman's --root option is regularly (mis)used to use pacman to manage
> a mounted guest system, typically one whose pacman installation is
> currently broken.  We have a few configuration defaults in place to
> make this sort of work, but support is incomplete.  Those defaults
> only actually take effect if the settings haven't been set in
> a configuration file, several options still default to the host system
> resources, and using the guest's pacman configuration requires
> updating all configured paths to the new mounted location.

What use would the current --root option be after this is implemented?
Is this just a bug that --root should already be working exactly like
proposed new option?

> Adding a --sysroot/--chroot option would allow pacman to properly
> operate in a mounted guest system.  At the moment, there are two ways
> we could accomplish this:  prefix all paths with the sysroot or just
> call chroot(2).  Obviously, the problem with chroot(2) is that it
> requires special privileges.  Unfortunately, I think my symbolic
> user/group patch (https://patchwork.archlinux.org/patch/3694/) will
> require chroot to work properly as I can't find any other way to look
> up users/groups in a mounted guest.  So, we may have to implement both
> approaches so that regular users can perform queries but privileged
> users can perform transactions with proper symbolic name support.

Don't we already chroot when running the install scripts?  Is this just
a case of extending that chroot to the entire operation?


More information about the pacman-dev mailing list