Changeset 3232 in MondoRescue for branches/3.2/mindi-busybox/util-linux/volume_id
- Timestamp:
- Jan 1, 2014, 12:47:38 AM (10 years ago)
- Location:
- branches/3.2/mindi-busybox/util-linux/volume_id
- Files:
-
- 24 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3.2/mindi-busybox/util-linux/volume_id/Kbuild.src
r2725 r3232 32 32 ### lib-$(CONFIG_FEATURE_VOLUMEID_MAC) += mac.o 33 33 ### lib-$(CONFIG_FEATURE_VOLUMEID_MSDOS) += msdos.o 34 lib-$(CONFIG_FEATURE_VOLUMEID_NILFS) += nilfs.o 34 35 lib-$(CONFIG_FEATURE_VOLUMEID_NTFS) += ntfs.o 36 lib-$(CONFIG_FEATURE_VOLUMEID_EXFAT) += exfat.o 35 37 lib-$(CONFIG_FEATURE_VOLUMEID_REISERFS) += reiserfs.o 36 38 lib-$(CONFIG_FEATURE_VOLUMEID_UDF) += udf.o -
branches/3.2/mindi-busybox/util-linux/volume_id/btrfs.c
r2725 r3232 103 103 volume_id_set_label_string(id, sb->label, VOLUME_ID_LABEL_SIZE); 104 104 volume_id_set_uuid(id, sb->fsid, UUID_DCE); 105 IF_FEATURE_BLKID_TYPE(id->type = "btrfs";) 105 106 106 107 return 0; -
branches/3.2/mindi-busybox/util-linux/volume_id/cramfs.c
r2725 r3232 52 52 53 53 // volume_id_set_usage(id, VOLUME_ID_FILESYSTEM); 54 // id->type = "cramfs"; 54 IF_FEATURE_BLKID_TYPE(id->type = "cramfs";) 55 55 return 0; 56 56 } -
branches/3.2/mindi-busybox/util-linux/volume_id/ext.c
r2725 r3232 20 20 21 21 #include "volume_id_internal.h" 22 #include "bb_e2fs_defs.h" 22 23 23 struct ext2_super_block {24 uint32_t inodes_count;25 uint32_t blocks_count;26 uint32_t r_blocks_count;27 uint32_t free_blocks_count;28 uint32_t free_inodes_count;29 uint32_t first_data_block;30 uint32_t log_block_size;31 uint32_t dummy3[7];32 uint8_t magic[2];33 uint16_t state;34 uint32_t dummy5[8];35 uint32_t feature_compat;36 uint32_t feature_incompat;37 uint32_t feature_ro_compat;38 uint8_t uuid[16];39 uint8_t volume_name[16];40 } PACKED;41 42 #define EXT3_FEATURE_COMPAT_HAS_JOURNAL 0x0000000443 #define EXT3_FEATURE_INCOMPAT_JOURNAL_DEV 0x0000000844 24 #define EXT_SUPERBLOCK_OFFSET 0x400 45 25 … … 55 35 return -1; 56 36 57 if (es-> magic[0] != 0123 || es->magic[1] != 0357) {37 if (es->s_magic != cpu_to_le16(EXT2_SUPER_MAGIC)) { 58 38 dbg("ext: no magic found"); 59 39 return -1; … … 62 42 // volume_id_set_usage(id, VOLUME_ID_FILESYSTEM); 63 43 // volume_id_set_label_raw(id, es->volume_name, 16); 64 volume_id_set_label_string(id, es->volume_name, 16);65 volume_id_set_uuid(id, es-> uuid, UUID_DCE);44 volume_id_set_label_string(id, (void*)es->s_volume_name, 16); 45 volume_id_set_uuid(id, es->s_uuid, UUID_DCE); 66 46 dbg("ext: label '%s' uuid '%s'", id->label, id->uuid); 67 47 68 // if ((le32_to_cpu(es->feature_compat) & EXT3_FEATURE_COMPAT_HAS_JOURNAL) != 0) 69 // id->type = "ext3"; 70 // else 71 // id->type = "ext2"; 72 48 #if ENABLE_FEATURE_BLKID_TYPE 49 if ((es->s_feature_ro_compat & cpu_to_le32(EXT4_FEATURE_RO_COMPAT_HUGE_FILE | EXT4_FEATURE_RO_COMPAT_DIR_NLINK)) 50 || (es->s_feature_incompat & cpu_to_le32(EXT4_FEATURE_INCOMPAT_EXTENTS | EXT4_FEATURE_INCOMPAT_64BIT)) 51 ) { 52 id->type = "ext4"; 53 } 54 else if (es->s_feature_compat & cpu_to_le32(EXT3_FEATURE_COMPAT_HAS_JOURNAL)) 55 id->type = "ext3"; 56 else 57 id->type = "ext2"; 58 #endif 73 59 return 0; 74 60 } -
branches/3.2/mindi-busybox/util-linux/volume_id/fat.c
r2725 r3232 333 333 ret: 334 334 // volume_id_set_usage(id, VOLUME_ID_FILESYSTEM); 335 // id->type = "vfat"; 335 IF_FEATURE_BLKID_TYPE(id->type = "vfat";) 336 336 337 337 return 0; -
branches/3.2/mindi-busybox/util-linux/volume_id/get_devname.c
r2725 r3232 20 20 char *label; 21 21 char *uc_uuid; /* prefix makes it easier to grep for */ 22 IF_FEATURE_BLKID_TYPE(const char *type;) 22 23 } *uuidCache; 24 25 #if !ENABLE_FEATURE_BLKID_TYPE 26 #define get_label_uuid(fd, label, uuid, type) \ 27 get_label_uuid(fd, label, uuid) 28 #define uuidcache_addentry(device, label, uuid, type) \ 29 uuidcache_addentry(device, label, uuid) 30 #endif 23 31 24 32 /* Returns !0 on error. … … 27 35 * NB: closes fd. */ 28 36 static int 29 get_label_uuid(int fd, char **label, char **uuid )37 get_label_uuid(int fd, char **label, char **uuid, const char **type) 30 38 { 31 39 int rv = 1; … … 42 50 goto ret; 43 51 44 if (vid->label[0] != '\0' || vid->uuid[0] != '\0') { 52 if (vid->label[0] != '\0' || vid->uuid[0] != '\0' 53 #if ENABLE_FEATURE_BLKID_TYPE 54 || vid->type != NULL 55 #endif 56 ) { 45 57 *label = xstrndup(vid->label, sizeof(vid->label)); 46 58 *uuid = xstrndup(vid->uuid, sizeof(vid->uuid)); 59 #if ENABLE_FEATURE_BLKID_TYPE 60 *type = vid->type; 61 dbg("found label '%s', uuid '%s', type '%s'", *label, *uuid, *type); 62 #else 47 63 dbg("found label '%s', uuid '%s'", *label, *uuid); 64 #endif 48 65 rv = 0; 49 66 } … … 55 72 /* NB: we take ownership of (malloc'ed) label and uuid */ 56 73 static void 57 uuidcache_addentry(char *device, /*int major, int minor,*/ char *label, char *uuid )74 uuidcache_addentry(char *device, /*int major, int minor,*/ char *label, char *uuid, const char *type) 58 75 { 59 76 struct uuidCache_s *last; … … 73 90 last->label = label; 74 91 last->uc_uuid = uuid; 92 IF_FEATURE_BLKID_TYPE(last->type = type;) 75 93 } 76 94 … … 84 102 int depth UNUSED_PARAM) 85 103 { 86 char *uuid = uuid; /* for compiler */87 char *label = label;88 int fd;89 90 104 /* note: this check rejects links to devices, among other nodes */ 91 105 if (!S_ISBLK(statbuf->st_mode)) … … 100 114 return TRUE; 101 115 102 fd = open(device, O_RDONLY); 103 if (fd < 0) 104 return TRUE; 105 106 /* get_label_uuid() closes fd in all cases (success & failure) */ 107 if (get_label_uuid(fd, &label, &uuid) == 0) { 108 /* uuidcache_addentry() takes ownership of all three params */ 109 uuidcache_addentry(xstrdup(device), /*ma, mi,*/ label, uuid); 110 } 116 add_to_uuid_cache(device); 117 111 118 return TRUE; 112 119 } 113 120 114 static void 115 uuidcache_init(void) 116 { 121 static struct uuidCache_s* 122 uuidcache_init(int scan_devices) 123 { 124 dbg("DBG: uuidCache=%x, uuidCache"); 117 125 if (uuidCache) 118 return ;126 return uuidCache; 119 127 120 128 /* We were scanning /proc/partitions … … 128 136 * (Maybe add scanning of /sys/block/XXX/dev for devices 129 137 * somehow not having their /dev/XXX entries created?) */ 130 131 recursive_action("/dev", ACTION_RECURSE, 132 uuidcache_check_device, /* file_action */ 133 NULL, /* dir_action */ 134 NULL, /* userData */ 135 0 /* depth */); 138 if (scan_devices) 139 recursive_action("/dev", ACTION_RECURSE, 140 uuidcache_check_device, /* file_action */ 141 NULL, /* dir_action */ 142 NULL, /* userData */ 143 0 /* depth */); 144 145 return uuidCache; 136 146 } 137 147 … … 145 155 struct uuidCache_s *uc; 146 156 147 uuidcache_init(); 148 uc = uuidCache; 149 157 uc = uuidcache_init(/*scan_devices:*/ 1); 150 158 while (uc) { 151 159 switch (n) { … … 212 220 213 221 /* Used by blkid */ 214 void display_uuid_cache(void) 215 { 216 struct uuidCache_s *u; 217 218 uuidcache_init(); 219 u = uuidCache; 220 while (u) { 221 printf("%s:", u->device); 222 if (u->label[0]) 223 printf(" LABEL=\"%s\"", u->label); 224 if (u->uc_uuid[0]) 225 printf(" UUID=\"%s\"", u->uc_uuid); 222 void display_uuid_cache(int scan_devices) 223 { 224 struct uuidCache_s *uc; 225 226 uc = uuidcache_init(scan_devices); 227 while (uc) { 228 printf("%s:", uc->device); 229 if (uc->label[0]) 230 printf(" LABEL=\"%s\"", uc->label); 231 if (uc->uc_uuid[0]) 232 printf(" UUID=\"%s\"", uc->uc_uuid); 233 #if ENABLE_FEATURE_BLKID_TYPE 234 if (uc->type) 235 printf(" TYPE=\"%s\"", uc->type); 236 #endif 226 237 bb_putchar('\n'); 227 u = u->next; 228 } 229 } 238 uc = uc->next; 239 } 240 } 241 242 int add_to_uuid_cache(const char *device) 243 { 244 char *uuid = uuid; /* for compiler */ 245 char *label = label; 246 #if ENABLE_FEATURE_BLKID_TYPE 247 const char *type = type; 248 #endif 249 int fd; 250 251 fd = open(device, O_RDONLY); 252 if (fd < 0) 253 return 0; 254 255 /* get_label_uuid() closes fd in all cases (success & failure) */ 256 if (get_label_uuid(fd, &label, &uuid, &type) == 0) { 257 /* uuidcache_addentry() takes ownership of all four params */ 258 uuidcache_addentry(xstrdup(device), /*ma, mi,*/ label, uuid, type); 259 return 1; 260 } 261 return 0; 262 } 263 230 264 231 265 /* Used by mount and findfs */ … … 235 269 struct uuidCache_s *uc; 236 270 237 uuidcache_init(); 238 uc = uuidCache; 271 uc = uuidcache_init(/*scan_devices:*/ 1); 239 272 while (uc) { 240 273 if (uc->label[0] && strcmp(spec, uc->label) == 0) { … … 250 283 struct uuidCache_s *uc; 251 284 252 uuidcache_init(); 253 uc = uuidCache; 285 uc = uuidcache_init(/*scan_devices:*/ 1); 254 286 while (uc) { 255 287 /* case of hex numbers doesn't matter */ -
branches/3.2/mindi-busybox/util-linux/volume_id/hfs.c
r2725 r3232 132 132 #define HFSPLUS_POR_CNID 1 133 133 134 static void FAST_FUNC hfs_set_uuid(struct volume_id *id, const uint8_t *hfs_id) 135 { 136 #define hfs_id_len 8 137 md5_ctx_t md5c; 138 uint8_t uuid[16]; 139 unsigned i; 140 141 for (i = 0; i < hfs_id_len; i++) 142 if (hfs_id[i] != 0) 143 goto do_md5; 144 return; 145 do_md5: 146 md5_begin(&md5c); 147 md5_hash(&md5c, "\263\342\17\71\362\222\21\326\227\244\0\60\145\103\354\254", 16); 148 md5_hash(&md5c, hfs_id, hfs_id_len); 149 md5_end(&md5c, uuid); 150 uuid[6] = 0x30 | (uuid[6] & 0x0f); 151 uuid[8] = 0x80 | (uuid[8] & 0x3f); 152 volume_id_set_uuid(id, uuid, UUID_DCE); 153 } 154 134 155 int FAST_FUNC volume_id_probe_hfs_hfsplus(struct volume_id *id /*,uint64_t off*/) 135 156 { … … 194 215 } 195 216 196 volume_id_set_uuid(id, hfs->finder_info.id, UUID_HFS);217 hfs_set_uuid(id, hfs->finder_info.id); 197 218 // volume_id_set_usage(id, VOLUME_ID_FILESYSTEM); 198 // id->type = "hfs"; 219 IF_FEATURE_BLKID_TYPE(id->type = "hfs";) 199 220 200 221 return 0; … … 208 229 209 230 hfsplus: 210 volume_id_set_uuid(id, hfsplus->finder_info.id, UUID_HFS);231 hfs_set_uuid(id, hfsplus->finder_info.id); 211 232 212 233 blocksize = be32_to_cpu(hfsplus->blocksize); … … 287 308 found: 288 309 // volume_id_set_usage(id, VOLUME_ID_FILESYSTEM); 289 // id->type = "hfsplus"; 310 IF_FEATURE_BLKID_TYPE(id->type = "hfsplus";) 290 311 291 312 return 0; -
branches/3.2/mindi-busybox/util-linux/volume_id/iso9660.c
r2725 r3232 115 115 found: 116 116 // volume_id_set_usage(id, VOLUME_ID_FILESYSTEM); 117 // id->type = "iso9660"; 117 IF_FEATURE_BLKID_TYPE(id->type = "iso9660";) 118 118 119 119 return 0; -
branches/3.2/mindi-busybox/util-linux/volume_id/jfs.c
r2725 r3232 55 55 56 56 // volume_id_set_usage(id, VOLUME_ID_FILESYSTEM); 57 // id->type = "jfs"; 57 IF_FEATURE_BLKID_TYPE(id->type = "jfs";) 58 58 59 59 return 0; -
branches/3.2/mindi-busybox/util-linux/volume_id/linux_raid.c
r2725 r3232 70 70 71 71 // snprintf(id->type_version, sizeof(id->type_version)-1, "%u.%u.%u", 72 // 73 // 74 // 72 // le32_to_cpu(mdp->major_version), 73 // le32_to_cpu(mdp->minor_version), 74 // le32_to_cpu(mdp->patch_version)); 75 75 76 76 dbg("found raid signature"); 77 77 // volume_id_set_usage(id, VOLUME_ID_RAID); 78 // id->type = "linux_raid_member"; 78 IF_FEATURE_BLKID_TYPE(id->type = "linux_raid_member";) 79 79 80 80 return 0; -
branches/3.2/mindi-busybox/util-linux/volume_id/linux_swap.c
r2725 r3232 73 73 found: 74 74 // volume_id_set_usage(id, VOLUME_ID_OTHER); 75 // id->type = "swap"; 75 IF_FEATURE_BLKID_TYPE(id->type = "swap";) 76 76 77 77 return 0; -
branches/3.2/mindi-busybox/util-linux/volume_id/luks.c
r2725 r3232 95 95 // volume_id_set_usage(id, VOLUME_ID_CRYPTO); 96 96 volume_id_set_uuid(id, header->uuid, UUID_DCE_STRING); 97 // id->type = "crypto_LUKS"; 97 IF_FEATURE_BLKID_TYPE(id->type = "crypto_LUKS";) 98 98 99 99 return 0; -
branches/3.2/mindi-busybox/util-linux/volume_id/ntfs.c
r2725 r3232 133 133 134 134 buf = volume_id_get_buffer(id, off + mft_off + (MFT_RECORD_VOLUME * mft_record_size), 135 135 mft_record_size); 136 136 if (buf == NULL) 137 137 goto found; … … 151 151 attr = (struct file_attribute*) &buf[attr_off]; 152 152 attr_type = le32_to_cpu(attr->type); 153 attr_len = le 16_to_cpu(attr->len);153 attr_len = le32_to_cpu(attr->len); 154 154 val_off = le16_to_cpu(attr->value_offset); 155 155 val_len = le32_to_cpu(attr->value_len); … … 166 166 167 167 dbg("found attribute type 0x%x, len %i, at offset %i", 168 168 attr_type, attr_len, attr_off); 169 169 170 170 // if (attr_type == MFT_RECORD_ATTR_VOLUME_INFO) { … … 189 189 found: 190 190 // volume_id_set_usage(id, VOLUME_ID_FILESYSTEM); 191 // id->type = "ntfs"; 191 IF_FEATURE_BLKID_TYPE(id->type = "ntfs";) 192 192 193 193 return 0; -
branches/3.2/mindi-busybox/util-linux/volume_id/ocfs2.c
r2725 r3232 102 102 OCFS2_MAX_VOL_LABEL_LEN : VOLUME_ID_LABEL_SIZE); 103 103 volume_id_set_uuid(id, os->s_uuid, UUID_DCE); 104 // id->type = "ocfs2"; 104 IF_FEATURE_BLKID_TYPE(id->type = "ocfs2";) 105 105 return 0; 106 106 } -
branches/3.2/mindi-busybox/util-linux/volume_id/reiserfs.c
r2725 r3232 108 108 found: 109 109 // volume_id_set_usage(id, VOLUME_ID_FILESYSTEM); 110 // id->type = "reiserfs"; 110 IF_FEATURE_BLKID_TYPE(id->type = "reiserfs";) 111 111 112 112 return 0; -
branches/3.2/mindi-busybox/util-linux/volume_id/romfs.c
r2725 r3232 48 48 49 49 // volume_id_set_usage(id, VOLUME_ID_FILESYSTEM); 50 // id->type = "romfs"; 50 IF_FEATURE_BLKID_TYPE(id->type = "romfs";) 51 51 return 0; 52 52 } -
branches/3.2/mindi-busybox/util-linux/volume_id/sysv.c
r2725 r3232 100 100 // volume_id_set_label_raw(id, vs->s_fname, 6); 101 101 volume_id_set_label_string(id, vs->s_fname, 6); 102 // id->type = "sysv";102 IF_FEATURE_BLKID_TYPE(id->type = "sysv"); 103 103 goto found; 104 104 } … … 113 113 // volume_id_set_label_raw(id, xs->s_fname, 6); 114 114 volume_id_set_label_string(id, xs->s_fname, 6); 115 // id->type = "xenix"; 115 IF_FEATURE_BLKID_TYPE(id->type = "xenix";) 116 116 goto found; 117 117 } -
branches/3.2/mindi-busybox/util-linux/volume_id/udf.c
r2725 r3232 110 110 111 111 dbg("vsd: %c%c%c%c%c", 112 112 vsd->id[0], vsd->id[1], vsd->id[2], vsd->id[3], vsd->id[4]); 113 113 114 114 if (vsd->id[0] == '\0') … … 168 168 found: 169 169 // volume_id_set_usage(id, VOLUME_ID_FILESYSTEM); 170 // id->type = "udf"; 171 170 IF_FEATURE_BLKID_TYPE(id->type = "udf";) 172 171 return 0; 173 172 } -
branches/3.2/mindi-busybox/util-linux/volume_id/unused_msdos.c
r2725 r3232 110 110 } else { 111 111 dbg("found 0x%x data partition at 0x%llx, len 0x%llx", 112 112 part[i].sys_ind, (unsigned long long) poff, (unsigned long long) plen); 113 113 114 114 // if (is_raid(part[i].sys_ind)) -
branches/3.2/mindi-busybox/util-linux/volume_id/unused_silicon_raid.c
r2725 r3232 63 63 // volume_id_set_usage(id, VOLUME_ID_RAID); 64 64 // snprintf(id->type_version, sizeof(id->type_version)-1, "%u.%u", 65 // 65 // le16_to_cpu(sil->major_ver), le16_to_cpu(sil->minor_ver)); 66 66 // id->type = "silicon_medley_raid_member"; 67 67 -
branches/3.2/mindi-busybox/util-linux/volume_id/util.c
r2725 r3232 32 32 else 33 33 c = (buf[i] << 8) | buf[i+1]; 34 if (c == 0) { 35 str[j] = '\0'; 34 if (c == 0) 36 35 break; 37 } else if (c < 0x80) { 38 if (j+1 >= len) 39 break; 40 str[j++] = (uint8_t) c; 41 } else if (c < 0x800) { 36 if (j+1 >= len) 37 break; 38 if (c < 0x80) { 39 /* 0xxxxxxx */ 40 } else { 41 uint8_t topbits = 0xc0; 42 42 if (j+2 >= len) 43 43 break; 44 str[j++] = (uint8_t) (0xc0 | (c >> 6)); 45 str[j++] = (uint8_t) (0x80 | (c & 0x3f)); 46 } else { 47 if (j+3 >= len) 48 break; 49 str[j++] = (uint8_t) (0xe0 | (c >> 12)); 50 str[j++] = (uint8_t) (0x80 | ((c >> 6) & 0x3f)); 51 str[j++] = (uint8_t) (0x80 | (c & 0x3f)); 44 if (c < 0x800) { 45 /* 110yyyxx 10xxxxxx */ 46 } else { 47 if (j+3 >= len) 48 break; 49 /* 1110yyyy 10yyyyxx 10xxxxxx */ 50 str[j++] = (uint8_t) (0xe0 | (c >> 12)); 51 topbits = 0x80; 52 } 53 str[j++] = (uint8_t) (topbits | ((c >> 6) & 0x3f)); 54 c = 0x80 | (c & 0x3f); 52 55 } 56 str[j++] = (uint8_t) c; 53 57 } 54 58 str[j] = '\0'; … … 126 130 void volume_id_set_label_unicode16(struct volume_id *id, const uint8_t *buf, enum endian endianess, size_t count) 127 131 { 128 132 volume_id_set_unicode16(id->label, sizeof(id->label), buf, endianess, count); 129 133 } 130 134 … … 132 136 { 133 137 unsigned i; 134 unsigned count = 0; 135 136 switch (format) { 137 case UUID_DOS: 138 count = 4; 139 break; 140 case UUID_NTFS: 141 case UUID_HFS: 142 count = 8; 143 break; 144 case UUID_DCE: 145 count = 16; 146 break; 147 case UUID_DCE_STRING: 148 /* 36 is ok, id->uuid has one extra byte for NUL */ 149 count = VOLUME_ID_UUID_SIZE; 150 break; 151 } 138 unsigned count = (format == UUID_DCE_STRING ? VOLUME_ID_UUID_SIZE : 4 << format); 139 152 140 // memcpy(id->uuid_raw, buf, count); 153 141 // id->uuid_raw_len = count; … … 169 157 buf[7], buf[6], buf[5], buf[4], 170 158 buf[3], buf[2], buf[1], buf[0]); 171 break;172 case UUID_HFS:173 sprintf(id->uuid, "%02X%02X%02X%02X%02X%02X%02X%02X",174 buf[0], buf[1], buf[2], buf[3],175 buf[4], buf[5], buf[6], buf[7]);176 159 break; 177 160 case UUID_DCE: -
branches/3.2/mindi-busybox/util-linux/volume_id/volume_id.c
r2725 r3232 94 94 volume_id_probe_vfat, 95 95 #endif 96 #if ENABLE_FEATURE_VOLUMEID_EXFAT 97 volume_id_probe_exfat, 98 #endif 96 99 #if ENABLE_FEATURE_VOLUMEID_MAC 97 100 volume_id_probe_mac_partition_map, 101 #endif 102 #if ENABLE_FEATURE_VOLUMEID_SQUASHFS 103 volume_id_probe_squashfs, 98 104 #endif 99 105 #if ENABLE_FEATURE_VOLUMEID_XFS … … 130 136 #if ENABLE_FEATURE_VOLUMEID_UFS 131 137 volume_id_probe_ufs, 138 #endif 139 #if ENABLE_FEATURE_VOLUMEID_NILFS 140 volume_id_probe_nilfs, 132 141 #endif 133 142 #if ENABLE_FEATURE_VOLUMEID_NTFS -
branches/3.2/mindi-busybox/util-linux/volume_id/volume_id_internal.h
r2725 r3232 81 81 // smallint usage_id; 82 82 // const char *usage; 83 // const char *type; 83 #if ENABLE_FEATURE_BLKID_TYPE 84 const char *type; 85 #endif 84 86 }; 85 87 … … 135 137 #endif 136 138 139 /* volume_id_set_uuid(id,buf,fmt) assumes size of uuid buf 140 * by shifting: 4 << fmt, except for fmt == UUID_DCE_STRING. 141 * The constants below should match sizes. 142 */ 137 143 enum uuid_format { 138 UUID_DCE_STRING, 139 UUID_DCE, 140 UUID_DOS, 141 UUID_NTFS, 142 UUID_HFS, 144 UUID_DOS = 0, /* 4 bytes */ 145 UUID_NTFS = 1, /* 8 bytes */ 146 UUID_DCE = 2, /* 16 bytes */ 147 UUID_DCE_STRING = 3, /* 36 bytes (VOLUME_ID_UUID_SIZE) */ 143 148 }; 144 149 … … 211 216 //int FAST_FUNC volume_id_probe_msdos_part_table(struct volume_id *id /*,uint64_t off*/); 212 217 218 int FAST_FUNC volume_id_probe_nilfs(struct volume_id *id /*,uint64_t off*/); 219 213 220 int FAST_FUNC volume_id_probe_ntfs(struct volume_id *id /*,uint64_t off*/); 214 221 222 int FAST_FUNC volume_id_probe_exfat(struct volume_id *id /*,uint64_t off*/); 223 215 224 int FAST_FUNC volume_id_probe_ocfs2(struct volume_id *id /*,uint64_t off*/); 216 225 … … 219 228 int FAST_FUNC volume_id_probe_romfs(struct volume_id *id /*,uint64_t off*/); 220 229 230 int FAST_FUNC volume_id_probe_squashfs(struct volume_id *id /*,uint64_t off*/); 231 221 232 int FAST_FUNC volume_id_probe_sysv(struct volume_id *id /*,uint64_t off*/); 222 233 -
branches/3.2/mindi-busybox/util-linux/volume_id/xfs.c
r2725 r3232 55 55 56 56 // volume_id_set_usage(id, VOLUME_ID_FILESYSTEM); 57 // id->type = "xfs"; 57 IF_FEATURE_BLKID_TYPE(id->type = "xfs";) 58 58 59 59 return 0;
Note:
See TracChangeset
for help on using the changeset viewer.