diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2016-01-17 14:28:26 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2016-01-17 14:28:26 +0000 |
commit | b7ea56d7cb8d127684a3f526e35fae94a356dd5b (patch) | |
tree | 3883732f9c0c96442c176fd4b57bd79e19d8bbce /sbin | |
parent | 958c1e7f4dc7aeb769c6c09598789790971f9847 (diff) |
A/UX is no more, was m68k only, and we have no sentimental reasons for
keeping support.
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/pdisk/convert.c | 34 | ||||
-rw-r--r-- | sbin/pdisk/convert.h | 3 | ||||
-rw-r--r-- | sbin/pdisk/dpme.h | 39 | ||||
-rw-r--r-- | sbin/pdisk/dump.c | 49 | ||||
-rw-r--r-- | sbin/pdisk/partition_map.c | 46 | ||||
-rw-r--r-- | sbin/pdisk/partition_map.h | 3 |
6 files changed, 6 insertions, 168 deletions
diff --git a/sbin/pdisk/convert.c b/sbin/pdisk/convert.c index db89a477fab..e8f51e3f8a5 100644 --- a/sbin/pdisk/convert.c +++ b/sbin/pdisk/convert.c @@ -1,4 +1,4 @@ -/* $OpenBSD: convert.c,v 1.8 2016/01/11 07:54:07 jasper Exp $ */ +/* $OpenBSD: convert.c,v 1.9 2016/01/17 14:28:25 krw Exp $ */ // // convert.c - Little-endian conversion @@ -86,43 +86,11 @@ convert_dpme(DPME *data, int to_cpu_form) reverse4((u8 *)&data->dpme_goto_addr); reverse4((u8 *)&data->dpme_goto_addr_2); reverse4((u8 *)&data->dpme_checksum); - convert_bzb((BZB *)data->dpme_bzb, to_cpu_form); #endif return 0; } -#if BYTE_ORDER == LITTLE_ENDIAN -int -convert_bzb(BZB *data, int to_cpu_form) -{ - // Since the data here varies according to the type of partition we - // do not want to convert willy-nilly. We use the flag to determine - // whether to check for the signature before or after we flip the bytes. - if (to_cpu_form) { - reverse4((u8 *)&data->bzb_magic); - if (data->bzb_magic != BZBMAGIC) { - reverse4((u8 *)&data->bzb_magic); - if (data->bzb_magic != BZBMAGIC) { - return 0; - } - } - } else { - if (data->bzb_magic != BZBMAGIC) { - return 0; - } - reverse4((u8 *)&data->bzb_magic); - } - reverse2((u8 *)&data->bzb_inode); - reverse4((u8 *)&data->bzb_flags); - reverse4((u8 *)&data->bzb_tmade); - reverse4((u8 *)&data->bzb_tmount); - reverse4((u8 *)&data->bzb_tumount); - return 0; -} -#endif - - int convert_block0(Block0 *data, int to_cpu_form) { diff --git a/sbin/pdisk/convert.h b/sbin/pdisk/convert.h index d718c3e49bd..2e51db41f5e 100644 --- a/sbin/pdisk/convert.h +++ b/sbin/pdisk/convert.h @@ -1,4 +1,4 @@ -/* $OpenBSD: convert.h,v 1.4 2016/01/11 07:54:07 jasper Exp $ */ +/* $OpenBSD: convert.h,v 1.5 2016/01/17 14:28:25 krw Exp $ */ // // convert.h - Little-endian conversion @@ -61,7 +61,6 @@ // Forward declarations // int convert_block0(Block0 *data, int to_cpu_form); -int convert_bzb(BZB *data, int to_cpu_form); int convert_dpme(DPME *data, int to_cpu_form); #endif /* __convert__ */ diff --git a/sbin/pdisk/dpme.h b/sbin/pdisk/dpme.h index c8a9889b60f..64592bf7cbd 100644 --- a/sbin/pdisk/dpme.h +++ b/sbin/pdisk/dpme.h @@ -1,4 +1,4 @@ -/* $OpenBSD: dpme.h,v 1.6 2016/01/15 16:39:20 krw Exp $ */ +/* $OpenBSD: dpme.h,v 1.7 2016/01/17 14:28:25 krw Exp $ */ // // dpme.h - Disk Partition Map Entry (dpme) @@ -50,14 +50,6 @@ #define DPISTRLEN 32 #define DPME_SIGNATURE 0x504D /* i.e. 'PM' */ -// A/UX only stuff (tradition!) -#define dpme_bzb dpme_boot_args -#define BZBMAGIC 0xABADBABE /* BZB magic number */ -#define FST ((u8) 0x1) /* standard UNIX FS */ -#define FSTEFS ((u8) 0x2) /* Autorecovery FS */ -#define FSTSFS ((u8) 0x3) /* Swap FS */ - - // // Types // @@ -126,35 +118,6 @@ struct dpme { typedef struct dpme DPME; - -// A/UX only data structures (sentimental reasons?) - -// BZB (Block Zero Block, but I can't remember the etymology) -// Where &dpme_boot_args[0] is actually the address of a struct bzb -// kludge to get around alignment junk -struct bzb /* block zero block format */ -{ - u32 bzb_magic; /* magic number */ - u8 bzb_cluster; /* Autorecovery cluster grouping */ - u8 bzb_type; /* FS type */ - u16 bzb_inode; /* bad block inode number */ - u32 bzb_flags; -#define BZB_ROOT (1<<31) -#define BZB_USR (1<<30) -#define BZB_CRIT (1<<29) -#define BZB_SLICE_SHIFT 16 -#define BZB_SLICE_MASK 0x1f - u32 bzb_tmade; /* time of FS creation */ - u32 bzb_tmount; /* time of last mount */ - u32 bzb_tumount; /* time of last umount */ - u32 bzb_fill2[7]; /* for expansion of ABM (ha!ha!) */ - u8 bzb_mount_point[64]; /* default mount point name */ -}; -typedef struct bzb BZB; - - - - // // Global Constants // diff --git a/sbin/pdisk/dump.c b/sbin/pdisk/dump.c index f770eee8383..08fd0009a04 100644 --- a/sbin/pdisk/dump.c +++ b/sbin/pdisk/dump.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dump.c,v 1.21 2016/01/17 14:13:42 jasper Exp $ */ +/* $OpenBSD: dump.c,v 1.22 2016/01/17 14:28:25 krw Exp $ */ // // dump.c - dumping partition maps @@ -291,11 +291,8 @@ show_data_structures(partition_map_header *map) Block0 *zp; DDMap *m; int i; - int j, slice; partition_map * entry; DPME *p; - BZB *bp; - const char *s; if (map == NULL) { printf("No partition map exists\n"); @@ -382,50 +379,6 @@ show_data_structures(partition_map_header *map) printf("\n"); } printf("\n"); - printf(" #: type RU *slice mount_point (A/UX only fields)\n"); - for (entry = map->disk_order; entry != NULL; entry = entry->next_on_disk) { - p = entry->data; - printf("%2ld: ", entry->disk_address); - - bp = (BZB *) (p->dpme_bzb); - j = -1; - if (bp->bzb_magic == BZBMAGIC) { - switch (bp->bzb_type) { - case FSTEFS: - s = "esch"; - break; - case FSTSFS: - s = "swap"; - j = 1; - break; - case FST: - default: - s = "fsys"; - if ((bp->bzb_flags & BZB_ROOT) != 0) { - j = 0; - } else if ((bp->bzb_flags & BZB_USR) != 0) { - j = 2; - } - break; - } - printf("%4s ", s); - printf("%c%c ", - (bp->bzb_flags & BZB_ROOT)?'R':' ', - (bp->bzb_flags & BZB_USR)?'U':' '); - slice = ((bp->bzb_flags >> BZB_SLICE_SHIFT) & BZB_SLICE_MASK); - if (slice != 0) { - printf(" %2d", slice); - } else if (j >= 0) { - printf(" *%2d", j); - } else { - printf(" "); - } - if (bp->bzb_mount_point[0] != 0) { - printf(" %.64s", bp->bzb_mount_point); - } - } - printf("\n"); - } } diff --git a/sbin/pdisk/partition_map.c b/sbin/pdisk/partition_map.c index 6a182562104..a30fd95afde 100644 --- a/sbin/pdisk/partition_map.c +++ b/sbin/pdisk/partition_map.c @@ -1,4 +1,4 @@ -/* $OpenBSD: partition_map.c,v 1.25 2016/01/17 14:13:42 jasper Exp $ */ +/* $OpenBSD: partition_map.c,v 1.26 2016/01/17 14:28:25 krw Exp $ */ // // partition_map.c - partition map routines @@ -672,49 +672,6 @@ dpme_init_flags(DPME *data) } } -/* These bits are appropriate for Apple_UNIX_SVR2 partitions - * used by OpenBSD. They may be ok for A/UX, but have not been - * tested. - */ -void -bzb_init_slice(BZB *bp, int slice) -{ - memset(bp,0,sizeof(BZB)); - if ((slice >= 'A') && (slice <= 'Z')) { - slice += 'a' - 'A'; - } - if ((slice != 0) && ((slice < 'a') || (slice > 'z'))) { - warnx("Bad bzb slice"); - slice = 0; - } - switch (slice) { - case 0: - case 'c': - return; - case 'a': - bp->bzb_type = FST; - strlcpy(bp->bzb_mount_point, "/", sizeof(bp->bzb_mount_point)); - bp->bzb_inode = 1; - bp->bzb_flags = BZB_ROOT | BZB_USR; - break; - case 'b': - bp->bzb_type = FSTSFS; - strlcpy(bp->bzb_mount_point, "(swap)", sizeof(bp->bzb_mount_point)); - break; - case 'g': - strlcpy(bp->bzb_mount_point, "/usr", sizeof(bp->bzb_mount_point)); - /* Fall through */ - default: - bp->bzb_type = FST; - bp->bzb_inode = 1; - bp->bzb_flags = BZB_USR; - break; - } - // XXX OpenBSD disksubr.c ignores slice - // bp->bzb_flags |= (slice-'a'+1) << BZB_SLICE_SHIFT; - bp->bzb_magic = BZBMAGIC; -} - void renumber_disk_addresses(partition_map_header *map) { @@ -731,7 +688,6 @@ renumber_disk_addresses(partition_map_header *map) } } - long compute_device_size(char *name) { diff --git a/sbin/pdisk/partition_map.h b/sbin/pdisk/partition_map.h index a734d22119f..bfc5fb1a769 100644 --- a/sbin/pdisk/partition_map.h +++ b/sbin/pdisk/partition_map.h @@ -1,4 +1,4 @@ -/* $OpenBSD: partition_map.h,v 1.8 2016/01/16 22:28:14 krw Exp $ */ +/* $OpenBSD: partition_map.h,v 1.9 2016/01/17 14:28:25 krw Exp $ */ // // partition_map.h - partition map routines @@ -114,7 +114,6 @@ void move_entry_in_map(long, long, partition_map_header *); partition_map_header* open_partition_map(char *name, int *valid_file); void resize_map(long new_size, partition_map_header *map); void write_partition_map(partition_map_header *map); -void bzb_init_slice(BZB *bp, int slice); void dpme_init_flags(DPME *data); #endif /* __partition_map__ */ |