From 9e9a4f09ae2ea33ffc12855071753a987a6b798d Mon Sep 17 00:00:00 2001 From: Amlal Date: Wed, 17 Jul 2024 11:47:56 +0200 Subject: [IMP] Automount FS property. Signed-off-by: Amlal --- Kernel/Sources/Main.cxx | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) (limited to 'Kernel/Sources') diff --git a/Kernel/Sources/Main.cxx b/Kernel/Sources/Main.cxx index c30b26e6..b4751110 100644 --- a/Kernel/Sources/Main.cxx +++ b/Kernel/Sources/Main.cxx @@ -7,7 +7,6 @@ ------------------------------------------- */ -#include "KernelKit/DebugOutput.hpp" #include #include #include @@ -27,10 +26,11 @@ #include EXTERN Kernel::Property cKernelVersion; +EXTERN Kernel::Property cAutoFormatDisk; namespace Kernel::Detail { - /// @brief Filesystem auto installer, additional checks are also done by the class. + /// @brief Filesystem auto formatter, additional checks are also done by the class. class FilesystemInstaller final { Kernel::NewFilesystemManager* fNewFS{nullptr}; @@ -39,16 +39,20 @@ namespace Kernel::Detail /// @brief wizard constructor. explicit FilesystemInstaller() { + if (cAutoFormatDisk.GetValue() == No) + { + return; + } + if (Kernel::FilesystemManagerInterface::GetMounted()) { - /// Mounted partition, cool! + // Partition is mounted, cool! Kernel::kcout - << "newoskrnl: No need to create for a NewFS+EPM partition here...\r"; + << "newoskrnl: No need to create for a new NewFS (EPM) partition here...\r"; } else { - /// Not mounted partition, auto-mount. - ///! Mounts a NewFS block. + // Mounts a NewFS from main drive. fNewFS = new Kernel::NewFilesystemManager(); Kernel::FilesystemManagerInterface::Mount(fNewFS); @@ -59,7 +63,7 @@ namespace Kernel::Detail const auto cDirCount = 9; const char* cDirStr[cDirCount] = { "\\Boot\\", "\\System\\", "\\Support\\", "\\Applications\\", - "\\Users\\", "\\Library\\", "\\Mount\\", "\\DCIM\\", "\\Storage\\"}; + "\\Users\\", "\\Library\\", "\\Mounted\\", "\\DCIM\\", "\\Applications\\Storage\\"}; for (Kernel::SizeT dirIndx = 0UL; dirIndx < cDirCount; ++dirIndx) { @@ -97,7 +101,7 @@ namespace Kernel::Detail Kernel::StringView metadataFolder(kNewFSSectorSz); metadataFolder += - "

Kind: folder

\r

Created by: system

\r

Edited by: " + "\r

Kind: folder

\r

Created by: system

\r

Edited by: " "system

\r

Volume Type: Zeta

\r"; metadataFolder += "

Path: "; @@ -135,7 +139,7 @@ namespace Kernel::Detail Kernel::StringView diskFolder(kNewFSSectorSz); diskFolder += - "

Kind: alias to SIM Card

\r

Created by: system

\r

Edited " + "

Kind: alias to SIM Card

\r

Created by: system

\r

Edited " "by: " "system

\r

Volume Type: SIM Card

\r"; -- cgit v1.2.3