From e93450c6c053d7499971a2b1310e893978f67f74 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Thu, 14 Feb 2013 11:26:07 +0100 Subject: bootchart: parse /etc/os-release rather than system-release Also parse it early, so that we can get it in the initramfs. --- src/bootchart/bootchart.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/bootchart/bootchart.c') 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); -- cgit v1.2.3-54-g00ecf