Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mkosi initrd fails on stale pacman sockets #2547

Closed
keszybz opened this issue Mar 23, 2024 · 0 comments · Fixed by #2550
Closed

mkosi initrd fails on stale pacman sockets #2547

keszybz opened this issue Mar 23, 2024 · 0 comments · Fixed by #2550
Labels

Comments

@keszybz
Copy link
Member

keszybz commented Mar 23, 2024

$ rpm -q mkosi mkosi-initrd              
mkosi-22-1.fc40.noarch
mkosi-initrd-22-1.fc40.noarch
$ sudo kernel-install -v add 6.8.1-300.fc40.x86_64 /lib/modules/6.8.1-300.fc40.x86_64/vmlinuz
..
Successfully forked off '(direxec)' as PID 12339.
cp: cannot open '/etc/pacman.d/gnupg/S.gpg-agent' for reading: No such device or address
cp: cannot open '/etc/pacman.d/gnupg/S.gpg-agent.extra' for reading: No such device or address
cp: cannot open '/etc/pacman.d/gnupg/S.gpg-agent.browser' for reading: No such device or address
cp: cannot open '/etc/pacman.d/gnupg/S.gpg-agent.ssh' for reading: No such device or address
‣ "cp --recursive --dereference --preserve=mode,links,timestamps,ownership,xattr --reflink=auto --copy-contents /etc/pacman.d /tmp/tmp4t5oozng/etc/pacman.d --no-target-directory" returned non-zero exit code 1.
/usr/lib/kernel/install.d/50-mkosi.install failed with exit status 1.
/usr/lib/kernel/install.d/50-mkosi.install failed with exit status 1.
(sd-exec-strv) failed with exit status 1.
$ ls -l /etc/pacman.d/gnupg/S.gpg-agent                                         
srwx------ 1 root root 0 Jan 22 10:58 /etc/pacman.d/gnupg/S.gpg-agent
$ file /etc/pacman.d/gnupg/S.gpg-agent                                  
/etc/pacman.d/gnupg/S.gpg-agent: socket

I don't know what created that socket there… But probably, anything that is not a file or directory should not be copied.

DaanDeMeyer added a commit to DaanDeMeyer/mkosi that referenced this issue Mar 25, 2024
These should be created in /run but gpg's logic for that is broken
for the root user (it checks for /run/user/0 which will never exist)
so the sockets are created in the gpg home dir (/etc/pacman.d/gnupg)
instead. Let's make sure we don't try to copy those as they cause issues
with cp -R.

Fixes systemd#2547
DaanDeMeyer added a commit to DaanDeMeyer/mkosi that referenced this issue Mar 25, 2024
These should be created in /run but gpg's logic for that is broken
for the root user (it checks for /run/user/0 which will never exist)
so the sockets are created in the gpg home dir (/etc/pacman.d/gnupg)
instead. Let's make sure we don't try to copy those as they cause issues
with cp -R.

Fixes systemd#2547
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging a pull request may close this issue.

2 participants