[PATCH] ssh dump: install random-seed from a new location

WANG Chao chaowang at redhat.com
Mon Jan 13 14:23:39 UTC 2014


On 12/23/13 at 01:50pm, 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=ef5bfcf668e6029faa78534dfeb2591df854cdef
> 

Hi, Vivek

Could you review this patch?
This one is for Fedora only.

Thanks
WANG Chao

> Signed-off-by: WANG Chao <chaowang at redhat.com>
> ---
>  dracut-kdump.sh        | 7 ++++++-
>  dracut-module-setup.sh | 3 ++-
>  2 files changed, 8 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..96009f8 100755
> --- a/dracut-module-setup.sh
> +++ b/dracut-module-setup.sh
> @@ -398,7 +398,8 @@ 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 || exit $?
> +        dracut_install -o /var/lib/systemd/random-seed || exit $?
>      fi
>      dracut_install -o /etc/adjtime /etc/localtime
>      inst "$moddir/monitor_dd_progress" "/kdumpscripts/monitor_dd_progress"
> -- 
> 1.8.4.2
> 
> _______________________________________________
> kexec mailing list
> kexec at lists.fedoraproject.org
> https://lists.fedoraproject.org/mailman/listinfo/kexec


More information about the kexec mailing list