summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2020-08-29 11:46:55 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2020-08-29 11:46:55 +0000
commit01696c66bb8d8e7528dece42ba48e19e22cbb28d (patch)
tree0ee463bb2494c76e091165674a41c5659d8de2ba /sys
parent5e9031eca8e66577e7460657d367a589063da331 (diff)
Only fall back on using the first potential root disk as the boot disk if
the boot kernel didn't hand us a valid bootduid. ok visa@
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/powerpc64/stand/rdboot/disk.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/arch/powerpc64/stand/rdboot/disk.c b/sys/arch/powerpc64/stand/rdboot/disk.c
index ad548994bcd..767f070bfda 100644
--- a/sys/arch/powerpc64/stand/rdboot/disk.c
+++ b/sys/arch/powerpc64/stand/rdboot/disk.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: disk.c,v 1.2 2020/08/26 22:27:02 kettenis Exp $ */
+/* $OpenBSD: disk.c,v 1.3 2020/08/29 11:46:54 kettenis Exp $ */
/*
* Copyright (c) 2019 Visa Hankala
@@ -41,6 +41,8 @@ int disk_proberoot(const char *);
int mounted = 0;
int rdroot = -1; /* fd that points to the root of the ramdisk */
+const u_char zeroduid[8];
+
void
disk_init(void)
{
@@ -105,7 +107,7 @@ disk_init(void)
/* Otherwise pick the first potential root disk. */
if (disk_proberoot(devname)) {
- if (strlen(cmd.bootdev) == 0) {
+ if (memcmp(cmd.bootduid, zeroduid, 8) == 0) {
snprintf(cmd.bootdev, sizeof(cmd.bootdev),
"%sa", devname);
}