On Wed, Apr 7, 2021 at 7:34 PM Coiby Xu <coxu(a)redhat.com> wrote:
On Wed, Apr 07, 2021 at 03:55:26PM +0800, Kairui Song wrote:
>Use a modified and minimized version of emergency shell.
>The differences of this kdump shell and dracut emergency shell are:
>
> - Kdump shell won't generate a rdsosreport automatically
> - Customized prompts
> - Never ask root password
> - Won't tangle with dracut's emergency_action. If emergency_action is
> set, dracut emergency shell will perform dracut's emergency_action
> instead of kdump final_action on exit.
> - If rd.shell=no is set, kdump shell will still work, dracut emergency
> shell won't, even if kdump failure_action is set to shell.
>
>Signed-off-by: Kairui Song <kasong(a)redhat.com>
>---
> kdump-lib-initramfs.sh | 33 +++++++++++++++++++++++++++++----
> 1 file changed, 29 insertions(+), 4 deletions(-)
>
>diff --git a/kdump-lib-initramfs.sh b/kdump-lib-initramfs.sh
>index eb4b07e..cd2227b 100755
>--- a/kdump-lib-initramfs.sh
>+++ b/kdump-lib-initramfs.sh
>@@ -233,10 +233,35 @@ dump_to_rootfs()
>
> kdump_emergency_shell()
> {
>- echo "PS1=\"kdump:\\\${PWD}# \"" >/etc/profile
>- ddebug "Switching to dracut emergency..."
>- /bin/dracut-emergency
>- rm -f /etc/profile
>+ ddebug "Switching to kdump emergency shell..."
>+
>+ [ -f /etc/profile ] && . /etc/profile
>+ export PS1='kdump:\\\${PWD}# '
You forgot to fix the unneeded escaping :)
Oops, thanks for the info, I'll fix it in V3.
--
Best Regards,
Kairui Song