diff options
author | Adrian Dudau <adrian.dudau@enea.com> | 2013-12-12 13:38:32 +0100 |
---|---|---|
committer | Adrian Dudau <adrian.dudau@enea.com> | 2013-12-12 13:50:20 +0100 |
commit | e2e6f6fe07049f33cb6348780fa975162752e421 (patch) | |
tree | b1813295411235d1297a0ed642b1346b24fdfb12 /meta/recipes-core/systemd/systemd_206.bb | |
download | poky-e2e6f6fe07049f33cb6348780fa975162752e421.tar.gz |
initial commit of Enea Linux 3.1
Migrated from the internal git server on the dora-enea branch
Signed-off-by: Adrian Dudau <adrian.dudau@enea.com>
Diffstat (limited to 'meta/recipes-core/systemd/systemd_206.bb')
-rw-r--r-- | meta/recipes-core/systemd/systemd_206.bb | 327 |
1 files changed, 327 insertions, 0 deletions
diff --git a/meta/recipes-core/systemd/systemd_206.bb b/meta/recipes-core/systemd/systemd_206.bb new file mode 100644 index 0000000000..a1a8bd7ceb --- /dev/null +++ b/meta/recipes-core/systemd/systemd_206.bb | |||
@@ -0,0 +1,327 @@ | |||
1 | DESCRIPTION = "Systemd a init replacement" | ||
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 | SRC_URI = "http://www.freedesktop.org/software/systemd/systemd-${PV}.tar.xz \ | ||
21 | file://0001-use-CAP_MKNOD-ConditionCapability.patch \ | ||
22 | file://0001-Use-bin-mkdir-instead-of-host-mkdir-path.patch \ | ||
23 | file://binfmt-install.patch \ | ||
24 | file://touchscreen.rules \ | ||
25 | ${UCLIBCPATCHES} \ | ||
26 | file://00-create-volatile.conf \ | ||
27 | file://init \ | ||
28 | file://run-ptest \ | ||
29 | " | ||
30 | SRC_URI[md5sum] = "89e36f2d3ba963020b72738549954cbc" | ||
31 | SRC_URI[sha256sum] = "4c993de071118ea1df7ffc4be26ef0b0d78354ef15b2743a2783d20edfcde9de" | ||
32 | |||
33 | UCLIBCPATCHES = "" | ||
34 | UCLIBCPATCHES_libc-uclibc = "file://systemd-pam-configure-check-uclibc.patch \ | ||
35 | file://systemd-pam-fix-execvpe.patch \ | ||
36 | file://systemd-pam-fix-fallocate.patch \ | ||
37 | file://systemd-pam-fix-getty-unit.patch \ | ||
38 | file://systemd-pam-fix-mkostemp.patch \ | ||
39 | file://systemd-pam-fix-msformat.patch \ | ||
40 | file://optional_secure_getenv.patch \ | ||
41 | file://0001-uClibc-doesn-t-implement-pwritev-preadv.patch \ | ||
42 | " | ||
43 | LDFLAGS_libc-uclibc_append = " -lrt" | ||
44 | |||
45 | GTKDOC_DOCDIR = "${S}/docs/" | ||
46 | |||
47 | PACKAGECONFIG ??= "xz tcp-wrappers" | ||
48 | # Sign the journal for anti-tampering | ||
49 | PACKAGECONFIG[gcrypt] = "--enable-gcrypt,--disable-gcrypt,libgcrypt" | ||
50 | # regardless of PACKAGECONFIG, libgcrypt is always required to expand | ||
51 | # the AM_PATH_LIBGCRYPT autoconf macro | ||
52 | DEPENDS += "libgcrypt" | ||
53 | # Compress the journal | ||
54 | PACKAGECONFIG[xz] = "--enable-xz,--disable-xz,xz" | ||
55 | PACKAGECONFIG[tcp-wrappers] = "--enable-tcpwrap,--disable-tcpwrap,tcp-wrappers" | ||
56 | PACKAGECONFIG[cryptsetup] = "--enable-libcryptsetup,--disable-libcryptsetup,cryptsetup" | ||
57 | |||
58 | CACHED_CONFIGUREVARS = "ac_cv_path_KILL=${base_bindir}/kill" | ||
59 | |||
60 | # Helper variables to clarify locations. This mirrors the logic in systemd's | ||
61 | # build system. | ||
62 | rootprefix ?= "${base_prefix}" | ||
63 | rootlibdir ?= "${base_libdir}" | ||
64 | rootlibexecdir = "${rootprefix}/lib" | ||
65 | |||
66 | # The gtk+ tools should get built as a separate recipe e.g. systemd-tools | ||
67 | EXTRA_OECONF = " --with-rootprefix=${rootprefix} \ | ||
68 | --with-rootlibdir=${rootlibdir} \ | ||
69 | ${@base_contains('DISTRO_FEATURES', 'pam', '--enable-pam', '--disable-pam', d)} \ | ||
70 | --enable-xz \ | ||
71 | --disable-manpages \ | ||
72 | --disable-coredump \ | ||
73 | --disable-introspection \ | ||
74 | --disable-tcpwrap \ | ||
75 | --enable-split-usr \ | ||
76 | --disable-microhttpd \ | ||
77 | --without-python \ | ||
78 | --with-sysvrcnd-path=${sysconfdir} \ | ||
79 | --with-firmware-path=/lib/firmware \ | ||
80 | ac_cv_path_KILL=${base_bindir}/kill \ | ||
81 | " | ||
82 | # uclibc does not have NSS | ||
83 | EXTRA_OECONF_append_libc-uclibc = " --disable-myhostname " | ||
84 | |||
85 | do_configure_prepend() { | ||
86 | export CPP="${HOST_PREFIX}cpp ${TOOLCHAIN_OPTIONS} ${HOST_CC_ARCH}" | ||
87 | export KMOD="${base_bindir}/kmod" | ||
88 | sed -i -e 's:=/root:=${ROOT_HOME}:g' ${S}/units/*.service* | ||
89 | } | ||
90 | |||
91 | do_install() { | ||
92 | autotools_do_install | ||
93 | install -d ${D}/${base_sbindir} | ||
94 | # Provided by a separate recipe | ||
95 | rm ${D}${systemd_unitdir}/system/serial-getty* -f | ||
96 | |||
97 | # Provide support for initramfs | ||
98 | ln -s ${rootlibexecdir}/systemd/systemd ${D}/init | ||
99 | ln -s ${rootlibexecdir}/systemd/systemd-udevd ${D}/${base_sbindir}/udevd | ||
100 | |||
101 | # Create dir for journal | ||
102 | install -d ${D}${localstatedir}/log/journal | ||
103 | |||
104 | # Create machine-id | ||
105 | # 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 | ||
106 | touch ${D}${sysconfdir}/machine-id | ||
107 | |||
108 | install -m 0644 ${WORKDIR}/*.rules ${D}${sysconfdir}/udev/rules.d/ | ||
109 | |||
110 | install -m 0644 ${WORKDIR}/00-create-volatile.conf ${D}${sysconfdir}/tmpfiles.d/ | ||
111 | |||
112 | if ${@base_contains('DISTRO_FEATURES','sysvinit','true','false',d)}; then | ||
113 | install -d ${D}${sysconfdir}/init.d | ||
114 | install -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/systemd-udevd | ||
115 | sed -i s%@UDEVD@%${rootlibexecdir}/systemd/systemd-udevd% ${D}${sysconfdir}/init.d/systemd-udevd | ||
116 | fi | ||
117 | } | ||
118 | |||
119 | do_install_ptest () { | ||
120 | install -d ${D}${PTEST_PATH}/test | ||
121 | install ${S}/test/* ${D}${PTEST_PATH}/test | ||
122 | install -m 0755 ${B}/test-udev ${D}${PTEST_PATH}/ | ||
123 | install -d ${D}${PTEST_PATH}/build-aux | ||
124 | cp -rf ${B}/rules ${D}${PTEST_PATH}/ | ||
125 | cp ${B}/Makefile ${D}${PTEST_PATH}/ | ||
126 | cp ${S}/build-aux/test-driver ${D}${PTEST_PATH}/build-aux/ | ||
127 | tar -C ${D}${PTEST_PATH}/test -xJf ${S}/test/sys.tar.xz | ||
128 | sed -i 's/"tree"/"ls"/' ${D}${PTEST_PATH}/test/udev-test.pl | ||
129 | } | ||
130 | |||
131 | python populate_packages_prepend (){ | ||
132 | systemdlibdir = d.getVar("rootlibdir", True) | ||
133 | do_split_packages(d, systemdlibdir, '^lib(.*)\.so\.*', 'lib%s', 'Systemd %s library', extra_depends='', allow_links=True) | ||
134 | } | ||
135 | PACKAGES_DYNAMIC += "^lib(udev|gudev|systemd).*" | ||
136 | |||
137 | PACKAGES =+ "${PN}-gui ${PN}-vconsole-setup ${PN}-initramfs ${PN}-analyze ${PN}-kernel-install ${PN}-rpm-macros ${PN}-binfmt" | ||
138 | |||
139 | SYSTEMD_PACKAGES = "${PN}-binfmt" | ||
140 | SYSTEMD_SERVICE_${PN}-binfmt = "systemd-binfmt.service" | ||
141 | |||
142 | USERADD_PACKAGES = "${PN}" | ||
143 | GROUPADD_PARAM_${PN} = "-r lock; -r systemd-journal" | ||
144 | |||
145 | FILES_${PN}-analyze = "${bindir}/systemd-analyze" | ||
146 | |||
147 | FILES_${PN}-initramfs = "/init" | ||
148 | RDEPENDS_${PN}-initramfs = "${PN}" | ||
149 | |||
150 | FILES_${PN}-gui = "${bindir}/systemadm" | ||
151 | |||
152 | FILES_${PN}-vconsole-setup = "${rootlibexecdir}/systemd/systemd-vconsole-setup \ | ||
153 | ${systemd_unitdir}/system/systemd-vconsole-setup.service \ | ||
154 | ${systemd_unitdir}/system/sysinit.target.wants/systemd-vconsole-setup.service" | ||
155 | |||
156 | FILES_${PN}-kernel-install = "${bindir}/kernel-install \ | ||
157 | ${sysconfdir}/kernel/ \ | ||
158 | ${exec_prefix}/lib/kernel \ | ||
159 | " | ||
160 | FILES_${PN}-rpm-macros = "${exec_prefix}/lib/rpm \ | ||
161 | " | ||
162 | |||
163 | FILES_${PN}-binfmt = "${sysconfdir}/binfmt.d/ \ | ||
164 | ${exec_prefix}/lib/binfmt.d \ | ||
165 | ${rootlibexecdir}/systemd/systemd-binfmt \ | ||
166 | ${systemd_unitdir}/system/proc-sys-fs-binfmt_misc.* \ | ||
167 | ${systemd_unitdir}/system/systemd-binfmt.service" | ||
168 | RRECOMMENDS_${PN}-binfmt = "kernel-module-binfmt-misc" | ||
169 | |||
170 | RRECOMMENDS_${PN}-vconsole-setup = "kbd kbd-consolefonts" | ||
171 | |||
172 | CONFFILES_${PN} = "${sysconfdir}/systemd/journald.conf \ | ||
173 | ${sysconfdir}/systemd/logind.conf \ | ||
174 | ${sysconfdir}/systemd/system.conf \ | ||
175 | ${sysconfdir}/systemd/user.conf" | ||
176 | |||
177 | FILES_${PN} = " ${base_bindir}/* \ | ||
178 | ${datadir}/bash-completion \ | ||
179 | ${datadir}/dbus-1/services \ | ||
180 | ${datadir}/dbus-1/system-services \ | ||
181 | ${datadir}/polkit-1 \ | ||
182 | ${datadir}/${BPN} \ | ||
183 | ${sysconfdir}/bash_completion.d/ \ | ||
184 | ${sysconfdir}/dbus-1/ \ | ||
185 | ${sysconfdir}/machine-id \ | ||
186 | ${sysconfdir}/modules-load.d/ \ | ||
187 | ${sysconfdir}/sysctl.d/ \ | ||
188 | ${sysconfdir}/systemd/ \ | ||
189 | ${sysconfdir}/tmpfiles.d/ \ | ||
190 | ${sysconfdir}/xdg/ \ | ||
191 | ${sysconfdir}/init.d/README \ | ||
192 | ${rootlibexecdir}/systemd/* \ | ||
193 | ${systemd_unitdir}/* \ | ||
194 | ${base_libdir}/security/*.so \ | ||
195 | ${libdir}/libnss_myhostname.so.2 \ | ||
196 | /cgroup \ | ||
197 | ${bindir}/systemd* \ | ||
198 | ${bindir}/localectl \ | ||
199 | ${bindir}/hostnamectl \ | ||
200 | ${bindir}/timedatectl \ | ||
201 | ${bindir}/bootctl \ | ||
202 | ${bindir}/kernel-install \ | ||
203 | ${exec_prefix}/lib/tmpfiles.d/*.conf \ | ||
204 | ${exec_prefix}/lib/systemd \ | ||
205 | ${exec_prefix}/lib/modules-load.d \ | ||
206 | ${exec_prefix}/lib/sysctl.d \ | ||
207 | ${localstatedir} \ | ||
208 | /lib/udev/rules.d/70-uaccess.rules \ | ||
209 | /lib/udev/rules.d/71-seat.rules \ | ||
210 | /lib/udev/rules.d/73-seat-late.rules \ | ||
211 | /lib/udev/rules.d/99-systemd.rules \ | ||
212 | " | ||
213 | |||
214 | FILES_${PN}-dbg += "${rootlibdir}/.debug ${systemd_unitdir}/.debug ${systemd_unitdir}/*/.debug ${base_libdir}/security/.debug/" | ||
215 | FILES_${PN}-dev += "${base_libdir}/security/*.la ${datadir}/dbus-1/interfaces/ ${sysconfdir}/rpm/macros.systemd" | ||
216 | |||
217 | RDEPENDS_${PN} += "kmod dbus util-linux-mount" | ||
218 | |||
219 | RRECOMMENDS_${PN} += "systemd-serialgetty systemd-compat-units \ | ||
220 | util-linux-agetty \ | ||
221 | util-linux-fsck e2fsprogs-e2fsck \ | ||
222 | kernel-module-autofs4 kernel-module-unix kernel-module-ipv6 \ | ||
223 | " | ||
224 | |||
225 | PACKAGES =+ "udev-dbg udev udev-utils udev-hwdb" | ||
226 | |||
227 | FILES_udev-dbg += "/lib/udev/.debug" | ||
228 | |||
229 | RDEPENDS_udev += "udev-utils" | ||
230 | RPROVIDES_udev = "hotplug" | ||
231 | RRECOMMENDS_udev += "udev-hwdb" | ||
232 | |||
233 | RDEPENDS_udev-hwdb += "udev-utils" | ||
234 | |||
235 | FILES_udev += "${base_sbindir}/udevd \ | ||
236 | ${rootlibexecdir}/systemd/systemd-udevd \ | ||
237 | ${rootlibexecdir}/udev/accelerometer \ | ||
238 | ${rootlibexecdir}/udev/ata_id \ | ||
239 | ${rootlibexecdir}/udev/cdrom_id \ | ||
240 | ${rootlibexecdir}/udev/collect \ | ||
241 | ${rootlibexecdir}/udev/findkeyboards \ | ||
242 | ${rootlibexecdir}/udev/keyboard-force-release.sh \ | ||
243 | ${rootlibexecdir}/udev/keymap \ | ||
244 | ${rootlibexecdir}/udev/mtd_probe \ | ||
245 | ${rootlibexecdir}/udev/scsi_id \ | ||
246 | ${rootlibexecdir}/udev/v4l_id \ | ||
247 | ${rootlibexecdir}/udev/keymaps \ | ||
248 | ${rootlibexecdir}/udev/rules.d/4*.rules \ | ||
249 | ${rootlibexecdir}/udev/rules.d/5*.rules \ | ||
250 | ${rootlibexecdir}/udev/rules.d/6*.rules \ | ||
251 | ${rootlibexecdir}/udev/rules.d/70-power-switch.rules \ | ||
252 | ${rootlibexecdir}/udev/rules.d/75*.rules \ | ||
253 | ${rootlibexecdir}/udev/rules.d/78*.rules \ | ||
254 | ${rootlibexecdir}/udev/rules.d/8*.rules \ | ||
255 | ${rootlibexecdir}/udev/rules.d/95*.rules \ | ||
256 | ${sysconfdir}/udev \ | ||
257 | ${sysconfdir}/init.d/systemd-udevd \ | ||
258 | ${systemd_unitdir}/system/*udev* \ | ||
259 | ${systemd_unitdir}/system/*.wants/*udev* \ | ||
260 | " | ||
261 | |||
262 | FILES_udev-utils = "${base_bindir}/udevadm ${datadir}/bash-completion/completions/udevadm" | ||
263 | |||
264 | FILES_udev-hwdb = "${rootlibexecdir}/udev/hwdb.d" | ||
265 | |||
266 | INITSCRIPT_PACKAGES = "udev" | ||
267 | INITSCRIPT_NAME_udev = "systemd-udevd" | ||
268 | INITSCRIPT_PARAMS_udev = "start 03 S ." | ||
269 | |||
270 | python __anonymous() { | ||
271 | features = d.getVar("DISTRO_FEATURES", True).split() | ||
272 | if "sysvinit" not in features: | ||
273 | d.setVar("INHIBIT_UPDATERCD_BBCLASS", "1") | ||
274 | } | ||
275 | |||
276 | # TODO: | ||
277 | # u-a for runlevel and telinit | ||
278 | |||
279 | ALTERNATIVE_${PN} = "init halt reboot shutdown poweroff runlevel" | ||
280 | |||
281 | ALTERNATIVE_TARGET[init] = "${rootlibexecdir}/systemd/systemd" | ||
282 | ALTERNATIVE_LINK_NAME[init] = "${base_sbindir}/init" | ||
283 | ALTERNATIVE_PRIORITY[init] ?= "300" | ||
284 | |||
285 | ALTERNATIVE_TARGET[halt] = "${base_bindir}/systemctl" | ||
286 | ALTERNATIVE_LINK_NAME[halt] = "${base_sbindir}/halt" | ||
287 | ALTERNATIVE_PRIORITY[halt] ?= "300" | ||
288 | |||
289 | ALTERNATIVE_TARGET[reboot] = "${base_bindir}/systemctl" | ||
290 | ALTERNATIVE_LINK_NAME[reboot] = "${base_sbindir}/reboot" | ||
291 | ALTERNATIVE_PRIORITY[reboot] ?= "300" | ||
292 | |||
293 | ALTERNATIVE_TARGET[shutdown] = "${base_bindir}/systemctl" | ||
294 | ALTERNATIVE_LINK_NAME[shutdown] = "${base_sbindir}/shutdown" | ||
295 | ALTERNATIVE_PRIORITY[shutdown] ?= "300" | ||
296 | |||
297 | ALTERNATIVE_TARGET[poweroff] = "${base_bindir}/systemctl" | ||
298 | ALTERNATIVE_LINK_NAME[poweroff] = "${base_sbindir}/poweroff" | ||
299 | ALTERNATIVE_PRIORITY[poweroff] ?= "300" | ||
300 | |||
301 | ALTERNATIVE_TARGET[runlevel] = "${base_bindir}/systemctl" | ||
302 | ALTERNATIVE_LINK_NAME[runlevel] = "${base_sbindir}/runlevel" | ||
303 | ALTERNATIVE_PRIORITY[runlevel] ?= "300" | ||
304 | |||
305 | pkg_postinst_udev-hwdb () { | ||
306 | if test -n "$D"; then | ||
307 | ${@qemu_run_binary(d, '$D', '${base_bindir}/udevadm')} hwdb --update \ | ||
308 | --root $D | ||
309 | else | ||
310 | udevadm hwdb --update | ||
311 | fi | ||
312 | } | ||
313 | |||
314 | pkg_prerm_udev-hwdb () { | ||
315 | if test -n "$D"; then | ||
316 | exit 1 | ||
317 | fi | ||
318 | |||
319 | rm -f ${sysconfdir}/udev/hwdb.bin | ||
320 | } | ||
321 | |||
322 | # As this recipe builds udev, respect the systemd DISTRO_FEATURE so we don't try | ||
323 | # building udev and systemd in world builds. | ||
324 | python () { | ||
325 | if not oe.utils.contains ('DISTRO_FEATURES', 'systemd', True, False, d): | ||
326 | raise bb.parse.SkipPackage("'systemd' not in DISTRO_FEATURES") | ||
327 | } | ||