diff options
| author | Amlal EL Mahrouss <amlalelmahrouss@icloud.com> | 2024-08-09 19:55:54 +0200 |
|---|---|---|
| committer | Amlal EL Mahrouss <amlalelmahrouss@icloud.com> | 2024-08-09 19:56:35 +0200 |
| commit | 1c217ed09c6c4b13ec09b897270a208439f0db55 (patch) | |
| tree | 43c93aef6ee233fafcd7ca07a5700dd76d5ecdf5 /Boot/BootKit/BootKit.hxx | |
| parent | acd8297fe927e601a7173cec7ca5445fd4a9c74a (diff) | |
[FIX] Fix bootloop on serial write, fixing more bugs now, still have to
fix allocation.
Signed-off-by: Amlal EL Mahrouss <amlalelmahrouss@icloud.com>
Diffstat (limited to 'Boot/BootKit/BootKit.hxx')
| -rw-r--r-- | Boot/BootKit/BootKit.hxx | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/Boot/BootKit/BootKit.hxx b/Boot/BootKit/BootKit.hxx index 680c9863..f716890a 100644 --- a/Boot/BootKit/BootKit.hxx +++ b/Boot/BootKit/BootKit.hxx @@ -243,11 +243,11 @@ public: blockPart->SectorSize != BootDev::kSectorSize || blockPart->Version != kNewFSVersionInteger) { - EFI::ThrowError(L"Invalid-Disk-Geometry", L"Invalid disk."); + return false; } else if (blockPart->PartitionName[0] == 0) { - EFI::ThrowError(L"Invalid-Partition-Name", L"Invalid disk partition."); + return false; } writer.Write(L"newosldr: partition name: ").Write(blockPart->PartitionName).Write(L" is healthy.\r"); @@ -281,19 +281,12 @@ private: catalogKind->Kind = blob->fKind; catalogKind->Flags = kNewFSFlagCreated; - /// before going to forks, we must check for the catalog name first. - if (blob->fKind == kNewFSCatalogKindDir && - blob->fFileName[strlen(blob->fFileName) - 1] != kNewFSSeparator) - { - EFI::ThrowError(L"Developer-Error", L"This is caused by the developer of the bootloader."); - } - --partBlock.FreeCatalog; --partBlock.FreeSectors; writer.Write(L"newosldr: root directory: ").Write(blob->fFileName).Write(L"\r"); - memcpy(catalogKind->Name, blob->fFileName, strlen(blob->fFileName)); + CopyMem(catalogKind->Name, blob->fFileName, StrLen(blob->fFileName)); fDiskDev.Leak().mBase = startLba; fDiskDev.Leak().mSize = sizeof(NFS_CATALOG_STRUCT); |
