From nobody Sat Feb 25 17:37:02 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PPDTq1qxyz3tgcT; Sat, 25 Feb 2023 17:37:03 +0000 (UTC) (envelope-from git@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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PPDTq1CBWz3tPj; Sat, 25 Feb 2023 17:37:03 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677346623; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GNQI7tHWym26FY1XXTD+J+06AWTKH2VGp7rsATdr+9Q=; b=rYWTQZWI4ZN+VsD9eZJojPuBWW0I5brqW+J6CpFnCsPwrr/2Euz2KVlJojDu5YSiAk5/Wo jVsLM3X+TgOpDaFPjGkNP7KptHtyr/4E605GaXm3tgPszpZ7IjpKOAqLOtaJaZQJfmQUfF omBt/V57GpCXb6fMnkFjW+7VkTzT0J8UNowCRhd3/fk72k0Mo33qj1F45Zdtn7YiN47e+l 4GRbG4X3nFyQzTWzjiQs6iNSsFyWc3sgRU6l1Q0CBBKCnA+7IVpdtXTUm6fli1jE/SJ4Km i5ZxhObTaJuvdsEN9h57CNK8y3r1anzUI7RhxfyfcX5qW1hpG3+9zZDBddO86Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677346623; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=GNQI7tHWym26FY1XXTD+J+06AWTKH2VGp7rsATdr+9Q=; b=bQALqU7jUFMaRZKiOPsxkqyt7KcWnf0fTZyQtyBF5M4Gt5HWQBVAJT7mGIOyfsVxI2SWHq okTRrss79yvKSQCOsPqqHfToZDsidEKSthmDGVA0kMGvYNcqFj4Kb76VZmXOmMAqBb+Njt FTBxiQT6UmYISW9HEeV6Vaff73XtK3fScrnt7p3EvriIXcHg2ND+IFIhD9wo6RtJUI++px UbOgTZQaL3xPAPsXpYYVeS4akH3vAMajmkmGp4qmxWMuSroX749osAZkFps7375l2g3n4A +DUvSVGI3HV+iqKZ9YPLxFcN7AWDG+YduOj4fpm+4W+qtAWBmZDeDKAu8TwpGQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677346623; a=rsa-sha256; cv=none; b=e0OW+O+XsqXNgTGLS/+UOpQ2HDJrhj7sR+2+/uN09aJvyGgITkxk8KrGpmRJZNFzoZuYLm qvDf+y6F3ofuG3MSH+OK0hPVcbM1jI/QqWpubHNzFw4fSafe92DqUbqlcM37AZGt3/QhSF h25EBe449G0ZYRLbK6iHz8fjv37WfP13CYYdDn3Cth8ktWJdoxTdENduuIW8vl0Cdi4liY JhFwXzUHt9PB5JrH565SbMPAaESpL+aMHRFghGN12kED3ObzXzug//5H20zYLF7X4HEy/y eBbkWss6rSTxsuloNUzP8Vi1dGu1RtjMSSiPSu5R+R8THMWfILop6ghmFCQ/WQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PPDTq0FRfz1C2V; Sat, 25 Feb 2023 17:37:03 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 31PHb2si072301; Sat, 25 Feb 2023 17:37:02 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 31PHb2R8072300; Sat, 25 Feb 2023 17:37:02 GMT (envelope-from git) Date: Sat, 25 Feb 2023 17:37:02 GMT Message-Id: <202302251737.31PHb2R8072300@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 773c13c686e4 - main - kldxref: skip .pkgsave files List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 773c13c686e4b6ae9dbbc150b342b82c3f47d73a Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=773c13c686e4b6ae9dbbc150b342b82c3f47d73a commit 773c13c686e4b6ae9dbbc150b342b82c3f47d73a Author: Mina Galić AuthorDate: 2023-02-25 17:31:58 +0000 Commit: Warner Losh CommitDate: 2023-02-25 17:35:43 +0000 kldxref: skip .pkgsave files This should help people transitioning from traditional setups to pkgbase experience a lot less friction. We do this by skipping all files containing two dots. Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/661 Differential Revision: https://reviews.freebsd.org/D27959 --- usr.sbin/kldxref/kldxref.8 | 12 +++++++++++- usr.sbin/kldxref/kldxref.c | 14 ++++++++------ 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/usr.sbin/kldxref/kldxref.8 b/usr.sbin/kldxref/kldxref.8 index 1a3b9118dd5c..38db9d6922ce 100644 --- a/usr.sbin/kldxref/kldxref.8 +++ b/usr.sbin/kldxref/kldxref.8 @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 9, 2001 +.Dd February 25, 2023 .Dt KLDXREF 8 .Os .Sh NAME @@ -51,6 +51,16 @@ If no hint records are generated for a particular directory, no hint file is created, and the preexisting hint file (if there was one in that directory) is removed. .Pp +.Nm +ignores files with at least two "."s in the filename, such as +.Pa foo.ko.debug +or +.Pa bar.ko.pkgsave . +Note that this means that modules cannot have names such as +.Pa foo.bar.ko . +This limitation however, has been lived practice since the beginning of +FreeBSD's kernel modules. +.Pp The following options are available: .Bl -tag -width indent .It Fl R diff --git a/usr.sbin/kldxref/kldxref.c b/usr.sbin/kldxref/kldxref.c index 7a4d704356b8..933de4991e62 100644 --- a/usr.sbin/kldxref/kldxref.c +++ b/usr.sbin/kldxref/kldxref.c @@ -685,6 +685,7 @@ main(int argc, char *argv[]) { FTS *ftsp; FTSENT *p; + char *dot = NULL; int opt, fts_options, ival; struct stat sb; @@ -752,14 +753,15 @@ main(int argc, char *argv[]) fwrite(&ival, sizeof(ival), 1, fxref); reccnt = 0; } - /* skip non-files and separate debug files */ + /* skip non-files.. */ if (p->fts_info != FTS_F) continue; - if (p->fts_namelen >= 6 && - strcmp(p->fts_name + p->fts_namelen - 6, ".debug") == 0) - continue; - if (p->fts_namelen >= 8 && - strcmp(p->fts_name + p->fts_namelen - 8, ".symbols") == 0) + /* + * Skip files that generate errors like .debug, .symbol and .pkgsave + * by generally skipping all files with 2 dots. + */ + dot = strchr(p->fts_name, '.'); + if (dot && strchr(dot + 1, '.') != NULL) continue; read_kld(p->fts_path, p->fts_name); }