1
0
mirror of https://github.com/systemd/systemd.git synced 2025-02-04 21:47:31 +03:00

[PATCH] Add support for highpoint ataraid to volume_id to suppress

This commit is contained in:
kay.sievers@vrfy.org 2004-11-02 10:22:11 +01:00 committed by Greg KH
parent 56b979e00d
commit a5d00f9d37
2 changed files with 43 additions and 6 deletions

View File

@ -263,6 +263,36 @@ static void free_buffer(struct volume_id *id)
}
}
#define HPT37X_CONFIG_OFF 0x1200
#define HPT37X_MAGIC_OK 0x5a7816f0
#define HPT37X_MAGIC_BAD 0x5a7816fd
static int probe_highpoint_ataraid(struct volume_id *id, __u64 off)
{
struct hpt37x {
__u8 filler1[32];
__u32 magic;
__u32 magic_0;
__u32 magic_1;
} __attribute__((packed)) *hpt;
const __u8 *buf;
buf = get_buffer(id, off + HPT37X_CONFIG_OFF, 0x200);
if (buf == NULL)
return -1;
hpt = (struct hpt37x *) buf;
if (hpt->magic != HPT37X_MAGIC_OK && hpt->magic != HPT37X_MAGIC_BAD)
return -1;
id->usage_id = VOLUME_ID_RAID;
id->type_id = VOLUME_ID_HPTRAID;
id->type = "hpt_ataraid_member";
return 0;
}
#define LVM1_SB_OFF 0x400
#define LVM1_MAGIC "HM"
static int probe_lvm1(struct volume_id *id, __u64 off)
@ -2038,6 +2068,9 @@ int volume_id_probe(struct volume_id *id,
case VOLUME_ID_LVM2:
rc = probe_lvm2(id, off);
break;
case VOLUME_ID_HPTRAID:
rc = probe_highpoint_ataraid(id, off);
break;
case VOLUME_ID_ALL:
default:
/* probe for raid first, cause fs probes may be successful on raid members */
@ -2048,14 +2081,14 @@ int volume_id_probe(struct volume_id *id,
if (rc == 0)
break;
rc = probe_lvm2(id, off);
if (rc == 0)
break;
rc = probe_highpoint_ataraid(id, off);
if (rc == 0)
break;
/* signature in the first block, only small buffer needed */
rc = probe_msdos_part_table(id, off);
if (rc == 0)
break;
rc = probe_ntfs(id, off);
if (rc == 0)
break;
rc = probe_vfat(id, off);
@ -2093,6 +2126,9 @@ int volume_id_probe(struct volume_id *id,
if (rc == 0)
break;
rc = probe_ufs(id, off);
if (rc == 0)
break;
rc = probe_ntfs(id, off);
if (rc == 0)
break;

View File

@ -21,7 +21,7 @@
#ifndef _VOLUME_ID_H_
#define _VOLUME_ID_H_
#define VOLUME_ID_VERSION 25
#define VOLUME_ID_VERSION 26
#define VOLUME_ID_LABEL_SIZE 64
#define VOLUME_ID_UUID_SIZE 16
@ -36,7 +36,7 @@ enum volume_id_usage {
VOLUME_ID_OTHER,
VOLUME_ID_FILESYSTEM,
VOLUME_ID_PARTITIONTABLE,
VOLUME_ID_RAID
VOLUME_ID_RAID,
};
enum volume_id_type {
@ -59,7 +59,8 @@ enum volume_id_type {
VOLUME_ID_UFS,
VOLUME_ID_LINUX_RAID,
VOLUME_ID_LVM1,
VOLUME_ID_LVM2
VOLUME_ID_LVM2,
VOLUME_ID_HPTRAID,
};
struct volume_id_partition {