From e918a40d049004578a4f3c287879d0aad65c6092 Mon Sep 17 00:00:00 2001 From: Luna D Dragon Date: Tue, 12 Nov 2024 11:59:05 +0530 Subject: [PATCH] kdump: add shell script to enable kdump on microos and don't show ansible play on microos --- pkg/kdump/kdump-view.jsx | 24 ++++++-- pkg/lib/cockpit-components-modifications.jsx | 59 ++++++++++++-------- 2 files changed, 56 insertions(+), 27 deletions(-) diff --git a/pkg/kdump/kdump-view.jsx b/pkg/kdump/kdump-view.jsx index 51d2de71dd30..20604c2de1bd 100644 --- a/pkg/kdump/kdump-view.jsx +++ b/pkg/kdump/kdump-view.jsx @@ -414,20 +414,34 @@ export class KdumpPage extends React.Component { # A reboot will be required if crashkernel was not set before kdumpctl reset-crashkernel`; } - const shell = ` + let shell; + if (this.state.os_release.NAME?.includes('MicroOS')) { + enableCrashKernel = ` +# A reboot will be required if crashkernel was not set before +transactional-update setup-kdump`; + shell = ` +cat > /etc/kdump.conf << EOF + ${kdumpconf} +EOF +${enableCrashKernel} + `; + } else { + shell = ` cat > /etc/kdump.conf << EOF ${kdumpconf} EOF systemctl enable --now kdump.service ${enableCrashKernel} `; + } Dialogs.show( ); } diff --git a/pkg/lib/cockpit-components-modifications.jsx b/pkg/lib/cockpit-components-modifications.jsx index 4d472fd13cbe..519101b37d45 100644 --- a/pkg/lib/cockpit-components-modifications.jsx +++ b/pkg/lib/cockpit-components-modifications.jsx @@ -38,7 +38,7 @@ const _ = cockpit.gettext; * */ export const ModificationsExportDialog = ({ show, onClose, shell, ansible }) => { - const [active_tab, setActiveTab] = React.useState("ansible"); + const [active_tab, setActiveTab] = React.useState(ansible ? "ansible" : "shell"); const [copied, setCopied] = React.useState(false); const [timeoutId, setTimeoutId] = React.useState(null); @@ -77,37 +77,52 @@ export const ModificationsExportDialog = ({ show, onClose, shell, ansible }) => ); - - return ( - + + +