chiark / gitweb /
util: add Debian welcome message
authorSedat Dilek <sedat.dilek@googlemail.com>
Sun, 12 Sep 2010 21:17:05 +0000 (23:17 +0200)
committerLennart Poettering <lennart@poettering.net>
Mon, 13 Sep 2010 16:03:00 +0000 (18:03 +0200)
Hi,

after talked with Michael on IRC, here is the patch to see a systemd
Welcome message on Debian systems.
FYI: I had to remove "quiet" from Kernel-command-line to see it.

"Stolen from Gentoo" :-) [1,2]?

Kind Regards,
- Sedat -

[1] http://lists.freedesktop.org/archives/systemd-devel/2010-September/000267.html
[2] http://cgit.freedesktop.org/systemd/commit/?id=0d37b36b2890fdf8149d12460ebb00822e555977

From 76d860ca774cb8724de25c3ed3c455ebe5d548e3 Mon Sep 17 00:00:00 2001
From: Sedat Dilek <sedat.dilek@gmail.com>
Date: Sun, 12 Sep 2010 23:02:22 +0200
Subject: [PATCH] util: add Debian welcome message

Include the "Debian" string as /etc/debian_version contains only the Distribution name like "squeeze".
Use Light Red color for Debian.

Based on a proposal patch of Michael Biebl <biebl@debian.org>

src/util.c

index ec3df946424d57ed3bec12ebcaddad3b45d4c971..b4beb2d796e4b0f9103da8110da65012a015b64f 100644 (file)
@@ -2835,6 +2835,7 @@ void status_welcome(void) {
 
         status_printf("Welcome to \x1B[0;32m%s\x1B[0m!\n", r); /* Green for SUSE */
         free(r);
+
 #elif defined(TARGET_GENTOO)
         char *r;
 
@@ -2846,6 +2847,18 @@ void status_welcome(void) {
         status_printf("Welcome to \x1B[1;34m%s\x1B[0m!\n", r); /* Light Blue for Gentoo */
 
         free(r);
+
+#elif defined(TARGET_DEBIAN)
+       char *r;
+
+       if (read_one_line_file("/etc/debian_version", &r) < 0)
+               return;
+
+       truncate_nl(r);
+
+       status_printf("Welcome to Debian \x1B[1;31m%s\x1B[0m!\n", r); /* Light Red for Debian */
+
+       free(r);
 #else
 #warning "You probably should add a welcome text logic here."
 #endif