summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/libcgroup
diff options
context:
space:
mode:
authorRoss Burton <ross@burtonini.com>2021-08-19 13:51:43 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-08-20 08:53:03 +0100
commitb001ac2f30d14987e881faa9007cec08b26c1e3d (patch)
tree7b1eedb817e7c76b7eadd38798adb7f62ba966ba /meta/recipes-core/libcgroup
parent90cf58dc7dda609ff5accad0b26bfb0936b1a0bd (diff)
downloadpoky-b001ac2f30d14987e881faa9007cec08b26c1e3d.tar.gz
libcgroup: upgrade to 2.0
Our UPSTREAM_CHECK_URI was looking at SourceForge, but development has moved to GitHub so update the URI. Update to 2.0. Swap musl-decls-compat.patch for a backport of an upstream commit. Replace do_install commands with a backport of an upstream commit to install the PAM module correctly. Don't mess about installing the library into base_libdir as the /lib vs /usr/lib prefix split is moot these days. Delete libcgroupfortesting.so as we don't install the test suite. (From OE-Core rev: 466c1c674e3da1fdbe1eae1cd90637d79a1500f5) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-core/libcgroup')
-rw-r--r--meta/recipes-core/libcgroup/libcgroup/CVE-2018-14348.patch37
-rw-r--r--meta/recipes-core/libcgroup/libcgroup/module.patch36
-rw-r--r--meta/recipes-core/libcgroup/libcgroup/musl-decls-compat.patch187
-rw-r--r--meta/recipes-core/libcgroup/libcgroup_0.41.bb46
-rw-r--r--meta/recipes-core/libcgroup/libcgroup_2.0.bb34
5 files changed, 188 insertions, 152 deletions
diff --git a/meta/recipes-core/libcgroup/libcgroup/CVE-2018-14348.patch b/meta/recipes-core/libcgroup/libcgroup/CVE-2018-14348.patch
deleted file mode 100644
index d133703dec..0000000000
--- a/meta/recipes-core/libcgroup/libcgroup/CVE-2018-14348.patch
+++ /dev/null
@@ -1,37 +0,0 @@
1From 0d88b73d189ea3440ccaab00418d6469f76fa590 Mon Sep 17 00:00:00 2001
2From: Michal Hocko <mhocko@suse.com>
3Date: Wed, 18 Jul 2018 11:24:29 +0200
4Subject: [PATCH] cgrulesengd: remove umask(0)
5
6One of our partners has noticed that cgred daemon is creating a log file
7(/var/log/cgred) with too wide permissions (0666) and that is seen as
8a security bug because an untrusted user can write to otherwise
9restricted area. CVE-2018-14348 has been assigned to this issue.
10
11CVE: CVE-2018-14348
12Upstream-Status: Backport [https://sourceforge.net/p/libcg/libcg/ci/0d88b73d189ea3440ccaab00418d6469f76fa590]
13
14Signed-off-by: Michal Hocko <mhocko@suse.com>
15Acked-by: Balbir Singh <bsingharora@gmail.com>
16Signed-off-by: Jagadeesh Krishnanjanappa <jkrishnanjanappa@mvista.com>
17---
18 src/daemon/cgrulesengd.c | 3 ---
19 1 file changed, 3 deletions(-)
20
21diff --git a/src/daemon/cgrulesengd.c b/src/daemon/cgrulesengd.c
22index ea51f11..0d288f3 100644
23--- a/src/daemon/cgrulesengd.c
24+++ b/src/daemon/cgrulesengd.c
25@@ -889,9 +889,6 @@ int cgre_start_daemon(const char *logp, const int logf,
26 } else if (pid > 0) {
27 exit(EXIT_SUCCESS);
28 }
29-
30- /* Change the file mode mask. */
31- umask(0);
32 } else {
33 flog(LOG_DEBUG, "Not using daemon mode\n");
34 pid = getpid();
35--
362.13.3
37
diff --git a/meta/recipes-core/libcgroup/libcgroup/module.patch b/meta/recipes-core/libcgroup/libcgroup/module.patch
new file mode 100644
index 0000000000..d8ff9b1479
--- /dev/null
+++ b/meta/recipes-core/libcgroup/libcgroup/module.patch
@@ -0,0 +1,36 @@
1Upstream-Status: Backport
2Signed-off-by: Ross Burton <ross.burton@arm.com>
3
4From 76f0879056ce7e3f0123c277f2303954d0b6cead Mon Sep 17 00:00:00 2001
5From: =?UTF-8?q?Tomasz=20K=C5=82oczko?= <kloczek@github.com>
6Date: Wed, 12 May 2021 20:36:02 +0000
7Subject: [PATCH 2/2] automake: build PAM module as unversioned DSO
8MIME-Version: 1.0
9Content-Type: text/plain; charset=UTF-8
10Content-Transfer-Encoding: 8bit
11
12PAM modules should be build as unversioned DSO.
13Add -avoid-version to pam_cgroup_la_LDFLAGS
14
15Signed-off-by: Tomasz Kłoczko <kloczek@github.com>
16Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
17---
18 src/pam/Makefile.am | 2 +-
19 1 file changed, 1 insertion(+), 1 deletion(-)
20
21diff --git a/src/pam/Makefile.am b/src/pam/Makefile.am
22index bd5a91d..4b0b2a9 100644
23--- a/src/pam/Makefile.am
24+++ b/src/pam/Makefile.am
25@@ -4,7 +4,7 @@ if WITH_PAM
26
27 pamlib_LTLIBRARIES = pam_cgroup.la
28 pam_cgroup_la_SOURCES = pam_cgroup.c
29-pam_cgroup_la_LDFLAGS = -module
30+pam_cgroup_la_LDFLAGS = -module -avoid-version
31 pam_cgroup_la_LIBADD = $(top_builddir)/src/libcgroup.la -lpam
32
33 endif
34--
352.32.0
36
diff --git a/meta/recipes-core/libcgroup/libcgroup/musl-decls-compat.patch b/meta/recipes-core/libcgroup/libcgroup/musl-decls-compat.patch
index 65f4ef9a55..531a562967 100644
--- a/meta/recipes-core/libcgroup/libcgroup/musl-decls-compat.patch
+++ b/meta/recipes-core/libcgroup/libcgroup/musl-decls-compat.patch
@@ -1,16 +1,37 @@
1commit ca780b4f7f71abeeb04a585f2a4d889caaa985fa 1Upstream-Status: Backport
2Author: Isaac Dunham <ibid.ag@gmail.com> 2Signed-off-by: Ross Burton <ross.burton@arm.com>
3Date: Fri Sep 5 22:35:32 2014 -0700
4 3
5 Remove __.*DECLS nonsense 4From 26f2889113789c176273bd24fcd1592a8064c346 Mon Sep 17 00:00:00 2001
5From: "Anthony G. Basile" <blueness@gentoo.org>
6Date: Tue, 6 Jul 2021 07:54:47 -0600
7Subject: [PATCH 1/2] Replace __BEGIN_DECLS and __END_DECLS with extern "C".
6 8
7Upstream-Status: Pending 9The macros __BEGIN_DECLS and __END_DECLS are a GNU-ism found in
8Signed-off-by: Khem Raj <raj.khem@gmail.com> 10glibc and uClibc, but not musl. We replace them by the more general
11extern "C" { ... } block exposed only if we have __cplusplus.
9 12
10Index: libcgroup-0.41/include/libcgroup/config.h 13Forward ported from a patch by Anthony G. Basile <blueness@gentoo.org>.
11=================================================================== 14
12--- libcgroup-0.41.orig/include/libcgroup/config.h 15Signed-off-by: Alex Xu (Hello71) <alex_y_xu@yahoo.ca>
13+++ libcgroup-0.41/include/libcgroup/config.h 16Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
17---
18 include/libcgroup/config.h | 8 ++++++--
19 include/libcgroup/error.h | 8 ++++++--
20 include/libcgroup/groups.h | 8 ++++++--
21 include/libcgroup/init.h | 8 ++++++--
22 include/libcgroup/iterators.h | 8 ++++++--
23 include/libcgroup/log.h | 8 ++++++--
24 include/libcgroup/tasks.h | 8 ++++++--
25 src/bindings/libcgroup.p | 8 --------
26 src/daemon/cgrulesengd.h | 8 ++++++--
27 src/libcgroup-internal.h | 8 ++++++--
28 src/tools/tools-common.h | 8 ++++++--
29 11 files changed, 60 insertions(+), 28 deletions(-)
30
31diff --git a/include/libcgroup/config.h b/include/libcgroup/config.h
32index 9aaa390..f835009 100644
33--- a/include/libcgroup/config.h
34+++ b/include/libcgroup/config.h
14@@ -9,7 +9,9 @@ 35@@ -9,7 +9,9 @@
15 #include <features.h> 36 #include <features.h>
16 #endif 37 #endif
@@ -22,20 +43,20 @@ Index: libcgroup-0.41/include/libcgroup/config.h
22 43
23 /** 44 /**
24 * @defgroup group_config 5. Configuration 45 * @defgroup group_config 5. Configuration
25@@ -107,6 +109,8 @@ int cgroup_config_create_template_group( 46@@ -128,6 +130,8 @@ int cgroup_config_create_template_group(
26 * @} 47 * @}
27 * @} 48 * @}
28 */ 49 */
29-__END_DECLS 50-__END_DECLS
30+#ifdef __cplusplus 51+#ifdef __cplusplus
31+} 52+} /* extern "C" */
32+#endif 53+#endif
33 54
34 #endif /*_LIBCGROUP_CONFIG_H*/ 55 #endif /*_LIBCGROUP_CONFIG_H*/
35Index: libcgroup-0.41/include/libcgroup/error.h 56diff --git a/include/libcgroup/error.h b/include/libcgroup/error.h
36=================================================================== 57index 1dfdde9..14a6e16 100644
37--- libcgroup-0.41.orig/include/libcgroup/error.h 58--- a/include/libcgroup/error.h
38+++ libcgroup-0.41/include/libcgroup/error.h 59+++ b/include/libcgroup/error.h
39@@ -9,7 +9,9 @@ 60@@ -9,7 +9,9 @@
40 #include <features.h> 61 #include <features.h>
41 #endif 62 #endif
@@ -53,14 +74,14 @@ Index: libcgroup-0.41/include/libcgroup/error.h
53 */ 74 */
54-__END_DECLS 75-__END_DECLS
55+#ifdef __cplusplus 76+#ifdef __cplusplus
56+} 77+} /* extern "C" */
57+#endif 78+#endif
58 79
59 #endif /* _LIBCGROUP_INIT_H */ 80 #endif /* _LIBCGROUP_INIT_H */
60Index: libcgroup-0.41/include/libcgroup/groups.h 81diff --git a/include/libcgroup/groups.h b/include/libcgroup/groups.h
61=================================================================== 82index 201558f..39ec3cd 100644
62--- libcgroup-0.41.orig/include/libcgroup/groups.h 83--- a/include/libcgroup/groups.h
63+++ libcgroup-0.41/include/libcgroup/groups.h 84+++ b/include/libcgroup/groups.h
64@@ -11,7 +11,9 @@ 85@@ -11,7 +11,9 @@
65 #include <stdbool.h> 86 #include <stdbool.h>
66 #endif 87 #endif
@@ -72,20 +93,20 @@ Index: libcgroup-0.41/include/libcgroup/groups.h
72 93
73 /** 94 /**
74 * Flags for cgroup_delete_cgroup_ext(). 95 * Flags for cgroup_delete_cgroup_ext().
75@@ -577,6 +579,8 @@ char *cgroup_get_cgroup_name(struct cgro 96@@ -587,6 +589,8 @@ char *cgroup_get_cgroup_name(struct cgroup *cgroup);
76 */ 97 */
77 98
78 99
79-__END_DECLS 100-__END_DECLS
80+#ifdef __cplusplus 101+#ifdef __cplusplus
81+} 102+} /* extern "C" */
82+#endif 103+#endif
83 104
84 #endif /* _LIBCGROUP_GROUPS_H */ 105 #endif /* _LIBCGROUP_GROUPS_H */
85Index: libcgroup-0.41/include/libcgroup/init.h 106diff --git a/include/libcgroup/init.h b/include/libcgroup/init.h
86=================================================================== 107index 5150f2f..ea2dcc9 100644
87--- libcgroup-0.41.orig/include/libcgroup/init.h 108--- a/include/libcgroup/init.h
88+++ libcgroup-0.41/include/libcgroup/init.h 109+++ b/include/libcgroup/init.h
89@@ -9,7 +9,9 @@ 110@@ -9,7 +9,9 @@
90 #include <features.h> 111 #include <features.h>
91 #endif 112 #endif
@@ -97,20 +118,20 @@ Index: libcgroup-0.41/include/libcgroup/init.h
97 118
98 /** 119 /**
99 * @defgroup group_init 1. Initialization 120 * @defgroup group_init 1. Initialization
100@@ -58,6 +60,8 @@ int cgroup_get_subsys_mount_point(const 121@@ -58,6 +60,8 @@ int cgroup_get_subsys_mount_point(const char *controller, char **mount_point);
101 * @} 122 * @}
102 * @} 123 * @}
103 */ 124 */
104-__END_DECLS 125-__END_DECLS
105+#ifdef __cplusplus 126+#ifdef __cplusplus
106+} 127+} /* extern "C" */
107+#endif 128+#endif
108 129
109 #endif /* _LIBCGROUP_INIT_H */ 130 #endif /* _LIBCGROUP_INIT_H */
110Index: libcgroup-0.41/include/libcgroup/iterators.h 131diff --git a/include/libcgroup/iterators.h b/include/libcgroup/iterators.h
111=================================================================== 132index c6d453d..b3ba3af 100644
112--- libcgroup-0.41.orig/include/libcgroup/iterators.h 133--- a/include/libcgroup/iterators.h
113+++ libcgroup-0.41/include/libcgroup/iterators.h 134+++ b/include/libcgroup/iterators.h
114@@ -11,7 +11,9 @@ 135@@ -11,7 +11,9 @@
115 #include <features.h> 136 #include <features.h>
116 #endif 137 #endif
@@ -122,20 +143,45 @@ Index: libcgroup-0.41/include/libcgroup/iterators.h
122 143
123 /** 144 /**
124 * @defgroup group_iterators 3. Iterators 145 * @defgroup group_iterators 3. Iterators
125@@ -423,6 +425,8 @@ int cgroup_get_subsys_mount_point_end(vo 146@@ -423,6 +425,8 @@ int cgroup_get_subsys_mount_point_end(void **handle);
126 * @} 147 * @}
127 */ 148 */
128 149
129-__END_DECLS 150-__END_DECLS
130+#ifdef __cplusplus 151+#ifdef __cplusplus
131+} 152+} /* extern "C" */
132+#endif 153+#endif
133 154
134 #endif /* _LIBCGROUP_ITERATORS_H */ 155 #endif /* _LIBCGROUP_ITERATORS_H */
135Index: libcgroup-0.41/include/libcgroup/tasks.h 156diff --git a/include/libcgroup/log.h b/include/libcgroup/log.h
136=================================================================== 157index 0dd03b4..f693473 100644
137--- libcgroup-0.41.orig/include/libcgroup/tasks.h 158--- a/include/libcgroup/log.h
138+++ libcgroup-0.41/include/libcgroup/tasks.h 159+++ b/include/libcgroup/log.h
160@@ -11,7 +11,9 @@
161
162 #include <stdarg.h>
163
164-__BEGIN_DECLS
165+#ifdef __cplusplus
166+extern "C" {
167+#endif
168
169 /**
170 * @defgroup group_log 7. Logging
171@@ -142,6 +144,8 @@ extern int cgroup_parse_log_level_str(const char *levelstr);
172 * @}
173 * @}
174 */
175-__END_DECLS
176+#ifdef __cplusplus
177+} /* extern "C" */
178+#endif
179
180 #endif /* _LIBCGROUP_LOG_H */
181diff --git a/include/libcgroup/tasks.h b/include/libcgroup/tasks.h
182index aad438a..8553c30 100644
183--- a/include/libcgroup/tasks.h
184+++ b/include/libcgroup/tasks.h
139@@ -12,7 +12,9 @@ 185@@ -12,7 +12,9 @@
140 #include <stdbool.h> 186 #include <stdbool.h>
141 #endif 187 #endif
@@ -147,20 +193,20 @@ Index: libcgroup-0.41/include/libcgroup/tasks.h
147 193
148 /** Flags for cgroup_change_cgroup_uid_gid(). */ 194 /** Flags for cgroup_change_cgroup_uid_gid(). */
149 enum cgflags { 195 enum cgflags {
150@@ -204,6 +206,8 @@ int cgroup_register_unchanged_process(pi 196@@ -204,6 +206,8 @@ int cgroup_register_unchanged_process(pid_t pid, int flags);
151 * @} 197 * @}
152 * @} 198 * @}
153 */ 199 */
154-__END_DECLS 200-__END_DECLS
155+#ifdef __cplusplus 201+#ifdef __cplusplus
156+} 202+} /* extern "C" */
157+#endif 203+#endif
158 204
159 #endif /* _LIBCGROUP_TASKS_H */ 205 #endif /* _LIBCGROUP_TASKS_H */
160Index: libcgroup-0.41/src/daemon/cgrulesengd.h 206diff --git a/src/daemon/cgrulesengd.h b/src/daemon/cgrulesengd.h
161=================================================================== 207index e273b4b..0b12076 100644
162--- libcgroup-0.41.orig/src/daemon/cgrulesengd.h 208--- a/src/daemon/cgrulesengd.h
163+++ libcgroup-0.41/src/daemon/cgrulesengd.h 209+++ b/src/daemon/cgrulesengd.h
164@@ -17,7 +17,9 @@ 210@@ -17,7 +17,9 @@
165 211
166 #include <features.h> 212 #include <features.h>
@@ -178,15 +224,15 @@ Index: libcgroup-0.41/src/daemon/cgrulesengd.h
178 224
179-__END_DECLS 225-__END_DECLS
180+#ifdef __cplusplus 226+#ifdef __cplusplus
181+} 227+} /* extern "C" */
182+#endif 228+#endif
183 229
184 #endif /* _CGRULESENGD_H */ 230 #endif /* _CGRULESENGD_H */
185 231
186Index: libcgroup-0.41/src/libcgroup-internal.h 232diff --git a/src/libcgroup-internal.h b/src/libcgroup-internal.h
187=================================================================== 233index 1dfc92b..edc5abb 100644
188--- libcgroup-0.41.orig/src/libcgroup-internal.h 234--- a/src/libcgroup-internal.h
189+++ libcgroup-0.41/src/libcgroup-internal.h 235+++ b/src/libcgroup-internal.h
190@@ -16,7 +16,9 @@ 236@@ -16,7 +16,9 @@
191 237
192 #define __LIBCG_INTERNAL 238 #define __LIBCG_INTERNAL
@@ -197,39 +243,42 @@ Index: libcgroup-0.41/src/libcgroup-internal.h
197+#endif 243+#endif
198 244
199 #include "config.h" 245 #include "config.h"
200 #include <fts.h> 246 #include <dirent.h>
201@@ -279,6 +281,8 @@ extern void cgroup_dictionary_iterator_e 247@@ -407,6 +409,8 @@ int cgroupv2_controller_enabled(const char * const cg_name,
202 */ 248
203 int cg_chmod_path(const char *path, mode_t mode, int owner_is_umask); 249 #endif /* UNIT_TEST */
204 250
205-__END_DECLS 251-__END_DECLS
206+#ifdef __cplusplus 252+#ifdef __cplusplus
207+} 253+} /* extern "C" */
208+#endif 254+#endif
209 255
210 #endif 256 #endif
211Index: libcgroup-0.41/include/libcgroup/log.h 257diff --git a/src/tools/tools-common.h b/src/tools/tools-common.h
212=================================================================== 258index 292c408..e3541b1 100644
213--- libcgroup-0.41.orig/include/libcgroup/log.h 259--- a/src/tools/tools-common.h
214+++ libcgroup-0.41/include/libcgroup/log.h 260+++ b/src/tools/tools-common.h
215@@ -11,7 +11,9 @@ 261@@ -18,7 +18,9 @@
216 262
217 #include <stdarg.h> 263 #define __TOOLS_COMMON
218 264
219-__BEGIN_DECLS 265-__BEGIN_DECLS
220+#ifdef __cplusplus 266+#ifdef __cplusplus
221+extern "C" { 267+extern "C" {
222+#endif 268+#endif
269 #include "config.h"
270 #include <libcgroup.h>
271 #include "../libcgroup-internal.h"
272@@ -136,6 +138,8 @@ int parse_r_flag(const char * const program_name,
273
274 #endif /* UNIT_TEST */
223 275
224 /**
225 * @defgroup group_log 7. Logging
226@@ -142,6 +144,8 @@ extern int cgroup_parse_log_level_str(co
227 * @}
228 * @}
229 */
230-__END_DECLS 276-__END_DECLS
231+#ifdef __cplusplus 277+#ifdef __cplusplus
232+} 278+} /* extern "C" */
233+#endif 279+#endif
234 280
235 #endif /* _LIBCGROUP_LOG_H */ 281 #endif /* TOOLS_COMMON */
282--
2832.32.0
284
diff --git a/meta/recipes-core/libcgroup/libcgroup_0.41.bb b/meta/recipes-core/libcgroup/libcgroup_0.41.bb
deleted file mode 100644
index 400f96f17f..0000000000
--- a/meta/recipes-core/libcgroup/libcgroup_0.41.bb
+++ /dev/null
@@ -1,46 +0,0 @@
1SUMMARY = "Linux control group abstraction library"
2HOMEPAGE = "http://libcg.sourceforge.net/"
3DESCRIPTION = "libcgroup is a library that abstracts the control group file system \
4in Linux. Control groups allow you to limit, account and isolate resource usage \
5(CPU, memory, disk I/O, etc.) of groups of processes."
6SECTION = "libs"
7LICENSE = "LGPLv2.1"
8LIC_FILES_CHKSUM = "file://COPYING;md5=2d5025d4aa3495befef8f17206a5b0a1"
9
10inherit autotools pkgconfig
11
12DEPENDS = "bison-native flex-native"
13
14SRC_URI = "${SOURCEFORGE_MIRROR}/project/libcg/${BPN}/v0.41/${BPN}-${PV}.tar.bz2 \
15 file://CVE-2018-14348.patch"
16SRC_URI:append:libc-musl = " file://musl-decls-compat.patch"
17
18SRC_URI[md5sum] = "3dea9d50b8a5b73ff0bf1cdcb210f63f"
19SRC_URI[sha256sum] = "e4e38bdc7ef70645ce33740ddcca051248d56b53283c0dc6d404e17706f6fb51"
20
21UPSTREAM_CHECK_URI = "http://sourceforge.net/projects/libcg/files/libcgroup/"
22
23DEPENDS:append:libc-musl = " fts "
24EXTRA_OEMAKE:append:libc-musl = " LIBS=-lfts"
25
26PACKAGECONFIG = "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)}"
27PACKAGECONFIG[pam] = "--enable-pam-module-dir=${base_libdir}/security --enable-pam=yes,--enable-pam=no,libpam"
28
29PACKAGES =+ "cgroups-pam-plugin"
30FILES:cgroups-pam-plugin = "${base_libdir}/security/pam_cgroup.so*"
31FILES:${PN}-dev += "${base_libdir}/security/*.la"
32
33do_install:append() {
34 # Moving libcgroup to base_libdir
35 if [ ! ${D}${libdir} -ef ${D}${base_libdir} ]; then
36 mkdir -p ${D}/${base_libdir}/
37 mv -f ${D}${libdir}/libcgroup.so.* ${D}${base_libdir}/
38 rm -f ${D}${libdir}/libcgroup.so
39 lnr ${D}${base_libdir}/libcgroup.so.1 ${D}${libdir}/libcgroup.so
40 fi
41 # pam modules in ${base_libdir}/security/ should be binary .so files, not symlinks.
42 if [ -f ${D}${base_libdir}/security/pam_cgroup.so.0.0.0 ]; then
43 mv -f ${D}${base_libdir}/security/pam_cgroup.so.0.0.0 ${D}${base_libdir}/security/pam_cgroup.so
44 rm -f ${D}${base_libdir}/security/pam_cgroup.so.*
45 fi
46}
diff --git a/meta/recipes-core/libcgroup/libcgroup_2.0.bb b/meta/recipes-core/libcgroup/libcgroup_2.0.bb
new file mode 100644
index 0000000000..bc0a75d46c
--- /dev/null
+++ b/meta/recipes-core/libcgroup/libcgroup_2.0.bb
@@ -0,0 +1,34 @@
1SUMMARY = "Linux control group abstraction library"
2HOMEPAGE = "http://libcg.sourceforge.net/"
3DESCRIPTION = "libcgroup is a library that abstracts the control group file system \
4in Linux. Control groups allow you to limit, account and isolate resource usage \
5(CPU, memory, disk I/O, etc.) of groups of processes."
6SECTION = "libs"
7LICENSE = "LGPLv2.1"
8LIC_FILES_CHKSUM = "file://COPYING;md5=2d5025d4aa3495befef8f17206a5b0a1"
9
10inherit autotools pkgconfig
11
12DEPENDS = "bison-native flex-native"
13
14SRC_URI = "https://github.com/${BPN}/${BPN}/releases/download/v${PV}/${BP}.tar.bz2 \
15 file://musl-decls-compat.patch \
16 file://module.patch"
17
18SRC_URI[sha256sum] = "11a2fbf0e42f46089f406b8b0dca7fef04aec2f21600b70e402c5db3661305d7"
19UPSTREAM_CHECK_URI = "https://github.com/libcgroup/libcgroup/releases/"
20
21DEPENDS:append:libc-musl = " fts "
22EXTRA_OEMAKE:append:libc-musl = " LIBS=-lfts"
23
24PACKAGECONFIG = "${@bb.utils.filter('DISTRO_FEATURES', 'pam', d)}"
25PACKAGECONFIG[pam] = "--enable-pam-module-dir=${base_libdir}/security --enable-pam=yes,--enable-pam=no,libpam"
26
27PACKAGES =+ "cgroups-pam-plugin"
28FILES:cgroups-pam-plugin = "${base_libdir}/security/pam_cgroup.so*"
29FILES:${PN}-dev += "${base_libdir}/security/*.la"
30
31do_install:append() {
32 # Until we ship the test suite, this library isn't useful
33 rm -f ${D}${libdir}/libcgroupfortesting.*
34}