summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMax Maisel <max.maisel@posteo.de>2018-03-01 17:31:32 +0100
committerMax Maisel <max.maisel@posteo.de>2018-03-01 17:57:53 +0100
commit151cd9f6e9120e3c41600875c6cfa42dc1321a0b (patch)
tree699ede624f2f82b107c467318903d8cf978763a9 /src
parentfa7ef73d810310ca42d361d337aeb5fea87c3ae4 (diff)
ext4_mkfs: Added UUID parameter to create new filesystems with non-zero UUID
Diffstat (limited to 'src')
-rw-r--r--src/ext4_mkfs.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/ext4_mkfs.c b/src/ext4_mkfs.c
index 5942055..355b20a 100644
--- a/src/ext4_mkfs.c
+++ b/src/ext4_mkfs.c
@@ -95,6 +95,7 @@ static int sb2info(struct ext4_sblock *sb, struct ext4_mkfs_info *info)
info->label = sb->volume_name;
info->len = (uint64_t)info->block_size * ext4_sb_get_blocks_cnt(sb);
info->dsc_size = to_le16(sb->desc_size);
+ memcpy(info->uuid, sb->uuid, UUID_SIZE);
return EOK;
}
@@ -260,7 +261,7 @@ static void fill_sb(struct fs_aux_info *aux_info, struct ext4_mkfs_info *info)
sb->features_incompatible = to_le32(info->feat_incompat);
sb->features_read_only = to_le32(info->feat_ro_compat);
- memset(sb->uuid, 0, sizeof(sb->uuid));
+ memcpy(sb->uuid, info->uuid, UUID_SIZE);
memset(sb->volume_name, 0, sizeof(sb->volume_name));
strncpy(sb->volume_name, info->label, sizeof(sb->volume_name));