forked from cockpit/cockpit
This adds 3 patches to support the new SUSE_PRETTY_NAME keys in the os-release. We can't depend on the NAME/PRETTY_NAME and need to use VARIANT/VARIANT_ID to determine to os we're on and SUSE_PRETTY_NAME to display the correct pretty name. 0001-cockpit-overview-support-SUSE_SUPPORT_PRODUCT-keys.patch should be dropped when systemd starts reporting the os name correctly.
52 lines
2.5 KiB
Diff
52 lines
2.5 KiB
Diff
From ec3a1efce07770b7641e07d41a73732967c65175 Mon Sep 17 00:00:00 2001
|
|
From: Luna D Dragon <luna.dragon@suse.com>
|
|
Date: Tue, 8 Jul 2025 14:58:03 +0530
|
|
Subject: [PATCH 1/3] cockpit overview: support SUSE_SUPPORT_PRODUCT keys
|
|
|
|
SLE Micro 6.2(and Framework one components) have custom os-release keys namely in SUSE_SUPPORT_PRODUCT and
|
|
SUSE_SUPPORT_PRODUCT_VERSION instead of the standard os prettyname which
|
|
results in systemd not being able to determine the os name correctly.
|
|
This patch should be dropped when systemd is fixed
|
|
---
|
|
pkg/systemd/overview.jsx | 10 ++++++++--
|
|
1 file changed, 8 insertions(+), 2 deletions(-)
|
|
|
|
diff --git a/pkg/systemd/overview.jsx b/pkg/systemd/overview.jsx
|
|
index 868469d68..186fcf59e 100644
|
|
--- a/pkg/systemd/overview.jsx
|
|
+++ b/pkg/systemd/overview.jsx
|
|
@@ -42,6 +42,7 @@ import { ShutdownModal } from 'cockpit-components-shutdown.jsx';
|
|
import { WithDialogs, DialogsContext } from "dialogs.jsx";
|
|
|
|
import "./overview.scss";
|
|
+import { read_os_release } from "os-release.js";
|
|
|
|
const _ = cockpit.gettext;
|
|
|
|
@@ -98,6 +99,7 @@ class OverviewPage extends React.Component {
|
|
this.hostname_proxy.addEventListener("changed", data => {
|
|
this.setState({ hostnameData: data.detail });
|
|
});
|
|
+ read_os_release().then(os_release => this.setState({ os_release }));
|
|
}
|
|
|
|
render() {
|
|
@@ -160,8 +162,12 @@ class OverviewPage extends React.Component {
|
|
{this.hostname_text()}
|
|
</h1>
|
|
{this.state.hostnameData &&
|
|
- this.state.hostnameData.OperatingSystemPrettyName &&
|
|
- <div className="ct-overview-header-subheading" id="system_information_os_text">{cockpit.format(_("running $0"), this.state.hostnameData.OperatingSystemPrettyName)}</div>}
|
|
+ this.state.hostnameData.OperatingSystemPrettyName && (
|
|
+ <div className="ct-overview-header-subheading" id="system_information_os_text">
|
|
+ {(this.state.os_release && this.state.os_release.SUSE_PRETTY_NAME)
|
|
+ ? cockpit.format(_("running $0"), this.state.os_release.SUSE_PRETTY_NAME)
|
|
+ : cockpit.format(_("running $0"), this.state.hostnameData.OperatingSystemPrettyName)}
|
|
+ </div>)}
|
|
</div>
|
|
<div className='ct-overview-header-actions'>
|
|
{ show_superuser && <SuperuserIndicator proxy={this.superuser} /> }
|
|
--
|
|
2.50.0
|
|
|