summaryrefslogtreecommitdiff
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 22:57:54 +0000
commit83c551b46e959d9382fa92ac4178c9c6c883d7c1 (patch)
tree37e524867312a62cfbcd9a482ab299506a46b4ba /meta
parent8df2060a323acf2a2cc2bc4076623463039c46a6 (diff)
downloadopenembedded-core-83c551b46e959d9382fa92ac4178c9c6c883d7c1.tar.gz
openembedded-core-83c551b46e959d9382fa92ac4178c9c6c883d7c1.tar.bz2
openembedded-core-83c551b46e959d9382fa92ac4178c9c6c883d7c1.zip
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. Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
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 @@
+Upstream-Status: Rejected
+
+Subject: uname: report processor and hardware correctly
+
+This patch is rejected by coreutils upstream, but distros like debian and fedora
+uses this patch to make `uname -i' and `uname -p' to not report 'unknown'.
+
+Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
+---
+ src/uname.c | 18 ++++++++++++++++--
+ 1 file changed, 16 insertions(+), 2 deletions(-)
+
+diff --git a/src/uname.c b/src/uname.c
+index 39bd28c..c84582d 100644
+--- a/src/uname.c
++++ b/src/uname.c
+@@ -299,13 +299,19 @@ main (int argc, char **argv)
+
+ if (toprint & PRINT_PROCESSOR)
+ {
+- char const *element = unknown;
++ char *element = unknown;
+ #if HAVE_SYSINFO && defined SI_ARCHITECTURE
+ {
+ static char processor[257];
+ if (0 <= sysinfo (SI_ARCHITECTURE, processor, sizeof processor))
+ element = processor;
+ }
++#else
++ {
++ static struct utsname u;
++ uname(&u);
++ element = u.machine;
++ }
+ #endif
+ #ifdef UNAME_PROCESSOR
+ if (element == unknown)
+@@ -343,7 +349,7 @@ main (int argc, char **argv)
+
+ if (toprint & PRINT_HARDWARE_PLATFORM)
+ {
+- char const *element = unknown;
++ char *element = unknown;
+ #if HAVE_SYSINFO && defined SI_PLATFORM
+ {
+ static char hardware_platform[257];
+@@ -361,6 +367,14 @@ main (int argc, char **argv)
+ if (sysctl (mib, 2, hardware_platform, &s, 0, 0) >= 0)
+ element = hardware_platform;
+ }
++#else
++ {
++ static struct utsname u;
++ uname(&u);
++ element = u.machine;
++ if(strlen(element)==4 && element[0]=='i' && element[2]=='8' && element[3]=='6')
++ element[1]='3';
++ }
+ #endif
+ if (! (toprint == UINT_MAX && element == unknown))
+ print_element (element);
+--
+1.9.1
+
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 \
file://remove-usr-local-lib-from-m4.patch \
file://fix-selinux-flask.patch \
file://0001-Unset-need_charset_alias-when-building-for-musl.patch \
+ file://0001-uname-report-processor-and-hardware-correctly.patch \
"
SRC_URI[tarball.md5sum] = "070e43ba7f618d747414ef56ab248a48"