From nobody Wed Dec 13 09:25:25 2023 X-Original-To: bugs@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 4SqqpF4Rnrz53TGG for ; Wed, 13 Dec 2023 09:25:25 +0000 (UTC) (envelope-from bugzilla-noreply@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 4SqqpF2h99z4K52 for ; Wed, 13 Dec 2023 09:25:25 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1702459525; a=rsa-sha256; cv=none; b=QwJgHJuafpHaCYj0bmH28vgIc7ETYCUtgIOh/ABl4uirUP5iPkgmykaCtTg3yuHUCgkEMH dwgc1YtR3xJUFBhUoWf9yBxnlpDPRkgA0tuzCx34YtGwmpBS0tSmxaMnn/pmyVsxNDh7Lf 25+UQxt+KbK0zKklyIENUChonnkBOIDYGZCU0hEqIMwejxG3+vFuS189ql3vYdpKMEW/oQ GxKZQEYD0j9S8mw/2Fl+IZnPgyUr0FMRjgtWocLps5vcqXCWZ7s61Y1o1ljo5hOfWBpl8p Q9iTmFQZGU6DxUj6qrxVc/fQE5hC2uL3lx6l4QnYaf67RqEVqFHUFic1Lew3dg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1702459525; 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=rIea2y13UdaDtN/pLG0GBEHWcci3PE0o+yVsLBwX8ZY=; b=BKAc0H8eSXAEBLXSBOloi9PVcJX29Uwaa+Xal7e9+DxYkO91qMl6JYBxIK+IADoV/jp7kB EqVjyR1AnUU0y+FD+vxwEpelbpUgEjl2i9p31Z5Z6rSYleJX9AnK9aTAqOsCbtQQGSbdTI RxHdNBcJ8RuNOGwVBp2uaR0ZrDbXsXPXSsVEYJrTWCpi31watPLndApdWG5C22lH8fyeu6 RYR0v0Qidj31razoW2QBcyPsXoeEGNKPwWFyH4ysP2I0GiasHqJoIbl+Va08q0qEEDf1qr CkRlS4L1DQlPVDIXmwHHBhUEX9MTCdTYbNeo/hIGM+VrmMZCXngo5TYPiEhvcA== Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (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 4SqqpF1lFvzsmw for ; Wed, 13 Dec 2023 09:25:25 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 3BD9PPBE075471 for ; Wed, 13 Dec 2023 09:25:25 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 3BD9PP19075469 for bugs@FreeBSD.org; Wed, 13 Dec 2023 09:25:25 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 275741] sys/modules: Fix processing of WITHOUT_MODULES Date: Wed, 13 Dec 2023 09:25:25 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: freebsd@kumba.dev X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@freebsd.org MIME-Version: 1.0 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D275741 Bug ID: 275741 Summary: sys/modules: Fix processing of WITHOUT_MODULES Product: Base System Version: CURRENT Hardware: Any OS: Any Status: New Severity: Affects Some People Priority: --- Component: kern Assignee: bugs@FreeBSD.org Reporter: freebsd@kumba.dev The handling of WITHOUT_MODULES in the FreeBSD kernel build system is curre= ntly suboptimal. At present, it is only possible to exclude kmods at the top-le= vel of /usr/src/sys/modules from being built with this variable. If a kmod is = in a subdirectory, then it is built regardless if it is listed in WITHOUT_MODULE= S.=20 I have tried several forms of specifying subdirectory kmods in this variabl= e to avoid building them, but none of them work. The crux of the issue is because the only processing of this variable is do= ne in /usr/src/sys/modules/Makefile, and it is a simple loop that iterates over WITHOUT_MODULES and removes any entries from the SUBDIR variable *only* in = that top-level Makefile. For kmods in subdirectories that have their own Makefi= les that define SUBDIR, no processing of WITHOUT_MODULES takes place, so they w= ill always be built. A previous attempt to tackle this issue was found in PR#76225, and the last comment says this was all fixed back in Jan 2005, however, this fix may have been undone at some point, as the current Makefile logic is not capable of excluding kmods in lower-level subdirectories from being built. The issue was again highlighted by PR#210143, but the reporter did not prov= ide a recommended fix or any patches, and the reporter eventually self-closed t= he PR due to feedback timeout (by developers?). I have made an effort to fix this in the attached patch by taking several steps: 1. Move the WITHOUT_MODULES for loop to a new mk file in /usr/src/sys/conf = and call it "kmod.without.mk". The loop is expanded to process kmod names as either a top-level name under /usr/src/sys/modules, or as a path relative to that directory. 2. Include this new mk file in every Makefile that defines a SUBDIR variabl= e in /usr/src/sys/modules. 3. Update the make.conf(5) manpage to specify the way kmods can be excluded from building via this variable. I've made the patch against -CURRENT (git HEAD), but I've only tested again= st one of my 14.0-RELEASE systems, as I don't actively run -CURRENT on any mac= hine at present. My systems use a custom kernel config that inherits from GENER= IC, and install to /boot/kernel.custom. After fixing the processing of WITHOUT_MODULES, I've been able to knock the size of /boot/kernel.custom do= wn to ~47MB, and I can probably get it smaller once I deep dive whether that particular system needs any of the i2c or other ancillary bus drivers. --=20 You are receiving this mail because: You are the assignee for the bug.=