Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-8]: src/sys/arch/i386/stand Pull up following revision(s) (reques...
details: https://anonhg.NetBSD.org/src/rev/357e8a059cf1
branches: netbsd-8
changeset: 852691:357e8a059cf1
user: martin <martin%NetBSD.org@localhost>
date: Tue Dec 17 12:19:49 2019 +0000
description:
Pull up following revision(s) (requested by manu in ticket #1473):
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 PR 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 78fa25fef550 -r 357e8a059cf1 sys/arch/i386/stand/boot/devopen.c
--- a/sys/arch/i386/stand/boot/devopen.c Sat Dec 14 12:34:19 2019 +0000
+++ b/sys/arch/i386/stand/boot/devopen.c Tue Dec 17 12:19:49 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: devopen.c,v 1.8.52.1 2019/09/17 18:26:53 martin Exp $ */
+/* $NetBSD: devopen.c,v 1.8.52.2 2019/12/17 12:19:49 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 78fa25fef550 -r 357e8a059cf1 sys/arch/i386/stand/efiboot/devopen.c
--- a/sys/arch/i386/stand/efiboot/devopen.c Sat Dec 14 12:34:19 2019 +0000
+++ b/sys/arch/i386/stand/efiboot/devopen.c Tue Dec 17 12:19:49 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: devopen.c,v 1.1.12.6 2019/09/27 09:40:08 martin Exp $ */
+/* $NetBSD: devopen.c,v 1.1.12.7 2019/12/17 12:19:49 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 78fa25fef550 -r 357e8a059cf1 sys/arch/i386/stand/lib/biosdisk.c
--- a/sys/arch/i386/stand/lib/biosdisk.c Sat Dec 14 12:34:19 2019 +0000
+++ b/sys/arch/i386/stand/lib/biosdisk.c Tue Dec 17 12:19:49 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: biosdisk.c,v 1.46.6.5 2019/09/18 17:30:05 martin Exp $ */
+/* $NetBSD: biosdisk.c,v 1.46.6.6 2019/12/17 12:19:49 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