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 Jelle van der Waa (jelly) - Monday, 18 September 2023, 17:53 GMT
Task Type Bug Report
Category Arch Projects
Status Closed
Assigned To No-one
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 3
Private No

Details

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
Closed by  Jelle van der Waa (jelly)
Monday, 18 September 2023, 17:53 GMT
Reason for closing:  Moved
Additional comments about closing:  https://gitlab.archlinux.org/archlinux/a rch-install-scripts/issues/60
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 https://wiki.archlinux.org/index.php/archiso#Profile_structure 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? :)
Comment by Buggy McBugFace (bugbot) - Tuesday, 08 August 2023, 19:11 GMT
This is an automated comment as this bug is open for more then 2 years. Please reply if you still experience this bug otherwise this issue will be closed after 1 month.

Loading...