diff options
| author | Leandro Pereira <leandro@hardinfo.org> | 2019-06-29 22:35:53 -0700 | 
|---|---|---|
| committer | Leandro Pereira <leandro@hardinfo.org> | 2019-06-29 22:35:53 -0700 | 
| commit | 2bf1a0317f479ee32f3a16be3f1bc22a99709da7 (patch) | |
| tree | fefdd121486c2c0cd60fecc654f053f4d64e4cd5 | |
| parent | c9d00c85af88085df1427e72dea11b836f409cd3 (diff) | |
Show kernel command line
| -rw-r--r-- | includes/computer.h | 1 | ||||
| -rw-r--r-- | modules/computer.c | 2 | ||||
| -rw-r--r-- | modules/computer/os.c | 1 | 
3 files changed, 4 insertions, 0 deletions
| diff --git a/includes/computer.h b/includes/computer.h index 57da9db3..fe427ef8 100644 --- a/includes/computer.h +++ b/includes/computer.h @@ -92,6 +92,7 @@ struct _Computer {  struct _OperatingSystem {      gchar *kernel; +    gchar *kcmdline;      gchar *libc;      gchar *distrocode;      gchar *distro; diff --git a/modules/computer.c b/modules/computer.c index 4a893dac..80d8ba2b 100644 --- a/modules/computer.c +++ b/modules/computer.c @@ -555,6 +555,7 @@ gchar *callback_os(void)      info_add_group(info, _("Version"),          info_field(_("Kernel"), computer->os->kernel), +        info_field(_("Command Line"), computer->os->kcmdline ? : _("Unknown")),          info_field(_("Version"), computer->os->kernel_version),          info_field(_("C Library"), computer->os->libc),          distro, @@ -971,6 +972,7 @@ void hi_module_deinit(void)      if (computer->os) {          g_free(computer->os->kernel); +        g_free(computer->os->kcmdline);          g_free(computer->os->libc);          g_free(computer->os->distrocode);          g_free(computer->os->distro); diff --git a/modules/computer/os.c b/modules/computer/os.c index 9d30b15e..d7710151 100644 --- a/modules/computer/os.c +++ b/modules/computer/os.c @@ -516,6 +516,7 @@ computer_get_os(void)      os->kernel_version = g_strdup(utsbuf.version);      os->kernel = g_strdup_printf("%s %s (%s)", utsbuf.sysname,  				 utsbuf.release, utsbuf.machine); +    os->kcmdline = h_sysfs_read_string("/proc", "cmdline");      os->hostname = g_strdup(utsbuf.nodename);      os->language = computer_get_language();      os->homedir = g_strdup(g_get_home_dir()); | 
