Module Name: src Committed By: martin Date: Wed Sep 18 17:22:32 UTC 2019
Modified Files: src/share/man/man8/man8.x86 [netbsd-8]: boot.8 src/sys/kern [netbsd-8]: kern_subr.c Log Message: Pull up following revision(s) (requested by manu in ticket #1381): 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.11.4.2 -r1.11.4.3 src/share/man/man8/man8.x86/boot.8 cvs rdiff -u -r1.217.10.1 -r1.217.10.2 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.11.4.2 src/share/man/man8/man8.x86/boot.8:1.11.4.3 --- src/share/man/man8/man8.x86/boot.8:1.11.4.2 Tue Sep 17 18:26:53 2019 +++ src/share/man/man8/man8.x86/boot.8 Wed Sep 18 17:22:32 2019 @@ -1,4 +1,4 @@ -.\" $NetBSD: boot.8,v 1.11.4.2 2019/09/17 18:26:53 martin Exp $ +.\" $NetBSD: boot.8,v 1.11.4.3 2019/09/18 17:22:32 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.217.10.1 src/sys/kern/kern_subr.c:1.217.10.2 --- src/sys/kern/kern_subr.c:1.217.10.1 Sat Oct 13 17:14:13 2018 +++ src/sys/kern/kern_subr.c Wed Sep 18 17:22:32 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: kern_subr.c,v 1.217.10.1 2018/10/13 17:14:13 martin Exp $ */ +/* $NetBSD: kern_subr.c,v 1.217.10.2 2019/09/18 17:22:32 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.217.10.1 2018/10/13 17:14:13 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: kern_subr.c,v 1.217.10.2 2019/09/18 17:22:32 martin Exp $"); #include "opt_ddb.h" #include "opt_md.h" @@ -600,13 +600,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