From owner-svn-src-all@freebsd.org Fri Dec 13 09:28:45 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D14711C8284; Fri, 13 Dec 2019 09:28:45 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47Z52P52hWz3JGP; Fri, 13 Dec 2019 09:28:45 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A809BA0A7; Fri, 13 Dec 2019 09:28:45 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBD9SjKp005187; Fri, 13 Dec 2019 09:28:45 GMT (envelope-from trasz@FreeBSD.org) Received: (from trasz@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBD9SiYX005183; Fri, 13 Dec 2019 09:28:44 GMT (envelope-from trasz@FreeBSD.org) Message-Id: <201912130928.xBD9SiYX005183@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: trasz set sender to trasz@FreeBSD.org using -f From: Edward Tomasz Napierala Date: Fri, 13 Dec 2019 09:28:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r355705 - in head: lib/geom/part sys/geom/part X-SVN-Group: head X-SVN-Commit-Author: trasz X-SVN-Commit-Paths: in head: lib/geom/part sys/geom/part X-SVN-Commit-Revision: 355705 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Dec 2019 09:28:45 -0000 Author: trasz Date: Fri Dec 13 09:28:44 2019 New Revision: 355705 URL: https://svnweb.freebsd.org/changeset/base/355705 Log: Add kern.geom.part.separator tunable. This makes it possible to specify an optional separator to insert before partition name; eg if it's set to "c/", you'll get "ada0c/s1" instead of "ada0s1". (It cannot be set to just “/“, since ada0 is a device node, not a directory.) Reviewed by: imp MFC after: 2 weeks Sponsored by: Klara Inc. Differential Revision: https://reviews.freebsd.org/D22193 Modified: head/lib/geom/part/gpart.8 head/sys/geom/part/g_part.c head/sys/geom/part/g_part.h head/sys/geom/part/g_part_if.m Modified: head/lib/geom/part/gpart.8 ============================================================================== --- head/lib/geom/part/gpart.8 Fri Dec 13 09:19:24 2019 (r355704) +++ head/lib/geom/part/gpart.8 Fri Dec 13 09:28:44 2019 (r355705) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 3, 2019 +.Dd December 13, 2019 .Dt GPART 8 .Os .Sh NAME @@ -1260,6 +1260,14 @@ If this variable is set to a non-zero value, the modul recalculate the user-specified offset and size for alignment with the CHS geometry. Otherwise the values will be left unchanged. +.It Va kern.geom.part.separator : No "" +Specify an optional separator that will be inserted between the GEOM name +and partition name. +This variable is a +.Xr loader 8 +tunable. +Note that setting this variable may break software which assumes a particular +naming scheme. .El .Sh EXIT STATUS Exit status is 0 on success, and 1 if the command fails. Modified: head/sys/geom/part/g_part.c ============================================================================== --- head/sys/geom/part/g_part.c Fri Dec 13 09:19:24 2019 (r355704) +++ head/sys/geom/part/g_part.c Fri Dec 13 09:28:44 2019 (r355705) @@ -147,6 +147,10 @@ static u_int allow_nesting = 0; SYSCTL_UINT(_kern_geom_part, OID_AUTO, allow_nesting, CTLFLAG_RWTUN, &allow_nesting, 0, "Allow additional levels of nesting"); +char g_part_separator[MAXPATHLEN] = ""; +SYSCTL_STRING(_kern_geom_part, OID_AUTO, separator, + CTLFLAG_RDTUN, &g_part_separator, sizeof(g_part_separator), + "Partition name separator"); /* * The GEOM partitioning class. Modified: head/sys/geom/part/g_part.h ============================================================================== --- head/sys/geom/part/g_part.h Fri Dec 13 09:19:24 2019 (r355704) +++ head/sys/geom/part/g_part.h Fri Dec 13 09:28:44 2019 (r355705) @@ -228,6 +228,8 @@ void g_part_geometry_heads(off_t, u_int, off_t *, u_in int g_part_modevent(module_t, int, struct g_part_scheme *); +extern char g_part_separator[]; + #define G_PART_SCHEME_DECLARE(name) \ static int name##_modevent(module_t mod, int tp, void *d) \ { \ Modified: head/sys/geom/part/g_part_if.m ============================================================================== --- head/sys/geom/part/g_part_if.m Fri Dec 13 09:19:24 2019 (r355704) +++ head/sys/geom/part/g_part_if.m Fri Dec 13 09:28:44 2019 (r355705) @@ -48,7 +48,7 @@ CODE { { char buf[32]; - sbuf_printf(sb, "%s%s", pfx, + sbuf_printf(sb, "%s%s%s", pfx, g_part_separator, G_PART_NAME(table, entry, buf, sizeof(buf))); }