init: Fix 65-os-release

Handle /usr/lib/os-release if it exists.
This commit is contained in:
Mikhail Efremov 2021-09-30 19:57:06 +03:00 committed by Anton Midyukov
parent 6c53cd86ad
commit 1754b3b02e

View File

@ -1,13 +1,15 @@
#!/bin/sh
# Install /etc/*-release files if needed
if [ -d /usr/share/branding-data-current ]; then
local rel_file=
for rel_file in altlinux-release os-release; do
if ! [ -e /etc/"$rel_file" ]; then
# in case it is dangling symlink
rm -f /etc/"$rel_file"
rel_file=
for rel_file in altlinux-release os-release; do
if ! [ -e /etc/"$rel_file" ]; then
# in case it is dangling symlink
rm -f /etc/"$rel_file"
if [ -r /usr/share/branding-data-current/release/"$rel_file" ]; then
cp -at /etc -- \
/usr/share/branding-data-current/release/"$rel_file"
elif [ -r /usr/lib/"$rel_file" ]; then
cp -a /usr/lib/"$rel_file" /etc/"$rel_file"
fi
done
fi
fi
done