summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/systemd/systemd/uclibc-get-physmem.patch
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2014-03-15 22:42:32 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-03-19 14:19:07 +0000
commit2c1047310970d3074f15fd20c8ccd58ba916a52f (patch)
tree3b64ea6ebdfaaa712829cf29d70b901bb496bb15 /meta/recipes-core/systemd/systemd/uclibc-get-physmem.patch
parentac4ff568f5b2ad4f50a1b7b60797e7b797c314bb (diff)
downloadpoky-2c1047310970d3074f15fd20c8ccd58ba916a52f.tar.gz
Upgrade to systemd 211+
Fixes [YOCTO #5940] Fix checks for %ms format to be a link time check runtime checks wont work in cross compiling Add a patch to workaround missing _SC_PHYS_PAGES in uclibc (From OE-Core rev: 0f5256d4ae5ed88c62e737e3c31587d7635b5dd6) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core/systemd/systemd/uclibc-get-physmem.patch')
-rw-r--r--meta/recipes-core/systemd/systemd/uclibc-get-physmem.patch37
1 files changed, 37 insertions, 0 deletions
diff --git a/meta/recipes-core/systemd/systemd/uclibc-get-physmem.patch b/meta/recipes-core/systemd/systemd/uclibc-get-physmem.patch
new file mode 100644
index 0000000000..39dfc9e2ea
--- /dev/null
+++ b/meta/recipes-core/systemd/systemd/uclibc-get-physmem.patch
@@ -0,0 +1,37 @@
1bypass unimplemented _SC_PHYS_PAGES system configuration API in uclibc
2
3Upstream-Status: Inappropriate [uclibc-specific]
4
5Signed-off-by: Khem Raj <raj.khem@gmail.com>
6
7Index: git/src/shared/util.c
8===================================================================
9--- git.orig/src/shared/util.c 2014-03-15 18:09:34.796358146 -0700
10+++ git/src/shared/util.c 2014-03-15 20:16:33.836501084 -0700
11@@ -6332,11 +6332,24 @@
12
13 /* We return this as uint64_t in case we are running as 32bit
14 * process on a 64bit kernel with huge amounts of memory */
15-
16+#ifdef __UCLIBC__
17+ char line[128];
18+ FILE *f = fopen("/proc/meminfo", "r");
19+ if (f == NULL)
20+ return 0;
21+ while (!feof(f) && fgets(line, sizeof(line)-1, f)) {
22+ if (sscanf(line, "MemTotal: %l kB", &mem) == 1) {
23+ mem *= 1024;
24+ break;
25+ }
26+ }
27+ fclose(f);
28+ return (uint64_t) mem;
29+#else
30 mem = sysconf(_SC_PHYS_PAGES);
31 assert(mem > 0);
32-
33 return (uint64_t) mem * (uint64_t) page_size();
34+#endif
35 }
36
37 char* mount_test_option(const char *haystack, const char *needle) {