You are not logged in.

#1 2013-06-06 13:53:30

starfry
Member
From: Surrey, UK
Registered: 2010-08-18
Posts: 238

mkarchroot fails if '/etc/pacman.d/gnupg' does not exist

I had an issue with one of my build boxes yesterday - suddenly my build script, which uses mkarchroot, failed. It failed with the below error:

cp: cannot stat '/etc/pacman.d/gnupg': No such file or directory

When investigating the problem, I discovered that mkarchroot has some new code at the end that invokes locale-gen using a new script called arch-nspawn that has been recently added to devtools (around 2013-05-02). It is arch-nspawn that attempts to copy "/etc/pacman.d/gnupg". If, for whatever reason, the host does not have that directory then the command will fail, which causes mkarchroot to fail.

Previously, mkarchroot worked fine without the presence of "/etc/pacman.d/gnupg" but now it doesn't.  I am unsure whether this would be seen as a bug.

This also made me think about the side-effect of copying the host's keyring into the new chroot (which may then end up copied to another host, thus giving two hosts with the same pacman keyring master key). According to this post, that is a bad thing. This isn't an area that I know much so I don't really know how bad that is in reality. I've read about a "pacman-init" service that creates a new key on each boot in a tmpfs but can't find any reference to it in the package repos (or aur).

The other thought I had is that the above means the use of arch-nspawn to enter a pre-existing chroot would cause its keys to be overwritten, which may or may not be desirable. I haven't tried this - it's just a thought.

Offline

#2 2013-06-28 21:29:12

falstaff_ch
Member
Registered: 2013-06-09
Posts: 28

Re: mkarchroot fails if '/etc/pacman.d/gnupg' does not exist

I encountered the exactly same issue. One can create new GPG-Keys for pacman easily using:

pacman-key --init

But as starfry already suspects I think too, this is actually a bug..

Offline

Board footer

Powered by FluxBB