system: show the kernel version

This commit is contained in:
Girish Ramakrishnan
2025-07-09 18:28:55 +02:00
parent fd61a0bfbf
commit 85eb88a4a6
3 changed files with 11 additions and 1 deletions
+2
View File
@@ -56,6 +56,7 @@ async function clearLocation() {
async function getConfig() {
const ubuntuVersion = await system.getUbuntuVersion();
const kernelVersion = await system.getKernelVersion();
const profileConfig = await userDirectory.getProfileConfig();
const externalLdapConfig = await externalLdap.getConfig();
@@ -71,6 +72,7 @@ async function getConfig() {
mailFqdn: (await mailServer.getLocation()).fqdn,
version: constants.VERSION,
ubuntuVersion,
kernelVersion,
isDemo: constants.DEMO,
cloudronName: await branding.getCloudronName(),
footer: await branding.renderFooter(),
+8
View File
@@ -4,6 +4,7 @@ exports = module.exports = {
reboot,
getInfo,
getUbuntuVersion,
getKernelVersion,
getSwaps,
checkDiskSpace,
getMemory,
@@ -358,6 +359,13 @@ async function checkRebootRequired() {
}
}
async function getKernelVersion() {
const data = safe.fs.readFileSync('/proc/version', 'utf-8');
if (data === null) throw new BoxError(BoxError.FS_ERROR, safe.error.message);
const version = data.match(/^Linux version (\S+)/)[1];
return `Linux ${version}`;
}
async function getUbuntuVersion() {
const release = safe.fs.readFileSync('/etc/lsb-release', 'utf-8');
if (release === null) throw new BoxError(BoxError.FS_ERROR, safe.error.message);