diff options
author | Tudor Florea <tudor.florea@enea.com> | 2014-10-16 03:05:19 +0200 |
---|---|---|
committer | Tudor Florea <tudor.florea@enea.com> | 2014-10-16 03:05:19 +0200 |
commit | c527fd1f14c27855a37f2e8ac5346ce8d940ced2 (patch) | |
tree | bb002c1fdf011c41dbd2f0927bed23ecb5f83c97 /meta/recipes-core/systemd/systemd_211.bb | |
download | poky-daisy-140929.tar.gz |
initial commit for Enea Linux 4.0-140929daisy-140929
Migrated from the internal git server on the daisy-enea-point-release branch
Signed-off-by: Tudor Florea <tudor.florea@enea.com>
Diffstat (limited to 'meta/recipes-core/systemd/systemd_211.bb')
-rw-r--r-- | meta/recipes-core/systemd/systemd_211.bb | 353 |
1 files changed, 353 insertions, 0 deletions
diff --git a/meta/recipes-core/systemd/systemd_211.bb b/meta/recipes-core/systemd/systemd_211.bb new file mode 100644 index 0000000000..44b196538a --- /dev/null +++ b/meta/recipes-core/systemd/systemd_211.bb | |||
@@ -0,0 +1,353 @@ | |||
1 | SUMMARY = "System and service manager for Linux, replacing SysVinit" | ||
2 | HOMEPAGE = "http://www.freedesktop.org/wiki/Software/systemd" | ||
3 | |||
4 | LICENSE = "GPLv2 & LGPLv2.1 & MIT" | ||
5 | LIC_FILES_CHKSUM = "file://LICENSE.GPL2;md5=751419260aa954499f7abaabaa882bbe \ | ||
6 | file://LICENSE.LGPL2.1;md5=4fbd65380cdd255951079008b364516c \ | ||
7 | file://LICENSE.MIT;md5=544799d0b492f119fa04641d1b8868ed" | ||
8 | |||
9 | PROVIDES = "udev" | ||
10 | |||
11 | PE = "1" | ||
12 | |||
13 | DEPENDS = "kmod docbook-sgml-dtd-4.1-native intltool-native gperf-native acl readline dbus libcap libcgroup glib-2.0 qemu-native util-linux" | ||
14 | DEPENDS += "${@base_contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)}" | ||
15 | |||
16 | SECTION = "base/shell" | ||
17 | |||
18 | inherit gtk-doc useradd pkgconfig autotools perlnative update-rc.d update-alternatives qemu systemd ptest | ||
19 | |||
20 | SRCREV = "3a450ec5c6adf3057bcedd6cc19c10617abc35a5" | ||
21 | |||
22 | PV = "211+git${SRCPV}" | ||
23 | |||
24 | SRC_URI = "git://anongit.freedesktop.org/systemd/systemd;branch=master;protocol=git \ | ||
25 | file://binfmt-install.patch \ | ||
26 | file://systemd-pam-configure-check-uclibc.patch \ | ||
27 | file://systemd-pam-fix-execvpe.patch \ | ||
28 | file://systemd-pam-fix-fallocate.patch \ | ||
29 | file://systemd-pam-fix-mkostemp.patch \ | ||
30 | file://optional_secure_getenv.patch \ | ||
31 | file://0001-uClibc-doesn-t-implement-pwritev-preadv.patch \ | ||
32 | file://uclibc-sysinfo_h.patch \ | ||
33 | file://uclibc-get-physmem.patch \ | ||
34 | file://sd-bus-don-t-use-assert_return-to-check-for-disconne.patch \ | ||
35 | \ | ||
36 | file://touchscreen.rules \ | ||
37 | file://00-create-volatile.conf \ | ||
38 | file://init \ | ||
39 | file://run-ptest \ | ||
40 | " | ||
41 | |||
42 | S = "${WORKDIR}/git" | ||
43 | |||
44 | SRC_URI_append_libc-uclibc = "\ | ||
45 | file://systemd-pam-fix-getty-unit.patch \ | ||
46 | " | ||
47 | LDFLAGS_append_libc-uclibc = " -lrt" | ||
48 | |||
49 | GTKDOC_DOCDIR = "${S}/docs/" | ||
50 | |||
51 | PACKAGECONFIG ??= "xz tcp-wrappers" | ||
52 | # Sign the journal for anti-tampering | ||
53 | PACKAGECONFIG[gcrypt] = "--enable-gcrypt,--disable-gcrypt,libgcrypt" | ||
54 | # regardless of PACKAGECONFIG, libgcrypt is always required to expand | ||
55 | # the AM_PATH_LIBGCRYPT autoconf macro | ||
56 | DEPENDS += "libgcrypt" | ||
57 | # Compress the journal | ||
58 | PACKAGECONFIG[xz] = "--enable-xz,--disable-xz,xz" | ||
59 | PACKAGECONFIG[tcp-wrappers] = "--enable-tcpwrap,--disable-tcpwrap,tcp-wrappers" | ||
60 | PACKAGECONFIG[cryptsetup] = "--enable-libcryptsetup,--disable-libcryptsetup,cryptsetup" | ||
61 | PACKAGECONFIG[microhttpd] = "--enable-microhttpd,--disable-microhttpd,libmicrohttpd" | ||
62 | |||
63 | CACHED_CONFIGUREVARS = "ac_cv_path_KILL=${base_bindir}/kill" | ||
64 | |||
65 | # Helper variables to clarify locations. This mirrors the logic in systemd's | ||
66 | # build system. | ||
67 | rootprefix ?= "${base_prefix}" | ||
68 | rootlibdir ?= "${base_libdir}" | ||
69 | rootlibexecdir = "${rootprefix}/lib" | ||
70 | |||
71 | # The gtk+ tools should get built as a separate recipe e.g. systemd-tools | ||
72 | EXTRA_OECONF = " --with-rootprefix=${rootprefix} \ | ||
73 | --with-rootlibdir=${rootlibdir} \ | ||
74 | ${@base_contains('DISTRO_FEATURES', 'pam', '--enable-pam', '--disable-pam', d)} \ | ||
75 | --enable-xz \ | ||
76 | --disable-manpages \ | ||
77 | --disable-coredump \ | ||
78 | --disable-introspection \ | ||
79 | --disable-kdbus \ | ||
80 | --enable-split-usr \ | ||
81 | --without-python \ | ||
82 | --with-sysvrcnd-path=${sysconfdir} \ | ||
83 | --with-firmware-path=/lib/firmware \ | ||
84 | ac_cv_path_KILL=${base_bindir}/kill \ | ||
85 | " | ||
86 | # uclibc does not have NSS | ||
87 | EXTRA_OECONF_append_libc-uclibc = " --disable-myhostname " | ||
88 | |||
89 | do_configure_prepend() { | ||
90 | export CPP="${HOST_PREFIX}cpp ${TOOLCHAIN_OPTIONS} ${HOST_CC_ARCH}" | ||
91 | export KMOD="${base_bindir}/kmod" | ||
92 | if [ -d ${S}/units.pre_sed ] ; then | ||
93 | cp -r ${S}/units.pre_sed ${S}/units | ||
94 | else | ||
95 | cp -r ${S}/units ${S}/units.pre_sed | ||
96 | fi | ||
97 | sed -i -e 's:=/root:=${ROOT_HOME}:g' ${S}/units/*.service* | ||
98 | sed -i -e 's:\$(LN_S) --relative -f:lnr:g' ${S}/Makefile.am | ||
99 | sed -i -e 's:\$(LN_S) --relative:lnr:g' ${S}/Makefile.am | ||
100 | } | ||
101 | |||
102 | do_install() { | ||
103 | autotools_do_install | ||
104 | install -d ${D}/${base_sbindir} | ||
105 | # Provided by a separate recipe | ||
106 | rm ${D}${systemd_unitdir}/system/serial-getty* -f | ||
107 | |||
108 | # Provide support for initramfs | ||
109 | [ ! -e ${D}/init ] && ln -s ${rootlibexecdir}/systemd/systemd ${D}/init | ||
110 | [ ! -e ${D}/${base_sbindir}/udevd ] && ln -s ${rootlibexecdir}/systemd/systemd-udevd ${D}/${base_sbindir}/udevd | ||
111 | |||
112 | # Create machine-id | ||
113 | # 20:12 < mezcalero> koen: you have three options: a) run systemd-machine-id-setup at install time, b) have / read-only and an empty file there (for stateless) and c) boot with / writable | ||
114 | touch ${D}${sysconfdir}/machine-id | ||
115 | |||
116 | install -m 0644 ${WORKDIR}/*.rules ${D}${sysconfdir}/udev/rules.d/ | ||
117 | |||
118 | install -m 0644 ${WORKDIR}/00-create-volatile.conf ${D}${sysconfdir}/tmpfiles.d/ | ||
119 | |||
120 | if ${@base_contains('DISTRO_FEATURES','sysvinit','true','false',d)}; then | ||
121 | install -d ${D}${sysconfdir}/init.d | ||
122 | install -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/systemd-udevd | ||
123 | sed -i s%@UDEVD@%${rootlibexecdir}/systemd/systemd-udevd% ${D}${sysconfdir}/init.d/systemd-udevd | ||
124 | fi | ||
125 | |||
126 | # Delete journal README, as log can be symlinked inside volatile. | ||
127 | rm -f ${D}/${localstatedir}/log/README | ||
128 | } | ||
129 | |||
130 | do_install_ptest () { | ||
131 | install -d ${D}${PTEST_PATH}/test | ||
132 | cp -rf ${S}/test/* ${D}${PTEST_PATH}/test | ||
133 | install -m 0755 ${B}/test-udev ${D}${PTEST_PATH}/ | ||
134 | install -d ${D}${PTEST_PATH}/build-aux | ||
135 | cp ${S}/build-aux/test-driver ${D}${PTEST_PATH}/build-aux/ | ||
136 | cp -rf ${B}/rules ${D}${PTEST_PATH}/ | ||
137 | # This directory needs to be there for udev-test.pl to work. | ||
138 | install -d ${D}${libdir}/udev/rules.d | ||
139 | cp ${B}/Makefile ${D}${PTEST_PATH}/ | ||
140 | cp ${S}/test/sys.tar.xz ${D}${PTEST_PATH}/test | ||
141 | sed -i 's/"tree"/"ls"/' ${D}${PTEST_PATH}/test/udev-test.pl | ||
142 | sed -i 's#${S}#${PTEST_PATH}#g' ${D}${PTEST_PATH}/Makefile | ||
143 | sed -i 's#${B}#${PTEST_PATH}#g' ${D}${PTEST_PATH}/Makefile | ||
144 | } | ||
145 | |||
146 | python populate_packages_prepend (){ | ||
147 | systemdlibdir = d.getVar("rootlibdir", True) | ||
148 | do_split_packages(d, systemdlibdir, '^lib(.*)\.so\.*', 'lib%s', 'Systemd %s library', extra_depends='', allow_links=True) | ||
149 | } | ||
150 | PACKAGES_DYNAMIC += "^lib(udev|gudev|systemd).*" | ||
151 | |||
152 | PACKAGES =+ "${PN}-gui ${PN}-vconsole-setup ${PN}-initramfs ${PN}-analyze ${PN}-kernel-install \ | ||
153 | ${PN}-rpm-macros ${PN}-binfmt ${PN}-pam ${PN}-zsh" | ||
154 | |||
155 | SYSTEMD_PACKAGES = "${PN}-binfmt" | ||
156 | SYSTEMD_SERVICE_${PN}-binfmt = "systemd-binfmt.service" | ||
157 | |||
158 | USERADD_PACKAGES = "${PN}" | ||
159 | USERADD_PARAM_${PN} += "--system systemd-journal-gateway" | ||
160 | GROUPADD_PARAM_${PN} = "-r lock; -r systemd-journal" | ||
161 | |||
162 | FILES_${PN}-analyze = "${bindir}/systemd-analyze" | ||
163 | |||
164 | FILES_${PN}-initramfs = "/init" | ||
165 | RDEPENDS_${PN}-initramfs = "${PN}" | ||
166 | |||
167 | # The test cases need perl and bash to run correctly. | ||
168 | RDEPENDS_${PN}-ptest += "perl bash" | ||
169 | FILES_${PN}-ptest += "${libdir}/udev/rules.d" | ||
170 | |||
171 | FILES_${PN}-dbg += "${libdir}/systemd/ptest/.debug" | ||
172 | |||
173 | FILES_${PN}-gui = "${bindir}/systemadm" | ||
174 | |||
175 | FILES_${PN}-vconsole-setup = "${rootlibexecdir}/systemd/systemd-vconsole-setup \ | ||
176 | ${systemd_unitdir}/system/systemd-vconsole-setup.service \ | ||
177 | ${systemd_unitdir}/system/sysinit.target.wants/systemd-vconsole-setup.service" | ||
178 | |||
179 | FILES_${PN}-kernel-install = "${bindir}/kernel-install \ | ||
180 | ${sysconfdir}/kernel/ \ | ||
181 | ${exec_prefix}/lib/kernel \ | ||
182 | " | ||
183 | FILES_${PN}-rpm-macros = "${exec_prefix}/lib/rpm \ | ||
184 | " | ||
185 | |||
186 | FILES_${PN}-zsh = "${datadir}/zsh/site-functions" | ||
187 | |||
188 | FILES_${PN}-binfmt = "${sysconfdir}/binfmt.d/ \ | ||
189 | ${exec_prefix}/lib/binfmt.d \ | ||
190 | ${rootlibexecdir}/systemd/systemd-binfmt \ | ||
191 | ${systemd_unitdir}/system/proc-sys-fs-binfmt_misc.* \ | ||
192 | ${systemd_unitdir}/system/systemd-binfmt.service" | ||
193 | RRECOMMENDS_${PN}-binfmt = "kernel-module-binfmt-misc" | ||
194 | |||
195 | RRECOMMENDS_${PN}-vconsole-setup = "kbd kbd-consolefonts" | ||
196 | |||
197 | CONFFILES_${PN} = "${sysconfdir}/systemd/journald.conf \ | ||
198 | ${sysconfdir}/systemd/logind.conf \ | ||
199 | ${sysconfdir}/systemd/system.conf \ | ||
200 | ${sysconfdir}/systemd/user.conf" | ||
201 | |||
202 | FILES_${PN} = " ${base_bindir}/* \ | ||
203 | ${datadir}/bash-completion \ | ||
204 | ${datadir}/dbus-1/services \ | ||
205 | ${datadir}/dbus-1/system-services \ | ||
206 | ${datadir}/polkit-1 \ | ||
207 | ${datadir}/${BPN} \ | ||
208 | ${sysconfdir}/bash_completion.d/ \ | ||
209 | ${sysconfdir}/dbus-1/ \ | ||
210 | ${sysconfdir}/machine-id \ | ||
211 | ${sysconfdir}/modules-load.d/ \ | ||
212 | ${sysconfdir}/sysctl.d/ \ | ||
213 | ${sysconfdir}/systemd/ \ | ||
214 | ${sysconfdir}/tmpfiles.d/ \ | ||
215 | ${sysconfdir}/xdg/ \ | ||
216 | ${sysconfdir}/init.d/README \ | ||
217 | ${rootlibexecdir}/systemd/* \ | ||
218 | ${systemd_unitdir}/* \ | ||
219 | ${base_libdir}/security/*.so \ | ||
220 | ${libdir}/libnss_myhostname.so.2 \ | ||
221 | /cgroup \ | ||
222 | ${bindir}/systemd* \ | ||
223 | ${bindir}/busctl \ | ||
224 | ${bindir}/localectl \ | ||
225 | ${bindir}/hostnamectl \ | ||
226 | ${bindir}/timedatectl \ | ||
227 | ${bindir}/bootctl \ | ||
228 | ${bindir}/kernel-install \ | ||
229 | ${exec_prefix}/lib/tmpfiles.d/*.conf \ | ||
230 | ${exec_prefix}/lib/systemd \ | ||
231 | ${exec_prefix}/lib/modules-load.d \ | ||
232 | ${exec_prefix}/lib/sysctl.d \ | ||
233 | ${localstatedir} \ | ||
234 | /lib/udev/rules.d/70-uaccess.rules \ | ||
235 | /lib/udev/rules.d/71-seat.rules \ | ||
236 | /lib/udev/rules.d/73-seat-late.rules \ | ||
237 | /lib/udev/rules.d/99-systemd.rules \ | ||
238 | ${@base_contains('DISTRO_FEATURES', 'pam', '${sysconfdir}/pam.d', '', d)} \ | ||
239 | " | ||
240 | |||
241 | FILES_${PN}-dbg += "${rootlibdir}/.debug ${systemd_unitdir}/.debug ${systemd_unitdir}/*/.debug ${base_libdir}/security/.debug/" | ||
242 | FILES_${PN}-dev += "${base_libdir}/security/*.la ${datadir}/dbus-1/interfaces/ ${sysconfdir}/rpm/macros.systemd" | ||
243 | |||
244 | RDEPENDS_${PN} += "kmod dbus util-linux-mount udev (= ${EXTENDPKGV})" | ||
245 | |||
246 | RRECOMMENDS_${PN} += "systemd-serialgetty systemd-compat-units \ | ||
247 | util-linux-agetty \ | ||
248 | util-linux-fsck e2fsprogs-e2fsck \ | ||
249 | kernel-module-autofs4 kernel-module-unix kernel-module-ipv6 \ | ||
250 | " | ||
251 | |||
252 | PACKAGES =+ "udev-dbg udev udev-utils udev-hwdb" | ||
253 | |||
254 | FILES_udev-dbg += "/lib/udev/.debug" | ||
255 | |||
256 | RDEPENDS_udev += "udev-utils" | ||
257 | RPROVIDES_udev = "hotplug" | ||
258 | RRECOMMENDS_udev += "udev-hwdb" | ||
259 | |||
260 | RDEPENDS_udev-hwdb += "udev-utils" | ||
261 | |||
262 | FILES_udev += "${base_sbindir}/udevd \ | ||
263 | ${rootlibexecdir}/systemd/systemd-udevd \ | ||
264 | ${rootlibexecdir}/udev/accelerometer \ | ||
265 | ${rootlibexecdir}/udev/ata_id \ | ||
266 | ${rootlibexecdir}/udev/cdrom_id \ | ||
267 | ${rootlibexecdir}/udev/collect \ | ||
268 | ${rootlibexecdir}/udev/findkeyboards \ | ||
269 | ${rootlibexecdir}/udev/keyboard-force-release.sh \ | ||
270 | ${rootlibexecdir}/udev/keymap \ | ||
271 | ${rootlibexecdir}/udev/mtd_probe \ | ||
272 | ${rootlibexecdir}/udev/scsi_id \ | ||
273 | ${rootlibexecdir}/udev/v4l_id \ | ||
274 | ${rootlibexecdir}/udev/keymaps \ | ||
275 | ${rootlibexecdir}/udev/rules.d/4*.rules \ | ||
276 | ${rootlibexecdir}/udev/rules.d/5*.rules \ | ||
277 | ${rootlibexecdir}/udev/rules.d/6*.rules \ | ||
278 | ${rootlibexecdir}/udev/rules.d/70-power-switch.rules \ | ||
279 | ${rootlibexecdir}/udev/rules.d/75*.rules \ | ||
280 | ${rootlibexecdir}/udev/rules.d/78*.rules \ | ||
281 | ${rootlibexecdir}/udev/rules.d/8*.rules \ | ||
282 | ${rootlibexecdir}/udev/rules.d/95*.rules \ | ||
283 | ${sysconfdir}/udev \ | ||
284 | ${sysconfdir}/init.d/systemd-udevd \ | ||
285 | ${systemd_unitdir}/system/*udev* \ | ||
286 | ${systemd_unitdir}/system/*.wants/*udev* \ | ||
287 | " | ||
288 | |||
289 | FILES_udev-utils = "${base_bindir}/udevadm ${datadir}/bash-completion/completions/udevadm" | ||
290 | |||
291 | FILES_udev-hwdb = "${rootlibexecdir}/udev/hwdb.d" | ||
292 | |||
293 | INITSCRIPT_PACKAGES = "udev" | ||
294 | INITSCRIPT_NAME_udev = "systemd-udevd" | ||
295 | INITSCRIPT_PARAMS_udev = "start 03 S ." | ||
296 | |||
297 | python __anonymous() { | ||
298 | if not oe.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d): | ||
299 | d.setVar("INHIBIT_UPDATERCD_BBCLASS", "1") | ||
300 | } | ||
301 | |||
302 | # TODO: | ||
303 | # u-a for runlevel and telinit | ||
304 | |||
305 | ALTERNATIVE_${PN} = "init halt reboot shutdown poweroff runlevel" | ||
306 | |||
307 | ALTERNATIVE_TARGET[init] = "${rootlibexecdir}/systemd/systemd" | ||
308 | ALTERNATIVE_LINK_NAME[init] = "${base_sbindir}/init" | ||
309 | ALTERNATIVE_PRIORITY[init] ?= "300" | ||
310 | |||
311 | ALTERNATIVE_TARGET[halt] = "${base_bindir}/systemctl" | ||
312 | ALTERNATIVE_LINK_NAME[halt] = "${base_sbindir}/halt" | ||
313 | ALTERNATIVE_PRIORITY[halt] ?= "300" | ||
314 | |||
315 | ALTERNATIVE_TARGET[reboot] = "${base_bindir}/systemctl" | ||
316 | ALTERNATIVE_LINK_NAME[reboot] = "${base_sbindir}/reboot" | ||
317 | ALTERNATIVE_PRIORITY[reboot] ?= "300" | ||
318 | |||
319 | ALTERNATIVE_TARGET[shutdown] = "${base_bindir}/systemctl" | ||
320 | ALTERNATIVE_LINK_NAME[shutdown] = "${base_sbindir}/shutdown" | ||
321 | ALTERNATIVE_PRIORITY[shutdown] ?= "300" | ||
322 | |||
323 | ALTERNATIVE_TARGET[poweroff] = "${base_bindir}/systemctl" | ||
324 | ALTERNATIVE_LINK_NAME[poweroff] = "${base_sbindir}/poweroff" | ||
325 | ALTERNATIVE_PRIORITY[poweroff] ?= "300" | ||
326 | |||
327 | ALTERNATIVE_TARGET[runlevel] = "${base_bindir}/systemctl" | ||
328 | ALTERNATIVE_LINK_NAME[runlevel] = "${base_sbindir}/runlevel" | ||
329 | ALTERNATIVE_PRIORITY[runlevel] ?= "300" | ||
330 | |||
331 | pkg_postinst_udev-hwdb () { | ||
332 | if test -n "$D"; then | ||
333 | ${@qemu_run_binary(d, '$D', '${base_bindir}/udevadm')} hwdb --update \ | ||
334 | --root $D | ||
335 | else | ||
336 | udevadm hwdb --update | ||
337 | fi | ||
338 | } | ||
339 | |||
340 | pkg_prerm_udev-hwdb () { | ||
341 | if test -n "$D"; then | ||
342 | exit 1 | ||
343 | fi | ||
344 | |||
345 | rm -f ${sysconfdir}/udev/hwdb.bin | ||
346 | } | ||
347 | |||
348 | # As this recipe builds udev, respect systemd being in DISTRO_FEATURES so | ||
349 | # that we don't build both udev and systemd in world builds. | ||
350 | python () { | ||
351 | if not oe.utils.contains ('DISTRO_FEATURES', 'systemd', True, False, d): | ||
352 | raise bb.parse.SkipPackage("'systemd' not in DISTRO_FEATURES") | ||
353 | } | ||