Hi Coiby,
I think I found an other problem related to this location...
On Wed, 19 Jan 2022 14:33:25 +0800
Coiby Xu <coxu(a)redhat.com> wrote:
The environment variable entries in /proc/[pid]/environ are separated
by
null bytes instead of by spaces. Update the sed regex to fix this issue.
Note this patch also fixes a issue which is kdumpctl would try to reset
crashkernel even osbuild has provided custom crashkernel value.
Fixes: ddd428a ("set up kernel crashkernel for osbuild in kernel hook")
Signed-off-by: Coiby Xu <coxu(a)redhat.com>
---
kdumpctl | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/kdumpctl b/kdumpctl
index 8107487..b32fac0 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -1578,7 +1578,7 @@ reset_crashkernel_after_update()
_is_osbuild()
{
- [[ $(sed -n -E 's/.*(^|\s)container=(\S*).*/\2/p' < /proc/1/environ) ==
bwrap-osbuild ]]
+ [[ $(sed -n -E 's/.*(^|\x00)container=([^\x00]*).*/\2/p' < /proc/1/environ)
== bwrap-osbuild ]]
}
reset_crashkernel_for_installed_kernel()
@@ -1590,8 +1590,10 @@ reset_crashkernel_for_installed_kernel()
exit 1
fi
- if _is_osbuild && ! grep -qs crashkernel= /etc/kernel/cmdline; then
- reset_crashkernel "--kernel=$_installed_kernel"
+ if _is_osbuild; then
+ if ! grep -qs crashkernel= /etc/kernel/cmdline; then
+ reset_crashkernel "--kernel=$_installed_kernel"
When parsing the --kernel option in reset_crashkernel it calls
_valid_grubby_kernel_path to verify the given path. But that
function relies on grubby being installed which needn't be the
case when _is_osbuild is true.
Or am I missing something?
Thanks
Philipp
+ fi
return
fi