diff options
| author | Kai Kang <kai.kang@windriver.com> | 2019-07-02 04:32:40 -0400 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-07-03 17:00:57 +0100 |
| commit | 6fcc6e5ab2ed8fc31ddb37f475c753b9090d2188 (patch) | |
| tree | 26d6e832a7b2274502060d7747609355ebd4fa10 /meta/recipes-support/rng-tools | |
| parent | 70146ea8a1c45b04f77dbf871e5a18a4e0364ee4 (diff) | |
| download | poky-6fcc6e5ab2ed8fc31ddb37f475c753b9090d2188.tar.gz | |
rng-tools: fix rngd blocks system shutdown
fix-rngd-fail-to-stop.patch is added to fix rngd blocks system shutdown
issue. But it causes rngd doesn't release CPU and causes 100% CPU
usage, so drop it.
The block shutdown issue is caused by comit [7cb64b9fe1 rng-tools: start
earlier in the boot process] which updated rngd.service. Revert the
modification of rngd.service.
Update sed expressions in do_install as well which fails to replace
second match in one line.
(From OE-Core rev: edf760682270de36850407c860bea5aea29e30bc)
Signed-off-by: Kai Kang <kai.kang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-support/rng-tools')
3 files changed, 2 insertions, 31 deletions
diff --git a/meta/recipes-support/rng-tools/rng-tools/fix-rngd-fail-to-stop.patch b/meta/recipes-support/rng-tools/rng-tools/fix-rngd-fail-to-stop.patch deleted file mode 100644 index 58cf3f9d59..0000000000 --- a/meta/recipes-support/rng-tools/rng-tools/fix-rngd-fail-to-stop.patch +++ /dev/null | |||
| @@ -1,25 +0,0 @@ | |||
| 1 | It fails to stop rngd. It just shows warnings when stop rngd such as by: | ||
| 2 | |||
| 3 | $ systemctl stop rngd.service | ||
| 4 | |||
| 5 | but stalls shutdown untill daemon rngd is killed. | ||
| 6 | |||
| 7 | Backport patch to fix the issue. | ||
| 8 | |||
| 9 | Upstream-Status: Backport [https://bugzilla.redhat.com/show_bug.cgi?id=1690364#c8] | ||
| 10 | |||
| 11 | Signed-off-by: Kai Kang <kai.kang@windriver.com> | ||
| 12 | --- | ||
| 13 | diff --git a/rngd_jitter.c b/rngd_jitter.c | ||
| 14 | index 54070ae..7a69bf9 100644 | ||
| 15 | --- a/rngd_jitter.c | ||
| 16 | +++ b/rngd_jitter.c | ||
| 17 | @@ -280,7 +280,7 @@ static void *thread_entropy_task(void *data) | ||
| 18 | |||
| 19 | /* Write to pipe */ | ||
| 20 | written = 0; | ||
| 21 | - while(written != me->buf_sz) { | ||
| 22 | + while(me->active && written != me->buf_sz) { | ||
| 23 | message(LOG_DAEMON|LOG_DEBUG, "Writing to pipe\n"); | ||
| 24 | ret = write(me->pipe_fd, &tmpbuf[written], me->buf_sz - written); | ||
| 25 | message(LOG_DAEMON|LOG_DEBUG, "DONE Writing to pipe with return %ld\n", ret); | ||
diff --git a/meta/recipes-support/rng-tools/rng-tools/rngd.service b/meta/recipes-support/rng-tools/rng-tools/rngd.service index b1a78527be..49d5de294f 100644 --- a/meta/recipes-support/rng-tools/rng-tools/rngd.service +++ b/meta/recipes-support/rng-tools/rng-tools/rngd.service | |||
| @@ -1,8 +1,5 @@ | |||
| 1 | [Unit] | 1 | [Unit] |
| 2 | Description=Hardware RNG Entropy Gatherer Daemon | 2 | Description=Hardware RNG Entropy Gatherer Daemon |
| 3 | DefaultDependencies=no | ||
| 4 | After=systemd-udev-settle.service | ||
| 5 | Before=sysinit.target | ||
| 6 | 3 | ||
| 7 | [Service] | 4 | [Service] |
| 8 | EnvironmentFile=-@SYSCONFDIR@/default/rng-tools | 5 | EnvironmentFile=-@SYSCONFDIR@/default/rng-tools |
diff --git a/meta/recipes-support/rng-tools/rng-tools_6.7.bb b/meta/recipes-support/rng-tools/rng-tools_6.7.bb index aeb558b2b7..b4e453f67f 100644 --- a/meta/recipes-support/rng-tools/rng-tools_6.7.bb +++ b/meta/recipes-support/rng-tools/rng-tools_6.7.bb | |||
| @@ -10,7 +10,6 @@ DEPENDS = "sysfsutils" | |||
| 10 | 10 | ||
| 11 | SRC_URI = "\ | 11 | SRC_URI = "\ |
| 12 | git://github.com/nhorman/rng-tools.git \ | 12 | git://github.com/nhorman/rng-tools.git \ |
| 13 | file://fix-rngd-fail-to-stop.patch \ | ||
| 14 | file://init \ | 13 | file://init \ |
| 15 | file://default \ | 14 | file://default \ |
| 16 | file://rngd.service \ | 15 | file://rngd.service \ |
| @@ -46,8 +45,8 @@ do_install_append() { | |||
| 46 | install -Dm 0644 ${WORKDIR}/rngd.service \ | 45 | install -Dm 0644 ${WORKDIR}/rngd.service \ |
| 47 | ${D}${systemd_system_unitdir}/rngd.service | 46 | ${D}${systemd_system_unitdir}/rngd.service |
| 48 | sed -i \ | 47 | sed -i \ |
| 49 | -e 's,@SYSCONFDIR@,${sysconfdir},' \ | 48 | -e 's,@SYSCONFDIR@,${sysconfdir},g' \ |
| 50 | -e 's,@SBINDIR@,${sbindir},' \ | 49 | -e 's,@SBINDIR@,${sbindir},g' \ |
| 51 | ${D}${sysconfdir}/init.d/rng-tools \ | 50 | ${D}${sysconfdir}/init.d/rng-tools \ |
| 52 | ${D}${systemd_system_unitdir}/rngd.service | 51 | ${D}${systemd_system_unitdir}/rngd.service |
| 53 | } | 52 | } |
