pacman -Q --sysroot "${pacstrap_dir}" can't resolve file:/// repositories in airootfs/etc/pacman.conf
Assuming a airootfs/etc/pacman.conf
:
[options]
HoldPkg = pacman glibc
Architecture = auto
DBPath = /root/packagedb
CacheDir = /root/packages
CheckSpace
SigLevel = Required DatabaseOptional
LocalFileSigLevel = Optional
[mkarchiso]
Server = file:///root/packages/
And we also place the appropriate local mirror under airootfs/root/packages
and a database under airootfs/root/packagedb
.
When https://gitlab.archlinux.org/archlinux/archiso/-/blob/28a3a54c5f28e40a935609de9b092fe0c1cfee24/archiso/mkarchiso#L1738 is executed, --sysroot
doesn't appear to be executed within the confines of the "future system" that we're packaging into the ISO. So /root/packages/
will be resolved to the actual host location, and there's no database there (unless we place one momentarily).
Perhaps we could do something similar to: arch-chroot "${pacstrap_dir}" "pacman --debug -Q > ${?}/pkglist.${arch}.txt"
instead? Or should I report this to pacman repo instead (not sure what implications it would have to change --sysroot behavior)?