summaryrefslogtreecommitdiffstats
path: root/src/bootchart/bootchart.c
diff options
context:
space:
mode:
authorHarald Hoyer <harald@redhat.com>2013-02-14 11:26:07 +0100
committerAuke Kok <auke-jan.h.kok@intel.com>2013-02-14 20:59:16 +0100
commite93450c6c053d7499971a2b1310e893978f67f74 (patch)
tree3dfd0209b4df51c4157f564281691f2b843e1776 /src/bootchart/bootchart.c
parentbootchart: more fixes for bootchart in the initramfs (diff)
downloadsystemd-e93450c6c053d7499971a2b1310e893978f67f74.tar.xz
systemd-e93450c6c053d7499971a2b1310e893978f67f74.zip
bootchart: parse /etc/os-release rather than system-release
Also parse it early, so that we can get it in the initramfs.
Diffstat (limited to 'src/bootchart/bootchart.c')
-rw-r--r--src/bootchart/bootchart.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/bootchart/bootchart.c b/src/bootchart/bootchart.c
index e34c08a5eb..7affacfdbf 100644
--- a/src/bootchart/bootchart.c
+++ b/src/bootchart/bootchart.c
@@ -82,6 +82,7 @@ static void signal_handler(int sig)
int main(int argc, char *argv[])
{
+ _cleanup_free_ char *build = NULL;
struct sigaction sig;
struct ps_struct *ps;
char output_file[PATH_MAX];
@@ -280,6 +281,12 @@ int main(int argc, char *argv[])
sysfd = open("/sys", O_RDONLY);
}
+ if (!build) {
+ parse_env_file("/etc/os-release", NEWLINE,
+ "PRETTY_NAME", &build,
+ NULL);
+ }
+
/* wait for /proc to become available, discarding samples */
if (!(graph_start > 0.0))
log_uptime();
@@ -350,7 +357,7 @@ int main(int argc, char *argv[])
exit (EXIT_FAILURE);
}
- svg_do();
+ svg_do(build);
fprintf(stderr, "bootchartd: Wrote %s\n", output_file);
fclose(of);