__u32 fs_stride;
struct ext2_super_block fs_param;
+char *fs_uuid = NULL;
char *creator_os;
char *volume_label;
char *mount_dir;
"\t[-g blocks-per-group] [-L volume-label] "
"[-M last-mounted-directory]\n\t[-O feature[,...]] "
"[-r fs-revision] [-E extended-option[,...]]\n"
- "\t[-T fs-type] [-jnqvFSV] device [blocks-count]\n"),
+ "\t[-T fs-type] [-U UUID] [-jnqvFSV] device [blocks-count]\n"),
program_name);
exit(1);
}
}
while ((c = getopt (argc, argv,
- "b:cf:g:G:i:jl:m:no:qr:s:t:vE:FI:J:L:M:N:O:R:ST:V")) != EOF) {
+ "b:cf:g:G:i:jl:m:no:qr:s:t:vE:FI:J:L:M:N:O:R:ST:U:V")) != EOF) {
switch (c) {
case 'b':
blocksize = strtol(optarg, &tmp, 0);
case 'T':
usage_types = optarg;
break;
+ case 'U':
+ fs_uuid = optarg;
+ break;
case 'V':
/* Print version number and exit */
show_version_only++;
zap_sector(fs, 2, 6);
/*
- * Generate a UUID for it...
+ * Parse or generate a UUID for the filesystem
*/
- uuid_generate(fs->super->s_uuid);
+ if (fs_uuid) {
+ if (uuid_parse(fs_uuid, fs->super->s_uuid) !=0) {
+ com_err(device_name, 0, "could not parse UUID: %s\n",
+ fs_uuid);
+ exit(1);
+ }
+ } else
+ uuid_generate(fs->super->s_uuid);
/*
* Initialize the directory index variables