Skip to content

Commit

Permalink
Merge pull request #21 from Ratler/systemd_os-release
Browse files Browse the repository at this point in the history
systemd: Generate an os-release file that is shell-compatible
  • Loading branch information
sofar committed Jul 15, 2012
2 parents bea949b + 1c0b8b2 commit 7bec2d8
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 9 deletions.
5 changes: 0 additions & 5 deletions system/systemd/BUILD
Expand Up @@ -17,11 +17,6 @@
# vconsole.conf defaults to us-layout
[ -f /etc/vconsole.conf ] || install -m 0644 -o root -g root $SCRIPT_DIRECTORY/files/vconsole.conf /etc/vconsole.conf &&

# os-release should properly show lunar
# todo: we might replace this with some auto-generated
# values from /etc/lunar.release in the future.
[ -f /etc/os-release ] || install -m 0644 -o root -g root $SCRIPT_DIRECTORY/files/os-release /etc/os-release &&

# last but not least the locale settings, defaulting to US
[ -f /etc/locale.conf ] || install -m 0644 -o root -g root $SCRIPT_DIRECTORY/files/locale.conf /etc/locale.conf &&

Expand Down
20 changes: 20 additions & 0 deletions system/systemd/POST_INSTALL
Expand Up @@ -46,4 +46,24 @@ if [ -n "$SYSTEMD_ERROR" ]; then
read -n 1
fi

# Generate some good default files based on current settings
# /etc/os-release
if [ ! -f /etc/os-release ] || ! grep -q 'HOME_URL' /etc/os-release ; then
if [ -f /etc/lunar.release ]; then
DRELEASE=$(awk '{ print $3 }' /etc/lunar.release | cut -d- -f1)
DCNAME=$(sed 's;.*(\(.*\) -.*;\1;' /etc/lunar.release)
DDESC=$(cat /etc/lunar.release)
DVERSION="$DRELEASE ($DCNAME)"
fi
cat <<EOF > /etc/os-release
NAME="Lunar Linux"
VERSION="$DVERSION"
ID=lunar
VERSION_ID=$DRELEASE
PRETTY_NAME="$DDESC"
ANSI_COLOR="1;34"
HOME_URL="http://lunar-linux.org/"
EOF
fi

lin -c dbus
4 changes: 0 additions & 4 deletions system/systemd/files/os-release

This file was deleted.

0 comments on commit 7bec2d8

Please sign in to comment.