aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2012-07-17 20:48:28 +0200
committerTom Gundersen <teg@jklm.no>2012-07-17 20:48:28 +0200
commite9b4330e9410f43dfe8b95b892b735175774f113 (patch)
tree3f49bc6e1e82940f1cce9b8e41d51d9a18b242d2
parentc1055b68263e5f1b79d7b92ad79d375e224ef076 (diff)
downloadinitscripts-e9b4330e9410f43dfe8b95b892b735175774f113.tar.xz
os-release: factor out distro name/url
This should make the lives of our downstreams slightly simpler by not having to patch rc.sysinit, but rather just ship their own /etc/os-release. Signed-off-by: Tom Gundersen <teg@jklm.no>
-rw-r--r--functions10
-rwxr-xr-xrc.sysinit6
2 files changed, 12 insertions, 4 deletions
diff --git a/functions b/functions
index 794766c..d7b2026 100644
--- a/functions
+++ b/functions
@@ -335,6 +335,16 @@ kill_all() {
fi
}
+print_welcome() {
+ # see os-release(5)
+ . /etc/os-release
+
+ echo " "
+ printhl "${PRETTY_NAME}\n"
+ printhl "${C_H2}${HOME_URL}"
+ printsep
+}
+
load_modules() {
local rc=0
diff --git a/rc.sysinit b/rc.sysinit
index c031531..8a3c5a4 100755
--- a/rc.sysinit
+++ b/rc.sysinit
@@ -12,10 +12,8 @@ elif [[ $LOCALE ]]; then
export LANG=$LOCALE
fi
-echo " "
-printhl "Arch Linux\n"
-printhl "${C_H2}https://www.archlinux.org"
-printsep
+# Prints distro name and URL
+print_welcome
# mount the API filesystems
# /proc, /sys, /run, /dev, /run/lock, /dev/pts, /dev/shm