summaryrefslogtreecommitdiff
path: root/sys/arch/amd64
diff options
context:
space:
mode:
authorKenneth R Westerback <krw@cvs.openbsd.org>2007-06-18 22:11:21 +0000
committerKenneth R Westerback <krw@cvs.openbsd.org>2007-06-18 22:11:21 +0000
commit2846b6a58d543b14fb1d85d84c54db82de969fe2 (patch)
tree0d90b089dacd69bd6a4111ff6c23ea0a10855d8f /sys/arch/amd64
parent3aa2b56dd45dc58e4825d293e0f499393fd69e30 (diff)
Calculate the disklabel checksum *after* filling in all the fields in
the disklabel. ok deraadt@
Diffstat (limited to 'sys/arch/amd64')
-rw-r--r--sys/arch/amd64/stand/libsa/diskprobe.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/arch/amd64/stand/libsa/diskprobe.c b/sys/arch/amd64/stand/libsa/diskprobe.c
index d728a5a7ae0..6de75d0bea5 100644
--- a/sys/arch/amd64/stand/libsa/diskprobe.c
+++ b/sys/arch/amd64/stand/libsa/diskprobe.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: diskprobe.c,v 1.4 2006/09/26 23:33:04 krw Exp $ */
+/* $OpenBSD: diskprobe.c,v 1.5 2007/06/18 22:11:20 krw Exp $ */
/*
* Copyright (c) 1997 Tobias Weingartner
@@ -259,10 +259,6 @@ cdprobe(void)
dip->disklabel.d_bbsize = 2048;
dip->disklabel.d_sbsize = 2048;
- dip->disklabel.d_magic = DISKMAGIC;
- dip->disklabel.d_magic2 = DISKMAGIC;
- dip->disklabel.d_checksum = dkcksum(&dip->disklabel);
-
/* 'a' partition covering the "whole" disk */
dip->disklabel.d_partitions[0].p_offset = 0;
dip->disklabel.d_partitions[0].p_size = 100;
@@ -275,6 +271,10 @@ cdprobe(void)
dip->disklabel.d_npartitions = RAW_PART + 1;
+ dip->disklabel.d_magic = DISKMAGIC;
+ dip->disklabel.d_magic2 = DISKMAGIC;
+ dip->disklabel.d_checksum = dkcksum(&dip->disklabel);
+
/* Add to queue of disks */
TAILQ_INSERT_TAIL(&disklist, dip, list);
}