Bug 284639 - if_mtw.ko: make installkernel tries to install debug binary although DEBUG is disabled
Summary: if_mtw.ko: make installkernel tries to install debug binary although DEBUG is...
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Some People
Assignee: Jesper Schmitz Mouridsen
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-02-07 16:51 UTC by O. Hartmann
Modified: 2025-02-07 20:35 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description O. Hartmann 2025-02-07 16:51:51 UTC
On recent CURRENT (FreeBSD 15.0-CURRENT #40 main-n275030-46a9fb7287f4: Sat Jan 25 07:09:38 CET 2025 amd) with settings in "GENERIC" like
[...]
# For full debugger support use (turn off in stable branch):
include "std.nodebug"

and /etc/src.conf retrofitted with

[...]
NOINSTALL_DEBUG=YES
WITHOUT_ASSERT_DEBUG=YES
WITHOUT_TESTS=YES
WITHOUT_DEBUG_FILES=YES
WITHOUT_CLEAN=YES
WITHOUT_REPRODUCIBLE_BUILD=YES


results in an attempt to install if_mtw(4) with debug informations I presume:
[...]
--- _kmodinstall ---
--- realinstall_subdir_usb/mtw ---
install -T dbg -o root -g wheel -m 444   if_mtw.ko.debug /usr/lib/debug/boot/kernel/
--- realinstall_subdir_usb/run ---
install -T release -o root -g wheel -m 444   if_run.ko /boot/kernel/
--- realinstall_subdir_usb/rum ---
install -T release -o root -g wheel -m 444   if_rum.ko /boot/kernel/
--- realinstall_subdir_usb/mtw ---
install: /usr/lib/debug/boot/kernel: No such file or directory
*** [_kmodinstall] Error code 71

make[5]: stopped making "install" in /usr/src/sys/modules/usb/mtw
*** [modules-install] Error code 6
Comment 1 Mark Johnston freebsd_committer freebsd_triage 2025-02-07 19:09:26 UTC
The DEBUG_FLAGS=-g in sys/modules/usb/mtw/Makefile is presumably the culprit here.
Comment 2 O. Hartmann 2025-02-07 19:42:25 UTC
(In reply to Mark Johnston from comment #1)

Deleting "-g" from the DEBUG_FLAGS tag ends up in:

[...]
--- realinstall_subdir_usb/rsufw ---
install -T release -o root -g wheel -m 444   rsu-rtl8712fw.ko /boot/kernel/
--- realinstall_subdir_usb/runfw ---
===> usb/runfw (install)
--- realinstall_subdir_usb/mtw ---
install: /usr/lib/debug/boot/kernel: No such file or directory
*** [modules-install] Error code 6


Also aworthy to note: I also run another box, almost same oldish hardware and configuration with almost same configuration - except the kernel name. The box in question and failing hasn't been updated over the past 2 weeks, but the sibbling. The other machine, sibbling, is performing well, not having this weird issue.

I fear I have issued the "make delete-old" process on the wrong console on the failing machine yesterday, so if this might be a useful hint ....
Comment 3 Jesper Schmitz Mouridsen freebsd_committer freebsd_triage 2025-02-07 20:19:09 UTC
https://reviews.freebsd.org/D48895 I hope the right solutions is to remove DEBUG_FLAGS all together
Comment 4 O. Hartmann 2025-02-07 20:30:51 UTC
Removing the tag DEBUG_FLAGS=-g completely (I just remove "-g" from the flag, leaving it empty) solved the install issue for me!
Comment 5 commit-hook freebsd_committer freebsd_triage 2025-02-07 20:32:13 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=2be8b121bf82d409773ee5b404e4e678506beffc

commit 2be8b121bf82d409773ee5b404e4e678506beffc
Author:     Jesper Schmitz Mouridsen <jsm@FreeBSD.org>
AuthorDate: 2025-02-07 20:26:36 +0000
Commit:     Jesper Schmitz Mouridsen <jsm@FreeBSD.org>
CommitDate: 2025-02-07 20:26:36 +0000

    mtw(4) remove misplaced DEBUG_FLAGS

    PR:             284639
    Approved by: markj,emaste
    Differential Revision:  https://reviews.freebsd.org/D48895

 sys/modules/usb/mtw/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)