Hi hoehermann
Welcome to the forum.
----SNIP----
5. With the new graphics extension in place, trying to load nouveau triggers a loading a dependency. However backlight cannot be loaded as the symbol backlight_device_get_by_type is already owned by kernel. Which seems to be a known problem.[/li][/list]
At this point, I am stumped. Why would menuconfig emit a configuration which leads to modules which cannot actually be used by the kernel the build produces? I am trying to produce a solution that is not only usable by me, but also by madmax and quite possibly other interested users. Any pointers of what I missed?
A couple of months ago I had to recompile a kernel to get some hardware on an ASUS T100 Transformer recognized and ran into
the same problem ("is already owned by kernel" error).
The error ("is already owned by kernel") is basically saying a symbol that a module is defining is already defined by the kernel. When
configuring a kernel, selecting certain options will force some drivers to be built into the kernel instead of as a module. So, assuming
you already have existing kernel modules, DRIVER_A is a module depending on DRIVER_B. You select a kernel option that requires
DRIVER_B to be built into the kernel. If you try loading DRIVER_A with the new kernel, it will attempt to load DRIVER_B (a dependency)
and you get that symbol "is already owned by kernel" error. This means DRIVER_A also needs to be recompiled so it no longer tries
to load DRIVER_B.
What I wound up doing is recompiling all modules when I changed the kernel. Here's a step by step for the whole procedure:
Compile a kernel:
tce-load -i compiletc perl5 bash ncursesw-dev bc glibc_apps elfutils-dev
wget http://tinycorelinux.net/10.x/x86_64/release/src/kernel/config-4.19.10-tinycore64
wget http://tinycorelinux.net/10.x/x86_64/release/src/kernel/linux-4.19.10-patched.txz
tar xf linux-4.19.10-patched.txz
cd linux-4.19.10
make mrproper
# Start with the most recent config file.
cp ../config-4.19.10-tinycore64 .config
make oldconfig
make menuconfig [make your changes]
# I like to save a copy of the config file to use as a starting point for the next time.
cp .config ../config-4.19.10-tinycore64-asusT100CHIrev1
# Compile kernel
make -j 2 bzImage
# Copy the kernel where the bootloader can find it.
cp arch/x86/boot/bzImage /mnt/sdg1/Linux/vmlinuzASUS64rev1
# Compile modules
make -j 2 modules
# Place the modules somewhere for packaging.
mkdir -p /home/tc/tmp/ASUS/modules/usr/local
make INSTALL_MOD_PATH=/home/tc/tmp/ASUS/modules/usr/local modules_install
cd /home/tc/tmp/ASUS/
# I like to keep the mod.alias, mod.builtin, mod.dep, mod.order, and mod.symbols files.
mv modules/usr/local/lib/modules/4.19.10-tinycore64/modules.* .
# Remove the 2 links in modules/usr/local/lib/modules/4.19.10-tinycore64/
rm modules/usr/local/lib/modules/4.19.10-tinycore64/build
rm modules/usr/local/lib/modules/4.19.10-tinycore64/source
# Set up sorter.sh to package all the modules.
cd ..
mkdir sorter
cd sorter
tce-load -i squashfs-tools zsync
wget https://github.com/tinycorelinux/sorter/archive/master.zip
unzip master.zip
cd sorter-master/
# This creates all of the Tinycore module packages and leaves them in the current directory.
./sorter.sh 4.19.10-tinycore64 /home/tc/tmp/ASUS/modules
# Back to the tmp directory.
cd ../../
# Fetch a 32 bit root file system.
wget http://tinycorelinux.net/10.x/x86/release/distribution_files/rootfs.gz
# Copy the module archive that's part of the base system
cp sorter/sorter-master/modules64.gz modulesASUS64rev1.gz
# Make a new initrd, 64 bit modules with 32 bit root file system (32 bit apps) in this example.
cat rootfs.gz modulesASUS64rev1.gz > coreASUS64rev1.gz
# Copy the initrd where the bootloader can find it.
cp coreASUS64rev1.gz /mnt/sdg1/Linux/
The downloads only need to be done once. If you need to compile again, use the config file you saved previously as a starting point.
Created directories to archive the results of each build. This allows you to revert to a previous build and keeps matching config,
kernels, modules, and initrd files together. Append rev1 to the config, kernel, and initrd filenames and place them in a rev1
directory along with their matching modules.
Compile times on a Dell Dimension E310 were 52 minutes for the kernel and 3 hours 45 minutes for the modules.