summaryrefslogtreecommitdiffstats
path: root/meta/recipes-extended
diff options
context:
space:
mode:
authorAndreas Oberritter <obi@opendreambox.org>2012-03-27 23:33:24 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2012-03-28 10:16:30 +0100
commit265903bdffb10c95ceaf7a892151a50b67939c71 (patch)
tree77d50b7985020d13e68b6a6f26c4aef4c57a6981 /meta/recipes-extended
parentf1f7680263143a67ca345970ab8d3f91d14934a5 (diff)
downloadpoky-265903bdffb10c95ceaf7a892151a50b67939c71.tar.gz
procps: don't print error message with kernel 3.0+
* All procps tools print a message like this when the kernel version consists of only two numbers: | Non-standard uts for running kernel: | release ... gives version code ... * Import a patch from Debian to quieten this message. (From OE-Core rev: ec8c54946572200c4fb779ff1fe2d2848660acab) Signed-off-by: Andreas Oberritter <obi@opendreambox.org> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-extended')
-rw-r--r--meta/recipes-extended/procps/procps-3.2.8/gnu-kbsd-version.patch44
-rw-r--r--meta/recipes-extended/procps/procps_3.2.8.bb3
2 files changed, 46 insertions, 1 deletions
diff --git a/meta/recipes-extended/procps/procps-3.2.8/gnu-kbsd-version.patch b/meta/recipes-extended/procps/procps-3.2.8/gnu-kbsd-version.patch
new file mode 100644
index 0000000000..2582857e25
--- /dev/null
+++ b/meta/recipes-extended/procps/procps-3.2.8/gnu-kbsd-version.patch
@@ -0,0 +1,44 @@
1Upstream-Status: Inappropriate [not author, no upstream]
2
3Imported from Debian.
4Source: http://anonscm.debian.org/gitweb/?p=collab-maint/procps.git;a=blob;f=debian/patches/gnu-kbsd-version.patch;h=fe5489fc772a3355ff8c0dcf9b953bf0c05aa9f8;hb=b460cfd726b019f8d918b380f78af4c19c5f3e50
5Bugtracker: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=632749
6
7Stops procps utilities from printing a warning when used with
8kernels having only two digit versions, e.g. 3.0.
9
10Author: <csmall@debian.org>
11Description: Rework version parsing so its ok with other OSes
12--- a/proc/version.c
13+++ b/proc/version.c
14@@ -35,15 +35,23 @@
15
16 static void init_Linux_version(void) __attribute__((constructor));
17 static void init_Linux_version(void) {
18- static struct utsname uts;
19- int x = 0, y = 0, z = 0; /* cleared in case sscanf() < 3 */
20+ int x = 0, y = 0, z = 0; /* cleared in case sscanf() < 2 */
21+ FILE *fp;
22+ char buf[256];
23
24- if (uname(&uts) == -1) /* failure implies impending death */
25- exit(1);
26- if (sscanf(uts.release, "%d.%d.%d", &x, &y, &z) < 3)
27+ if ( (fp=fopen("/proc/version","r")) == NULL) /* failure implies impending death */
28+ exit(1);
29+ if (fgets(buf, 256, fp) == NULL) {
30+ fprintf(stderr, "Cannot read kernel version from /proc/version\n");
31+ fclose(fp);
32+ exit(1);
33+ }
34+ fclose(fp);
35+ if (sscanf(buf, "Linux version %d.%d.%d", &x, &y, &z) < 2)
36 fprintf(stderr, /* *very* unlikely to happen by accident */
37 "Non-standard uts for running kernel:\n"
38- "release %s=%d.%d.%d gives version code %d\n",
39- uts.release, x, y, z, LINUX_VERSION(x,y,z));
40+ "release %s=%d.%d.%d gives version code %d\n",
41+ buf,
42+ x, y, z, LINUX_VERSION(x,y,z));
43 linux_version_code = LINUX_VERSION(x, y, z);
44 }
diff --git a/meta/recipes-extended/procps/procps_3.2.8.bb b/meta/recipes-extended/procps/procps_3.2.8.bb
index 683badc2f9..dfae0b8f22 100644
--- a/meta/recipes-extended/procps/procps_3.2.8.bb
+++ b/meta/recipes-extended/procps/procps_3.2.8.bb
@@ -1,6 +1,6 @@
1require procps.inc 1require procps.inc
2 2
3PR = "r6" 3PR = "r7"
4 4
5inherit update-alternatives 5inherit update-alternatives
6 6
@@ -14,6 +14,7 @@ SRC_URI += "file://procmodule.patch \
14 file://linux-limits.patch \ 14 file://linux-limits.patch \
15 file://sysctl.conf \ 15 file://sysctl.conf \
16 file://procps-3.2.8+gmake-3.82.patch \ 16 file://procps-3.2.8+gmake-3.82.patch \
17 file://gnu-kbsd-version.patch \
17 " 18 "
18 19
19SRC_URI[md5sum] = "9532714b6846013ca9898984ba4cd7e0" 20SRC_URI[md5sum] = "9532714b6846013ca9898984ba4cd7e0"