From: kettenis Date: Fri, 12 May 2023 16:43:00 +0000 (+0000) Subject: Fall back on loading the kernel from the EFI system partition if we're X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=7db964dc674b69a964320450359e0bbdf0b223cf;p=openbsd Fall back on loading the kernel from the EFI system partition if we're booting from a disk without a BSD disklabel. ok kn@, caspar@ --- diff --git a/sys/arch/arm64/stand/efiboot/conf.c b/sys/arch/arm64/stand/efiboot/conf.c index 3e489c817a8..a74bf79fac3 100644 --- a/sys/arch/arm64/stand/efiboot/conf.c +++ b/sys/arch/arm64/stand/efiboot/conf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: conf.c,v 1.45 2023/04/18 23:11:56 dlg Exp $ */ +/* $OpenBSD: conf.c,v 1.46 2023/05/12 16:43:00 kettenis Exp $ */ /* * Copyright (c) 1996 Michael Shalayeff @@ -46,7 +46,7 @@ #include "efipxe.h" #include "softraid_arm64.h" -const char version[] = "1.17"; +const char version[] = "1.18"; int debug = 0; struct fs_ops file_system[] = { diff --git a/sys/arch/arm64/stand/efiboot/efiboot.c b/sys/arch/arm64/stand/efiboot/efiboot.c index c74526320f6..2754f192f0e 100644 --- a/sys/arch/arm64/stand/efiboot/efiboot.c +++ b/sys/arch/arm64/stand/efiboot/efiboot.c @@ -1,4 +1,4 @@ -/* $OpenBSD: efiboot.c,v 1.47 2023/02/15 14:13:38 kettenis Exp $ */ +/* $OpenBSD: efiboot.c,v 1.48 2023/05/12 16:43:00 kettenis Exp $ */ /* * Copyright (c) 2015 YASUOKA Masahiko @@ -831,6 +831,15 @@ devboot(dev_t dev, char *p) return; } + /* + * If there is no BSD disklabel on the boot device, boot from + * the ESP instead. + */ + if ((bootdev_dip->flags & DISKINFO_FLAG_GOODLABEL) == 0) { + strlcpy(p, "esp0a", 6); + return; + } + TAILQ_FOREACH(dip, &disklist, list) { if (bootdev_dip == dip) break; @@ -841,8 +850,7 @@ devboot(dev_t dev, char *p) * Determine the partition type for the 'a' partition of the * boot device. */ - if ((bootdev_dip->flags & DISKINFO_FLAG_GOODLABEL) != 0) - part_type = bootdev_dip->disklabel.d_partitions[0].p_fstype; + part_type = bootdev_dip->disklabel.d_partitions[0].p_fstype; /* * See if we booted from a disk that is a member of a bootable