summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2005-01-01 03:07:09 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2005-01-01 03:07:09 +0000
commit4d2e29d08285c7608c13a3640b608c05eb2b4472 (patch)
treea3557b5be3feea0960bcca10aebed130c6f6a921
parente660cdec3bf575f5a945b92b3ae48f3dd762f987 (diff)
Add more debugging printf #ifdef DEBUG. This was useful when tracking
down the bootdev issue. OK deraadt@
-rw-r--r--sys/arch/amd64/amd64/dkcsum.c13
-rw-r--r--sys/arch/i386/i386/dkcsum.c13
2 files changed, 24 insertions, 2 deletions
diff --git a/sys/arch/amd64/amd64/dkcsum.c b/sys/arch/amd64/amd64/dkcsum.c
index ab2d1582076..0c060144d74 100644
--- a/sys/arch/amd64/amd64/dkcsum.c
+++ b/sys/arch/amd64/amd64/dkcsum.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dkcsum.c,v 1.3 2004/12/25 23:02:23 miod Exp $ */
+/* $OpenBSD: dkcsum.c,v 1.4 2005/01/01 03:07:08 millert Exp $ */
/*-
* Copyright (c) 1997 Niklas Hallqvist. All rights reserved.
@@ -67,6 +67,9 @@ dkcsumattach(void)
if (bios_diskinfo == NULL || bios_cksumlen * DEV_BSIZE > MAXBSIZE)
return;
+#ifdef DEBUG
+ printf("dkcsum: bootdev=0x%x\n", bootdev);
+#endif
pribootdev = altbootdev = 0;
/*
@@ -185,6 +188,10 @@ dkcsumattach(void)
part = B_PARTITION(bootdev);
pribootdev = MAKEBOOTDEV(type, ctrl, adap, unit, part);
+#ifdef DEBUG
+ printf("dkcsum: setting %s as primary boot disk\n",
+ dv->dv_xname);
+#endif
}
/* B_TYPE independent hd unit counting bootblocks */
if (B_UNIT(bootdev) == (hit->bios_number & 0x7F)) {
@@ -197,6 +204,10 @@ dkcsumattach(void)
part = B_PARTITION(bootdev);
altbootdev = MAKEBOOTDEV(type, ctrl, adap, unit, part);
+#ifdef DEBUG
+ printf("dkcsum: setting %s as alternate boot disk\n",
+ dv->dv_xname);
+#endif
}
/* This will overwrite /boot's guess, just so you remember */
diff --git a/sys/arch/i386/i386/dkcsum.c b/sys/arch/i386/i386/dkcsum.c
index 82a08067c9d..691f53407cb 100644
--- a/sys/arch/i386/i386/dkcsum.c
+++ b/sys/arch/i386/i386/dkcsum.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dkcsum.c,v 1.14 2004/12/31 20:37:25 deraadt Exp $ */
+/* $OpenBSD: dkcsum.c,v 1.15 2005/01/01 03:07:08 millert Exp $ */
/*-
* Copyright (c) 1997 Niklas Hallqvist. All rights reserved.
@@ -67,6 +67,9 @@ dkcsumattach()
if (bios_diskinfo == NULL || bios_cksumlen * DEV_BSIZE > MAXBSIZE)
return;
+#ifdef DEBUG
+ printf("dkcsum: bootdev=0x%x\n", bootdev);
+#endif
pribootdev = altbootdev = 0;
/*
@@ -184,6 +187,10 @@ dkcsumattach()
part = B_PARTITION(bootdev);
pribootdev = MAKEBOOTDEV(type, ctrl, adap, unit, part);
+#ifdef DEBUG
+ printf("dkcsum: setting %s as primary boot disk\n",
+ dv->dv_xname);
+#endif
}
/* B_TYPE independent hd unit counting bootblocks */
if (B_UNIT(bootdev) == (hit->bios_number & 0x7F)) {
@@ -196,6 +203,10 @@ dkcsumattach()
part = B_PARTITION(bootdev);
altbootdev = MAKEBOOTDEV(type, ctrl, adap, unit, part);
+#ifdef DEBUG
+ printf("dkcsum: setting %s as alternate boot disk\n",
+ dv->dv_xname);
+#endif
}
/* This will overwrite /boot's guess, just so you remember */