From b3d757b73f77f3f266b988d17db81b456d1336f0 Mon Sep 17 00:00:00 2001 From: John Baldwin Date: Wed, 27 Nov 2002 19:57:39 +0000 Subject: [PATCH] Only include the fdisk editor and associated code if WITH_SLICES is defined. Tested on: i386, alpha, sparc64 Approved by: re --- usr.sbin/sade/disks.c | 18 ++++++++++-------- usr.sbin/sysinstall/disks.c | 18 ++++++++++-------- 2 files changed, 20 insertions(+), 16 deletions(-) diff --git a/usr.sbin/sade/disks.c b/usr.sbin/sade/disks.c index 8328bf238c87..bc6c2244583e 100644 --- a/usr.sbin/sade/disks.c +++ b/usr.sbin/sade/disks.c @@ -40,6 +40,7 @@ #include #include +#ifdef WITH_SLICES enum size_units_t { UNIT_BLOCKS, UNIT_KILO, UNIT_MEG, UNIT_SIZE }; #ifdef PC98 @@ -261,6 +262,7 @@ getBootMgr(char *dname, u_char **bootCode, size_t *bootCodeSize) *bootCodeSize = 0; } #endif +#endif /* WITH_SLICES */ int diskGetSelectCount(Device ***devs) @@ -281,6 +283,7 @@ diskGetSelectCount(Device ***devs) return enabled; } +#ifdef WITH_SLICES void diskPartition(Device *dev) { @@ -371,7 +374,7 @@ diskPartition(Device *dev) case 'A': case 'F': /* Undocumented magic Dangerously Dedicated mode */ -#if defined(__alpha__) || defined(__sparc64__) +#ifndef __i386__ rv = 1; #else /* The rest is only relevant on x86 */ cp = variable_get(VAR_DEDICATE_DISK); @@ -448,11 +451,6 @@ diskPartition(Device *dev) partitiontype = efi; else partitiontype = unknown; -#if defined(__alpha__) || defined(__sparc64__) - if (partitiontype == freebsd && size == chunk_info[current_chunk]->size) - All_FreeBSD(d, 1); - else -#endif Create_Chunk(d, chunk_info[current_chunk]->offset, size, partitiontype, subtype, (chunk_info[current_chunk]->flags & CHUNK_ALIGN), name); variable_set2(DISK_PARTITIONED, "yes", 0); @@ -709,6 +707,7 @@ diskPartition(Device *dev) } restorescr(w); } +#endif /* WITH_SLICES */ static u_char * bootalloc(char *name, size_t *size) @@ -742,7 +741,8 @@ bootalloc(char *name, size_t *size) msgDebug("bootalloc: can't stat %s\n", buf); return NULL; } - + +#ifdef WITH_SLICES static int partitionHook(dialogMenuItem *selected) { @@ -831,6 +831,7 @@ diskPartitionEditor(dialogMenuItem *self) } return DITEM_SUCCESS; } +#endif /* WITH_SLICES */ int diskPartitionWrite(dialogMenuItem *self) @@ -878,6 +879,7 @@ diskPartitionWrite(dialogMenuItem *self) return DITEM_SUCCESS | DITEM_RESTORE; } +#ifdef WITH_SLICES /* Partition a disk based wholly on which variables are set */ static void diskPartitionNonInteractive(Device *dev) @@ -985,4 +987,4 @@ diskPartitionNonInteractive(Device *dev) variable_set2(DISK_PARTITIONED, "yes", 0); } } - +#endif /* WITH_SLICES */ diff --git a/usr.sbin/sysinstall/disks.c b/usr.sbin/sysinstall/disks.c index 8328bf238c87..bc6c2244583e 100644 --- a/usr.sbin/sysinstall/disks.c +++ b/usr.sbin/sysinstall/disks.c @@ -40,6 +40,7 @@ #include #include +#ifdef WITH_SLICES enum size_units_t { UNIT_BLOCKS, UNIT_KILO, UNIT_MEG, UNIT_SIZE }; #ifdef PC98 @@ -261,6 +262,7 @@ getBootMgr(char *dname, u_char **bootCode, size_t *bootCodeSize) *bootCodeSize = 0; } #endif +#endif /* WITH_SLICES */ int diskGetSelectCount(Device ***devs) @@ -281,6 +283,7 @@ diskGetSelectCount(Device ***devs) return enabled; } +#ifdef WITH_SLICES void diskPartition(Device *dev) { @@ -371,7 +374,7 @@ diskPartition(Device *dev) case 'A': case 'F': /* Undocumented magic Dangerously Dedicated mode */ -#if defined(__alpha__) || defined(__sparc64__) +#ifndef __i386__ rv = 1; #else /* The rest is only relevant on x86 */ cp = variable_get(VAR_DEDICATE_DISK); @@ -448,11 +451,6 @@ diskPartition(Device *dev) partitiontype = efi; else partitiontype = unknown; -#if defined(__alpha__) || defined(__sparc64__) - if (partitiontype == freebsd && size == chunk_info[current_chunk]->size) - All_FreeBSD(d, 1); - else -#endif Create_Chunk(d, chunk_info[current_chunk]->offset, size, partitiontype, subtype, (chunk_info[current_chunk]->flags & CHUNK_ALIGN), name); variable_set2(DISK_PARTITIONED, "yes", 0); @@ -709,6 +707,7 @@ diskPartition(Device *dev) } restorescr(w); } +#endif /* WITH_SLICES */ static u_char * bootalloc(char *name, size_t *size) @@ -742,7 +741,8 @@ bootalloc(char *name, size_t *size) msgDebug("bootalloc: can't stat %s\n", buf); return NULL; } - + +#ifdef WITH_SLICES static int partitionHook(dialogMenuItem *selected) { @@ -831,6 +831,7 @@ diskPartitionEditor(dialogMenuItem *self) } return DITEM_SUCCESS; } +#endif /* WITH_SLICES */ int diskPartitionWrite(dialogMenuItem *self) @@ -878,6 +879,7 @@ diskPartitionWrite(dialogMenuItem *self) return DITEM_SUCCESS | DITEM_RESTORE; } +#ifdef WITH_SLICES /* Partition a disk based wholly on which variables are set */ static void diskPartitionNonInteractive(Device *dev) @@ -985,4 +987,4 @@ diskPartitionNonInteractive(Device *dev) variable_set2(DISK_PARTITIONED, "yes", 0); } } - +#endif /* WITH_SLICES */