|
|
b7d0ab |
diff -Naur a/manpages/fatlabel.8.in b/manpages/fatlabel.8.in
|
|
|
b7d0ab |
--- a/manpages/fatlabel.8.in 2021-01-31 04:49:12.000000000 -0800
|
|
|
b7d0ab |
+++ b/manpages/fatlabel.8.in 2022-10-20 10:39:36.449439626 -0700
|
|
|
b7d0ab |
@@ -51,6 +51,8 @@
|
|
|
b7d0ab |
.IP "\fB-c\fP \fIPAGE\fP, \fB\-\-codepage\fP=\fIPAGE\fP" 4
|
|
|
b7d0ab |
Use DOS codepage \fIPAGE\fP to encode/decode label.
|
|
|
b7d0ab |
By default codepage 850 is used.
|
|
|
b7d0ab |
+.IP "\fB\-\-skip-name-validation\fP" 4
|
|
|
b7d0ab |
+Do not validate filesystem label.
|
|
|
b7d0ab |
.IP "\fB\-h\fP, \fB\-\-help\fP" 4
|
|
|
b7d0ab |
Display a help message and terminate.
|
|
|
b7d0ab |
.IP "\fB\-V\fP, \fB\-\-version\fP" 4
|
|
|
b7d0ab |
diff -Naur a/manpages/mkfs.fat.8.in b/manpages/mkfs.fat.8.in
|
|
|
b7d0ab |
--- a/manpages/mkfs.fat.8.in 2021-01-31 04:49:12.000000000 -0800
|
|
|
b7d0ab |
+++ b/manpages/mkfs.fat.8.in 2022-10-20 10:39:36.449439626 -0700
|
|
|
b7d0ab |
@@ -218,6 +218,8 @@
|
|
|
b7d0ab |
Multiple runs of \fBmkfs.fat\fP on the same device create identical results
|
|
|
b7d0ab |
with this option.
|
|
|
b7d0ab |
Its main purpose is testing \fBmkfs.fat\fP.
|
|
|
b7d0ab |
+.IP "\fB\-\-skip-name-validation\fP" 4
|
|
|
b7d0ab |
+Do not validate filesystem label.
|
|
|
b7d0ab |
.\" ----------------------------------------------------------------------------
|
|
|
b7d0ab |
.SH BUGS
|
|
|
b7d0ab |
\fBmkfs.fat\fP can not create boot-able filesystems.
|
|
|
b7d0ab |
diff -Naur a/src/common.c b/src/common.c
|
|
|
b7d0ab |
--- a/src/common.c 2021-01-31 04:49:12.000000000 -0800
|
|
|
b7d0ab |
+++ b/src/common.c 2022-10-20 10:39:36.450439587 -0700
|
|
|
b7d0ab |
@@ -42,6 +42,7 @@
|
|
|
b7d0ab |
int interactive;
|
|
|
b7d0ab |
int write_immed;
|
|
|
b7d0ab |
int atari_format;
|
|
|
b7d0ab |
+int skip_name_validation;
|
|
|
b7d0ab |
const char *program_name;
|
|
|
b7d0ab |
|
|
|
b7d0ab |
|
|
|
b7d0ab |
@@ -327,6 +328,9 @@
|
|
|
b7d0ab |
int ret = 0;
|
|
|
b7d0ab |
wchar_t wlabel[12];
|
|
|
b7d0ab |
|
|
|
b7d0ab |
+ if (skip_name_validation)
|
|
|
b7d0ab |
+ return 0;
|
|
|
b7d0ab |
+
|
|
|
b7d0ab |
if (dos_string_to_wchar_string(wlabel, doslabel, sizeof(wlabel))) {
|
|
|
b7d0ab |
for (i = 0; wlabel[i]; i++) {
|
|
|
b7d0ab |
/* FAT specification: Lower case characters are not allowed in DIR_Name
|
|
|
b7d0ab |
diff -Naur a/src/common.h b/src/common.h
|
|
|
b7d0ab |
--- a/src/common.h 2021-01-31 04:49:12.000000000 -0800
|
|
|
b7d0ab |
+++ b/src/common.h 2022-10-20 10:39:36.450439587 -0700
|
|
|
b7d0ab |
@@ -35,6 +35,7 @@
|
|
|
b7d0ab |
extern int interactive;
|
|
|
b7d0ab |
extern int write_immed;
|
|
|
b7d0ab |
extern int atari_format; /* Use Atari variation of MS-DOS FS format */
|
|
|
b7d0ab |
+extern int skip_name_validation;
|
|
|
b7d0ab |
|
|
|
b7d0ab |
/* program_name used for printing messages; no name will be printed when it is
|
|
|
b7d0ab |
* left as NULL */
|
|
|
b7d0ab |
diff -Naur a/src/fatlabel.c b/src/fatlabel.c
|
|
|
b7d0ab |
--- a/src/fatlabel.c 2021-01-31 04:49:12.000000000 -0800
|
|
|
b7d0ab |
+++ b/src/fatlabel.c 2022-10-20 10:39:36.451439549 -0700
|
|
|
b7d0ab |
@@ -195,21 +195,24 @@
|
|
|
b7d0ab |
fprintf(f, "existing label or serial if NEW is not given.\n");
|
|
|
b7d0ab |
fprintf(f, "\n");
|
|
|
b7d0ab |
fprintf(f, "Options:\n");
|
|
|
b7d0ab |
- fprintf(f, " -i, --volume-id Work on serial number instead of label\n");
|
|
|
b7d0ab |
- fprintf(f, " -r, --reset Remove label or generate new serial number\n");
|
|
|
b7d0ab |
- fprintf(f, " -c N, --codepage=N use DOS codepage N to encode/decode label (default: %d)\n", DEFAULT_DOS_CODEPAGE);
|
|
|
b7d0ab |
- fprintf(f, " -V, --version Show version number and terminate\n");
|
|
|
b7d0ab |
- fprintf(f, " -h, --help Print this message and terminate\n");
|
|
|
b7d0ab |
+ fprintf(f, " -i, --volume-id Work on serial number instead of label\n");
|
|
|
b7d0ab |
+ fprintf(f, " -r, --reset Remove label or generate new serial number\n");
|
|
|
b7d0ab |
+ fprintf(f, " -c N, --codepage=N use DOS codepage N to encode/decode label (default: %d)\n", DEFAULT_DOS_CODEPAGE);
|
|
|
b7d0ab |
+ fprintf(f, " --skip-name-validation Do not validate filesystem label\n");
|
|
|
b7d0ab |
+ fprintf(f, " -V, --version Show version number and terminate\n");
|
|
|
b7d0ab |
+ fprintf(f, " -h, --help Print this message and terminate\n");
|
|
|
b7d0ab |
exit(status);
|
|
|
b7d0ab |
}
|
|
|
b7d0ab |
|
|
|
b7d0ab |
|
|
|
b7d0ab |
int main(int argc, char *argv[])
|
|
|
b7d0ab |
{
|
|
|
b7d0ab |
+ enum {OPT_SKIP_NAME_VALIDATION=1000};
|
|
|
b7d0ab |
const struct option long_options[] = {
|
|
|
b7d0ab |
{"volume-id", no_argument, NULL, 'i'},
|
|
|
b7d0ab |
{"reset", no_argument, NULL, 'r'},
|
|
|
b7d0ab |
{"codepage", required_argument, NULL, 'c'},
|
|
|
b7d0ab |
+ {"skip-name-validation", optional_argument, NULL, OPT_SKIP_NAME_VALIDATION},
|
|
|
b7d0ab |
{"version", no_argument, NULL, 'V'},
|
|
|
b7d0ab |
{"help", no_argument, NULL, 'h'},
|
|
|
b7d0ab |
{0,}
|
|
|
b7d0ab |
@@ -246,6 +249,10 @@
|
|
|
b7d0ab |
usage(1, 0);
|
|
|
b7d0ab |
break;
|
|
|
b7d0ab |
|
|
|
b7d0ab |
+ case OPT_SKIP_NAME_VALIDATION:
|
|
|
b7d0ab |
+ skip_name_validation = 1;
|
|
|
b7d0ab |
+ break;
|
|
|
b7d0ab |
+
|
|
|
b7d0ab |
case 'V':
|
|
|
b7d0ab |
printf("fatlabel " VERSION " (" VERSION_DATE ")\n");
|
|
|
b7d0ab |
exit(0);
|
|
|
b7d0ab |
diff -Naur a/src/mkfs.fat.c b/src/mkfs.fat.c
|
|
|
b7d0ab |
--- a/src/mkfs.fat.c 2021-01-31 04:49:12.000000000 -0800
|
|
|
b7d0ab |
+++ b/src/mkfs.fat.c 2022-10-20 10:41:34.018323059 -0700
|
|
|
b7d0ab |
@@ -1454,6 +1454,7 @@
|
|
|
b7d0ab |
fprintf(stderr, " -S SIZE Select a sector size of SIZE (a power of two, at least 512)\n");
|
|
|
b7d0ab |
fprintf(stderr, " -v Verbose execution\n");
|
|
|
b7d0ab |
fprintf(stderr, " --variant=TYPE Select variant TYPE of filesystem (standard or Atari)\n");
|
|
|
b7d0ab |
+ fprintf(stderr, " --skip-name-validation Do not validate filesystem label\n");
|
|
|
b7d0ab |
fprintf(stderr, "\n");
|
|
|
b7d0ab |
fprintf(stderr, " --invariant Use constants for randomly generated or time based values\n");
|
|
|
b7d0ab |
fprintf(stderr, " --offset=SECTOR Write the filesystem at a specific sector into the device file.\n");
|
|
|
b7d0ab |
@@ -1478,14 +1479,15 @@
|
|
|
b7d0ab |
struct timeval create_timeval;
|
|
|
b7d0ab |
long long conversion;
|
|
|
b7d0ab |
|
|
|
b7d0ab |
- enum {OPT_HELP=1000, OPT_INVARIANT, OPT_MBR, OPT_VARIANT, OPT_CODEPAGE, OPT_OFFSET};
|
|
|
b7d0ab |
+ enum {OPT_HELP=1000, OPT_INVARIANT, OPT_MBR, OPT_VARIANT, OPT_CODEPAGE, OPT_OFFSET, OPT_SKIP_NAME_VALIDATION};
|
|
|
b7d0ab |
const struct option long_options[] = {
|
|
|
b7d0ab |
- {"codepage", required_argument, NULL, OPT_CODEPAGE},
|
|
|
b7d0ab |
- {"invariant", no_argument, NULL, OPT_INVARIANT},
|
|
|
b7d0ab |
- {"mbr", optional_argument, NULL, OPT_MBR},
|
|
|
b7d0ab |
- {"variant", required_argument, NULL, OPT_VARIANT},
|
|
|
b7d0ab |
- {"offset", required_argument, NULL, OPT_OFFSET},
|
|
|
b7d0ab |
- {"help", no_argument, NULL, OPT_HELP},
|
|
|
b7d0ab |
+ {"codepage", required_argument, NULL, OPT_CODEPAGE},
|
|
|
b7d0ab |
+ {"invariant", no_argument, NULL, OPT_INVARIANT},
|
|
|
b7d0ab |
+ {"mbr", optional_argument, NULL, OPT_MBR},
|
|
|
b7d0ab |
+ {"variant", required_argument, NULL, OPT_VARIANT},
|
|
|
b7d0ab |
+ {"offset", required_argument, NULL, OPT_OFFSET},
|
|
|
b7d0ab |
+ {"skip-name-validation", optional_argument, NULL, OPT_SKIP_NAME_VALIDATION},
|
|
|
b7d0ab |
+ {"help", no_argument, NULL, OPT_HELP},
|
|
|
b7d0ab |
{0,}
|
|
|
b7d0ab |
};
|
|
|
b7d0ab |
|
|
|
b7d0ab |
@@ -1813,6 +1815,10 @@
|
|
|
b7d0ab |
part_sector = (off_t) conversion;
|
|
|
b7d0ab |
break;
|
|
|
b7d0ab |
|
|
|
b7d0ab |
+ case OPT_SKIP_NAME_VALIDATION:
|
|
|
b7d0ab |
+ skip_name_validation = 1;
|
|
|
b7d0ab |
+ break;
|
|
|
b7d0ab |
+
|
|
|
b7d0ab |
case '?':
|
|
|
b7d0ab |
usage(argv[0], 1);
|
|
|
b7d0ab |
exit(1);
|