diff options
Diffstat (limited to 'meta/recipes-core/systemd/systemd_232.bb')
-rw-r--r-- | meta/recipes-core/systemd/systemd_232.bb | 594 |
1 files changed, 594 insertions, 0 deletions
diff --git a/meta/recipes-core/systemd/systemd_232.bb b/meta/recipes-core/systemd/systemd_232.bb new file mode 100644 index 0000000000..baee02ed73 --- /dev/null +++ b/meta/recipes-core/systemd/systemd_232.bb | |||
@@ -0,0 +1,594 @@ | |||
1 | require systemd.inc | ||
2 | |||
3 | PROVIDES = "udev" | ||
4 | |||
5 | PE = "1" | ||
6 | |||
7 | DEPENDS = "kmod intltool-native gperf-native acl readline libcap libcgroup qemu-native util-linux" | ||
8 | |||
9 | SECTION = "base/shell" | ||
10 | |||
11 | inherit useradd pkgconfig autotools perlnative update-rc.d update-alternatives qemu systemd ptest gettext bash-completion manpages | ||
12 | |||
13 | SRC_URI += " \ | ||
14 | file://touchscreen.rules \ | ||
15 | file://00-create-volatile.conf \ | ||
16 | file://init \ | ||
17 | file://run-ptest \ | ||
18 | file://0003-define-exp10-if-missing.patch \ | ||
19 | file://0004-Use-getenv-when-secure-versions-are-not-available.patch \ | ||
20 | file://0005-binfmt-Don-t-install-dependency-links-at-install-tim.patch \ | ||
21 | file://0006-configure-Check-for-additional-features-that-uclibc-.patch \ | ||
22 | file://0007-use-lnr-wrapper-instead-of-looking-for-relative-opti.patch \ | ||
23 | file://0008-nspawn-Use-execvpe-only-when-libc-supports-it.patch \ | ||
24 | file://0009-util-bypass-unimplemented-_SC_PHYS_PAGES-system-conf.patch \ | ||
25 | file://0010-implment-systemd-sysv-install-for-OE.patch \ | ||
26 | file://0011-nss-mymachines-Build-conditionally-when-HAVE_MYHOSTN.patch \ | ||
27 | file://0012-rules-whitelist-hd-devices.patch \ | ||
28 | file://0013-Make-root-s-home-directory-configurable.patch \ | ||
29 | file://0014-Revert-rules-remove-firmware-loading-rules.patch \ | ||
30 | file://0015-Revert-udev-remove-userspace-firmware-loading-suppor.patch \ | ||
31 | file://0016-make-test-dir-configurable.patch \ | ||
32 | file://0017-remove-duplicate-include-uchar.h.patch \ | ||
33 | file://0018-check-for-uchar.h-in-configure.patch \ | ||
34 | file://0019-socket-util-don-t-fail-if-libc-doesn-t-support-IDN.patch \ | ||
35 | " | ||
36 | SRC_URI_append_libc-uclibc = "\ | ||
37 | file://0002-units-Prefer-getty-to-agetty-in-console-setup-system.patch \ | ||
38 | " | ||
39 | SRC_URI_append_qemuall = " file://0001-core-device.c-Change-the-default-device-timeout-to-2.patch" | ||
40 | |||
41 | PACKAGECONFIG ??= "xz \ | ||
42 | ldconfig \ | ||
43 | ${@bb.utils.contains('DISTRO_FEATURES', 'pam', 'pam', '', d)} \ | ||
44 | ${@bb.utils.contains('DISTRO_FEATURES', 'x11', 'xkbcommon', '', d)} \ | ||
45 | ${@bb.utils.contains('DISTRO_FEATURES', 'selinux', 'selinux', '', d)} \ | ||
46 | ${@bb.utils.contains('DISTRO_FEATURES', 'wifi', 'rfkill', '', d)} \ | ||
47 | ${@bb.utils.contains('MACHINE_FEATURES', 'efi', 'efi', '', d)} \ | ||
48 | binfmt \ | ||
49 | randomseed \ | ||
50 | machined \ | ||
51 | backlight \ | ||
52 | quotacheck \ | ||
53 | hostnamed \ | ||
54 | ${@bb.utils.contains('TCLIBC', 'glibc', 'myhostname sysusers', '', d)} \ | ||
55 | hibernate \ | ||
56 | timedated \ | ||
57 | timesyncd \ | ||
58 | localed \ | ||
59 | ima \ | ||
60 | smack \ | ||
61 | logind \ | ||
62 | firstboot \ | ||
63 | utmp \ | ||
64 | polkit \ | ||
65 | " | ||
66 | PACKAGECONFIG_remove_libc-musl = "selinux" | ||
67 | PACKAGECONFIG_remove_libc-musl = "smack" | ||
68 | |||
69 | # Use the upstream systemd serial-getty@.service and rely on | ||
70 | # systemd-getty-generator instead of using the OE-core specific | ||
71 | # systemd-serialgetty.bb - not enabled by default. | ||
72 | PACKAGECONFIG[serial-getty-generator] = "" | ||
73 | |||
74 | PACKAGECONFIG[journal-upload] = "--enable-libcurl,--disable-libcurl,curl" | ||
75 | # Sign the journal for anti-tampering | ||
76 | PACKAGECONFIG[gcrypt] = "--enable-gcrypt,--disable-gcrypt,libgcrypt" | ||
77 | PACKAGECONFIG[cryptsetup] = "--enable-libcryptsetup,--disable-libcryptsetup,cryptsetup" | ||
78 | PACKAGECONFIG[microhttpd] = "--enable-microhttpd,--disable-microhttpd,libmicrohttpd" | ||
79 | PACKAGECONFIG[elfutils] = "--enable-elfutils,--disable-elfutils,elfutils" | ||
80 | PACKAGECONFIG[resolved] = "--enable-resolved,--disable-resolved" | ||
81 | PACKAGECONFIG[networkd] = "--enable-networkd,--disable-networkd" | ||
82 | PACKAGECONFIG[machined] = "--enable-machined,--disable-machined" | ||
83 | PACKAGECONFIG[backlight] = "--enable-backlight,--disable-backlight" | ||
84 | PACKAGECONFIG[quotacheck] = "--enable-quotacheck,--disable-quotacheck" | ||
85 | PACKAGECONFIG[hostnamed] = "--enable-hostnamed,--disable-hostnamed" | ||
86 | PACKAGECONFIG[myhostname] = "--enable-myhostname,--disable-myhostname" | ||
87 | PACKAGECONFIG[rfkill] = "--enable-rfkill,--disable-rfkill" | ||
88 | PACKAGECONFIG[hibernate] = "--enable-hibernate,--disable-hibernate" | ||
89 | PACKAGECONFIG[timedated] = "--enable-timedated,--disable-timedated" | ||
90 | PACKAGECONFIG[timesyncd] = "--enable-timesyncd,--disable-timesyncd" | ||
91 | PACKAGECONFIG[localed] = "--enable-localed,--disable-localed" | ||
92 | PACKAGECONFIG[efi] = "--enable-efi,--disable-efi" | ||
93 | PACKAGECONFIG[ima] = "--enable-ima,--disable-ima" | ||
94 | PACKAGECONFIG[smack] = "--enable-smack,--disable-smack" | ||
95 | # libseccomp is found in meta-security | ||
96 | PACKAGECONFIG[seccomp] = "--enable-seccomp,--disable-seccomp,libseccomp" | ||
97 | PACKAGECONFIG[logind] = "--enable-logind,--disable-logind" | ||
98 | PACKAGECONFIG[sysusers] = "--enable-sysusers,--disable-sysusers" | ||
99 | PACKAGECONFIG[firstboot] = "--enable-firstboot,--disable-firstboot" | ||
100 | PACKAGECONFIG[randomseed] = "--enable-randomseed,--disable-randomseed" | ||
101 | PACKAGECONFIG[binfmt] = "--enable-binfmt,--disable-binfmt" | ||
102 | PACKAGECONFIG[utmp] = "--enable-utmp,--disable-utmp" | ||
103 | PACKAGECONFIG[polkit] = "--enable-polkit,--disable-polkit" | ||
104 | # importd requires curl/xz/zlib/bzip2/gcrypt | ||
105 | PACKAGECONFIG[importd] = "--enable-importd,--disable-importd" | ||
106 | PACKAGECONFIG[libidn] = "--enable-libidn,--disable-libidn,libidn" | ||
107 | PACKAGECONFIG[audit] = "--enable-audit,--disable-audit,audit" | ||
108 | PACKAGECONFIG[manpages] = "--enable-manpages,--disable-manpages,libxslt-native xmlto-native docbook-xml-dtd4-native docbook-xsl-stylesheets-native" | ||
109 | PACKAGECONFIG[pam] = "--enable-pam,--disable-pam,libpam" | ||
110 | # Verify keymaps on locale change | ||
111 | PACKAGECONFIG[xkbcommon] = "--enable-xkbcommon,--disable-xkbcommon,libxkbcommon" | ||
112 | # Update NAT firewall rules | ||
113 | PACKAGECONFIG[iptc] = "--enable-libiptc,--disable-libiptc,iptables" | ||
114 | PACKAGECONFIG[ldconfig] = "--enable-ldconfig,--disable-ldconfig,," | ||
115 | PACKAGECONFIG[selinux] = "--enable-selinux,--disable-selinux,libselinux" | ||
116 | PACKAGECONFIG[valgrind] = "ac_cv_header_valgrind_memcheck_h=yes ac_cv_header_valgrind_valgrind_h=yes ,ac_cv_header_valgrind_memcheck_h=no ac_cv_header_valgrind_valgrind_h=no ,valgrind" | ||
117 | PACKAGECONFIG[qrencode] = "--enable-qrencode,--disable-qrencode,qrencode" | ||
118 | PACKAGECONFIG[dbus] = "--enable-dbus,--disable-dbus,dbus" | ||
119 | PACKAGECONFIG[coredump] = "--enable-coredump,--disable-coredump" | ||
120 | PACKAGECONFIG[bzip2] = "--enable-bzip2,--disable-bzip2,bzip2" | ||
121 | PACKAGECONFIG[lz4] = "--enable-lz4,--disable-lz4,lz4" | ||
122 | PACKAGECONFIG[xz] = "--enable-xz,--disable-xz,xz" | ||
123 | PACKAGECONFIG[zlib] = "--enable-zlib,--disable-zlib,zlib" | ||
124 | |||
125 | CACHED_CONFIGUREVARS += "ac_cv_path_KILL=${base_bindir}/kill" | ||
126 | CACHED_CONFIGUREVARS += "ac_cv_path_KMOD=${base_bindir}/kmod" | ||
127 | CACHED_CONFIGUREVARS += "ac_cv_path_QUOTACHECK=${sbindir}/quotacheck" | ||
128 | CACHED_CONFIGUREVARS += "ac_cv_path_QUOTAON=${sbindir}/quotaon" | ||
129 | CACHED_CONFIGUREVARS += "ac_cv_path_SULOGIN=${base_sbindir}/sulogin" | ||
130 | |||
131 | # Helper variables to clarify locations. This mirrors the logic in systemd's | ||
132 | # build system. | ||
133 | rootprefix ?= "${base_prefix}" | ||
134 | rootlibdir ?= "${base_libdir}" | ||
135 | rootlibexecdir = "${rootprefix}/lib" | ||
136 | |||
137 | CACHED_CONFIGUREVARS_class-target = "\ | ||
138 | ac_cv_path_MOUNT_PATH=${base_bindir}/mount \ | ||
139 | ac_cv_path_UMOUNT_PATH=${base_bindir}/umount \ | ||
140 | ac_cv_path_KMOD=${base_bindir}/kmod \ | ||
141 | ac_cv_path_KILL=${base_bindir}/kill \ | ||
142 | ac_cv_path_SULOGIN=${base_sbindir}/sulogin \ | ||
143 | ac_cv_path_KEXEC=${sbindir}/kexec \ | ||
144 | ac_cv_path_QUOTACHECK=${sbindir}/quotacheck \ | ||
145 | ac_cv_path_QUOTAON=${sbindir}/quotaon \ | ||
146 | " | ||
147 | |||
148 | EXTRA_OECONF = " --with-rootprefix=${rootprefix} \ | ||
149 | --with-rootlibdir=${rootlibdir} \ | ||
150 | --with-roothomedir=${ROOT_HOME} \ | ||
151 | --enable-split-usr \ | ||
152 | --without-python \ | ||
153 | --with-sysvrcnd-path=${sysconfdir} \ | ||
154 | --with-firmware-path=/lib/firmware \ | ||
155 | --with-testdir=${PTEST_PATH} \ | ||
156 | " | ||
157 | # per the systemd README, define VALGRIND=1 to run under valgrind | ||
158 | CFLAGS .= "${@bb.utils.contains('PACKAGECONFIG', 'valgrind', ' -DVALGRIND=1', '', d)}" | ||
159 | |||
160 | # disable problematic GCC 5.2 optimizations [YOCTO #8291] | ||
161 | FULL_OPTIMIZATION_append_arm = " -fno-schedule-insns -fno-schedule-insns2" | ||
162 | |||
163 | do_configure_prepend() { | ||
164 | export NM="${HOST_PREFIX}gcc-nm" | ||
165 | export AR="${HOST_PREFIX}gcc-ar" | ||
166 | export RANLIB="${HOST_PREFIX}gcc-ranlib" | ||
167 | export KMOD="${base_bindir}/kmod" | ||
168 | if [ -d ${S}/units.pre_sed ] ; then | ||
169 | cp -r ${S}/units.pre_sed ${S}/units | ||
170 | else | ||
171 | cp -r ${S}/units ${S}/units.pre_sed | ||
172 | fi | ||
173 | sed -i -e 's:-DTEST_DIR=\\\".*\\\":-DTEST_DIR=\\\"${PTEST_PATH}/tests/test\\\":' ${S}/Makefile.am | ||
174 | sed -i -e 's:-DCATALOG_DIR=\\\".*\\\":-DCATALOG_DIR=\\\"${PTEST_PATH}/tests/catalog\\\":' ${S}/Makefile.am | ||
175 | } | ||
176 | |||
177 | do_install() { | ||
178 | autotools_do_install | ||
179 | install -d ${D}/${base_sbindir} | ||
180 | if ${@bb.utils.contains('PACKAGECONFIG', 'serial-getty-generator', 'false', 'true', d)}; then | ||
181 | # Provided by a separate recipe | ||
182 | rm ${D}${systemd_unitdir}/system/serial-getty* -f | ||
183 | fi | ||
184 | |||
185 | # Provide support for initramfs | ||
186 | [ ! -e ${D}/init ] && ln -s ${rootlibexecdir}/systemd/systemd ${D}/init | ||
187 | [ ! -e ${D}/${base_sbindir}/udevd ] && ln -s ${rootlibexecdir}/systemd/systemd-udevd ${D}/${base_sbindir}/udevd | ||
188 | |||
189 | # Create machine-id | ||
190 | # 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 | ||
191 | touch ${D}${sysconfdir}/machine-id | ||
192 | |||
193 | |||
194 | install -d ${D}${sysconfdir}/udev/rules.d/ | ||
195 | install -d ${D}${sysconfdir}/tmpfiles.d | ||
196 | install -m 0644 ${WORKDIR}/*.rules ${D}${sysconfdir}/udev/rules.d/ | ||
197 | install -d ${D}${libdir}/pkgconfig | ||
198 | install -m 0644 ${B}/src/udev/udev.pc ${D}${libdir}/pkgconfig/ | ||
199 | |||
200 | install -m 0644 ${WORKDIR}/00-create-volatile.conf ${D}${sysconfdir}/tmpfiles.d/ | ||
201 | |||
202 | if ${@bb.utils.contains('DISTRO_FEATURES','sysvinit','true','false',d)}; then | ||
203 | install -d ${D}${sysconfdir}/init.d | ||
204 | install -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/systemd-udevd | ||
205 | sed -i s%@UDEVD@%${rootlibexecdir}/systemd/systemd-udevd% ${D}${sysconfdir}/init.d/systemd-udevd | ||
206 | fi | ||
207 | |||
208 | chown root:systemd-journal ${D}/${localstatedir}/log/journal | ||
209 | |||
210 | # Delete journal README, as log can be symlinked inside volatile. | ||
211 | rm -f ${D}/${localstatedir}/log/README | ||
212 | |||
213 | install -d ${D}${systemd_unitdir}/system/graphical.target.wants | ||
214 | install -d ${D}${systemd_unitdir}/system/multi-user.target.wants | ||
215 | install -d ${D}${systemd_unitdir}/system/poweroff.target.wants | ||
216 | install -d ${D}${systemd_unitdir}/system/reboot.target.wants | ||
217 | install -d ${D}${systemd_unitdir}/system/rescue.target.wants | ||
218 | |||
219 | # Create symlinks for systemd-update-utmp-runlevel.service | ||
220 | if ${@bb.utils.contains('PACKAGECONFIG', 'utmp', 'true', 'false', d)}; then | ||
221 | ln -sf ../systemd-update-utmp-runlevel.service ${D}${systemd_unitdir}/system/graphical.target.wants/systemd-update-utmp-runlevel.service | ||
222 | ln -sf ../systemd-update-utmp-runlevel.service ${D}${systemd_unitdir}/system/multi-user.target.wants/systemd-update-utmp-runlevel.service | ||
223 | ln -sf ../systemd-update-utmp-runlevel.service ${D}${systemd_unitdir}/system/poweroff.target.wants/systemd-update-utmp-runlevel.service | ||
224 | ln -sf ../systemd-update-utmp-runlevel.service ${D}${systemd_unitdir}/system/reboot.target.wants/systemd-update-utmp-runlevel.service | ||
225 | ln -sf ../systemd-update-utmp-runlevel.service ${D}${systemd_unitdir}/system/rescue.target.wants/systemd-update-utmp-runlevel.service | ||
226 | fi | ||
227 | |||
228 | # Enable journal to forward message to syslog daemon | ||
229 | sed -i -e 's/.*ForwardToSyslog.*/ForwardToSyslog=yes/' ${D}${sysconfdir}/systemd/journald.conf | ||
230 | # Set the maximium size of runtime journal to 64M as default | ||
231 | sed -i -e 's/.*RuntimeMaxUse.*/RuntimeMaxUse=64M/' ${D}${sysconfdir}/systemd/journald.conf | ||
232 | |||
233 | # this file is needed to exist if networkd is disabled but timesyncd is still in use since timesyncd checks it | ||
234 | # for existence else it fails | ||
235 | if [ -s ${D}${exec_prefix}/lib/tmpfiles.d/systemd.conf ]; then | ||
236 | ${@bb.utils.contains('PACKAGECONFIG', 'networkd', ':', 'sed -i -e "\$ad /run/systemd/netif/links 0755 root root -" ${D}${exec_prefix}/lib/tmpfiles.d/systemd.conf', d)} | ||
237 | fi | ||
238 | if ! ${@bb.utils.contains('PACKAGECONFIG', 'resolved', 'true', 'false', d)}; then | ||
239 | # if resolved is disabled, it won't handle the link of resolv.conf, so | ||
240 | # set it up ourselves | ||
241 | ln -s ../run/resolv.conf ${D}${sysconfdir}/resolv.conf | ||
242 | echo 'L! ${sysconfdir}/resolv.conf - - - - ../run/resolv.conf' >>${D}${exec_prefix}/lib/tmpfiles.d/etc.conf | ||
243 | echo 'f /run/resolv.conf 0644 root root' >>${D}${exec_prefix}/lib/tmpfiles.d/systemd.conf | ||
244 | fi | ||
245 | install -Dm 0755 ${S}/src/systemctl/systemd-sysv-install.SKELETON ${D}${systemd_unitdir}/systemd-sysv-install | ||
246 | } | ||
247 | |||
248 | do_install_ptest () { | ||
249 | # install data files needed for tests | ||
250 | install -d ${D}${PTEST_PATH}/tests/test | ||
251 | cp -rfL ${S}/test/* ${D}${PTEST_PATH}/tests/test | ||
252 | # python is disabled for systemd, thus removing these python testing scripts | ||
253 | rm ${D}${PTEST_PATH}/tests/test/*.py | ||
254 | sed -i 's/"tree"/"ls"/' ${D}${PTEST_PATH}/tests/test/udev-test.pl | ||
255 | |||
256 | install -d ${D}${PTEST_PATH}/tests/catalog | ||
257 | install ${S}/catalog/* ${D}${PTEST_PATH}/tests/catalog/ | ||
258 | |||
259 | install -D ${S}/build-aux/test-driver ${D}${PTEST_PATH}/tests/build-aux/test-driver | ||
260 | |||
261 | install -d ${D}${PTEST_PATH}/tests/rules | ||
262 | install ${B}/rules/* ${D}${PTEST_PATH}/tests/rules/ | ||
263 | |||
264 | # This directory needs to be there for udev-test.pl to work. | ||
265 | install -d ${D}${libdir}/udev/rules.d | ||
266 | |||
267 | # install actual test binaries | ||
268 | install -m 0755 ${B}/test-* ${D}${PTEST_PATH}/tests/ | ||
269 | install -m 0755 ${B}/.libs/test-* ${D}${PTEST_PATH}/tests/ | ||
270 | |||
271 | install ${B}/Makefile ${D}${PTEST_PATH}/tests/ | ||
272 | } | ||
273 | |||
274 | python populate_packages_prepend (){ | ||
275 | systemdlibdir = d.getVar("rootlibdir", True) | ||
276 | do_split_packages(d, systemdlibdir, '^lib(.*)\.so\.*', 'lib%s', 'Systemd %s library', extra_depends='', allow_links=True) | ||
277 | } | ||
278 | PACKAGES_DYNAMIC += "^lib(udev|systemd|nss).*" | ||
279 | |||
280 | PACKAGES =+ "\ | ||
281 | ${PN}-gui \ | ||
282 | ${PN}-vconsole-setup \ | ||
283 | ${PN}-initramfs \ | ||
284 | ${PN}-analyze \ | ||
285 | ${PN}-kernel-install \ | ||
286 | ${PN}-rpm-macros \ | ||
287 | ${PN}-binfmt \ | ||
288 | ${PN}-pam \ | ||
289 | ${PN}-zsh-completion \ | ||
290 | ${PN}-xorg-xinitrc \ | ||
291 | ${PN}-container \ | ||
292 | ${PN}-extra-utils \ | ||
293 | " | ||
294 | |||
295 | SUMMARY_${PN}-container = "Tools for containers and VMs" | ||
296 | DESCRIPTION_${PN}-container = "Systemd tools to spawn and manage containers and virtual machines." | ||
297 | |||
298 | SYSTEMD_PACKAGES = "${@bb.utils.contains('PACKAGECONFIG', 'binfmt', '${PN}-binfmt', '', d)}" | ||
299 | SYSTEMD_SERVICE_${PN}-binfmt = "systemd-binfmt.service" | ||
300 | |||
301 | USERADD_PACKAGES = "${PN} ${PN}-extra-utils" | ||
302 | USERADD_PARAM_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'microhttpd', '--system -d / -M --shell /bin/nologin systemd-journal-gateway;', '', d)}" | ||
303 | USERADD_PARAM_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'microhttpd', '--system -d / -M --shell /bin/nologin systemd-journal-remote;', '', d)}" | ||
304 | USERADD_PARAM_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'journal-upload', '--system -d / -M --shell /bin/nologin systemd-journal-upload;', '', d)}" | ||
305 | USERADD_PARAM_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'timesyncd', '--system -d / -M --shell /bin/nologin systemd-timesync;', '', d)}" | ||
306 | USERADD_PARAM_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'networkd', '--system -d / -M --shell /bin/nologin systemd-network;', '', d)}" | ||
307 | USERADD_PARAM_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'coredump', '--system -d / -M --shell /bin/nologin systemd-coredump;', '', d)}" | ||
308 | USERADD_PARAM_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'resolved', '--system -d / -M --shell /bin/nologin systemd-resolve;', '', d)}" | ||
309 | GROUPADD_PARAM_${PN} = "-r lock; -r systemd-journal" | ||
310 | USERADD_PARAM_${PN}-extra-utils += "--system -d / -M --shell /bin/nologin systemd-bus-proxy;" | ||
311 | |||
312 | FILES_${PN}-analyze = "${bindir}/systemd-analyze" | ||
313 | |||
314 | FILES_${PN}-initramfs = "/init" | ||
315 | RDEPENDS_${PN}-initramfs = "${PN}" | ||
316 | |||
317 | RDEPENDS_${PN}-ptest += "gawk make perl bash xz \ | ||
318 | tzdata tzdata-americas tzdata-asia \ | ||
319 | tzdata-europe tzdata-africa tzdata-antarctica \ | ||
320 | tzdata-arctic tzdata-atlantic tzdata-australia \ | ||
321 | tzdata-pacific tzdata-posix" | ||
322 | |||
323 | FILES_${PN}-ptest += "${libdir}/udev/rules.d" | ||
324 | |||
325 | FILES_${PN}-gui = "${bindir}/systemadm" | ||
326 | |||
327 | FILES_${PN}-vconsole-setup = "${rootlibexecdir}/systemd/systemd-vconsole-setup \ | ||
328 | ${systemd_unitdir}/system/systemd-vconsole-setup.service \ | ||
329 | ${systemd_unitdir}/system/sysinit.target.wants/systemd-vconsole-setup.service" | ||
330 | |||
331 | RDEPENDS_${PN}-kernel-install += "bash" | ||
332 | FILES_${PN}-kernel-install = "${bindir}/kernel-install \ | ||
333 | ${sysconfdir}/kernel/ \ | ||
334 | ${exec_prefix}/lib/kernel \ | ||
335 | " | ||
336 | FILES_${PN}-rpm-macros = "${exec_prefix}/lib/rpm \ | ||
337 | " | ||
338 | |||
339 | FILES_${PN}-xorg-xinitrc = "${sysconfdir}/X11/xinit/xinitrc.d/*" | ||
340 | |||
341 | FILES_${PN}-zsh-completion = "${datadir}/zsh/site-functions" | ||
342 | |||
343 | FILES_${PN}-binfmt = "${sysconfdir}/binfmt.d/ \ | ||
344 | ${exec_prefix}/lib/binfmt.d \ | ||
345 | ${rootlibexecdir}/systemd/systemd-binfmt \ | ||
346 | ${systemd_unitdir}/system/proc-sys-fs-binfmt_misc.* \ | ||
347 | ${systemd_unitdir}/system/systemd-binfmt.service" | ||
348 | RRECOMMENDS_${PN}-binfmt = "kernel-module-binfmt-misc" | ||
349 | |||
350 | RRECOMMENDS_${PN}-vconsole-setup = "kbd kbd-consolefonts kbd-keymaps" | ||
351 | |||
352 | FILES_${PN}-container = "${sysconfdir}/dbus-1/system.d/org.freedesktop.import1.conf \ | ||
353 | ${sysconfdir}/dbus-1/system.d/org.freedesktop.machine1.conf \ | ||
354 | ${base_bindir}/machinectl \ | ||
355 | ${bindir}/systemd-nspawn \ | ||
356 | ${nonarch_libdir}/systemd/import-pubring.gpg \ | ||
357 | ${systemd_system_unitdir}/busnames.target.wants/org.freedesktop.import1.busname \ | ||
358 | ${systemd_system_unitdir}/busnames.target.wants/org.freedesktop.machine1.busname \ | ||
359 | ${systemd_system_unitdir}/local-fs.target.wants/var-lib-machines.mount \ | ||
360 | ${systemd_system_unitdir}/machine.slice \ | ||
361 | ${systemd_system_unitdir}/machines.target \ | ||
362 | ${systemd_system_unitdir}/org.freedesktop.import1.busname \ | ||
363 | ${systemd_system_unitdir}/org.freedesktop.machine1.busname \ | ||
364 | ${systemd_system_unitdir}/systemd-importd.service \ | ||
365 | ${systemd_system_unitdir}/systemd-machined.service \ | ||
366 | ${systemd_system_unitdir}/dbus-org.freedesktop.machine1.service \ | ||
367 | ${systemd_system_unitdir}/var-lib-machines.mount \ | ||
368 | ${rootlibexecdir}/systemd/systemd-import \ | ||
369 | ${rootlibexecdir}/systemd/systemd-importd \ | ||
370 | ${rootlibexecdir}/systemd/systemd-journal-gatewayd \ | ||
371 | ${rootlibexecdir}/systemd/systemd-journal-remote \ | ||
372 | ${rootlibexecdir}/systemd/systemd-journal-upload \ | ||
373 | ${rootlibexecdir}/systemd/systemd-machined \ | ||
374 | ${rootlibexecdir}/systemd/systemd-pull \ | ||
375 | ${exec_prefix}/lib/tmpfiles.d/systemd-nspawn.conf \ | ||
376 | ${systemd_system_unitdir}/systemd-nspawn@.service \ | ||
377 | ${libdir}/libnss_mymachines.so.2 \ | ||
378 | ${datadir}/dbus-1/system-services/org.freedesktop.import1.service \ | ||
379 | ${datadir}/dbus-1/system-services/org.freedesktop.machine1.service \ | ||
380 | ${datadir}/polkit-1/actions/org.freedesktop.import1.policy \ | ||
381 | ${datadir}/polkit-1/actions/org.freedesktop.machine1.policy \ | ||
382 | " | ||
383 | |||
384 | FILES_${PN}-extra-utils = "\ | ||
385 | ${base_bindir}/systemd-escape \ | ||
386 | ${base_bindir}/systemd-inhibit \ | ||
387 | ${bindir}/systemd-detect-virt \ | ||
388 | ${bindir}/systemd-path \ | ||
389 | ${bindir}/systemd-run \ | ||
390 | ${bindir}/systemd-cat \ | ||
391 | ${bindir}/systemd-delta \ | ||
392 | ${bindir}/systemd-cgls \ | ||
393 | ${bindir}/systemd-cgtop \ | ||
394 | ${bindir}/systemd-stdio-bridge \ | ||
395 | ${base_bindir}/systemd-ask-password \ | ||
396 | ${base_bindir}/systemd-tty-ask-password-agent \ | ||
397 | ${systemd_unitdir}/system/systemd-ask-password-console.path \ | ||
398 | ${systemd_unitdir}/system/systemd-ask-password-console.service \ | ||
399 | ${systemd_unitdir}/system/systemd-ask-password-wall.path \ | ||
400 | ${systemd_unitdir}/system/systemd-ask-password-wall.service \ | ||
401 | ${systemd_unitdir}/system/sysinit.target.wants/systemd-ask-password-console.path \ | ||
402 | ${systemd_unitdir}/system/sysinit.target.wants/systemd-ask-password-wall.path \ | ||
403 | ${systemd_unitdir}/system/multi-user.target.wants/systemd-ask-password-wall.path \ | ||
404 | ${rootlibexecdir}/systemd/systemd-resolve-host \ | ||
405 | ${rootlibexecdir}/systemd/systemd-ac-power \ | ||
406 | ${rootlibexecdir}/systemd/systemd-activate \ | ||
407 | ${rootlibexecdir}/systemd/systemd-bus-proxyd \ | ||
408 | ${systemd_unitdir}/system/systemd-bus-proxyd.service \ | ||
409 | ${systemd_unitdir}/system/systemd-bus-proxyd.socket \ | ||
410 | ${rootlibexecdir}/systemd/systemd-socket-proxyd \ | ||
411 | ${rootlibexecdir}/systemd/systemd-reply-password \ | ||
412 | ${rootlibexecdir}/systemd/systemd-sleep \ | ||
413 | ${rootlibexecdir}/systemd/system-sleep \ | ||
414 | ${systemd_unitdir}/system/systemd-hibernate.service \ | ||
415 | ${systemd_unitdir}/system/systemd-hybrid-sleep.service \ | ||
416 | ${systemd_unitdir}/system/systemd-suspend.service \ | ||
417 | ${systemd_unitdir}/system/sleep.target \ | ||
418 | ${rootlibexecdir}/systemd/systemd-initctl \ | ||
419 | ${systemd_unitdir}/system/systemd-initctl.service \ | ||
420 | ${systemd_unitdir}/system/systemd-initctl.socket \ | ||
421 | ${systemd_unitdir}/system/sockets.target.wants/systemd-initctl.socket \ | ||
422 | ${rootlibexecdir}/systemd/system-generators/systemd-gpt-auto-generator \ | ||
423 | ${rootlibexecdir}/systemd/systemd-cgroups-agent \ | ||
424 | " | ||
425 | |||
426 | CONFFILES_${PN} = "${sysconfdir}/machine-id \ | ||
427 | ${sysconfdir}/systemd/coredump.conf \ | ||
428 | ${sysconfdir}/systemd/journald.conf \ | ||
429 | ${sysconfdir}/systemd/logind.conf \ | ||
430 | ${sysconfdir}/systemd/system.conf \ | ||
431 | ${sysconfdir}/systemd/user.conf" | ||
432 | |||
433 | FILES_${PN} = " ${base_bindir}/* \ | ||
434 | ${datadir}/dbus-1/services \ | ||
435 | ${datadir}/dbus-1/system-services \ | ||
436 | ${datadir}/polkit-1 \ | ||
437 | ${datadir}/${BPN} \ | ||
438 | ${datadir}/factory \ | ||
439 | ${sysconfdir}/dbus-1/ \ | ||
440 | ${sysconfdir}/machine-id \ | ||
441 | ${sysconfdir}/modules-load.d/ \ | ||
442 | ${sysconfdir}/pam.d/ \ | ||
443 | ${sysconfdir}/sysctl.d/ \ | ||
444 | ${sysconfdir}/systemd/ \ | ||
445 | ${sysconfdir}/tmpfiles.d/ \ | ||
446 | ${sysconfdir}/xdg/ \ | ||
447 | ${sysconfdir}/init.d/README \ | ||
448 | ${sysconfdir}/resolv.conf \ | ||
449 | ${rootlibexecdir}/systemd/* \ | ||
450 | ${systemd_unitdir}/* \ | ||
451 | ${base_libdir}/security/*.so \ | ||
452 | ${libdir}/libnss_* \ | ||
453 | /cgroup \ | ||
454 | ${bindir}/systemd* \ | ||
455 | ${bindir}/busctl \ | ||
456 | ${bindir}/coredumpctl \ | ||
457 | ${bindir}/localectl \ | ||
458 | ${bindir}/hostnamectl \ | ||
459 | ${bindir}/timedatectl \ | ||
460 | ${bindir}/bootctl \ | ||
461 | ${bindir}/kernel-install \ | ||
462 | ${exec_prefix}/lib/tmpfiles.d/*.conf \ | ||
463 | ${exec_prefix}/lib/systemd \ | ||
464 | ${exec_prefix}/lib/modules-load.d \ | ||
465 | ${exec_prefix}/lib/sysctl.d \ | ||
466 | ${exec_prefix}/lib/sysusers.d \ | ||
467 | ${localstatedir} \ | ||
468 | ${nonarch_base_libdir}/udev/rules.d/70-uaccess.rules \ | ||
469 | ${nonarch_base_libdir}/udev/rules.d/71-seat.rules \ | ||
470 | ${nonarch_base_libdir}/udev/rules.d/73-seat-late.rules \ | ||
471 | ${nonarch_base_libdir}/udev/rules.d/99-systemd.rules \ | ||
472 | " | ||
473 | |||
474 | FILES_${PN}-dev += "${base_libdir}/security/*.la ${datadir}/dbus-1/interfaces/ ${sysconfdir}/rpm/macros.systemd" | ||
475 | |||
476 | RDEPENDS_${PN} += "kmod dbus util-linux-mount udev (= ${EXTENDPKGV})" | ||
477 | RDEPENDS_${PN} += "volatile-binds update-rc.d" | ||
478 | |||
479 | RRECOMMENDS_${PN} += "${@bb.utils.contains('PACKAGECONFIG', 'serial-getty-generator', '', 'systemd-serialgetty', d)} \ | ||
480 | systemd-vconsole-setup \ | ||
481 | systemd-extra-utils \ | ||
482 | systemd-compat-units udev-hwdb \ | ||
483 | util-linux-agetty util-linux-fsck e2fsprogs-e2fsck \ | ||
484 | kernel-module-autofs4 kernel-module-unix kernel-module-ipv6 \ | ||
485 | os-release \ | ||
486 | " | ||
487 | |||
488 | INSANE_SKIP_${PN} += "dev-so" | ||
489 | INSANE_SKIP_${PN}-doc += " libdir" | ||
490 | |||
491 | PACKAGES =+ "udev udev-hwdb" | ||
492 | |||
493 | RPROVIDES_udev = "hotplug" | ||
494 | |||
495 | RDEPENDS_udev-hwdb += "udev" | ||
496 | |||
497 | FILES_udev += "${base_sbindir}/udevd \ | ||
498 | ${rootlibexecdir}/systemd/systemd-udevd \ | ||
499 | ${rootlibexecdir}/udev/accelerometer \ | ||
500 | ${rootlibexecdir}/udev/ata_id \ | ||
501 | ${rootlibexecdir}/udev/cdrom_id \ | ||
502 | ${rootlibexecdir}/udev/collect \ | ||
503 | ${rootlibexecdir}/udev/findkeyboards \ | ||
504 | ${rootlibexecdir}/udev/keyboard-force-release.sh \ | ||
505 | ${rootlibexecdir}/udev/keymap \ | ||
506 | ${rootlibexecdir}/udev/mtd_probe \ | ||
507 | ${rootlibexecdir}/udev/scsi_id \ | ||
508 | ${rootlibexecdir}/udev/v4l_id \ | ||
509 | ${rootlibexecdir}/udev/keymaps \ | ||
510 | ${rootlibexecdir}/udev/rules.d/*.rules \ | ||
511 | ${sysconfdir}/udev \ | ||
512 | ${sysconfdir}/init.d/systemd-udevd \ | ||
513 | ${systemd_unitdir}/system/*udev* \ | ||
514 | ${systemd_unitdir}/system/*.wants/*udev* \ | ||
515 | ${base_bindir}/udevadm \ | ||
516 | ${datadir}/bash-completion/completions/udevadm \ | ||
517 | " | ||
518 | |||
519 | FILES_udev-hwdb = "${rootlibexecdir}/udev/hwdb.d" | ||
520 | |||
521 | INITSCRIPT_PACKAGES = "udev" | ||
522 | INITSCRIPT_NAME_udev = "systemd-udevd" | ||
523 | INITSCRIPT_PARAMS_udev = "start 03 S ." | ||
524 | |||
525 | python __anonymous() { | ||
526 | if not bb.utils.contains('DISTRO_FEATURES', 'sysvinit', True, False, d): | ||
527 | d.setVar("INHIBIT_UPDATERCD_BBCLASS", "1") | ||
528 | } | ||
529 | |||
530 | # TODO: | ||
531 | # u-a for runlevel and telinit | ||
532 | |||
533 | ALTERNATIVE_${PN} = "init halt reboot shutdown poweroff runlevel" | ||
534 | |||
535 | ALTERNATIVE_TARGET[init] = "${rootlibexecdir}/systemd/systemd" | ||
536 | ALTERNATIVE_LINK_NAME[init] = "${base_sbindir}/init" | ||
537 | ALTERNATIVE_PRIORITY[init] ?= "300" | ||
538 | |||
539 | ALTERNATIVE_TARGET[halt] = "${base_bindir}/systemctl" | ||
540 | ALTERNATIVE_LINK_NAME[halt] = "${base_sbindir}/halt" | ||
541 | ALTERNATIVE_PRIORITY[halt] ?= "300" | ||
542 | |||
543 | ALTERNATIVE_TARGET[reboot] = "${base_bindir}/systemctl" | ||
544 | ALTERNATIVE_LINK_NAME[reboot] = "${base_sbindir}/reboot" | ||
545 | ALTERNATIVE_PRIORITY[reboot] ?= "300" | ||
546 | |||
547 | ALTERNATIVE_TARGET[shutdown] = "${base_bindir}/systemctl" | ||
548 | ALTERNATIVE_LINK_NAME[shutdown] = "${base_sbindir}/shutdown" | ||
549 | ALTERNATIVE_PRIORITY[shutdown] ?= "300" | ||
550 | |||
551 | ALTERNATIVE_TARGET[poweroff] = "${base_bindir}/systemctl" | ||
552 | ALTERNATIVE_LINK_NAME[poweroff] = "${base_sbindir}/poweroff" | ||
553 | ALTERNATIVE_PRIORITY[poweroff] ?= "300" | ||
554 | |||
555 | ALTERNATIVE_TARGET[runlevel] = "${base_bindir}/systemctl" | ||
556 | ALTERNATIVE_LINK_NAME[runlevel] = "${base_sbindir}/runlevel" | ||
557 | ALTERNATIVE_PRIORITY[runlevel] ?= "300" | ||
558 | |||
559 | pkg_postinst_${PN} () { | ||
560 | sed -e '/^hosts:/s/\s*\<myhostname\>//' \ | ||
561 | -e 's/\(^hosts:.*\)\(\<files\>\)\(.*\)\(\<dns\>\)\(.*\)/\1\2 myhostname \3\4\5/' \ | ||
562 | -i $D${sysconfdir}/nsswitch.conf | ||
563 | } | ||
564 | |||
565 | pkg_prerm_${PN} () { | ||
566 | sed -e '/^hosts:/s/\s*\<myhostname\>//' \ | ||
567 | -e '/^hosts:/s/\s*myhostname//' \ | ||
568 | -i $D${sysconfdir}/nsswitch.conf | ||
569 | } | ||
570 | |||
571 | pkg_postinst_udev-hwdb () { | ||
572 | if test -n "$D"; then | ||
573 | ${@qemu_run_binary(d, '$D', '${base_bindir}/udevadm')} hwdb --update \ | ||
574 | --root $D | ||
575 | chown root:root $D${sysconfdir}/udev/hwdb.bin | ||
576 | else | ||
577 | udevadm hwdb --update | ||
578 | fi | ||
579 | } | ||
580 | |||
581 | pkg_prerm_udev-hwdb () { | ||
582 | rm -f $D${sysconfdir}/udev/hwdb.bin | ||
583 | } | ||
584 | |||
585 | # As this recipe builds udev, respect systemd being in DISTRO_FEATURES so | ||
586 | # that we don't build both udev and systemd in world builds. | ||
587 | python () { | ||
588 | if not bb.utils.contains ('DISTRO_FEATURES', 'systemd', True, False, d): | ||
589 | raise bb.parse.SkipPackage("'systemd' not in DISTRO_FEATURES") | ||
590 | |||
591 | import re | ||
592 | if re.match('.*musl*', d.getVar('TARGET_OS', True)) != None: | ||
593 | raise bb.parse.SkipPackage("Not _yet_ supported on musl based targets") | ||
594 | } | ||