On 06/08/17 at 06:44pm, Bhupesh Sharma wrote:
Presently the kdump helper scripts use /lib/kdump to refer to the path of the kdump helper files. However this might cause issues on 64-bit systems where the %{_libdir} directive (generally used in .spec files), refers to '/usr/lib64' by default, instead of '/usr/lib'
If this is the case maybe we do not need change rpmspec, the scripts are arch independent so /usr/lib makes sense.
This patch fixes the same.
Signed-off-by: Bhupesh Sharma bhsharma@redhat.com
dracut-module-setup.sh | 19 ++++++++++++++++--- kdump-dep-generator.sh | 14 +++++++++++++- kdumpctl | 15 ++++++++++++++- mkdumprd | 16 +++++++++++++++- 4 files changed, 58 insertions(+), 6 deletions(-)
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh index 9f88b4edaf7a..792fb82136fa 100755 --- a/dracut-module-setup.sh +++ b/dracut-module-setup.sh @@ -1,7 +1,20 @@ #!/bin/bash
. $dracutfunctions -. /lib/kdump/kdump-lib.sh
+# Detect lib path +if ! [[ $libdir ]] ; then
- if [[ "$(ldd /bin/sh)" == */lib64/* ]] &>/dev/null \
&& [[ -d /lib64 ]]; then
libdir=" /lib64"
- else
libdir=" /lib"
- fi
- export libdir
+fi
+. $libdir/kdump/kdump-lib.sh
if ! [[ -d "${initdir}/tmp" ]]; then mkdir -p "${initdir}/tmp" @@ -727,8 +740,8 @@ install() { inst "/bin/head" "/bin/head" inst "/sbin/makedumpfile" "/sbin/makedumpfile" inst "/sbin/vmcore-dmesg" "/sbin/vmcore-dmesg"
- inst "/lib/kdump/kdump-lib.sh" "/lib/kdump-lib.sh"
- inst "/lib/kdump/kdump-lib-initramfs.sh" "/lib/kdump-lib-initramfs.sh"
- inst "$libdir/kdump/kdump-lib.sh" "lib/kdump-lib.sh"
- inst "$libdir/kdump/kdump-lib-initramfs.sh" "lib/kdump-lib-initramfs.sh" inst "$moddir/kdump.sh" "/usr/bin/kdump.sh" inst "$moddir/kdump-capture.service" "$systemdsystemunitdir/kdump-capture.service" ln_r "$systemdsystemunitdir/kdump-capture.service" "$systemdsystemunitdir/initrd.target.wants/kdump-capture.service"
diff --git a/kdump-dep-generator.sh b/kdump-dep-generator.sh index e1ae1af9f244..932caf64a79c 100644 --- a/kdump-dep-generator.sh +++ b/kdump-dep-generator.sh @@ -3,7 +3,19 @@ # More details about systemd generator: # http://www.freedesktop.org/wiki/Software/systemd/Generators/
-. /lib/kdump/kdump-lib.sh +# Detect lib path +if ! [[ $libdir ]] ; then
- if [[ "$(ldd /bin/sh)" == */lib64/* ]] &>/dev/null \
&& [[ -d /lib64 ]]; then
libdir=" /lib64"
- else
libdir=" /lib"
- fi
- export libdir
+fi
+. $libdir/kdump/kdump-lib.sh
# If invokded with no arguments for testing purpose, output to /tmp to # avoid overriding the existing. diff --git a/kdumpctl b/kdumpctl index e440bbbd8af4..dbc46addc3f0 100755 --- a/kdumpctl +++ b/kdumpctl @@ -21,7 +21,20 @@ image_time=0
[[ $dracutbasedir ]] || dracutbasedir=/usr/lib/dracut . $dracutbasedir/dracut-functions.sh -. /lib/kdump/kdump-lib.sh
+# Detect lib path +if ! [[ $libdir ]] ; then
- if [[ "$(ldd /bin/sh)" == */lib64/* ]] &>/dev/null \
&& [[ -d /lib64 ]]; then
libdir=" /lib64"
- else
libdir=" /lib"
- fi
- export libdir
+fi
+. $libdir/kdump/kdump-lib.sh
standard_kexec_args="-p"
diff --git a/mkdumprd b/mkdumprd index 5a25853d0f3d..9f4c7c73ee81 100644 --- a/mkdumprd +++ b/mkdumprd @@ -8,7 +8,21 @@
[[ $dracutbasedir ]] || dracutbasedir=/usr/lib/dracut . $dracutbasedir/dracut-functions.sh -. /lib/kdump/kdump-lib.sh
+# Detect lib path +if ! [[ $libdir ]] ; then
- if [[ "$(ldd /bin/sh)" == */lib64/* ]] &>/dev/null \
&& [[ -d /lib64 ]]; then
libdir=" /lib64"
- else
libdir=" /lib"
- fi
- export libdir
+fi
+. $libdir/kdump/kdump-lib.sh
export IN_KDUMP=1
conf_file="/etc/kdump.conf"
2.7.4 _______________________________________________ kexec mailing list -- kexec@lists.fedoraproject.org To unsubscribe send an email to kexec-leave@lists.fedoraproject.org
Thanks Dave