diff options
author | Harald Hoyer <harald@redhat.com> | 2013-02-14 11:26:07 +0100 |
---|---|---|
committer | Auke Kok <auke-jan.h.kok@intel.com> | 2013-02-14 11:59:16 -0800 |
commit | e93450c6c053d7499971a2b1310e893978f67f74 (patch) | |
tree | 3dfd0209b4df51c4157f564281691f2b843e1776 /src/bootchart/svg.c | |
parent | b823b5e272d07d31c12625a268e8d563289a4db5 (diff) |
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/svg.c')
-rw-r--r-- | src/bootchart/svg.c | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/src/bootchart/svg.c b/src/bootchart/svg.c index dc55cb3797..414d7af9b9 100644 --- a/src/bootchart/svg.c +++ b/src/bootchart/svg.c @@ -140,7 +140,7 @@ static void svg_header(void) } -static void svg_title(void) +static void svg_title(const char *build) { char cmdline[256] = ""; char filename[PATH_MAX]; @@ -149,7 +149,6 @@ static void svg_title(void) char model[256] = "Unknown"; char date[256] = "Unknown"; char cpu[256] = "Unknown"; - char build[256] = "Unknown"; char *c; FILE *f; time_t t; @@ -201,14 +200,6 @@ static void svg_title(void) fclose(f); } - /* Build - 1st line from /etc/system-release */ - f = fopen("/etc/system-release", "r"); - if (f) { - if (fgets(buf, 255, f)) - strncpy(build, buf, 255); - fclose(f); - } - svg("<text class=\"t1\" x=\"0\" y=\"30\">Bootchart for %s - %s</text>\n", uts.nodename, date); svg("<text class=\"t2\" x=\"20\" y=\"50\">System: %s %s %s %s</text>\n", @@ -1053,7 +1044,7 @@ static void svg_top_ten_pss(void) } -void svg_do(void) +void svg_do(const char *build) { struct ps_struct *ps; @@ -1106,7 +1097,7 @@ void svg_do(void) svg("</g>\n\n"); svg("<g transform=\"translate(10, 0)\">\n"); - svg_title(); + svg_title(build); svg("</g>\n\n"); svg("<g transform=\"translate(10,200)\">\n"); |