parted/parted-wipeaix.patch

35 lines
1.2 KiB
Diff

--- parted-1.6.3/libparted/labels/dos.c 2002-09-23 14:32:38.000000000 +0000
+++ parted-1.6.3/libparted/labels/dos.c 2002-09-23 14:26:07.000000000 +0000
@@ -51,6 +51,8 @@
#define MSDOS_MAGIC 0xAA55
#define PARTITION_MAGIC_MAGIC 0xf6f6
+#define AIXIPLRECID 0xc9c2d4c1 /* Value is EBCIDIC 'IBMA' */
+
#define PARTITION_EMPTY 0x00
#define PARTITION_FAT12 0x01
#define PARTITION_FAT16_SM 0x04
@@ -166,6 +166,10 @@
if (PED_LE16_TO_CPU (part_table->magic) != MSDOS_MAGIC)
return 0;
+ /* Is this an AIX IPL label? Then just go away. */
+ if (PED_BE32_TO_CPU (*(unsigned int*)(part_table->boot_code)) == AIXIPLRECID)
+ return 0;
+
/* if this is a FAT fs, fail here. Note that the Smart Boot Manager
* Loader (SBML) signature indicates a partition table, not a file
* system.
@@ -784,7 +786,10 @@
ped_device_read (disk->dev, &table, 0, 1);
- if (!table.boot_code[0]) {
+ /* either no bootrecord at all, or AIX IPL signature ... */
+ if ((!table.boot_code[0]) ||
+ (PED_BE32_TO_CPU (*(unsigned int*)(table.boot_code)) == AIXIPLRECID)
+ ) {
memset (table.boot_code, 0, 512);
memcpy (table.boot_code, MBR_BOOT_CODE,
sizeof (MBR_BOOT_CODE));