On Fri, Jan 03, 2014 at 03:38:21PM +0800, WANG Chao wrote:
In ssh dump, we use random-seed to feed /dev/urandom. In later
release
of systemd[1], random-seed is moved from /var/lib/random-seed to
/var/lib/systemd/random-seed. We need to adapt the change and also keep
backward compatibility with older systemd.
[1]:
http://cgit.freedesktop.org/systemd/systemd/commit/?id=ef5bfcf668e6029faa...
Is this Fedora only? Maybe it's good to optionally install the seeds.
Signed-off-by: WANG Chao <chaowang(a)redhat.com>
---
dracut-kdump.sh | 7 ++++++-
dracut-module-setup.sh | 2 +-
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/dracut-kdump.sh b/dracut-kdump.sh
index 4d8616f..a7672e1 100755
--- a/dracut-kdump.sh
+++ b/dracut-kdump.sh
@@ -146,7 +146,12 @@ dump_ssh()
echo "kdump: saving to $_host:$_dir"
- cat /var/lib/random-seed > /dev/urandom
+ if [ -f /var/lib/random-seed ]; then
+ cat /var/lib/random-seed > /dev/urandom
+ elif [ -f /var/lib/systemd/random-seed ]; then
+ cat /var/lib/systemd/random-seed > /dev/urandom
+ fi
+
ssh -q $_opt $_host mkdir -p $_dir || return 1
save_vmcore_dmesg_ssh ${DMESG_COLLECTOR} ${_dir} "${_opt}" $_host
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh
index c013430..5785820 100755
--- a/dracut-module-setup.sh
+++ b/dracut-module-setup.sh
@@ -398,7 +398,7 @@ install() {
>"$initdir/lib/dracut/no-emergency-shell"
if is_ssh_dump_target; then
- dracut_install /var/lib/random-seed || exit $?
+ dracut_install -o /var/lib/random-seed /var/lib/systemd/random-seed
fi
dracut_install -o /etc/adjtime /etc/localtime
inst "$moddir/monitor_dd_progress"
"/kdumpscripts/monitor_dd_progress"
--
1.8.4.2