Module Name: src Committed By: manu Date: Tue Dec 17 01:37:53 UTC 2019
Modified Files: src/sys/arch/i386/stand/efiboot: efidisk.c src/sys/arch/i386/stand/lib: biosdisk.c Log Message: Do not use NAME=label syntax when label are empty When booting sysinst from UEFI, it defaults to a GPT installation where partition have no labels. Bootstrap used the NAME=label partition anyway, with the result that both EFI and FFS root partition had the same name "NAME=" and could not be distinguished. The first matching partition for the name was used, and bootstrap looked for the kernel in the EFI partition. We fix that by not using NAME=label names for partition when label is empty. In that case we revert to old syntax such as hd0b To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/sys/arch/i386/stand/efiboot/efidisk.c cvs rdiff -u -r1.53 -r1.54 src/sys/arch/i386/stand/lib/biosdisk.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/arch/i386/stand/efiboot/efidisk.c diff -u src/sys/arch/i386/stand/efiboot/efidisk.c:1.8 src/sys/arch/i386/stand/efiboot/efidisk.c:1.9 --- src/sys/arch/i386/stand/efiboot/efidisk.c:1.8 Sun Aug 18 02:18:24 2019 +++ src/sys/arch/i386/stand/efiboot/efidisk.c Tue Dec 17 01:37:52 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: efidisk.c,v 1.8 2019/08/18 02:18:24 manu Exp $ */ +/* $NetBSD: efidisk.c,v 1.9 2019/12/17 01:37:52 manu Exp $ */ /*- * Copyright (c) 2016 Kimihiro Nonaka <non...@netbsd.org> @@ -253,7 +253,7 @@ efi_disk_show(void) printf(" "); first = false; } - if (part[i].part_name != NULL) + if (part[i].part_name && part[i].part_name[0]) printf(" NAME=%s(", part[i].part_name); else printf(" hd%d%c(", edi->dev & 0x7f, i + 'a'); @@ -308,7 +308,7 @@ efi_disk_show(void) printf(" "); first = 0; } - if (part[j].part_name != NULL) + if (part[j].part_name && part[j].part_name[0]) printf(" NAME=%s(", part[j].part_name); else printf(" raid%d%c(", Index: src/sys/arch/i386/stand/lib/biosdisk.c diff -u src/sys/arch/i386/stand/lib/biosdisk.c:1.53 src/sys/arch/i386/stand/lib/biosdisk.c:1.54 --- src/sys/arch/i386/stand/lib/biosdisk.c:1.53 Tue Dec 10 02:02:47 2019 +++ src/sys/arch/i386/stand/lib/biosdisk.c Tue Dec 17 01:37:53 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: biosdisk.c,v 1.53 2019/12/10 02:02:47 manu Exp $ */ +/* $NetBSD: biosdisk.c,v 1.54 2019/12/17 01:37:53 manu Exp $ */ /* * Copyright (c) 1996, 1998 @@ -908,7 +908,8 @@ biosdisk_probe(void) first = 0; } #ifndef NO_GPT - if (d->part[part].part_name != NULL) + if (d->part[part].part_name && + d->part[part].part_name[0]) printf(" NAME=%s(", d->part[part].part_name); else #endif @@ -987,7 +988,8 @@ next_disk: first = 0; } #ifndef NO_GPT - if (d->part[part].part_name != NULL) + if (d->part[part].part_name && + d->part[part].part_name[0]) printf(" NAME=%s(", d->part[part].part_name); else #endif @@ -1095,7 +1097,9 @@ biosdisk_findpartition(int biosdev, dadd *partition = boot_part; #ifndef NO_GPT - if (part_name && d->part[boot_part].part_name) { + if (part_name && + d->part[boot_part].part_name && + d->part[boot_part].part_name[0]) { strlcpy(namebuf, d->part[boot_part].part_name, BIOSDISK_PART_NAME_LEN); *part_name = namebuf;