3 Sat Mar 20 09:51:38 EST 1999 Arnaldo Carvalho de Melo <acme@conectiva.com.br>
6 #include <stdio.h> /* stderr */
7 #include <string.h> /* strstr */
8 #include <unistd.h> /* write */
14 #include "fdiskmaclabel.h"
17 #define MAC_BITMASK 0xffff0000
20 static int other_endian = 0;
21 static short volumes=1;
24 * only dealing with free blocks here
30 _("\n\tThere is a valid Mac label on this disk.\n"
31 "\tUnfortunately fdisk(1) cannot handle these disks.\n"
32 "\tUse either pdisk or parted to modify the partition table.\n"
33 "\tNevertheless some advice:\n"
34 "\t1. fdisk will destroy its contents on write.\n"
35 "\t2. Be sure that this disk is NOT a still vital\n"
36 "\t part of a volume group. (Otherwise you may\n"
37 "\t erase the other disks as well, if unmirrored.)\n")
47 memset( MBRbuffer, 0, sizeof(MBRbuffer) ); /* avoid fdisk cores */
52 check_mac_label( void )
55 Conversion: only 16 bit should compared
56 e.g.: HFS Label is only 16bit long
58 int magic_masked = 0 ;
59 magic_masked = maclabel->magic & MAC_BITMASK ;
61 switch (magic_masked) {
62 case MAC_LABEL_MAGIC :
63 case MAC_LABEL_MAGIC_2:
64 case MAC_LABEL_MAGIC_3:
76 other_endian = (maclabel->magic == MAC_LABEL_MAGIC_SWAPPED); // =?
79 partitions= 1016; // =?
82 mac_nolabel(); /* %% */
83 mac_label = 1; /* %% */