In ssh dump, we use random-seed to feed /dev/urandom. Since the systemd random-seed file could change location, it's better we create our own random-seed.
The discussion is listed below for future reference: https://lists.fedoraproject.org/pipermail/kexec/2014-January/000340.html
Signed-off-by: WANG Chao chaowang@redhat.com --- dracut-module-setup.sh | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh index c013430..a4351b9 100755 --- a/dracut-module-setup.sh +++ b/dracut-module-setup.sh @@ -392,13 +392,26 @@ kdump_check_iscsi_targets () { } }
+# Install a random seed used to feed /dev/urandom +# By the time kdump service starts, /dev/uramdom is already fed by systemd +kdump_install_random_seed() { + local poolsize=`cat /proc/sys/kernel/random/poolsize` + + if [ ! -d ${initdir}/var/lib/ ]; then + mkdir -p ${initdir}/var/lib/ + fi + + dd if=/dev/urandom of=${initdir}/var/lib/random-seed \ + bs=$poolsize count=1 2> /dev/null +} +
install() { kdump_install_conf >"$initdir/lib/dracut/no-emergency-shell"
if is_ssh_dump_target; then - dracut_install /var/lib/random-seed || exit $? + kdump_install_random_seed fi dracut_install -o /etc/adjtime /etc/localtime inst "$moddir/monitor_dd_progress" "/kdumpscripts/monitor_dd_progress"
On Tue, Jan 28, 2014 at 12:24:43PM +0800, WANG Chao wrote:
In ssh dump, we use random-seed to feed /dev/urandom. Since the systemd random-seed file could change location, it's better we create our own random-seed.
The discussion is listed below for future reference: https://lists.fedoraproject.org/pipermail/kexec/2014-January/000340.html
Signed-off-by: WANG Chao chaowang@redhat.com
Acked-by: Vivek Goyal vgoyal@redhat.com
Vivek
dracut-module-setup.sh | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh index c013430..a4351b9 100755 --- a/dracut-module-setup.sh +++ b/dracut-module-setup.sh @@ -392,13 +392,26 @@ kdump_check_iscsi_targets () { } }
+# Install a random seed used to feed /dev/urandom +# By the time kdump service starts, /dev/uramdom is already fed by systemd +kdump_install_random_seed() {
- local poolsize=`cat /proc/sys/kernel/random/poolsize`
- if [ ! -d ${initdir}/var/lib/ ]; then
mkdir -p ${initdir}/var/lib/- fi
- dd if=/dev/urandom of=${initdir}/var/lib/random-seed \
bs=$poolsize count=1 2> /dev/null+}
install() { kdump_install_conf >"$initdir/lib/dracut/no-emergency-shell"
if is_ssh_dump_target; then
dracut_install /var/lib/random-seed || exit $?
fi dracut_install -o /etc/adjtime /etc/localtime inst "$moddir/monitor_dd_progress" "/kdumpscripts/monitor_dd_progress"kdump_install_random_seed-- 1.8.4.2