Unfortunately, I lost my boot drive due to hardware failure. In principle, there was no important data on there. However, now I am struggling to set everything back up, even though I thought knew the necessary steps.
The first step was to install the Kernel module for the device LEDs; the device is a Ugreen DXP 6800 Pro. This can be found on github (I cannot provide a link here) and worked perfectly last time.
However, I cannot remember how I got to the point where I was able to compile kernel modules. When I try it now, with a fresh install of TrueNAS Scale 24.10.2 or even using the same iso I used previously (24.10.1), I get:
make -C /lib/modules/6.6.44-production+truenas/build M=[REDACTED]
make[1]: Entering directory '/usr/src/linux-headers-6.6.44-production+truenas'
ERROR: Kernel configuration is invalid.
include/generated/autoconf.h or include/config/auto.conf are missing.
Run 'make oldconfig && make prepare' on kernel src to fix it.
make[2]: *** [/usr/src/linux-headers-6.6.44-production+truenas/Makefile:809: include/config/auto.conf] Error 1
make[1]: *** [Makefile:237: __sub-make] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-6.6.44-production+truenas'
make: *** [Makefile:11: all] Error 2
Will put this in here though I get the impression you understand the implications of going outside of the guardrails put in place (no support):
If there’s a specific kernel module you need and a valid use case, maybe you should stick in a feature request to see if it can be included in a later release?
Thanks, but the problem is more general and this is only the first kernel module I need. I will later need to install others, which are not directly available.
I ran install-dev-tools, but it did not fix the issue. It also seems I had already run it at some point. Output:
+ [[ '' == \-\-\f\o\r\c\e ]]
+ [[ ! -S /var/run/middleware/middlewared.sock ]]
+ PACKAGES=(make open-iscsi python3-cryptography python3-pip python3-pyfakefs python3-pyotp python3-pytest python3-pytest-asyncio python3-pytest-dependency python3-pytest-rerunfailures python3-pytest-timeout snmp sshpass zstd)
+ PIP_PACKAGES=()
+ '[' -f /usr/local/libexec/disable-rootfs-protection ']'
+ /usr/local/libexec/disable-rootfs-protection
Flagging root dataset as developer mode
Setting readonly=off on dataset boot-pool/ROOT/24.10.1/opt
Setting readonly=off on dataset boot-pool/ROOT/24.10.1/usr
+ '[' 0 -ne 0 ']'
+ apt update
Hit:1 https://apt.sys.truenas.net/electriceel/nightlies/debian bookworm InRelease
Hit:2 https://apt.sys.truenas.net/electriceel/nightlies/debian-security bookworm-security InRelease
Hit:3 https://apt.sys.truenas.net/electriceel/nightlies/debian-backports bookworm-backports InRelease
Hit:4 https://apt.sys.truenas.net/electriceel/nightlies/debian-debug bookworm-debug InRelease
Hit:5 https://apt.sys.truenas.net/electriceel/nightlies/yarn stable InRelease
Hit:6 https://apt.sys.truenas.net/electriceel/nightlies/docker bookworm InRelease
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
2 packages can be upgraded. Run 'apt list --upgradable' to see them.
W: https://apt.sys.truenas.net/electriceel/nightlies/debian/dists/bookworm/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
W: https://apt.sys.truenas.net/electriceel/nightlies/debian-security/dists/bookworm-security/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
W: https://apt.sys.truenas.net/electriceel/nightlies/debian-backports/dists/bookworm-backports/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
W: Skipping acquire of configured file 'contrib/binary-amd64/Packages' as repository 'https://apt.sys.truenas.net/electriceel/nightlies/debian-backports bookworm-backports InRelease' doesn't have the component 'contrib' (component misspelt in sources.list?)
W: Skipping acquire of configured file 'contrib/i18n/Translation-en' as repository 'https://apt.sys.truenas.net/electriceel/nightlies/debian-backports bookworm-backports InRelease' doesn't have the component 'contrib' (component misspelt in sources.list?)
W: Skipping acquire of configured file 'non-free/binary-amd64/Packages' as repository 'https://apt.sys.truenas.net/electriceel/nightlies/debian-backports bookworm-backports InRelease' doesn't have the component 'non-free' (component misspelt in sources.list?)
W: Skipping acquire of configured file 'non-free/i18n/Translation-en' as repository 'https://apt.sys.truenas.net/electriceel/nightlies/debian-backports bookworm-backports InRelease' doesn't have the component 'non-free' (component misspelt in sources.list?)
W: Skipping acquire of configured file 'non-free-firmware/binary-amd64/Packages' as repository 'https://apt.sys.truenas.net/electriceel/nightlies/debian-backports bookworm-backports InRelease' doesn't have the component 'non-free-firmware' (component misspelt in sources.list?)
W: Skipping acquire of configured file 'non-free-firmware/i18n/Translation-en' as repository 'https://apt.sys.truenas.net/electriceel/nightlies/debian-backports bookworm-backports InRelease' doesn't have the component 'non-free-firmware' (component misspelt in sources.list?)
W: https://apt.sys.truenas.net/electriceel/nightlies/debian-debug/dists/bookworm-debug/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
W: https://apt.sys.truenas.net/electriceel/nightlies/yarn/dists/stable/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
W: https://apt.sys.truenas.net/electriceel/nightlies/docker/dists/bookworm/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
+ apt install -y make open-iscsi python3-cryptography python3-pip python3-pyfakefs python3-pyotp python3-pytest python3-pytest-asyncio python3-pytest-dependency python3-pytest-rerunfailures python3-pytest-timeout snmp sshpass zstd
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
make is already the newest version (4.3-4.1).
open-iscsi is already the newest version (2.1.8-1).
python3-cryptography is already the newest version (38.0.4-3).
python3-pip is already the newest version (23.0.1+dfsg-1).
python3-pyfakefs is already the newest version (4.6.3-3).
python3-pyotp is already the newest version (2.6.0-3).
python3-pytest is already the newest version (7.2.1-2).
python3-pytest-asyncio is already the newest version (0.20.3-1).
python3-pytest-dependency is already the newest version (0.5.1-5).
python3-pytest-rerunfailures is already the newest version (10.2-2).
python3-pytest-timeout is already the newest version (2.1.0-3).
snmp is already the newest version (5.9.3+dfsg-2).
sshpass is already the newest version (1.09-1+b1).
zstd is already the newest version (1.5.4+dfsg2-5).
0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.
+ '[' 0 -gt 0 ']'
If you’re anticipating this, it’s entirely possible that TrueNAS is not the OS for you. It’s an appliance, it’s not intended that users will be messing around with the software, and iX are more and more hardening it to prevent users from doing this. I’m not saying it’s impossible to do what you’re asking, but you’ll be very much working against the design of the system.
It’s only three kernel modules, so I think it is worth it. This issue is not even about anything related to these modules, it is about why I suddenly no longer can compile them. Or anything that would require the kernel source.
Because it’s appliance software. It makes no promise that it will behave like a typical Linux distro.
I suspect that iX doesn’t test the ability to compile kernel modules (or anything else for that matter) inside TrueNAS. Bending TrueNAS to your will here will be a drudge for, as you said yourself, “only three kernel modules”.