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