Skip to content

Add symlink from /etc/os-release to /usr/lib/os-release

Daan De Meyer requested to merge daandemeyer/filesystem:os-release into main

From the systemd os-release man page:

/etc/os-release should be a relative symlink to /usr/lib/os-release, to provide compatibility with applications only looking at /etc/.

While systemd ships a tmpfiles dropin that will make the symlink, when building e.g. portable service images, those might not have systemd itself, and thus won't have the tmpfiles dropin. To make sure all Arch images have the symlink, let's ship it as part of the filesystem package since we already ship /usr/lib/os-release in the filesystem package as well.

We do this in a install script to avoid messing with any existing /etc/os-release files or symlinks. For safety we only create the file symlink if /etc/os-release is not yet a symlink and doesn't exist.

Edited by Daan De Meyer

Merge request reports