summaryrefslogtreecommitdiff
path: root/sbin
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1999-07-14 23:16:27 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1999-07-14 23:16:27 +0000
commit7f382689fbb382ea74d8d8e4949329ca5a9eb2d8 (patch)
tree4148613413dd91e1f6bad433774ab7563837fa96 /sbin
parent15c79903aa9d47dfaeb292a5b97ec11393b6a16a (diff)
put in a check for architectures that demand that partition A start at sector 0
Diffstat (limited to 'sbin')
-rw-r--r--sbin/disklabel/Makefile4
-rw-r--r--sbin/disklabel/disklabel.c11
-rw-r--r--sbin/disklabel/editor.c9
3 files changed, 18 insertions, 6 deletions
diff --git a/sbin/disklabel/Makefile b/sbin/disklabel/Makefile
index bf3698094c0..3f1a95054c1 100644
--- a/sbin/disklabel/Makefile
+++ b/sbin/disklabel/Makefile
@@ -1,4 +1,4 @@
-# $OpenBSD: Makefile,v 1.20 1999/02/01 16:43:20 pefo Exp $
+# $OpenBSD: Makefile,v 1.21 1999/07/14 23:16:26 deraadt Exp $
PROG= disklabel
SRCS= disklabel.c dkcksum.c editor.c manual.c
@@ -31,7 +31,7 @@ CFLAGS+= -DNUMBOOT=1
.endif
.if (${MACHINE} == "sun3") || (${MACHINE} == "sparc")
-CFLAGS+= -DSEEALSO="\"installboot(8)\"" -DCYLCHECK
+CFLAGS+= -DSEEALSO="\"installboot(8)\"" -DCYLCHECK -DAAT0
.endif
.if (${MACHINE} == "mvme68k") || (${MACHINE} == "mvme68k")
diff --git a/sbin/disklabel/disklabel.c b/sbin/disklabel/disklabel.c
index 6ddf73b600a..c96566d100a 100644
--- a/sbin/disklabel/disklabel.c
+++ b/sbin/disklabel/disklabel.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: disklabel.c,v 1.64 1999/06/16 10:12:38 espie Exp $ */
+/* $OpenBSD: disklabel.c,v 1.65 1999/07/14 23:16:26 deraadt Exp $ */
/* $NetBSD: disklabel.c,v 1.30 1996/03/14 19:49:24 ghudson Exp $ */
/*
@@ -44,7 +44,7 @@ static char copyright[] =
#endif /* not lint */
#ifndef lint
-static char rcsid[] = "$OpenBSD: disklabel.c,v 1.64 1999/06/16 10:12:38 espie Exp $";
+static char rcsid[] = "$OpenBSD: disklabel.c,v 1.65 1999/07/14 23:16:26 deraadt Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -1641,6 +1641,13 @@ checklabel(lp)
warnx("warning, partition %c: offset %% cylinder-size != 0",
part);
#endif
+#ifdef AAT0
+ if (i == 0 && pp->p_size != 0 && pp->p_offset != 0) {
+ warnx("this architecture requires partition 'a' to "
+ "start at sector 0");
+ errors++;
+ }
+#endif
if (pp->p_offset > lp->d_secperunit) {
warnx("partition %c: offset past end of unit", part);
errors++;
diff --git a/sbin/disklabel/editor.c b/sbin/disklabel/editor.c
index 57402965be6..b2b2922071f 100644
--- a/sbin/disklabel/editor.c
+++ b/sbin/disklabel/editor.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: editor.c,v 1.65 1999/06/10 22:37:54 pjanzen Exp $ */
+/* $OpenBSD: editor.c,v 1.66 1999/07/14 23:16:26 deraadt Exp $ */
/*
* Copyright (c) 1997-1999 Todd C. Miller <Todd.Miller@courtesan.com>
@@ -28,7 +28,7 @@
*/
#ifndef lint
-static char rcsid[] = "$OpenBSD: editor.c,v 1.65 1999/06/10 22:37:54 pjanzen Exp $";
+static char rcsid[] = "$OpenBSD: editor.c,v 1.66 1999/07/14 23:16:26 deraadt Exp $";
#endif /* not lint */
#include <sys/types.h>
@@ -2054,6 +2054,11 @@ get_offset(lp, partno)
"at sector %u, you tried to add a partition at %u."
" You can use the 'b' command to change the size "
"of the OpenBSD portion.\n", ending_sector, ui);
+#ifdef AAT0
+ else if (partno == 0 && ui != 0)
+ fprintf(stderr, "This architecture requires that "
+ "partition 'a' start at sector 0.");
+#endif
else
break;
}