20-100 However, when I modload i915drmkms, I get the following error:
kobj_checksyms, 1026: [%M/drmkms/drmkms.kmod]: linker error: global symbol 'drm_ioctl' redefined
WARNING: module error: recursive load failed for 'i915drmkms' ('drmkms' required), error 8
This shouldn't happen. If this isn't some transient -CURRENT broken-ness, then it looks like drmkms
can't be built as modules. I'll look into it, but, ask on the kernel mailing-list too.
20-100 I've created a kernel configuration by copying GENERIC, removing compat and drmkms sections. I also had to add a '-no drm*' inspired from MODULAR, otherwise i915drmkms was still loaded on startup (with the same error as above).
I'm not aware of modules configuration files or options, so I just used "make depend; make" to build them.
This is the way I build my kernels:
# Prep.--only once (as root)
usermod -G wsrc rvp
rm -rf /usr/obj
install -d -m 775 -o root -g wsrc /usr/obj
# Configure kernel
cd /usr/src
cp sys/arch/amd64/conf/{GENERIC,MYKERNEL}
# Edit sys/arch/amd64/conf/MYKERNEL and make your changes.
# Unset any old compiler flags, if any.
unset CC CXX CFLAGS CXXFLAGS LDFLAGS
umask 022
# First build tools (once), then the kernel
./build.sh -j3 -U tools
./build.sh -j3 -U kernel=MYKERNEL
# Save default kernel (once) and install the new one (as root)
mv /netbsd /netbsd.GENERIC
install -m 755 -o root -g wheel sys/arch/amd64/compile/obj/MYKERNEL/netbsd /netbsd
# Subsequent kernel builds pass `-u' to bypass the full clean which
# saves time.
./build.sh -j3 -u -U kernel=MYKERNEL
# Build modules
./build.sh -j3 -U modules
# Install modules (as root)
# save orig. modules first (once)
mv /stand/amd64 /stand/amd64.GENERIC
mv /stand/amd64-xen /stand/amd64-xen.GENERIC
./build.sh -j3 -U installmodules=/
For me, just commenting out the *drmkms*
stuff worked--nothing else was needed to build modules:
$ cd /usr/src/
$ diff -u sys/arch/amd64/conf/{GENERIC,MYKERNEL}
--- sys/arch/amd64/conf/GENERIC 2020-07-07 10:29:05.000000000 +0000
+++ sys/arch/amd64/conf/MYKERNEL 2020-11-12 21:15:17.891054161 +0000
@@ -417,17 +417,17 @@
#tdfxdrm* at drm? # 3dfx (voodoo) DRM driver
# DRMKMS drivers
-i915drmkms* at pci? dev ? function ?
-intelfb* at intelfbbus?
+# i915drmkms* at pci? dev ? function ?
+# intelfb* at intelfbbus?
-radeon* at pci? dev ? function ?
-radeondrmkmsfb* at radeonfbbus?
+# radeon* at pci? dev ? function ?
+# radeondrmkmsfb* at radeonfbbus?
#amdgpu* at pci? dev ? function ?
#amdgpufb* at amdgpufbbus?
-nouveau* at pci? dev ? function ?
-nouveaufb* at nouveaufbbus?
+# nouveau* at pci? dev ? function ?
+# nouveaufb* at nouveaufbbus?
# DRMUMS drivers
#viadrmums* at drm?
$