Resolves: BZ1433852 https://bugzilla.redhat.com/show_bug.cgi?id=1433852
This patchset fixes a couple of issues reported by rpmlint when it is run on kexec-tools:
1. Patch 3 fixes several instances of hardcoded-library-path errors. 2. Patch 4 fixes a couple of whitespace errors.
While at it, we also try to improve the way /lib*/kdump paths are used in the kdump helper scripts via Patch 1 and 2.
Changes since v1: ---------------- ~ Addressed the issue with kdump helper scripts where they use /lib*/kdump as the path of the kdump helper scripts irrespective of whether they are running on a 64-bit machine.
Bhupesh Sharma (4): kdump-dep-generator.sh: Use uniform source path for kdump-lib.sh Make kdump helper scripts use proper lib paths when referring to /lib*/kdump path kexec-tools.spec: Fix hardcoded-library-path errors kexec-tools.spec: Fix whitespace errors
dracut-module-setup.sh | 19 ++++++++++++++++--- kdump-dep-generator.sh | 14 +++++++++++++- kdumpctl | 15 ++++++++++++++- kexec-tools.spec | 18 +++++++++--------- mkdumprd | 16 +++++++++++++++- 5 files changed, 67 insertions(+), 15 deletions(-)
Presently kdump-dep-generator.sh uses '/usr/lib/kdump/kdump-lib.sh' as the path to source the kdump-lib.sh helper script, whereas the rest of the kdump helper scripts use the convention '/lib/kdump/kdump-lib.sh'.
Use the later convention in kdump-dep-generator.sh as well.
Signed-off-by: Bhupesh Sharma bhsharma@redhat.com --- kdump-dep-generator.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kdump-dep-generator.sh b/kdump-dep-generator.sh index b6fab2dbe68c..e1ae1af9f244 100644 --- a/kdump-dep-generator.sh +++ b/kdump-dep-generator.sh @@ -3,7 +3,7 @@ # More details about systemd generator: # http://www.freedesktop.org/wiki/Software/systemd/Generators/
-. /usr/lib/kdump/kdump-lib.sh +. /lib/kdump/kdump-lib.sh
# If invokded with no arguments for testing purpose, output to /tmp to # avoid overriding the existing.
Hi Bhupesh,
On 06/08/17 at 06:44pm, Bhupesh Sharma wrote:
Presently kdump-dep-generator.sh uses '/usr/lib/kdump/kdump-lib.sh' as the path to source the kdump-lib.sh helper script, whereas the rest of the kdump helper scripts use the convention '/lib/kdump/kdump-lib.sh'.
Use the later convention in kdump-dep-generator.sh as well.
Signed-off-by: Bhupesh Sharma bhsharma@redhat.com
kdump-dep-generator.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kdump-dep-generator.sh b/kdump-dep-generator.sh index b6fab2dbe68c..e1ae1af9f244 100644 --- a/kdump-dep-generator.sh +++ b/kdump-dep-generator.sh @@ -3,7 +3,7 @@ # More details about systemd generator: # http://www.freedesktop.org/wiki/Software/systemd/Generators/
-. /usr/lib/kdump/kdump-lib.sh +. /lib/kdump/kdump-lib.sh
Fedora use /usr/lib by default, it is better to use /usr/lib https://fedoraproject.org/wiki/Features/UsrMove
# If invokded with no arguments for testing purpose, output to /tmp to
# avoid overriding the existing.
2.7.4 _______________________________________________ kexec mailing list -- kexec@lists.fedoraproject.org To unsubscribe send an email to kexec-leave@lists.fedoraproject.org
Thanks Dave
Thanks for the review Dave,
On Tue, Jun 13, 2017 at 12:18 PM, Dave Young dyoung@redhat.com wrote:
Hi Bhupesh,
On 06/08/17 at 06:44pm, Bhupesh Sharma wrote:
Presently kdump-dep-generator.sh uses '/usr/lib/kdump/kdump-lib.sh' as the path to source the kdump-lib.sh helper script, whereas the rest of the kdump helper scripts use the convention '/lib/kdump/kdump-lib.sh'.
Use the later convention in kdump-dep-generator.sh as well.
Signed-off-by: Bhupesh Sharma bhsharma@redhat.com
kdump-dep-generator.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kdump-dep-generator.sh b/kdump-dep-generator.sh index b6fab2dbe68c..e1ae1af9f244 100644 --- a/kdump-dep-generator.sh +++ b/kdump-dep-generator.sh @@ -3,7 +3,7 @@ # More details about systemd generator: # http://www.freedesktop.org/wiki/Software/systemd/Generators/
-. /usr/lib/kdump/kdump-lib.sh +. /lib/kdump/kdump-lib.sh
Fedora use /usr/lib by default, it is better to use /usr/lib https://fedoraproject.org/wiki/Features/UsrMove
I went through the Fedora documentation. I agree to drop this. Now, I am thinking if we should try to have kdump helper scripts (all?) use /usr/lib instead of /lib everywhere.
Let me know your opinion on the same.
Regards, Bhupesh
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'
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"
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
On Tue, Jun 13, 2017 at 12:21 PM, Dave Young dyoung@redhat.com wrote:
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.
Ok. Do you suggest to drop this patch and send the patch which fixes the whitespace errors (and has been Acked) as v3?
Regards, Bhupesh
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
On 06/15/17 at 05:31pm, Bhupesh Sharma wrote:
On Tue, Jun 13, 2017 at 12:21 PM, Dave Young dyoung@redhat.com wrote:
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.
Ok. Do you suggest to drop this patch and send the patch which fixes the whitespace errors (and has been Acked) as v3?
Bhupesh, will pick up the whitespace patch when merging other patches later.
Thanks Dave
Regards, Bhupesh
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
kexec mailing list -- kexec@lists.fedoraproject.org To unsubscribe send an email to kexec-leave@lists.fedoraproject.org
On 06/28/17 at 01:40pm, Dave Young wrote:
On 06/15/17 at 05:31pm, Bhupesh Sharma wrote:
On Tue, Jun 13, 2017 at 12:21 PM, Dave Young dyoung@redhat.com wrote:
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.
Ok. Do you suggest to drop this patch and send the patch which fixes the whitespace errors (and has been Acked) as v3?
Bhupesh, will pick up the whitespace patch when merging other patches later.
Actually already applied previously..
Thanks Dave
On Wed, Jun 28, 2017 at 12:09 PM, Dave Young dyoung@redhat.com wrote:
On 06/28/17 at 01:40pm, Dave Young wrote:
On 06/15/17 at 05:31pm, Bhupesh Sharma wrote:
On Tue, Jun 13, 2017 at 12:21 PM, Dave Young dyoung@redhat.com wrote:
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.
Ok. Do you suggest to drop this patch and send the patch which fixes the whitespace errors (and has been Acked) as v3?
Bhupesh, will pick up the whitespace patch when merging other patches later.
Actually already applied previously..
Thanks for the help Dave.
Regards, Bhupesh
This patch fixes the hardcoded-library-path errors reported by 'rpmlint' or 'fedpkg lint' when they are run on kexec-tools srpm.
As suggested by Fedora Packaging Guidelines instead of using hardcoded-library-path '/usr/lib' inside the .spec file we should use the %{_libdir} macro instead.
Signed-off-by: Bhupesh Sharma bhsharma@redhat.com --- kexec-tools.spec | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/kexec-tools.spec b/kexec-tools.spec index 59ce32fe0045..37b797305574 100644 --- a/kexec-tools.spec +++ b/kexec-tools.spec @@ -170,7 +170,7 @@ mkdir -p -m755 $RPM_BUILD_ROOT%{_udevrulesdir} mkdir -p $RPM_BUILD_ROOT%{_unitdir} mkdir -p -m755 $RPM_BUILD_ROOT%{_bindir} mkdir -p -m755 $RPM_BUILD_ROOT%{_libdir} -mkdir -p -m755 $RPM_BUILD_ROOT%{_prefix}/lib/kdump +mkdir -p -m755 $RPM_BUILD_ROOT%{_libdir}/kdump install -m 755 %{SOURCE1} $RPM_BUILD_ROOT%{_bindir}/kdumpctl
SYSCONFIG=$RPM_SOURCE_DIR/kdump.sysconfig.%{_target_cpu} @@ -183,8 +183,8 @@ install -m 644 %{SOURCE8} $RPM_BUILD_ROOT%{_sysconfdir}/kdump.conf install -m 644 kexec/kexec.8 $RPM_BUILD_ROOT%{_mandir}/man8/kexec.8 install -m 644 %{SOURCE12} $RPM_BUILD_ROOT%{_mandir}/man8/mkdumprd.8 install -m 644 %{SOURCE26} $RPM_BUILD_ROOT%{_mandir}/man8/kdumpctl.8 -install -m 755 %{SOURCE20} $RPM_BUILD_ROOT%{_prefix}/lib/kdump/kdump-lib.sh -install -m 755 %{SOURCE24} $RPM_BUILD_ROOT%{_prefix}/lib/kdump/kdump-lib-initramfs.sh +install -m 755 %{SOURCE20} $RPM_BUILD_ROOT%{_libdir}/kdump/kdump-lib.sh +install -m 755 %{SOURCE24} $RPM_BUILD_ROOT%{_libdir}/kdump/kdump-lib-initramfs.sh %ifnarch s390x # For s390x the ELF header is created in the kdump kernel and therefore kexec # udev rules are not required @@ -192,7 +192,7 @@ install -m 644 %{SOURCE14} $RPM_BUILD_ROOT%{_udevrulesdir}/98-kexec.rules %endif install -m 644 %{SOURCE15} $RPM_BUILD_ROOT%{_mandir}/man5/kdump.conf.5 install -m 644 %{SOURCE16} $RPM_BUILD_ROOT%{_unitdir}/kdump.service -install -m 755 -D %{SOURCE22} $RPM_BUILD_ROOT%{_prefix}/lib/systemd/system-generators/kdump-dep-generator.sh +install -m 755 -D %{SOURCE22} $RPM_BUILD_ROOT%{_libdir}/systemd/system-generators/kdump-dep-generator.sh
%ifarch %{ix86} x86_64 ppc64 s390x ppc64le install -m 755 makedumpfile-1.6.1/makedumpfile $RPM_BUILD_ROOT/sbin/makedumpfile @@ -222,7 +222,7 @@ chmod 755 $RPM_BUILD_ROOT/etc/kdump-adv-conf/kdump_dracut_modules/99kdumpbase/%{ chmod 755 $RPM_BUILD_ROOT/etc/kdump-adv-conf/kdump_dracut_modules/99kdumpbase/%{remove_dracut_prefix %{SOURCE101}}
-%define dracutlibdir %{_prefix}/lib/dracut +%define dracutlibdir %{_libdir}/dracut #and move the custom dracut modules to the dracut directory mkdir -p $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/ mv $RPM_BUILD_ROOT/etc/kdump-adv-conf/kdump_dracut_modules/* $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/ @@ -299,7 +299,7 @@ done /sbin/* %{_bindir}/* %{_datadir}/kdump -%{_prefix}/lib/kdump +%{_libdir}/kdump %ifarch %{ix86} x86_64 ppc64 s390x ppc64le %{_sysconfdir}/makedumpfile.conf.sample %endif @@ -313,7 +313,7 @@ done %{_mandir}/man8/* %{_mandir}/man5/* %{_unitdir}/kdump.service -%{_prefix}/lib/systemd/system-generators/kdump-dep-generator.sh +%{_libdir}/systemd/system-generators/kdump-dep-generator.sh %doc News %doc COPYING %doc TODO
This patch fixes the whitespace errors reported by 'rpmlint' or 'fedpkg lint' when they are run on kexec-tools srpm:
kexec-tools.spec:242: W: mixed-use-of-spaces-and-tabs (spaces: line 107, tab: line 242)
Signed-off-by: Bhupesh Sharma bhsharma@redhat.com --- kexec-tools.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/kexec-tools.spec b/kexec-tools.spec index 37b797305574..7c6c37a47bde 100644 --- a/kexec-tools.spec +++ b/kexec-tools.spec @@ -104,8 +104,8 @@ binary and ancillary utilities that together form the userspace component of the kernel's kexec feature.
%package anaconda-addon -Summary: Kdump configuration anaconda addon -Requires: anaconda >= 21.33 +Summary: Kdump configuration anaconda addon +Requires: anaconda >= 21.33 %description anaconda-addon Kdump anaconda addon
On 06/08/17 at 06:44pm, Bhupesh Sharma wrote:
This patch fixes the whitespace errors reported by 'rpmlint' or 'fedpkg lint' when they are run on kexec-tools srpm:
kexec-tools.spec:242: W: mixed-use-of-spaces-and-tabs (spaces: line 107, tab: line 242)
Signed-off-by: Bhupesh Sharma bhsharma@redhat.com
kexec-tools.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/kexec-tools.spec b/kexec-tools.spec index 37b797305574..7c6c37a47bde 100644 --- a/kexec-tools.spec +++ b/kexec-tools.spec @@ -104,8 +104,8 @@ binary and ancillary utilities that together form the userspace component of the kernel's kexec feature.
%package anaconda-addon -Summary: Kdump configuration anaconda addon -Requires: anaconda >= 21.33 +Summary: Kdump configuration anaconda addon +Requires: anaconda >= 21.33 %description anaconda-addon Kdump anaconda addon
-- 2.7.4 _______________________________________________ kexec mailing list -- kexec@lists.fedoraproject.org To unsubscribe send an email to kexec-leave@lists.fedoraproject.org
Acked-by: Dave Young dyoung@redhat.com
Thanks Dave