-/* $OpenBSD: efiboot.c,v 1.43 2022/11/05 18:58:24 patrick Exp $ */
+/* $OpenBSD: efiboot.c,v 1.44 2022/11/05 19:00:31 patrick Exp $ */
/*
* Copyright (c) 2015 YASUOKA Masahiko <yasuoka@yasuoka.net>
if (!fdt_init(fdt))
return NULL;
+ /* Create common nodes which might not exist when using mach dtb */
+ node = fdt_find_node("/aliases");
+ if (node == NULL)
+ fdt_node_add_node(fdt_find_node("/"), "aliases", &node);
node = fdt_find_node("/chosen");
- if (!node)
- return NULL;
+ if (node == NULL)
+ fdt_node_add_node(fdt_find_node("/"), "chosen", &node);
+ node = fdt_find_node("/chosen");
len = strlen(bootargs) + 1;
fdt_node_add_property(node, "bootargs", bootargs, len);
fdt_node_add_property(node, "openbsd,boothowto",