From 672c1a093c9672585d798e014cbb0da963f041b4 Mon Sep 17 00:00:00 2001 From: Eli Bosley Date: Thu, 3 Sep 2026 15:58:29 -0400 Subject: [PATCH 1/2] fix(boot): restore stopped boot usage stats --- emhttp/plugins/dynamix/nchan/device_list | 9 ++++++++- tests/stopped-array-utilization.php | 16 ++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/emhttp/plugins/dynamix/nchan/device_list b/emhttp/plugins/dynamix/nchan/device_list index 512f004f6..da46b8f80 100755 --- a/emhttp/plugins/dynamix/nchan/device_list +++ b/emhttp/plugins/dynamix/nchan/device_list @@ -380,6 +380,7 @@ function pool_function_row(string $label, ?array $poolDisk, ?array $firstMember, $disk['fsStatus'] = _var($fsOverride,'fsStatus',_var($poolDisk,'fsStatus',_var($firstMember,'fsStatus',''))); $disk['fsType'] = _var($fsOverride,'fsType',_var($poolDisk,'fsType',_var($firstMember,'fsType',''))); $disk['fsMountpoint'] = _var($fsOverride,'fsMountpoint',_var($poolDisk,'fsMountpoint',_var($firstMember,'fsMountpoint',''))); + $disk['showUsageWhenStopped'] = _var($fsOverride,'showUsageWhenStopped',false); $disk['fsSize'] = _var($metrics,'fsSize',_var($poolDisk,'fsSize',_var($firstMember,'fsSize',''))); $disk['fsUsed'] = _var($metrics,'fsUsed',_var($poolDisk,'fsUsed',_var($firstMember,'fsUsed',''))); $disk['fsFree'] = _var($metrics,'fsFree',_var($poolDisk,'fsFree',_var($firstMember,'fsFree',''))); @@ -690,7 +691,10 @@ function fs_info(&$disk,$online = false) { $echo = []; if (empty(_var($disk,'fsStatus',''))) return ""; - if (_var($disk,'fsStatus')=='Mounted' && _var($var,'fsState') == 'Started') { + $showUsage = _var($var,'fsState') == 'Started' + || _var($disk,'type') == 'Flash' + || _var($disk,'showUsageWhenStopped',false); + if (_var($disk,'fsStatus')=='Mounted' && $showUsage) { $fsSize = effective_fs_size($disk); $echo[] = "".vfs_type($disk,$online).""; $echo[] = "".my_scale($fsSize*1024,$unit,-1)." $unit"; @@ -1144,6 +1148,7 @@ while (true) { 'fsType' => $bootFsType, 'fsStatus' => $bootFsStatus, 'fsMountpoint' => $bootMountPoint, + 'showUsageWhenStopped' => true, ], true, $bootPoolName, @@ -1289,6 +1294,7 @@ while (true) { 'fsType' => $bootFsType, 'fsStatus' => $bootFsStatus, 'fsMountpoint' => $bootMountPoint, + 'showUsageWhenStopped' => true, ], true, $bootPoolName, @@ -1430,6 +1436,7 @@ while (true) { 'fsType' => $bootFsType, 'fsStatus' => $bootFsStatus, 'fsMountpoint' => $bootMountPoint, + 'showUsageWhenStopped' => true, ], true, $bootPoolName, diff --git a/tests/stopped-array-utilization.php b/tests/stopped-array-utilization.php index 02bfd3e14..2b412b729 100644 --- a/tests/stopped-array-utilization.php +++ b/tests/stopped-array-utilization.php @@ -116,6 +116,22 @@ function assertNotContainsText(string $needle, string $haystack, string $message assertContainsText('Mounted', $diskInfo, 'Stopped filesystems must keep showing their status.'); assertNotContainsText('usage-disk', $diskInfo, 'Stopped filesystems must not show a usage bar.'); +$bootDisk = $disk; +$bootDisk['type'] = 'Flash'; +$bootInfo = fs_info($bootDisk, true); +assertContainsText('25', $bootInfo, 'Stopped flash boot devices must show used space.'); +assertContainsText('75', $bootInfo, 'Stopped flash boot devices must show free space.'); + +$bootPoolDisk = $disk; +$bootPoolDisk['type'] = 'Cache'; +$bootPoolDisk['showUsageWhenStopped'] = true; +$bootPoolInfo = fs_info($bootPoolDisk, true); +assertContainsText('25', $bootPoolInfo, 'Stopped internal boot pools must show used space.'); +assertContainsText('75', $bootPoolInfo, 'Stopped internal boot pools must show free space.'); + +$dataPoolInfo = fs_info($disk, true); +assertNotContainsText('usage-disk', $dataPoolInfo, 'Stopped data pools must not show a usage bar.'); + $var['fsState'] = 'Started'; $diskInfo = fs_info($disk, true); assertContainsText('usage-disk', $diskInfo, 'Started filesystems must keep showing a usage bar.'); From de10f92987258be5a90aae11323481b4d036d0fb Mon Sep 17 00:00:00 2001 From: SimonFair <39065407+SimonFair@users.noreply.github.com> Date: Fri, 4 Sep 2026 10:27:23 +0100 Subject: [PATCH 2/2] fix(boot): keep mounted filesystem usage visible Restore row-level filesystem rendering to use mount status so mounted boot partitions keep their used/free statistics when the array is stopped. Keep the stopped-state check in my_usage() for the aggregate navigation widget and cover mounted boot versus unmounted data partitions.\n\nRefs: https://linear.app/lime-technology/issue/OS-852/740-beta12-regression-boot-device-usedfree-stats-missing-when-array-is --- emhttp/plugins/dynamix/nchan/device_list | 11 ++----- tests/stopped-array-utilization.php | 40 +++++++++++------------- 2 files changed, 21 insertions(+), 30 deletions(-) diff --git a/emhttp/plugins/dynamix/nchan/device_list b/emhttp/plugins/dynamix/nchan/device_list index da46b8f80..b399ccde4 100755 --- a/emhttp/plugins/dynamix/nchan/device_list +++ b/emhttp/plugins/dynamix/nchan/device_list @@ -380,7 +380,6 @@ function pool_function_row(string $label, ?array $poolDisk, ?array $firstMember, $disk['fsStatus'] = _var($fsOverride,'fsStatus',_var($poolDisk,'fsStatus',_var($firstMember,'fsStatus',''))); $disk['fsType'] = _var($fsOverride,'fsType',_var($poolDisk,'fsType',_var($firstMember,'fsType',''))); $disk['fsMountpoint'] = _var($fsOverride,'fsMountpoint',_var($poolDisk,'fsMountpoint',_var($firstMember,'fsMountpoint',''))); - $disk['showUsageWhenStopped'] = _var($fsOverride,'showUsageWhenStopped',false); $disk['fsSize'] = _var($metrics,'fsSize',_var($poolDisk,'fsSize',_var($firstMember,'fsSize',''))); $disk['fsUsed'] = _var($metrics,'fsUsed',_var($poolDisk,'fsUsed',_var($firstMember,'fsUsed',''))); $disk['fsFree'] = _var($metrics,'fsFree',_var($poolDisk,'fsFree',_var($firstMember,'fsFree',''))); @@ -687,14 +686,11 @@ function effective_fs_size(&$disk) { } function fs_info(&$disk,$online = false) { - global $display, $var; + global $display; $echo = []; if (empty(_var($disk,'fsStatus',''))) return ""; - $showUsage = _var($var,'fsState') == 'Started' - || _var($disk,'type') == 'Flash' - || _var($disk,'showUsageWhenStopped',false); - if (_var($disk,'fsStatus')=='Mounted' && $showUsage) { + if (_var($disk,'fsStatus')=='Mounted') { $fsSize = effective_fs_size($disk); $echo[] = "".vfs_type($disk,$online).""; $echo[] = "".my_scale($fsSize*1024,$unit,-1)." $unit"; @@ -1148,7 +1144,6 @@ while (true) { 'fsType' => $bootFsType, 'fsStatus' => $bootFsStatus, 'fsMountpoint' => $bootMountPoint, - 'showUsageWhenStopped' => true, ], true, $bootPoolName, @@ -1294,7 +1289,6 @@ while (true) { 'fsType' => $bootFsType, 'fsStatus' => $bootFsStatus, 'fsMountpoint' => $bootMountPoint, - 'showUsageWhenStopped' => true, ], true, $bootPoolName, @@ -1436,7 +1430,6 @@ while (true) { 'fsType' => $bootFsType, 'fsStatus' => $bootFsStatus, 'fsMountpoint' => $bootMountPoint, - 'showUsageWhenStopped' => true, ], true, $bootPoolName, diff --git a/tests/stopped-array-utilization.php b/tests/stopped-array-utilization.php index 2b412b729..b372a343b 100644 --- a/tests/stopped-array-utilization.php +++ b/tests/stopped-array-utilization.php @@ -104,7 +104,8 @@ function assertNotContainsText(string $needle, string $haystack, string $message $navigationUsage = ob_get_clean(); assertContainsText('50%', $navigationUsage, 'Started arrays must keep showing the usage percentage.'); -$disk = [ +$bootPartition = [ + 'type' => 'Cache', 'fsStatus' => 'Mounted', 'fsType' => 'xfs', 'fsSize' => 100, @@ -112,28 +113,25 @@ function assertNotContainsText(string $needle, string $haystack, string $message 'fsFree' => 75, ]; $var['fsState'] = 'Stopped'; -$diskInfo = fs_info($disk, true); -assertContainsText('Mounted', $diskInfo, 'Stopped filesystems must keep showing their status.'); -assertNotContainsText('usage-disk', $diskInfo, 'Stopped filesystems must not show a usage bar.'); - -$bootDisk = $disk; -$bootDisk['type'] = 'Flash'; -$bootInfo = fs_info($bootDisk, true); -assertContainsText('25', $bootInfo, 'Stopped flash boot devices must show used space.'); -assertContainsText('75', $bootInfo, 'Stopped flash boot devices must show free space.'); - -$bootPoolDisk = $disk; -$bootPoolDisk['type'] = 'Cache'; -$bootPoolDisk['showUsageWhenStopped'] = true; -$bootPoolInfo = fs_info($bootPoolDisk, true); -assertContainsText('25', $bootPoolInfo, 'Stopped internal boot pools must show used space.'); -assertContainsText('75', $bootPoolInfo, 'Stopped internal boot pools must show free space.'); - -$dataPoolInfo = fs_info($disk, true); -assertNotContainsText('usage-disk', $dataPoolInfo, 'Stopped data pools must not show a usage bar.'); +$bootInfo = fs_info($bootPartition, true); +assertContainsText('25', $bootInfo, 'Stopped mounted boot partitions must show used space.'); +assertContainsText('75', $bootInfo, 'Stopped mounted boot partitions must show free space.'); +assertContainsText('usage-disk', $bootInfo, 'Stopped mounted boot partitions must show usage bars.'); + +$flashBootDisk = $bootPartition; +$flashBootDisk['type'] = 'Flash'; +$flashBootInfo = fs_info($flashBootDisk, true); +assertContainsText('25', $flashBootInfo, 'Stopped mounted flash boot devices must show used space.'); +assertContainsText('75', $flashBootInfo, 'Stopped mounted flash boot devices must show free space.'); + +$dataPartition = $bootPartition; +$dataPartition['fsStatus'] = 'Unmounted'; +$dataInfo = fs_info($dataPartition, true); +assertContainsText('Unmounted', $dataInfo, 'Stopped unmounted data partitions must show their status.'); +assertNotContainsText('usage-disk', $dataInfo, 'Stopped unmounted data partitions must not show a usage bar.'); $var['fsState'] = 'Started'; -$diskInfo = fs_info($disk, true); +$diskInfo = fs_info($bootPartition, true); assertContainsText('usage-disk', $diskInfo, 'Started filesystems must keep showing a usage bar.'); echo "Stopped array utilization regression test passed.\n";