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/3f084b4956b5
branches:  netbsd-9
changeset: 1001314:3f084b4956b5
user:      martin <martin%NetBSD.org@localhost>
date:      Tue Dec 17 12:59:52 2019 +0000

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

        sys/arch/i386/stand/lib/biosdisk.c: revision 1.53
        sys/arch/i386/stand/efiboot/devopen.c: revision 1.9
        sys/arch/i386/stand/boot/devopen.c: revision 1.10

In-RAID partitions with no name can be candidate for booting

The code to select boot partition in RAID assumed thet had a name,
which is true when there is a GPT inside the RAID, but not when there
is a disklabel inside the RAID. This caused a regression from behavior
of NetBSD 8.1.

We fix this by allowing nameless partition to be boot candidates.
This fixes misc/54748

While there, let raid device be used in the boot specification, like
raid0a:/netbsd.

diffstat:

 sys/arch/i386/stand/boot/devopen.c    |   4 ++--
 sys/arch/i386/stand/efiboot/devopen.c |  13 +++++++++----
 sys/arch/i386/stand/lib/biosdisk.c    |   8 ++++----
 3 files changed, 15 insertions(+), 10 deletions(-)

diffs (81 lines):

diff -r fde332f1306e -r 3f084b4956b5 sys/arch/i386/stand/boot/devopen.c
--- a/sys/arch/i386/stand/boot/devopen.c        Tue Dec 17 12:56:45 2019 +0000
+++ b/sys/arch/i386/stand/boot/devopen.c        Tue Dec 17 12:59:52 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: devopen.c,v 1.8.64.1 2019/09/13 07:00:13 martin Exp $   */
+/*     $NetBSD: devopen.c,v 1.8.64.2 2019/12/17 12:59:52 martin Exp $   */
 
 /*-
  * Copyright (c) 2005 The NetBSD Foundation, Inc.
@@ -156,7 +156,7 @@
        if (strstr(devname, "raid") == devname) {
                f->f_dev = &devsw[0];           /* must be biosdisk */
 
-               return biosdisk_open_name(f, devname);
+               return biosdisk_open_name(f, fname);
        }
 #endif
 
diff -r fde332f1306e -r 3f084b4956b5 sys/arch/i386/stand/efiboot/devopen.c
--- a/sys/arch/i386/stand/efiboot/devopen.c     Tue Dec 17 12:56:45 2019 +0000
+++ b/sys/arch/i386/stand/efiboot/devopen.c     Tue Dec 17 12:59:52 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: devopen.c,v 1.5.6.2 2019/09/27 09:32:22 martin Exp $    */
+/*     $NetBSD: devopen.c,v 1.5.6.3 2019/12/17 12:59:52 martin Exp $    */
 
 /*-
  * Copyright (c) 2005 The NetBSD Foundation, Inc.
@@ -151,6 +151,7 @@
 devopen(struct open_file *f, const char *fname, char **file)
 {
        char *fsname, *devname;
+       const char *xname = NULL;
        int unit, partition;
        int biosdev;
        int i, error;
@@ -172,8 +173,12 @@
        nfsys = nfsys_disk;
 
        /* Search by GPT label or raidframe name */
-       if ((strstr(devname, "NAME=") == devname) ||
-           (strstr(devname, "raid") == devname)) {
+       if (strstr(devname, "NAME=") == devname)
+               xname = devname;
+       if (strstr(devname, "raid") == devname)
+               xname = fname;
+
+       if (xname != NULL) {
                f->f_dev = &devsw[0];           /* must be biosdisk */
 
                if (!kernel_loaded) {
@@ -181,7 +186,7 @@
                        BI_ADD(&bibp, BTINFO_BOOTPATH, sizeof(bibp));
                }
 
-               error = biosdisk_open_name(f, devname);
+               error = biosdisk_open_name(f, xname);
                return error;
        }
 
diff -r fde332f1306e -r 3f084b4956b5 sys/arch/i386/stand/lib/biosdisk.c
--- a/sys/arch/i386/stand/lib/biosdisk.c        Tue Dec 17 12:56:45 2019 +0000
+++ b/sys/arch/i386/stand/lib/biosdisk.c        Tue Dec 17 12:59:52 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: biosdisk.c,v 1.49.6.2 2019/09/17 19:31:59 martin Exp $ */
+/*     $NetBSD: biosdisk.c,v 1.49.6.3 2019/12/17 12:59:52 martin Exp $ */
 
 /*
  * Copyright (c) 1996, 1998
@@ -1401,9 +1401,9 @@
                                continue;
                        if (d->part[part].fstype == FS_UNUSED)
                                continue;
-                       if (d->part[part].part_name == NULL)
-                               continue;
-                       if (strcmp(d->part[part].part_name, name) == 0) {
+
+                       if (d->part[part].part_name != NULL &&
+                           strcmp(d->part[part].part_name, name) == 0) {
                                *biosdev = raidframe[i].biosdev;
                                *offset = raidframe[i].offset
                                        + RF_PROTECTED_SECTORS



Home | Main Index | Thread Index | Old Index