summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorChen Qi <Qi.Chen@windriver.com>2015-10-29 15:54:12 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-03-20 23:12:26 +0000
commite382d96c6bb04b30e59dbeeb30b4c6e0a549c8ba (patch)
treedd7e161a59ae22666e67a0bc533c4acb9b31f0db /meta
parent3b8cd1db0d388e50c010899352f641d66e73279c (diff)
downloadpoky-e382d96c6bb04b30e59dbeeb30b4c6e0a549c8ba.tar.gz
coreutils: fix reporting 'unknown' by `uname -p' and `uname -i'
This patch make `uname -p' and `uname -i' not reporting 'unknown'. It refers a to Fedora's way to do this. The coreutils upstream rejects to accept this patch, blaming the 'unknown' result to the kernel not providing enough information. As on normal distros, `uname -p' and `uname -i' do not report 'unknown', we refer to Fedora's patch to fix this problem. (From OE-Core rev: 83c551b46e959d9382fa92ac4178c9c6c883d7c1) Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/recipes-core/coreutils/coreutils-8.25/0001-uname-report-processor-and-hardware-correctly.patch64
-rw-r--r--meta/recipes-core/coreutils/coreutils_8.25.bb1
2 files changed, 65 insertions, 0 deletions
diff --git a/meta/recipes-core/coreutils/coreutils-8.25/0001-uname-report-processor-and-hardware-correctly.patch b/meta/recipes-core/coreutils/coreutils-8.25/0001-uname-report-processor-and-hardware-correctly.patch
new file mode 100644
index 0000000000..c5f449f4f0
--- /dev/null
+++ b/meta/recipes-core/coreutils/coreutils-8.25/0001-uname-report-processor-and-hardware-correctly.patch
@@ -0,0 +1,64 @@
1Upstream-Status: Rejected
2
3Subject: uname: report processor and hardware correctly
4
5This patch is rejected by coreutils upstream, but distros like debian and fedora
6uses this patch to make `uname -i' and `uname -p' to not report 'unknown'.
7
8Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
9---
10 src/uname.c | 18 ++++++++++++++++--
11 1 file changed, 16 insertions(+), 2 deletions(-)
12
13diff --git a/src/uname.c b/src/uname.c
14index 39bd28c..c84582d 100644
15--- a/src/uname.c
16+++ b/src/uname.c
17@@ -299,13 +299,19 @@ main (int argc, char **argv)
18
19 if (toprint & PRINT_PROCESSOR)
20 {
21- char const *element = unknown;
22+ char *element = unknown;
23 #if HAVE_SYSINFO && defined SI_ARCHITECTURE
24 {
25 static char processor[257];
26 if (0 <= sysinfo (SI_ARCHITECTURE, processor, sizeof processor))
27 element = processor;
28 }
29+#else
30+ {
31+ static struct utsname u;
32+ uname(&u);
33+ element = u.machine;
34+ }
35 #endif
36 #ifdef UNAME_PROCESSOR
37 if (element == unknown)
38@@ -343,7 +349,7 @@ main (int argc, char **argv)
39
40 if (toprint & PRINT_HARDWARE_PLATFORM)
41 {
42- char const *element = unknown;
43+ char *element = unknown;
44 #if HAVE_SYSINFO && defined SI_PLATFORM
45 {
46 static char hardware_platform[257];
47@@ -361,6 +367,14 @@ main (int argc, char **argv)
48 if (sysctl (mib, 2, hardware_platform, &s, 0, 0) >= 0)
49 element = hardware_platform;
50 }
51+#else
52+ {
53+ static struct utsname u;
54+ uname(&u);
55+ element = u.machine;
56+ if(strlen(element)==4 && element[0]=='i' && element[2]=='8' && element[3]=='6')
57+ element[1]='3';
58+ }
59 #endif
60 if (! (toprint == UINT_MAX && element == unknown))
61 print_element (element);
62--
631.9.1
64
diff --git a/meta/recipes-core/coreutils/coreutils_8.25.bb b/meta/recipes-core/coreutils/coreutils_8.25.bb
index 650008e528..b875b18f9c 100644
--- a/meta/recipes-core/coreutils/coreutils_8.25.bb
+++ b/meta/recipes-core/coreutils/coreutils_8.25.bb
@@ -18,6 +18,7 @@ SRC_URI = "${GNU_MIRROR}/coreutils/${BP}.tar.xz;name=tarball \
18 file://remove-usr-local-lib-from-m4.patch \ 18 file://remove-usr-local-lib-from-m4.patch \
19 file://fix-selinux-flask.patch \ 19 file://fix-selinux-flask.patch \
20 file://0001-Unset-need_charset_alias-when-building-for-musl.patch \ 20 file://0001-Unset-need_charset_alias-when-building-for-musl.patch \
21 file://0001-uname-report-processor-and-hardware-correctly.patch \
21 " 22 "
22 23
23SRC_URI[tarball.md5sum] = "070e43ba7f618d747414ef56ab248a48" 24SRC_URI[tarball.md5sum] = "070e43ba7f618d747414ef56ab248a48"