mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-09-13 05:44:54 +03:00
libvolume_id: read ufs2 label
Taken from the FreeBSD HAL repository.
This commit is contained in:
@@ -13,7 +13,7 @@ INSTALL_DATA = ${INSTALL} -m 644
|
|||||||
INSTALL_LIB = ${INSTALL} -m 755
|
INSTALL_LIB = ${INSTALL} -m 755
|
||||||
|
|
||||||
SHLIB_CUR = 0
|
SHLIB_CUR = 0
|
||||||
SHLIB_REV = 68
|
SHLIB_REV = 69
|
||||||
SHLIB_AGE = 0
|
SHLIB_AGE = 0
|
||||||
SHLIB = libvolume_id.so.$(SHLIB_CUR).$(SHLIB_REV).$(SHLIB_AGE)
|
SHLIB = libvolume_id.so.$(SHLIB_CUR).$(SHLIB_REV).$(SHLIB_AGE)
|
||||||
|
|
||||||
|
@@ -205,6 +205,18 @@ int volume_id_probe_ufs(struct volume_id *id, uint64_t off, uint64_t size)
|
|||||||
found:
|
found:
|
||||||
volume_id_set_usage(id, VOLUME_ID_FILESYSTEM);
|
volume_id_set_usage(id, VOLUME_ID_FILESYSTEM);
|
||||||
id->type = "ufs";
|
id->type = "ufs";
|
||||||
|
switch (magic) {
|
||||||
|
case UFS_MAGIC:
|
||||||
|
strcpy(id->type_version, "1");
|
||||||
|
break;
|
||||||
|
case UFS2_MAGIC:
|
||||||
|
strcpy(id->type_version, "2");
|
||||||
|
volume_id_set_label_raw(id, ufs->fs_u11.fs_u2.fs_volname, 32);
|
||||||
|
volume_id_set_label_string(id, ufs->fs_u11.fs_u2.fs_volname, 32);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user