blob: 98e8130a4571daa6eba964385714c47476c83e67 [file] [log] [blame]
Patrick Williams12fc9392021-08-06 09:16:53 -05001FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
William A. Kennington III1987be72019-05-16 01:05:58 -07002SRC_URI += "file://10-nice.conf"
3
Patrick Williams12fc9392021-08-06 09:16:53 -05004PACKAGECONFIG:remove = "\
Patrick Williams1976e312020-03-02 12:20:12 -06005 ${@bb.utils.contains('MACHINE_FEATURES', 'hw-rng', \
6 'libjitterentropy', '', d)}\
7 "
8
William A. Kennington III1987be72019-05-16 01:05:58 -07009inherit systemd
10
Patrick Williams12fc9392021-08-06 09:16:53 -050011FILES:${PN} += "${systemd_system_unitdir}/rngd.service.d"
William A. Kennington III1987be72019-05-16 01:05:58 -070012
Patrick Williams12fc9392021-08-06 09:16:53 -050013do_install:append() {
Patrick Williams1976e312020-03-02 12:20:12 -060014
15 # When using systemd and using libjitterentropy, install a config
16 # which runs rngd at a 'nice' priority. libjitterentropy uses a
17 # lot of CPU early on in the boot process and makes the whole boot
18 # go slower.
William A. Kennington III1987be72019-05-16 01:05:58 -070019 if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
Patrick Williams1976e312020-03-02 12:20:12 -060020 if ${@bb.utils.contains('PACKAGECONFIG', 'libjitterentropy', 'true', 'false', d)}; then
Brad Bishop57e15b12021-03-25 15:40:46 -040021 install -d ${D}${systemd_system_unitdir}/rngd.service.d
Patrick Williams1976e312020-03-02 12:20:12 -060022 install -m 644 ${WORKDIR}/10-nice.conf \
Brad Bishop57e15b12021-03-25 15:40:46 -040023 ${D}${systemd_system_unitdir}/rngd.service.d
Patrick Williams1976e312020-03-02 12:20:12 -060024 fi
William A. Kennington III1987be72019-05-16 01:05:58 -070025 fi
26}