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