From: Kairui Song kasong@tencent.com
Currently kdump-dep-generator will source kdump-lib.sh. Notice kdump-dep-generator have #!/bin/sh so it should be POSIX, but kdump-lib.sh is a non-POSIX bash script. When Bash is configured to run in POSIX mode for #!/bin/sh scripts, it will fail with:
/usr/lib/kdump/kdump-lib.sh: line 1042: syntax error near unexpected token `<' /usr/lib/kdump/kdump-lib.sh: line 1042: ` done < <( _crashkernel_parse "$ck")'
This subshell call is easy to convert into a pipe but we should just source kdump-lib-initramfs.sh here, the only thing kdump-dep-generator needs is is_ssh_dump_target which is in kdump-lib-initramfs.sh, also prevents further POSIX violations.
Signed-off-by: Kairui Song kasong@tencent.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 f48c8f688e39..70ae62135395 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 +. /usr/lib/kdump/kdump-lib-initramfs.sh . /usr/lib/kdump/kdump-logger.sh
# If invokded with no arguments for testing purpose, output to /tmp to
Hi Kairui,
nice catch! Reviewed-by: Philipp Rudo prudo@redhat.com
On Tue, 30 Jan 2024 01:54:05 +0800 Kairui Song ryncsn@gmail.com wrote:
From: Kairui Song kasong@tencent.com
Currently kdump-dep-generator will source kdump-lib.sh. Notice kdump-dep-generator have #!/bin/sh so it should be POSIX, but kdump-lib.sh is a non-POSIX bash script. When Bash is configured to run in POSIX mode for #!/bin/sh scripts, it will fail with:
/usr/lib/kdump/kdump-lib.sh: line 1042: syntax error near unexpected token `<' /usr/lib/kdump/kdump-lib.sh: line 1042: ` done < <( _crashkernel_parse "$ck")'
This subshell call is easy to convert into a pipe but we should just source kdump-lib-initramfs.sh here, the only thing kdump-dep-generator needs is is_ssh_dump_target which is in kdump-lib-initramfs.sh, also prevents further POSIX violations.
Signed-off-by: Kairui Song kasong@tencent.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 f48c8f688e39..70ae62135395 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 +. /usr/lib/kdump/kdump-lib-initramfs.sh . /usr/lib/kdump/kdump-logger.sh
# If invokded with no arguments for testing purpose, output to /tmp to
On Tue, Jan 30, 2024 at 09:49:10AM +0100, Philipp Rudo wrote:
Hi Kairui,
nice catch! Reviewed-by: Philipp Rudo prudo@redhat.com
Patch merged, thanks to Kairui and Philipp!