sdutil FAT formatting, libfat fix memcpy overflow, generate linker .map files for user apps
All checks were successful
Build documentation / build-and-deploy (push) Successful in 3m46s

This commit is contained in:
2026-03-21 00:08:19 +01:00
parent 7fa37ad6d7
commit 3a48856ee4
11 changed files with 41 additions and 34 deletions

1
ce/.gitignore vendored
View File

@@ -2,4 +2,5 @@
*.json
docs/
.cache/
*.map
ce

View File

@@ -6,7 +6,6 @@ $(eval $(call add_lib,libaux))
$(eval $(call add_lib,libarena))
$(eval $(call add_lib,libioutil))
$(eval $(call add_lib,libterminal))
$(eval $(call add_lib,libfat))
$(eval $(call add_lib,libmalloc))
$(eval $(call add_lib,libdebugconsole))
$(eval $(call add_lib,libinput))

View File

@@ -9,7 +9,6 @@
#include <filewriter.h>
#include <fs_types.h>
#include <kb.h>
#include <libfat.h>
#include <malloc.h>
#include <mprintf.h>
#include <path.h>
@@ -299,30 +298,6 @@ static void mkvol (struct context* context, const char* volume, const char* str_
cprintf (context, "ERROR Could not create volume: %s\n", str_status[-ret]);
}
static void format (struct context* context, const char* device, const char* str_fs_type) {
int fs_type;
if (strcmp (str_fs_type, "tar") == 0) {
fs_type = FS_TARFS;
} else if (strcmp (str_fs_type, "fat16") == 0) {
fs_type = FS_FAT16;
} else if (strcmp (str_fs_type, "fat32") == 0) {
fs_type = FS_FAT32;
} else {
cprintf (context, "ERROR Unknown filesystem '%s'\n", str_fs_type);
return;
}
struct fatfs_ctx ctx;
int ret = fat_format_drive (&ctx, device, fs_type);
if (ret < 0)
cprintf (context, "ERROR Could not format drive: %s\n", str_status[-ret]);
else
cprintf (context, "OK\n");
}
static void help (struct context* context) {
cprintf (context, "Available commands:\n");
cprintf (context, "help\n");
@@ -336,7 +311,6 @@ static void help (struct context* context) {
cprintf (context, "terminfo\n");
cprintf (context, "cls\n");
cprintf (context, "mkvol <volume> <filesystem> <device>\n");
cprintf (context, "format <device> <filesystem>\n");
cprintf (context, "quit\n");
}
@@ -410,11 +384,6 @@ static void execute_cmd (struct ast_cmd* cmd, struct context* context) {
mkvol (context, cmd->args[0], cmd->args[1], cmd->args[2]);
else
cprintf (context, "ERROR No volume key, filesystem type or device key provided\n");
} else if (strcmp (cmd->name, "format") == 0) {
if ((cmd->args[0] != NULL) && (cmd->args[1] != NULL))
format (context, cmd->args[0], cmd->args[1]);
else
cprintf (context, "ERROR No device key or filesystem type provided\n");
} else {
char volume[VOLUME_MAX];
const char* path;