From 3368128c0089fa0cef64fc6cbbfc053dbf8fc869 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Fri, 26 Nov 2021 11:37:59 +0100 Subject: [statistics] Add lookup table for GPT type UUIDs --- modules-available/statistics/pages/machine.inc.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'modules-available/statistics/pages') diff --git a/modules-available/statistics/pages/machine.inc.php b/modules-available/statistics/pages/machine.inc.php index b23db721..019b0d8d 100644 --- a/modules-available/statistics/pages/machine.inc.php +++ b/modules-available/statistics/pages/machine.inc.php @@ -528,7 +528,7 @@ class SubPage $used += $part['size']; $lastEnd = $part['start'] + $part['size']; if (!isset($part['name'])) { - $part['name'] = self::mbrType($part['slxtype'] ?? $part['type']); + $part['name'] = self::partTypeToName($part['slxtype'] ?? $part['type']); } } $dist = $hdd['size'] - $lastEnd; @@ -651,7 +651,11 @@ class SubPage return $retval; } - private static function mbrType(string $type): string + /** + * @param string $type MBR-type or GPT UUID + * @return string Name of partition type if known, otherwise, $type is returned + */ + private static function partTypeToName(string $type): string { switch ($type) { case '44': @@ -666,7 +670,7 @@ class SubPage case 'ef': return 'EFI'; } - return $type; + return HardwareInfo::GPT[$type] ?? $type; } } \ No newline at end of file -- cgit v1.2.3-55-g7522