Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-9]: src/sys/arch/i386/stand Pull up following revision(s) (reques...



details:   https://anonhg.NetBSD.org/src/rev/b80abed62d9f
branches:  netbsd-9
changeset: 843697:b80abed62d9f
user:      martin <martin%NetBSD.org@localhost>
date:      Tue Dec 17 13:01:39 2019 +0000

description:
Pull up following revision(s) (requested by manu in ticket #568):

        sys/arch/i386/stand/lib/biosdisk.c: revision 1.54
        sys/arch/i386/stand/efiboot/efidisk.c: revision 1.9

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

diffstat:

 sys/arch/i386/stand/efiboot/efidisk.c |   6 +++---
 sys/arch/i386/stand/lib/biosdisk.c    |  12 ++++++++----
 2 files changed, 11 insertions(+), 7 deletions(-)

diffs (67 lines):

diff -r 3a88fc4c7393 -r b80abed62d9f sys/arch/i386/stand/efiboot/efidisk.c
--- a/sys/arch/i386/stand/efiboot/efidisk.c     Tue Dec 17 12:59:52 2019 +0000
+++ b/sys/arch/i386/stand/efiboot/efidisk.c     Tue Dec 17 13:01:39 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: efidisk.c,v 1.7.4.1 2019/09/13 07:00:13 martin Exp $   */
+/*     $NetBSD: efidisk.c,v 1.7.4.2 2019/12/17 13:01:39 martin Exp $   */
 
 /*-
  * Copyright (c) 2016 Kimihiro Nonaka <nonaka%netbsd.org@localhost>
@@ -253,7 +253,7 @@
                                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 @@
                                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(",
diff -r 3a88fc4c7393 -r b80abed62d9f sys/arch/i386/stand/lib/biosdisk.c
--- a/sys/arch/i386/stand/lib/biosdisk.c        Tue Dec 17 12:59:52 2019 +0000
+++ b/sys/arch/i386/stand/lib/biosdisk.c        Tue Dec 17 13:01:39 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: biosdisk.c,v 1.49.6.3 2019/12/17 12:59:52 martin Exp $ */
+/*     $NetBSD: biosdisk.c,v 1.49.6.4 2019/12/17 13:01:39 martin Exp $ */
 
 /*
  * Copyright (c) 1996, 1998
@@ -908,7 +908,8 @@
                                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 @@
                                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 @@
 
                *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;



Home | Main Index | Thread Index | Old Index