* [PATCH 0/1] coreutils: fix reporting 'unknown' by `uname -p' and `uname -i' @ 2015-10-29 7:54 Chen Qi 2015-10-29 7:54 ` [PATCH 1/1] " Chen Qi 0 siblings, 1 reply; 3+ messages in thread From: Chen Qi @ 2015-10-29 7:54 UTC (permalink / raw) To: openembedded-core The following changes since commit f787b688f2884ce3fa888b4041030538c7d2bf55: oeqa/utils/decorators: fix missing keyword arguments on decorators (2015-10-27 07:22:22 +0000) are available in the git repository at: git://git.openembedded.org/openembedded-core-contrib ChenQi/coreutils-uname http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=ChenQi/coreutils-uname Chen Qi (1): coreutils: fix reporting 'unknown' by `uname -p' and `uname -i' ...e-report-processor-and-hardware-correctly.patch | 64 ++++++++++++++++++++++ meta/recipes-core/coreutils/coreutils_8.24.bb | 1 + 2 files changed, 65 insertions(+) create mode 100644 meta/recipes-core/coreutils/coreutils-8.24/0001-uname-report-processor-and-hardware-correctly.patch -- 1.9.1 ^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 1/1] coreutils: fix reporting 'unknown' by `uname -p' and `uname -i' 2015-10-29 7:54 [PATCH 0/1] coreutils: fix reporting 'unknown' by `uname -p' and `uname -i' Chen Qi @ 2015-10-29 7:54 ` Chen Qi 2016-03-15 7:02 ` ChenQi 0 siblings, 1 reply; 3+ messages in thread From: Chen Qi @ 2015-10-29 7:54 UTC (permalink / raw) To: openembedded-core 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> --- ...e-report-processor-and-hardware-correctly.patch | 64 ++++++++++++++++++++++ meta/recipes-core/coreutils/coreutils_8.24.bb | 1 + 2 files changed, 65 insertions(+) create mode 100644 meta/recipes-core/coreutils/coreutils-8.24/0001-uname-report-processor-and-hardware-correctly.patch diff --git a/meta/recipes-core/coreutils/coreutils-8.24/0001-uname-report-processor-and-hardware-correctly.patch b/meta/recipes-core/coreutils/coreutils-8.24/0001-uname-report-processor-and-hardware-correctly.patch new file mode 100644 index 0000000..c5f449f --- /dev/null +++ b/meta/recipes-core/coreutils/coreutils-8.24/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.24.bb b/meta/recipes-core/coreutils/coreutils_8.24.bb index f042346..ae9c375 100644 --- a/meta/recipes-core/coreutils/coreutils_8.24.bb +++ b/meta/recipes-core/coreutils/coreutils_8.24.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] = "40efdbce865d2458d8da0a9dcee7c16c" -- 1.9.1 ^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 1/1] coreutils: fix reporting 'unknown' by `uname -p' and `uname -i' 2015-10-29 7:54 ` [PATCH 1/1] " Chen Qi @ 2016-03-15 7:02 ` ChenQi 0 siblings, 0 replies; 3+ messages in thread From: ChenQi @ 2016-03-15 7:02 UTC (permalink / raw) To: openembedded-core ping ... On 10/29/2015 03:54 PM, Chen Qi wrote: > 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> > --- > ...e-report-processor-and-hardware-correctly.patch | 64 ++++++++++++++++++++++ > meta/recipes-core/coreutils/coreutils_8.24.bb | 1 + > 2 files changed, 65 insertions(+) > create mode 100644 meta/recipes-core/coreutils/coreutils-8.24/0001-uname-report-processor-and-hardware-correctly.patch > > diff --git a/meta/recipes-core/coreutils/coreutils-8.24/0001-uname-report-processor-and-hardware-correctly.patch b/meta/recipes-core/coreutils/coreutils-8.24/0001-uname-report-processor-and-hardware-correctly.patch > new file mode 100644 > index 0000000..c5f449f > --- /dev/null > +++ b/meta/recipes-core/coreutils/coreutils-8.24/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.24.bb b/meta/recipes-core/coreutils/coreutils_8.24.bb > index f042346..ae9c375 100644 > --- a/meta/recipes-core/coreutils/coreutils_8.24.bb > +++ b/meta/recipes-core/coreutils/coreutils_8.24.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] = "40efdbce865d2458d8da0a9dcee7c16c" ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-03-15 7:02 UTC | newest] Thread overview: 3+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2015-10-29 7:54 [PATCH 0/1] coreutils: fix reporting 'unknown' by `uname -p' and `uname -i' Chen Qi 2015-10-29 7:54 ` [PATCH 1/1] " Chen Qi 2016-03-15 7:02 ` ChenQi
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox