diff options
author | Xin Ouyang <Xin.Ouyang@windriver.com> | 2012-02-29 17:59:40 +0800 |
---|---|---|
committer | Xin Ouyang <Xin.Ouyang@windriver.com> | 2012-02-29 17:59:40 +0800 |
commit | 208e905d1cd122cad54e1301403c985ce5e5a0da (patch) | |
tree | a5ebde49764a3fab0396d238572ccf14390fbfab | |
parent | 64c9a63c630539978d788b19196623db6c772eb6 (diff) | |
download | meta-selinux-208e905d1cd122cad54e1301403c985ce5e5a0da.tar.gz |
libcgroup: Add libcgroup for initscripts.
-rw-r--r-- | recipes-core/libcgroup/libcgroup/fix-LSB-routines.patch | 129 | ||||
-rw-r--r-- | recipes-core/libcgroup/libcgroup_0.38.bb | 23 |
2 files changed, 152 insertions, 0 deletions
diff --git a/recipes-core/libcgroup/libcgroup/fix-LSB-routines.patch b/recipes-core/libcgroup/libcgroup/fix-LSB-routines.patch new file mode 100644 index 0000000..88e5621 --- /dev/null +++ b/recipes-core/libcgroup/libcgroup/fix-LSB-routines.patch | |||
@@ -0,0 +1,129 @@ | |||
1 | From 15db1ef0f561309e2b475df3993c8f185d19a7eb Mon Sep 17 00:00:00 2001 | ||
2 | From: Xin Ouyang <Xin.Ouyang@windriver.com> | ||
3 | Date: Wed, 29 Feb 2012 17:42:57 +0800 | ||
4 | Subject: [PATCH] Fix LSB routines for non-LSB releases. | ||
5 | |||
6 | --- | ||
7 | scripts/init.d/cgconfig.in | 49 ++++++++++++++++++++++++++++++++++++++++--- | ||
8 | scripts/init.d/cgred.in | 45 +++++++++++++++++++++++++++++++++++++++- | ||
9 | 2 files changed, 89 insertions(+), 5 deletions(-) | ||
10 | |||
11 | diff --git a/scripts/init.d/cgconfig.in b/scripts/init.d/cgconfig.in | ||
12 | index 14aa2e3..6ca9ecf 100644 | ||
13 | --- a/scripts/init.d/cgconfig.in | ||
14 | +++ b/scripts/init.d/cgconfig.in | ||
15 | @@ -36,10 +36,51 @@ CONFIG_FILE=/etc/cgconfig.conf | ||
16 | servicename=cgconfig | ||
17 | lockfile=/var/lock/subsys/$servicename | ||
18 | |||
19 | -# | ||
20 | -# Source LSB routines | ||
21 | -# | ||
22 | -. /lib/lsb/init-functions | ||
23 | +# for log_success_msg and friends | ||
24 | +if [ -r /lib/lsb/init-functions ]; then | ||
25 | +# LSB, SLES, ... | ||
26 | + . /lib/lsb/init-functions | ||
27 | +elif [ -r /etc/init.d/functions ]; then | ||
28 | +# Red Hat / VMware | ||
29 | + . /etc/init.d/functions | ||
30 | + my_log_message() | ||
31 | + { | ||
32 | + ACTION=$1 | ||
33 | + shift | ||
34 | + | ||
35 | + case "$ACTION" in | ||
36 | + success) | ||
37 | + echo -n $* | ||
38 | + success "$*" | ||
39 | + echo | ||
40 | + ;; | ||
41 | + failure) | ||
42 | + echo -n $* | ||
43 | + failure "$*" | ||
44 | + echo | ||
45 | + ;; | ||
46 | + warning) | ||
47 | + echo -n $* | ||
48 | + warning "$*" | ||
49 | + echo | ||
50 | + ;; | ||
51 | + *) | ||
52 | + ;; | ||
53 | + esac | ||
54 | + } | ||
55 | + log_success_msg() | ||
56 | + { | ||
57 | + my_log_message success "$*" | ||
58 | + } | ||
59 | + log_failure_msg() | ||
60 | + { | ||
61 | + my_log_message failure "$*" | ||
62 | + } | ||
63 | + log_warning_msg() | ||
64 | + { | ||
65 | + my_log_message warning "$*" | ||
66 | + } | ||
67 | +fi | ||
68 | |||
69 | # read the config | ||
70 | CREATE_DEFAULT=yes | ||
71 | diff --git a/scripts/init.d/cgred.in b/scripts/init.d/cgred.in | ||
72 | index 9ff2d9b..4b02536 100644 | ||
73 | --- a/scripts/init.d/cgred.in | ||
74 | +++ b/scripts/init.d/cgred.in | ||
75 | @@ -41,7 +41,50 @@ CGRED_CONF=/etc/cgrules.conf | ||
76 | |||
77 | # Source function library & LSB routines | ||
78 | . /etc/rc.d/init.d/functions | ||
79 | -. /lib/lsb/init-functions | ||
80 | +# for log_success_msg and friends | ||
81 | +if [ -r /lib/lsb/init-functions ]; then | ||
82 | +# LSB, SLES, ... | ||
83 | + . /lib/lsb/init-functions | ||
84 | +elif [ -r /etc/init.d/functions ]; then | ||
85 | +# Red Hat / VMware | ||
86 | + my_log_message() | ||
87 | + { | ||
88 | + ACTION=$1 | ||
89 | + shift | ||
90 | + | ||
91 | + case "$ACTION" in | ||
92 | + success) | ||
93 | + echo -n $* | ||
94 | + success "$*" | ||
95 | + echo | ||
96 | + ;; | ||
97 | + failure) | ||
98 | + echo -n $* | ||
99 | + failure "$*" | ||
100 | + echo | ||
101 | + ;; | ||
102 | + warning) | ||
103 | + echo -n $* | ||
104 | + warning "$*" | ||
105 | + echo | ||
106 | + ;; | ||
107 | + *) | ||
108 | + ;; | ||
109 | + esac | ||
110 | + } | ||
111 | + log_success_msg() | ||
112 | + { | ||
113 | + my_log_message success "$*" | ||
114 | + } | ||
115 | + log_failure_msg() | ||
116 | + { | ||
117 | + my_log_message failure "$*" | ||
118 | + } | ||
119 | + log_warning_msg() | ||
120 | + { | ||
121 | + my_log_message warning "$*" | ||
122 | + } | ||
123 | +fi | ||
124 | |||
125 | # Read in configuration options. | ||
126 | if [ -f "/etc/sysconfig/cgred.conf" ] ; then | ||
127 | -- | ||
128 | 1.7.5.4 | ||
129 | |||
diff --git a/recipes-core/libcgroup/libcgroup_0.38.bb b/recipes-core/libcgroup/libcgroup_0.38.bb index 7a31cf5..316131a 100644 --- a/recipes-core/libcgroup/libcgroup_0.38.bb +++ b/recipes-core/libcgroup/libcgroup_0.38.bb | |||
@@ -19,7 +19,10 @@ SRC_URI = "${SOURCEFORGE_MIRROR}/project/libcg/libcgroup/v.038/libcgroup-${PV}.t | |||
19 | SRC_URI[md5sum] = "f0f7d4060bf36ccc19d75dbf4f1695db" | 19 | SRC_URI[md5sum] = "f0f7d4060bf36ccc19d75dbf4f1695db" |
20 | SRC_URI[sha256sum] = "5d36d1a48b95f62fe9fcdf74a5a4089512e5e43e6011aa1504fd6f2a0909867f" | 20 | SRC_URI[sha256sum] = "5d36d1a48b95f62fe9fcdf74a5a4089512e5e43e6011aa1504fd6f2a0909867f" |
21 | 21 | ||
22 | SRC_URI += "file://fix-LSB-routines.patch" | ||
23 | |||
22 | EXTRA_OECONF = "${@base_contains('DISTRO_FEATURES', 'pam', '--enable-pam-module-dir=${base_libdir}/security --enable-pam=yes', '--enable-pam=no', d)}" | 24 | EXTRA_OECONF = "${@base_contains('DISTRO_FEATURES', 'pam', '--enable-pam-module-dir=${base_libdir}/security --enable-pam=yes', '--enable-pam=no', d)}" |
25 | EXTRA_OECONF += "--enable-initscript-install" | ||
23 | 26 | ||
24 | # http://www.mail-archive.com/openembedded-devel@lists.openembedded.org/msg21444.html | 27 | # http://www.mail-archive.com/openembedded-devel@lists.openembedded.org/msg21444.html |
25 | PARALLEL_MAKE = "" | 28 | PARALLEL_MAKE = "" |
@@ -30,4 +33,24 @@ FILES_cgroups-pam-plugin = "${base_libdir}/security/pam_cgroup.so*" | |||
30 | # We really need the symlink so :( | 33 | # We really need the symlink so :( |
31 | ERROR_QA = "debug-deps dev-deps debug-files arch la2 pkgconfig la perms" | 34 | ERROR_QA = "debug-deps dev-deps debug-files arch la2 pkgconfig la perms" |
32 | 35 | ||
36 | do_install_append() { | ||
37 | install -d ${D}${sysconfdir} | ||
38 | install -m 644 samples/cgconfig.conf ${D}/${sysconfdir}/cgconfig.conf | ||
39 | install -m 644 samples/cgrules.conf ${D}/${sysconfdir}/cgrules.conf | ||
40 | install -m 644 samples/cgsnapshot_blacklist.conf ${D}/${sysconfdir}/cgsnapshot_blacklist.conf | ||
41 | install -d ${D}${sysconfdir}/sysconfig/ | ||
42 | head -7 samples/cgconfig.sysconfig > samples/cgconfig.sysconfig.new | ||
43 | echo "# By default, do not create these groups:" >> samples/cgconfig.sysconfig.new | ||
44 | echo "CREATE_DEFAULT=no" >> samples/cgconfig.sysconfig.new | ||
45 | install -m 644 samples/cgconfig.sysconfig.new ${D}${sysconfdir}/sysconfig/cgconfig | ||
46 | |||
47 | # sanitize pam module, we need only pam_cgroup.so | ||
48 | if [ -f ${D}/${base_libdir}/security/pam_cgroup.so.*.*.* ]; then | ||
49 | mv -f ${D}/${base_libdir}/security/pam_cgroup.so.*.*.* ${D}/${base_libdir}/security/pam_cgroup.so | ||
50 | rm -f ${D}/${base_libdir}/security/pam_cgroup.la ${D}/${base_libdir}/security/pam_cgroup.so.* | ||
51 | fi | ||
52 | |||
53 | rm -f ${D}/${libdir}/*.la | ||
54 | } | ||
55 | |||
33 | BBCLASSEXTEND = "native" | 56 | BBCLASSEXTEND = "native" |