feat(storage): use volume labels for default mount folders

This commit is contained in:
Aaron committed 2026-10-31 16:39:43 +00:00
1 parent d1ecd3fc41
commit d8d51ba5df
2 files changed
+104 -72

No files matched your search

File diff suppressed because it is too large. Load diff
@@ -166,42 +166,10 @@ begin
end; end;
function auto_mount_volume(volume : PStorage_Volume) : TError; function auto_mount_volume(volume : PStorage_Volume) : TError;
var
volIdx : sint32;
volNumStr : pchar;
volName : pchar;
prefix : pchar;
mountPath : pchar;
begin begin
auto_mount_volume := eDeviceNotReady; auto_mount_volume := eVolumeNotFound;
if volume = nil then exit; if find_volume_index(volume) < 0 then exit;
if volume^.filesystem = nil then exit; auto_mount_volume := driver.storage.vfs.mountDefaultVolume(volume);
volIdx := find_volume_index(volume);
if volIdx < 0 then exit;
volNumStr := intToString(volume^.id);
volName := stringConcat('vol', volNumStr);
kfree(void(volNumStr));
prefix := stringNew(6);
prefix[0] := '/';
prefix[1] := 'd';
prefix[2] := 'i';
prefix[3] := 's';
prefix[4] := 'k';
prefix[5] := '/';
mountPath := stringConcat(prefix, volName);
if driver.storage.vfs.mountVolume(mountPath, volume) = pvRegistered then begin
auto_mount_volume := eNone;
if volume^.isBootDrive then
if driver.storage.vfs.mountVolume('/boot', volume) <> pvRegistered then
auto_mount_volume := eDeviceNotReady;
end;
kfree(void(volName));
kfree(void(prefix));
kfree(void(mountPath));
end; end;
function find_partition_slot_by_start(mbr : PMaster_Boot_Record; sectorStart : uint32) : sint32; function find_partition_slot_by_start(mbr : PMaster_Boot_Record; sectorStart : uint32) : sint32;