wok-6.x rev 695

hardinfo: add boot parameters
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sat Apr 26 10:28:00 2008 +0000 (2008-04-26)
parents c5069bc9ff25
children 7bd5e34e4a45
files hardinfo/stuff/boots.patch
line diff
     1.1 --- a/hardinfo/stuff/boots.patch	Sat Apr 26 09:24:27 2008 +0000
     1.2 +++ b/hardinfo/stuff/boots.patch	Sat Apr 26 10:28:00 2008 +0000
     1.3 @@ -1,6 +1,6 @@
     1.4  --- arch/linux/common/boots.h	2008-04-26 10:38:31.000000000 +0200
     1.5  +++ arch/linux/common/boots.h	2008-04-26 11:15:20.000000000 +0200
     1.6 -@@ -16,11 +16,17 @@
     1.7 +@@ -16,11 +16,19 @@
     1.8    *    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
     1.9    */
    1.10   
    1.11 @@ -12,6 +12,8 @@
    1.12   {
    1.13  -    FILE *last;
    1.14  -    char buffer[256];
    1.15 ++    FILE *dev;
    1.16 ++    char buffer[2048];
    1.17  +    struct sysinfo info;
    1.18  +    struct utsname uname_info;
    1.19  +    time_t now;
    1.20 @@ -20,7 +22,7 @@
    1.21   
    1.22       scan_os(FALSE);
    1.23   
    1.24 -@@ -29,33 +35,13 @@
    1.25 +@@ -29,33 +37,20 @@
    1.26       else
    1.27         return;
    1.28       
    1.29 @@ -62,4 +64,11 @@
    1.30  +    date[i] = 0;
    1.31  +    computer->os->boots = h_strdup_cprintf("\n%s=Kernel %s",
    1.32  +		computer->os->boots, date, uname_info.release);
    1.33 ++    dev = fopen("/proc/cmdline", "r");
    1.34 ++    if (!dev)
    1.35 ++	return;
    1.36 ++    if (fgets(buffer, sizeof(buffer), dev)) 
    1.37 ++	computer->os->boots = h_strdup_cprintf("\nBoot options=%s",
    1.38 ++		computer->os->boots, buffer);
    1.39 ++    fclose(dev);
    1.40   }