All of lore.kernel.org
 help / color / mirror / Atom feed
* [meta-oe][PATCH] procps: apply patch from Ubuntu to finally get rid of 'Unknown Hz value'
@ 2012-12-09 21:37 Stan Hu
  2012-12-10 22:48 ` Saul Wold
  0 siblings, 1 reply; 2+ messages in thread
From: Stan Hu @ 2012-12-09 21:37 UTC (permalink / raw)
  To: openembedded-core

Patch ported from openembedded tree:

http://cgit.openembedded.org/openembedded/commit/?id=ce2d4f482a41ee2b8884095174ce278d8fc277de
---
 .../procps/procps-3.2.8/linux-version-init.patch   |   45 ++++++++++++++++++++
 1 file changed, 45 insertions(+)
 create mode 100644 meta/recipes-extended/procps/procps-3.2.8/linux-version-init.patch

diff --git a/meta/recipes-extended/procps/procps-3.2.8/linux-version-init.patch b/meta/recipes-extended/procps/procps-3.2.8/linux-version-init.patch
new file mode 100644
index 0000000..9c1477a
--- /dev/null
+++ b/meta/recipes-extended/procps/procps-3.2.8/linux-version-init.patch
@@ -0,0 +1,45 @@
+Index: procps-3.2.8/proc/sysinfo.c
+===================================================================
+--- procps-3.2.8.orig/proc/sysinfo.c	2008-03-23 21:33:43.000000000 -0700
++++ procps-3.2.8/proc/sysinfo.c	2012-12-09 00:52:53.288000030 -0800
+@@ -212,6 +212,7 @@
+ static void init_libproc(void) __attribute__((constructor));
+ static void init_libproc(void){
+   have_privs = check_for_privs();
++  init_Linux_version(); // make sure we have version before continuing...
+   // ought to count CPUs in /proc/stat instead of relying
+   // on glibc, which foolishly tries to parse /proc/cpuinfo
+   //
+Index: procps-3.2.8/proc/version.c
+===================================================================
+--- procps-3.2.8.orig/proc/version.c	2012-12-09 00:52:53.228000030 -0800
++++ procps-3.2.8/proc/version.c	2012-12-09 00:56:14.468000086 -0800
+@@ -33,12 +33,13 @@
+ 
+ int linux_version_code;
+ 
+-static void init_Linux_version(void) __attribute__((constructor));
+-static void init_Linux_version(void) {
++// cannot depend on this auto-running before libproc init...
++//static void init_Linux_version(void) __attribute__((constructor));
++void init_Linux_version(void) {
+     int x = 0, y = 0, z = 0;	/* cleared in case sscanf() < 2 */
+     FILE *fp;
+     char buf[256];
+-    
++
+     if ( (fp=fopen("/proc/version","r")) == NULL) /* failure implies impending death */
+       exit(1);
+     if (fgets(buf, 256, fp) == NULL) {
+Index: procps-3.2.8/proc/version.h
+===================================================================
+--- procps-3.2.8.orig/proc/version.h	2002-12-14 16:08:32.000000000 -0800
++++ procps-3.2.8/proc/version.h	2012-12-09 00:52:53.288000030 -0800
+@@ -14,6 +14,7 @@
+ 
+ EXTERN_C_BEGIN
+ 
++extern void init_Linux_version(void);	/* initialize linux version */
+ extern void display_version(void);	/* display suite version */
+ extern const char procps_version[];		/* global buf for suite version */
+ 
-- 
1.7.9.5




^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [meta-oe][PATCH] procps: apply patch from Ubuntu to finally get rid of 'Unknown Hz value'
  2012-12-09 21:37 [meta-oe][PATCH] procps: apply patch from Ubuntu to finally get rid of 'Unknown Hz value' Stan Hu
@ 2012-12-10 22:48 ` Saul Wold
  0 siblings, 0 replies; 2+ messages in thread
From: Saul Wold @ 2012-12-10 22:48 UTC (permalink / raw)
  To: Stan Hu; +Cc: openembedded-core

On 12/09/2012 01:37 PM, Stan Hu wrote:
> Patch ported from openembedded tree:
>
> http://cgit.openembedded.org/openembedded/commit/?id=ce2d4f482a41ee2b8884095174ce278d8fc277de
> ---
>   .../procps/procps-3.2.8/linux-version-init.patch   |   45 ++++++++++++++++++++
>   1 file changed, 45 insertions(+)
>   create mode 100644 meta/recipes-extended/procps/procps-3.2.8/linux-version-init.patch
>
Not sure how this was tested, as I don's see any changes to the procps 
recipe itself to add the patch and bump the PR (although that's going 
away shortly).

> diff --git a/meta/recipes-extended/procps/procps-3.2.8/linux-version-init.patch b/meta/recipes-extended/procps/procps-3.2.8/linux-version-init.patch
> new file mode 100644
> index 0000000..9c1477a
> --- /dev/null
> +++ b/meta/recipes-extended/procps/procps-3.2.8/linux-version-init.patch

Please add a patch header explaining why this is needed, also need a 
Signed-off-by: or the Author's name from oe commit.  Also a Upstream-Status:

See http://www.openembedded.org/wiki/Commit_Patch_Message_Guidelines for 
more details.

Sau!

> @@ -0,0 +1,45 @@
> +Index: procps-3.2.8/proc/sysinfo.c
> +===================================================================
> +--- procps-3.2.8.orig/proc/sysinfo.c	2008-03-23 21:33:43.000000000 -0700
> ++++ procps-3.2.8/proc/sysinfo.c	2012-12-09 00:52:53.288000030 -0800
> +@@ -212,6 +212,7 @@
> + static void init_libproc(void) __attribute__((constructor));
> + static void init_libproc(void){
> +   have_privs = check_for_privs();
> ++  init_Linux_version(); // make sure we have version before continuing...
> +   // ought to count CPUs in /proc/stat instead of relying
> +   // on glibc, which foolishly tries to parse /proc/cpuinfo
> +   //
> +Index: procps-3.2.8/proc/version.c
> +===================================================================
> +--- procps-3.2.8.orig/proc/version.c	2012-12-09 00:52:53.228000030 -0800
> ++++ procps-3.2.8/proc/version.c	2012-12-09 00:56:14.468000086 -0800
> +@@ -33,12 +33,13 @@
> +
> + int linux_version_code;
> +
> +-static void init_Linux_version(void) __attribute__((constructor));
> +-static void init_Linux_version(void) {
> ++// cannot depend on this auto-running before libproc init...
> ++//static void init_Linux_version(void) __attribute__((constructor));
> ++void init_Linux_version(void) {
> +     int x = 0, y = 0, z = 0;	/* cleared in case sscanf() < 2 */
> +     FILE *fp;
> +     char buf[256];
> +-
> ++
> +     if ( (fp=fopen("/proc/version","r")) == NULL) /* failure implies impending death */
> +       exit(1);
> +     if (fgets(buf, 256, fp) == NULL) {
> +Index: procps-3.2.8/proc/version.h
> +===================================================================
> +--- procps-3.2.8.orig/proc/version.h	2002-12-14 16:08:32.000000000 -0800
> ++++ procps-3.2.8/proc/version.h	2012-12-09 00:52:53.288000030 -0800
> +@@ -14,6 +14,7 @@
> +
> + EXTERN_C_BEGIN
> +
> ++extern void init_Linux_version(void);	/* initialize linux version */
> + extern void display_version(void);	/* display suite version */
> + extern const char procps_version[];		/* global buf for suite version */
> +
>



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-12-10 23:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-12-09 21:37 [meta-oe][PATCH] procps: apply patch from Ubuntu to finally get rid of 'Unknown Hz value' Stan Hu
2012-12-10 22:48 ` Saul Wold

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.