fix: raise ramdisk file table to 2048 entries, log when full
The 0:/usr devkit pushed the base image to ~650 files, past the ramdisk's MaxFiles = 512. The USTAR loader silently dropped the tail of the archive and, worse, every runtime Create/Mkdir failed once the table was full - so first-boot account creation could not write the user database and every login failed with "invalid username or password". Raise MaxFiles to 2048 (256 KiB static table) and log loudly both when archive entries are dropped at load and when Create/Mkdir hit the cap, so a full table can never masquerade as an auth failure again. Verified in QEMU end to end: setup -> create account -> log in -> desktop. Co-Authored-By: Claude Fable 5 <[email protected]>
This commit is contained in:
@@ -12,4 +12,4 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#define MONTAUK_BUILD_NUMBER 11
|
||||
#define MONTAUK_BUILD_NUMBER 12
|
||||
|
||||
@@ -161,6 +161,12 @@ namespace Fs::Ramdisk {
|
||||
ptr += 512 + dataBlocks * 512;
|
||||
}
|
||||
|
||||
if (fileCount >= MaxFiles && ptr + 512 <= end) {
|
||||
Kt::KernelLogStream(Kt::ERROR, "Ramdisk")
|
||||
<< "File table full (MaxFiles=" << MaxFiles
|
||||
<< "), remaining archive entries were DROPPED";
|
||||
}
|
||||
|
||||
Kt::KernelLogStream(Kt::OK, "Ramdisk") << "Loaded " << fileCount << " entries";
|
||||
}
|
||||
|
||||
@@ -340,7 +346,11 @@ namespace Fs::Ramdisk {
|
||||
|
||||
int Create(const char* path) {
|
||||
if (path == nullptr) return -1;
|
||||
if (fileCount >= MaxFiles) return -1;
|
||||
if (fileCount >= MaxFiles) {
|
||||
Kt::KernelLogStream(Kt::ERROR, "Ramdisk")
|
||||
<< "Create failed: file table full (MaxFiles=" << MaxFiles << ")";
|
||||
return -1;
|
||||
}
|
||||
|
||||
// Normalize: skip leading '/'
|
||||
if (path[0] == '/') path++;
|
||||
@@ -425,7 +435,11 @@ namespace Fs::Ramdisk {
|
||||
|
||||
int Mkdir(const char* path) {
|
||||
if (path == nullptr) return -1;
|
||||
if (fileCount >= MaxFiles) return -1;
|
||||
if (fileCount >= MaxFiles) {
|
||||
Kt::KernelLogStream(Kt::ERROR, "Ramdisk")
|
||||
<< "Mkdir failed: file table full (MaxFiles=" << MaxFiles << ")";
|
||||
return -1;
|
||||
}
|
||||
if (path[0] == '/') path++;
|
||||
|
||||
// Check if directory already exists
|
||||
|
||||
@@ -10,7 +10,9 @@
|
||||
|
||||
namespace Fs::Ramdisk {
|
||||
|
||||
static constexpr int MaxFiles = 512;
|
||||
// Static file table. The base image ships ~650 files since the
|
||||
// 0:/usr devkit; keep generous headroom for runtime file creation.
|
||||
static constexpr int MaxFiles = 2048;
|
||||
static constexpr int MaxNameLen = 100;
|
||||
|
||||
struct FileEntry {
|
||||
|
||||
Reference in New Issue
Block a user