diff -ur pdisk.orig/dump.c pdisk/dump.c --- pdisk.orig/dump.c Mon Jan 13 22:30:09 1997 +++ pdisk/dump.c Thu Dec 4 22:13:23 1997 @@ -3,7 +3,11 @@ // // Written by Eryk Vershen (eryk@apple.com) // - +/* + * Linux/m68k version by Christiaan Welvaart + * minor fixes and glibc change by Michael Schmitz + */ + /* * Copyright 1996,1997 by Apple Computer, Inc. * All Rights Reserved @@ -60,6 +64,7 @@ // NAMES plist[] = { "Drvr", "Apple_Driver", + "Dr43", "Apple_Driver43", "Free", "Apple_Free", " HFS", "Apple_HFS", " MFS", "Apple_MFS", @@ -83,7 +88,7 @@ // Forward declarations // void dump_block_zero(partition_map_header *map); -void dump_partition_entry(partition_map *entry, int digits); +void dump_partition_entry(partition_map *entry, int digits, char *dev); // @@ -119,6 +124,7 @@ } printf("\nBlock size=%u, Number of Blocks=%u\n", p->sbBlkSize, p->sbBlkCount); +#ifndef __mc68000__ printf("DeviceType=0x%x, DeviceId=0x%x\n", p->sbDevType, p->sbDevId); if (p->sbDrvrCount > 0) { @@ -130,6 +136,7 @@ } } printf("\n"); +#endif } @@ -149,20 +156,25 @@ if (j < 7) { j = 7; } - printf(" #: type name " - "%*s %-*s ( size )\n", j, "length", j, "base"); +#ifdef __mc68000__ + printf("%*s type name " + "%*s %-*s ( size ) system\n", strlen(map->name)+1, "#", j, "length", j, "base"); +#else + printf("%*s type name " + "%*s %-*s ( size ) system\n", strlen(map->name)+1, "#", j, "length", j, "base"); +#endif if (disk_order) { for (entry = map->disk_order; entry != NULL; entry = entry->next_on_disk) { - dump_partition_entry(entry, j); + dump_partition_entry(entry, j, map->name); } } else { for (entry = map->base_order; entry != NULL; entry = entry->next_by_base) { - dump_partition_entry(entry, j); + dump_partition_entry(entry, j, map->name); } } dump_block_zero(map); @@ -170,18 +182,23 @@ void -dump_partition_entry(partition_map *entry, int digits) +dump_partition_entry(partition_map *entry, int digits, char *dev) { partition_map_header *map; int j; DPME *p; BZB *bp; char *s; +#ifdef __mc68000__ + int aflag = 1; +#else int aflag = 0; +#endif int pflag = 1; u32 size; double bytes; + map = entry->the_map; p = entry->data; if (aflag) { @@ -192,9 +209,13 @@ break; } } - printf("%4d: %.4s %-18.32s ", entry->disk_address, s, p->dpme_name); +#ifdef __mc68000__ + printf("%s%-2d %.4s %-12.32s ", dev, entry->disk_address, s, p->dpme_name); +#else + printf("%s%-4d %.4s %-18.32s ", dev, entry->disk_address, s, p->dpme_name); +#endif } else { - printf("%4d: %20.32s %-18.32s ", + printf("%s%-4d %20.32s %-18.32s ", dev, entry->disk_address, p->dpme_type, p->dpme_name); } @@ -217,7 +238,10 @@ printf("@~%-*u", digits, p->dpme_pblock_start + p->dpme_lblock_start); } + j = 's'; + bytes = size / ONE_KILOBYTE_IN_BLOCKS; + j = 'k'; if (bytes >= 1024.0) { bytes = bytes / 1024.0; if (bytes < 1024.0) { @@ -226,58 +250,42 @@ bytes = bytes / 1024.0; j = 'G'; } - printf(" (%#5.1f%c)", bytes, j); } + printf(" (%#5.1f%c) ", bytes, j); -#if 0 - // Old A/UX fields that no one pays attention to anymore. - bp = (BZB *) (p->dpme_bzb); - j = -1; - if (bp->bzb_magic == BZBMAGIC) { - switch (bp->bzb_type) { - case FSTEFS: - s = "EFS"; - break; - case FSTSFS: - s = "SFS"; - j = 1; - break; - case FST: - default: - if (bzb_root_get(bp) != 0) { - if (bzb_usr_get(bp) != 0) { - s = "RUFS"; - } else { - s = "RFS"; - } - j = 0; - } else if (bzb_usr_get(bp) != 0) { - s = "UFS"; - j = 2; - } else { - s = "FS"; - } - break; - } - if (bzb_slice_get(bp) != 0) { - printf(" s%1d %4s", bzb_slice_get(bp)-1, s); - } else if (j >= 0) { - printf(" S%1d %4s", j, s); - } else { - printf(" %4s", s); - } - if (bzb_crit_get(bp) != 0) { - printf(" K%1d", bp->bzb_cluster); - } else if (j < 0) { - printf(" "); - } else { - printf(" k%1d", bp->bzb_cluster); - } - if (bp->bzb_mount_point[0] != 0) { - printf(" %.64s", bp->bzb_mount_point); - } - } -#endif + if (!strcmp(p->dpme_type, "Apple_UNIX_SVR2")) + { + if (!strcmp(p->dpme_name, "Swap") || !strcmp(p->dpme_name, "swap")) + printf("Linux swap"); + else + printf("Linux native"); + } + else + if (!strcmp(p->dpme_type, "Apple_Scratch")) + printf("Linux swap"); //not just linux, but who cares + else + if (!strcmp(p->dpme_type, "Apple_HFS")) + printf("HFS"); + else + if (!strcmp(p->dpme_type, "Apple_MFS")) + printf("MFS"); + else + if (!strcmp(p->dpme_type, "Apple_Driver")) + printf("Driver"); + else + if (!strcmp(p->dpme_type, "Apple_Driver43")) + printf("Driver 4.3"); + else + if (!strcmp(p->dpme_type, "Apple_partition_map")) + printf("Partition map"); + else + if (!strcmp(p->dpme_type, "Apple_PRODOS")) + printf("ProDOS"); + else + if (!strcmp(p->dpme_type, "Apple_Free")) + printf("Free space"); + else + printf("Unknown"); printf("\n"); } diff -ur pdisk.orig/fdisklabel.c pdisk/fdisklabel.c --- pdisk.orig/fdisklabel.c Tue Jan 14 12:34:13 1997 +++ pdisk/fdisklabel.c Wed Nov 26 09:00:46 1997 @@ -377,7 +377,7 @@ { #if defined (i386) if (bsd_initlabel (bsd_part, &bsd_dlabel, bsd_part_index) == 1) -#elif defined (__alpha__) || defined (__powerpc__) +#elif defined (__alpha__) || defined (__powerpc__) || defined (__mc68000__) if (bsd_initlabel (NULL, &bsd_dlabel, 0) == 1) #endif { diff -ur pdisk.orig/fdisklabel.h pdisk/fdisklabel.h --- pdisk.orig/fdisklabel.h Tue Jan 14 12:34:13 1997 +++ pdisk/fdisklabel.h Wed Nov 26 08:59:11 1997 @@ -52,6 +52,12 @@ #define BSD_LABELOFFSET 0 #define BSD_BBSIZE 0 #define BSD_SBSIZE 0 +#elif defined (__mc68000__) +/* LABELSECTOR, LABELOFFSET, BBSIZE & SBSIZE are undefined for __powerpc__ */ +#define BSD_LABELSECTOR 0 +#define BSD_LABELOFFSET 0 +#define BSD_BBSIZE 0 +#define BSD_SBSIZE 0 #else #error unknown architecture #endif diff -ur pdisk.orig/io.c pdisk/io.c --- pdisk.orig/io.c Thu Jan 9 14:31:36 1997 +++ pdisk/io.c Wed Nov 26 08:53:58 1997 @@ -30,6 +30,10 @@ #include #include #include +#else +#ifdef __GLIBC__ +#include +#endif #endif #include #include