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
All checks were successful
Build documentation / build-and-deploy (push) Successful in 3m46s
This commit is contained in:
31
ce/interp.c
31
ce/interp.c
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user