Module Name: src Committed By: martin Date: Tue Sep 17 19:45:03 UTC 2019
Modified Files: src/share/man/man8/man8.x86 [netbsd-9]: boot.8 src/sys/kern [netbsd-9]: kern_subr.c Log Message: Pull up following revision(s) (requested by manu in ticket #205): share/man/man8/man8.x86/boot.8: revision 1.18 sys/kern/kern_subr.c: revision 1.227 Accept root device specification as NAME=label Document that bootdev option accepts device specification as NAME=label To generate a diff of this commit: cvs rdiff -u -r1.15.2.2 -r1.15.2.3 src/share/man/man8/man8.x86/boot.8 cvs rdiff -u -r1.223 -r1.223.4.1 src/sys/kern/kern_subr.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/share/man/man8/man8.x86/boot.8 diff -u src/share/man/man8/man8.x86/boot.8:1.15.2.2 src/share/man/man8/man8.x86/boot.8:1.15.2.3 --- src/share/man/man8/man8.x86/boot.8:1.15.2.2 Tue Sep 17 19:32:00 2019 +++ src/share/man/man8/man8.x86/boot.8 Tue Sep 17 19:45:02 2019 @@ -1,4 +1,4 @@ -.\" $NetBSD: boot.8,v 1.15.2.2 2019/09/17 19:32:00 martin Exp $ +.\" $NetBSD: boot.8,v 1.15.2.3 2019/09/17 19:45:02 martin Exp $ .\" .\" Copyright (c) 1991, 1993 .\" The Regents of the University of California. All rights reserved. @@ -436,7 +436,11 @@ being separated with spaces .It Ic bootdev Ns = Ns Ar dev Po or Ic root Ns = Ns Ar dev Pc Override the default boot device. .Ar dev -can be a unit name +is of the form +.Va NAME=partition_label +for +.Xr gpt 8 +partitionned disks. It can also be a unit name .Po Dq wd0 .Pc , or an interface name Index: src/sys/kern/kern_subr.c diff -u src/sys/kern/kern_subr.c:1.223 src/sys/kern/kern_subr.c:1.223.4.1 --- src/sys/kern/kern_subr.c:1.223 Sun Jan 27 02:08:43 2019 +++ src/sys/kern/kern_subr.c Tue Sep 17 19:45:03 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: kern_subr.c,v 1.223 2019/01/27 02:08:43 pgoyette Exp $ */ +/* $NetBSD: kern_subr.c,v 1.223.4.1 2019/09/17 19:45:03 martin Exp $ */ /*- * Copyright (c) 1997, 1998, 1999, 2002, 2007, 2008 The NetBSD Foundation, Inc. @@ -79,7 +79,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: kern_subr.c,v 1.223 2019/01/27 02:08:43 pgoyette Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kern_subr.c,v 1.223.4.1 2019/09/17 19:45:03 martin Exp $"); #include "opt_ddb.h" #include "opt_md.h" @@ -679,13 +679,18 @@ getdisk(char *str, int len, int defpart, static const char * getwedgename(const char *name, int namelen) { - const char *wpfx = "wedge:"; - const int wpfxlen = strlen(wpfx); + const char *wpfx1 = "wedge:"; + const char *wpfx2 = "NAME="; + const int wpfx1len = strlen(wpfx1); + const int wpfx2len = strlen(wpfx2); - if (namelen < wpfxlen || strncmp(name, wpfx, wpfxlen) != 0) - return NULL; + if (namelen > wpfx1len && strncmp(name, wpfx1, wpfx1len) == 0) + return name + wpfx1len; - return name + wpfxlen; + if (namelen > wpfx2len && strncasecmp(name, wpfx2, wpfx2len) == 0) + return name + wpfx2len; + + return NULL; } static device_t