summaryrefslogtreecommitdiff
path: root/sys/arch/armv7
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2016-05-20 11:21:09 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2016-05-20 11:21:09 +0000
commitdeabb2cfe2433be52571bd183a8f5d194398b746 (patch)
treefe4d9c293544c355d318781b42272eb10196da26 /sys/arch/armv7
parent762b7055abcb62f74c4a9d9634395d2d738da610 (diff)
For FDT-based boots, look for a "openbsd,bootduid" property of the /chosen
node. If it is present, copy its value into the bootduid variable for DUID-based boot disk selection. ok patrick@, jsg@
Diffstat (limited to 'sys/arch/armv7')
-rw-r--r--sys/arch/armv7/armv7/armv7_machdep.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/sys/arch/armv7/armv7/armv7_machdep.c b/sys/arch/armv7/armv7/armv7_machdep.c
index 3975283aa59..a71b57e9c4a 100644
--- a/sys/arch/armv7/armv7/armv7_machdep.c
+++ b/sys/arch/armv7/armv7/armv7_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: armv7_machdep.c,v 1.26 2016/04/03 12:44:37 patrick Exp $ */
+/* $OpenBSD: armv7_machdep.c,v 1.27 2016/05/20 11:21:08 kettenis Exp $ */
/* $NetBSD: lubbock_machdep.c,v 1.2 2003/07/15 00:25:06 lukem Exp $ */
/*
@@ -462,9 +462,16 @@ initarm(void *arg0, void *arg1, void *arg2)
node = fdt_find_node("/chosen");
if (node != NULL) {
- char *bootargs;
- if (fdt_node_property(node, "bootargs", &bootargs))
- process_kernel_args(bootargs);
+ char *args, *duid;
+ int len;
+
+ len = fdt_node_property(node, "bootargs", &args);
+ if (len > 0)
+ process_kernel_args(args);
+
+ len = fdt_node_property(node, "openbsd,bootduid", &duid);
+ if (len == sizeof(bootduid))
+ memcpy(bootduid, duid, sizeof(bootduid));
}
}