Willy Tu | e86ebe3 | 2022-03-14 15:26:51 -0700 | [diff] [blame] | 1 | FILESEXTRAPATHS:prepend:gbmc := "${THISDIR}/${PN}:" |
| 2 | |
| 3 | SRC_URI:append:gbmc = " file://default" |
William A. Kennington III | 24f6d99 | 2022-03-14 16:42:00 -0700 | [diff] [blame] | 4 | |
David Wang | c36a021 | 2023-04-27 15:01:52 +0800 | [diff] [blame] | 5 | SYSTEMD_SERVICE:${PN}-service:append:gbmc = " rng-tools-nojitter.service" |
William A. Kennington III | 24f6d99 | 2022-03-14 16:42:00 -0700 | [diff] [blame] | 6 | |
| 7 | do_install:append:gbmc() { |
Patrick Williams | 6cd13da | 2022-08-22 05:35:02 -0500 | [diff] [blame] | 8 | 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 III | 24f6d99 | 2022-03-14 16:42:00 -0700 | [diff] [blame] | 11 | sed -i 's,\$EXTRA_ARGS,-x jitter \$EXTRA_ARGS,' \ |
Patrick Williams | 6cd13da | 2022-08-22 05:35:02 -0500 | [diff] [blame] | 12 | ${D}${systemd_system_unitdir}/rng-tools-nojitter.service |
William A. Kennington III | 24f6d99 | 2022-03-14 16:42:00 -0700 | [diff] [blame] | 13 | # Run the jitter enabled service if this one fails |
Patrick Williams | 6cd13da | 2022-08-22 05:35:02 -0500 | [diff] [blame] | 14 | sed -i '/^\[Unit\]$/aOnFailure=rng-tools.service\nConflicts=rng-tools.service' \ |
| 15 | ${D}${systemd_system_unitdir}/rng-tools-nojitter.service |
William A. Kennington III | 24f6d99 | 2022-03-14 16:42:00 -0700 | [diff] [blame] | 16 | |
| 17 | # Don't run the jitter service by default |
Patrick Williams | 6cd13da | 2022-08-22 05:35:02 -0500 | [diff] [blame] | 18 | sed -i '/^WantedBy=/d' ${D}${systemd_system_unitdir}/rng-tools.service |
William A. Kennington III | 24f6d99 | 2022-03-14 16:42:00 -0700 | [diff] [blame] | 19 | } |