Arch Linux

Please read this before reporting a bug:

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!

FS#49347 - {arch-install-scripts} pacstrap maybe should set --hookdir

Attached to Project: Arch Linux
Opened by Gerardo Exequiel Pozzi (djgera) - Sunday, 15 May 2016, 20:48 GMT
Last edited by Dave Reisner (falconindy) - Tuesday, 08 September 2020, 22:18 GMT
Task Type Bug Report
Category Arch Projects
Status Assigned
Assigned To No-one
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 0%
Votes 3
Private No


While building archiso, it uses pacstrap, I see custom hooks made in my system in /etc/pacman.d/hooks running inside the $newroot. I guess should be an option to avoid this from command line or set by default to $newroot/etc/pacman.d/hooks via --hookdir. (Note using defaults: unset HookDir option)

arch-install-scripts 15-1
Comment by Dave Reisner (falconindy) - Monday, 16 May 2016, 12:46 GMT
I think this is something to fix in pacman itself. The default hookdir should be assumed to be relative to the root, in the same way that the DBPath is. Otherwise, you risk Bad Things™ happening due to the two not being in sync.
Comment by Gerardo Exequiel Pozzi (djgera) - Monday, 16 May 2016, 22:13 GMT
Yes Dave, I was initially surprised first, indeed I first think opening a ticket for pacman, but later reading pacman manpages seems to be the desired bahavior. In any case, the documentation seems to be confused al least for options about paths.

In any case I opened a ticket for pacman and --hookdir parameter. FS#49349
Comment by Allan McRae (Allan) - Monday, 16 May 2016, 22:33 GMT
Hrm... in terms of being relative to the root --hookdir is acting the same as --dbpath and --config.
Comment by Andrew Gregory (andrewgregory) - Tuesday, 17 May 2016, 01:05 GMT
I think it would be okay to default HookDir relative to RootDir. But, regarding "Bad Things", -r is already dangerous when (mis)used this way. -r is not equivalent to a chroot, as many people seem to assume. It is just a path prefix determining where package files are extracted. The host config is still used, including DBPath and LogFile if they have been set. So, Bad Things™ can easily still happen even with paths defaulting under RootDir; we just don't see that because most people don't set those options. What we probably need is something like a --chroot option that gets prepended to all configuration paths even if they are manually set.
Comment by Allan McRae (Allan) - Saturday, 14 January 2017, 07:30 GMT
Unassigning myself - I am assigned to the bug on the pacman end.
Comment by Eli Schwartz (eschwartz) - Tuesday, 31 July 2018, 23:33 GMT
This would be fixed by using --sysroot instead, cf. FS#58778
Comment by Conrad Hoffmann (conrausch) - Tuesday, 08 September 2020, 20:55 GMT
I am pretty sure that this is not a pacstrap problem. To bootstrap anything from scratch, one has to start with _some_ config for pacman (read: the host's config), so --sysroot is certainly not an option. I think it is fair to assume that the (pacstrap) caller's config is in a state fit for the task. I have never used archiso, but looking at it seems they even supply their own pacman.conf (by now?). As such, either they should make sure not to include custom hooks there, or maybe they want to allow custom hooks to achieve certain things, then they should document that the (archiso) caller has to make sure the configured hooks are approriate.

Thoughts? :)