From owner-svn-src-all@freebsd.org Tue Sep 29 17:52:16 2020 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 3C4A842B7B2; Tue, 29 Sep 2020 17:52:16 +0000 (UTC) (envelope-from fernape@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 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 4C16R40wB6z3fmY; Tue, 29 Sep 2020 17:52:16 +0000 (UTC) (envelope-from fernape@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 02F8F12692; Tue, 29 Sep 2020 17:52:16 +0000 (UTC) (envelope-from fernape@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 08THqFW8076106; Tue, 29 Sep 2020 17:52:15 GMT (envelope-from fernape@FreeBSD.org) Received: (from fernape@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 08THqFNT076105; Tue, 29 Sep 2020 17:52:15 GMT (envelope-from fernape@FreeBSD.org) Message-Id: <202009291752.08THqFNT076105@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: fernape set sender to fernape@FreeBSD.org using -f From: =?UTF-8?Q?Fernando_Apestegu=c3=ada?= Date: Tue, 29 Sep 2020 17:52:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r366264 - head/sbin/kldconfig X-SVN-Group: head X-SVN-Commit-Author: fernape X-SVN-Commit-Paths: head/sbin/kldconfig X-SVN-Commit-Revision: 366264 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.33 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: Tue, 29 Sep 2020 17:52:16 -0000 Author: fernape (ports committer) Date: Tue Sep 29 17:52:15 2020 New Revision: 366264 URL: https://svnweb.freebsd.org/changeset/base/366264 Log: kldconfig(8): Add EXAMPLES to the man page Add EXAMPLES section to the man page showing the use of all flags except for -S. While here, clarify -f description. It not only suppresses diagnostic messages but it also affects the exit status of the command itself. This is shown in two of the examples. Approved by: bcr@ Differential Revision: https://reviews.freebsd.org/D26588 Modified: head/sbin/kldconfig/kldconfig.8 Modified: head/sbin/kldconfig/kldconfig.8 ============================================================================== --- head/sbin/kldconfig/kldconfig.8 Tue Sep 29 17:22:14 2020 (r366263) +++ head/sbin/kldconfig/kldconfig.8 Tue Sep 29 17:52:15 2020 (r366264) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 27, 2017 +.Dd September 29, 2020 .Dt KLDCONFIG 8 .Os .Sh NAME @@ -54,9 +54,8 @@ The following options are available: .It Fl d Remove the specified paths from the module search path. .It Fl f -Do not display a diagnostic message if a path specified for adding is -already present in the search path, or if a path specified for removing -is not present in the search path. +Do not fail if a path specified for adding is already present in the search +path, or if a path specified for removing is not present in the search path. This may be useful in startup/shutdown scripts for adding a path to a file system which is still not mounted, or in shutdown scripts for unconditionally removing a path that may have been added during startup. @@ -95,6 +94,69 @@ The default module search path used by the kernel. .El .Sh EXIT STATUS .Ex -std +.Sh EXAMPLES +Show the module search path +.Bd -literal -offset indent +$ kldconfig -r +/boot/kernel;/boot/modules;/boot/dtb;/boot/dtb/overlays +.Ed +.Pp +Try to delete the +.Pa /boot +directory from the search path. +The command will fail: +.Bd -literal -offset indent +$ kldconfig -d /boot +kldconfig: not in module search path: /boot +$ echo $? +1 +.Ed +.Pp +Same as above but forcing the operation. +This time the command will succeed: +.Bd -literal -offset indent +$ kldconfig -d -f /boot +$ echo $? +0 +.Ed +.Pp +Add the +.Pa /boot +directory to the beginning of the search path and display extra verbose output: +.Bd -literal -offset indent +$ kldconfig -i -m -vv /boot +/boot/kernel;/boot/modules -> /boot;/boot/kernel;/boot/modules +.Ed +.Pp +Without +.Fl m +the +.Fl i +flag will overwrite the contents of the search path list: +.Bd -literal -offset indent +$ kldconfig -i -vv /boot +/boot;/boot/kernel;/boot/modules;/boot/dtb;/boot/dtb/overlays -> /boot +.Ed +.Pp +Same as above but using +.Fl n +to simulate the operation without actually doing it: +.Bd -literal -offset indent +$ kldconfig -i -n -vv /boot +/boot;/boot/kernel;/boot/modules;/boot/dtb;/boot/dtb/overlays -> /boot +.Ed +.Pp +Add directories to the search path removing duplicates. +Note the need of +.Fl f +to force the operation in case any of the directories is already in the +search path. +The +.Pa /boot/kernel +directory will be added once: +.Bd -literal -offset indent +$ kldconfig -f -U /boot/kernel /boot/kernel /boot/modules /boot/dtb /boot/dtb/overlays +.Ed .Sh SEE ALSO .Xr kldload 2 , .Xr kldload 8 ,