ostree
ostree copied to clipboard
error: Not a regular file or symlink: S.gpg-agent.extra
Trying to save SD card partition into freshly created .osrepo fails.
✗ sudo ostree --repo=.osrepo commit --branch manjaro /run/media/root/ROOT/
error: Not a regular file or symlink: S.gpg-agent.extra
The mounted SD card content is unpacked Manjaro Linux for ARM.
Thanks for the report. It sounds like you are trying to commit a Unix socket (S.gpg-agent.extra), is that intended?
@lucab I am not sure how such socket may exist on a SD card mount. I didn't expect any sockets in this case.
Did you ever boot from that SD card? It might just be remnants from gpg-agent starting in a homedir on there. You should be able to remove that file and try again.
@jlebon if I remember correctly, I needed ostree to remaster Manjaro image for Raspberry PI. The image is probably never booted, or at least never booted into user session. It might be repeatable with Manjaro image.
There is indeed a socket file in that image (/tmp/img is my temporary mountpoint):
$ sha256sum Manjaro-ARM-kde-plasma-rpi4-20.10.img
f51969cc5fa1f777b53bef210820d904635c89e4ae430af0465744a553cb2fbe Manjaro-ARM-kde-plasma-rpi4-20.10.img
$ find /tmp/img -name 'S.gpg-agent.extra'
/tmp/img/etc/pacman.d/gnupg/S.gpg-agent.extra
$ stat /tmp/img/etc/pacman.d/gnupg/S.gpg-agent.extra
File: /tmp/img/etc/pacman.d/gnupg/S.gpg-agent.extra
Size: 0 Blocks: 0 IO Block: 4096 socket
Device: 700h/1792d Inode: 131801 Links: 1
Access: (0700/srwx------) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2020-10-12 20:15:59.501126108 +0000
Modify: 2020-10-12 20:15:59.501126108 +0000
Change: 2020-10-12 20:28:29.630358615 +0000
Birth: 2020-10-12 20:28:29.630358615 +0000
Related to this, while reviewing https://github.com/ostreedev/ostree/pull/2242, I realized that the archive import API supports a ignore_unsupported_content flag. We could extend that for directory commits too and expose it as e.g. ostree commit --ignore-unsupported-content.
My original goal was to use ostree to modify Linux images that are written to SD card. Is it safe to ignore such sockets on a filesystem? They will be removed in resulting image, right?
From https://wiki.archlinux.org/index.php/Pacman/Package_signing, it seems that the pacman trusted keys are simply stored in a GnuPG homedir there. Pacman will be of little use to you on an ostree system since it will be immutable, so you could just wipe the whole directory and probably never notice. However, If you want to retain that, just delete any leftover sockets there. GnuPG names them all beginning with S. and will recreate them as necessary. So, just rm -f etc/pacman.d/gnupg/S.* before committing should be fine.
Generally there's a bit of cleanup to do before committing an OS because any configuration or state in the tree would later be distributed to everyone and that might not be correct. So, while it might work fine to mount an image and throw it all into a commit, it's likely you'll want to trim some things out like this.
I hoped to use ostree as a generic version control system while working on that image. Using git for that purpose is impractical due to the image size. Losing information from the image is also not practical, so I guess ostree just doesn't fit the use case.
@abitrolly to the best of my knowledge, the socket file in the image is a leftover/mistake. As this is an inert image, there is no process anymore alive that can accept connections on that unix socket, which is effectively a dead entry in the filesystem. If that makes sense, would you mind opening a bug to the distro in order to have it filtered out of the image?
@jlebon I'm not too familiar with the API, are you suggesting a list of specific unsupported things to ignore or a plain "keep-going on all unsupported" switch?
It would be great if we could ignore sockets instead of failing the whole commit.