3
0
forked from pool/util-linux
util-linux/util-linux-2.12r-mount_by_uuid.patch

54 lines
2.0 KiB
Diff

Index: util-linux-ng-2.12r+git20070330/mount/fstab.c
===================================================================
--- util-linux-ng-2.12r+git20070330.orig/mount/fstab.c
+++ util-linux-ng-2.12r+git20070330/mount/fstab.c
@@ -295,7 +295,7 @@ has_uuid(const char *device, const char
const char *devuuid;
int ret;
- devuuid = mount_get_devname_by_uuid(device);
+ devuuid = mount_get_volume_uuid_by_spec(device);
ret = !strcmp(uuid, devuuid);
/* free(devuuid); */
return ret;
Index: util-linux-ng-2.12r+git20070330/mount/mount_blkid.c
===================================================================
--- util-linux-ng-2.12r+git20070330.orig/mount/mount_blkid.c
+++ util-linux-ng-2.12r+git20070330/mount/mount_blkid.c
@@ -16,6 +16,11 @@ mount_blkid_put_cache(void) {
}
const char *
+mount_get_volume_uuid_by_spec(const char *spec) {
+ return blkid_get_tag_value(blkid, "UUID", spec);
+}
+
+const char *
mount_get_volume_label_by_spec(const char *spec) {
return blkid_get_tag_value(blkid, "LABEL", spec);
}
@@ -56,6 +61,11 @@ mount_blkid_put_cache(void) {
}
const char *
+mount_get_volume_uuid_by_spec(const char *spec) {
+ return xstrdup(get_volume_uuid_by_spec(spec));
+}
+
+const char *
mount_get_volume_label_by_spec(const char *spec) {
return xstrdup(get_volume_label_by_spec(spec));
}
Index: util-linux-ng-2.12r+git20070330/mount/mount_blkid.h
===================================================================
--- util-linux-ng-2.12r+git20070330.orig/mount/mount_blkid.h
+++ util-linux-ng-2.12r+git20070330/mount/mount_blkid.h
@@ -7,6 +7,7 @@ extern void mount_blkid_get_cache(void);
extern void mount_blkid_put_cache(void);
extern const char *mount_get_devname_by_uuid(const char *uuid);
extern const char *mount_get_devname_by_label(const char *label);
+extern const char *mount_get_volume_uuid_by_spec(const char *spec);
extern const char *mount_get_volume_label_by_spec(const char *spec);
extern const char *mount_get_devname(const char *spec);
extern const char *mount_get_devname_for_mounting(const char *spec);