blob: 4c9aa3fc452d9b75d0e0ea39385f398bf35b474a [file] [log] [blame]
Willy Tue86ebe32022-03-14 15:26:51 -07001FILESEXTRAPATHS:prepend:gbmc := "${THISDIR}/${PN}:"
2
3SRC_URI:append:gbmc = " file://default"
William A. Kennington III24f6d992022-03-14 16:42:00 -07004
David Wangc36a0212023-04-27 15:01:52 +08005SYSTEMD_SERVICE:${PN}-service:append:gbmc = " rng-tools-nojitter.service"
William A. Kennington III24f6d992022-03-14 16:42:00 -07006
7do_install:append:gbmc() {
Patrick Williams6cd13da2022-08-22 05:35:02 -05008 install -m 0644 ${D}${systemd_system_unitdir}/rng-tools.service \
9 ${D}${systemd_system_unitdir}/rng-tools-nojitter.service
10 # Don't enable jitter in rng-tools-nojitter
William A. Kennington III24f6d992022-03-14 16:42:00 -070011 sed -i 's,\$EXTRA_ARGS,-x jitter \$EXTRA_ARGS,' \
Patrick Williams6cd13da2022-08-22 05:35:02 -050012 ${D}${systemd_system_unitdir}/rng-tools-nojitter.service
William A. Kennington III24f6d992022-03-14 16:42:00 -070013 # Run the jitter enabled service if this one fails
Patrick Williams6cd13da2022-08-22 05:35:02 -050014 sed -i '/^\[Unit\]$/aOnFailure=rng-tools.service\nConflicts=rng-tools.service' \
15 ${D}${systemd_system_unitdir}/rng-tools-nojitter.service
William A. Kennington III24f6d992022-03-14 16:42:00 -070016
17 # Don't run the jitter service by default
Patrick Williams6cd13da2022-08-22 05:35:02 -050018 sed -i '/^WantedBy=/d' ${D}${systemd_system_unitdir}/rng-tools.service
William A. Kennington III24f6d992022-03-14 16:42:00 -070019}