ZSMALLOC is now the default allocator for ZSWAP, so if the allocator
isn't changed, ZSMALLOC must be y on 6.7 (and will default to that).
The script will set all options that can be modules to m anyway, so
there was no need for us to be explicitly setting it to module before
anyway.
These options were already enabled in previous versions, but Kconfig
changes in 6.6 made NixOS kernel disable them. Therefore, we enable
unconditionally, to be explicit that they're needed.
Without them, the fbcon/console on systems with DRM devices freeze/blank
on early boot, even though the system boots normally.
under armv7l, config.gz already had CONFIG_ALIGNMENT_TRAP=y, but
explicitly enable it and provide some context for the option.
under aarch64, on kernels that are new enough to support it, specify
CONFIG_COMPAT_ALIGNMENT_FIXUPS=y to attempt to resolve alignment
faults identically to how they are handled under 32-bit kernels. This
minimizes the potential for aarch32 userspace to behave differently
under an aarch64 kernel.
This already gets set to yes by the x86 defconfig, but is not set to
true on aarch64, which means you can't program IPv4 routes with multiple
nexthops there. Set this to y unconditionally, so we don't have this odd
mismatch between x86_64 and aarch64.
`VIDEO_STK1160_COMMON` was removed in
7f7ac101236bd020681f122089b611eca8e507ac ("media: stk1160: Simplify the build config definition").
This is now guarded for newer kernels.
This enables shady options because upstream and Atheros probably didn't fix the issue
and their idea of "certification" is quite extreme.
We follow OpenWRT here and apply those changes to reduce "WTFs/min" for users
wondering what is the difference between OpenWRT and NixOS for their APs.
This was tested on Qualcomm Atheros QCA986x/988x 802.11ac Wireless Network Adapter on a x86 machine
in the French regulatory domain on frequency 5600MHz, DFS was used successfully by hostapd
instead of a mind-boggling "device or resource busy" error which is what happens without those options.
ZBUD depends on ZPOOL. If we get asked about ZPOOL first, by default
it would be set to m, and it would then not be possible to set ZBUD=y.
This fixes, for example, building Linux 5.15 for microblazeel-linux.
Zram needs CONFIG_ZRAM_WRITEBACK in order for writeback configuration
to work. Since there is even a NixOS option (zramSwap.writebackDevice)
for configuring writeback, it should be enabled.
Support for IR remotes was originally introduced in NixOS in 2013 with
[1]. This worked fine until 2018 with the release of Linux 4.16 which
contained [2], which removed the default-enable on the IR decoders.
This means that kernels since then build with RC_DEVICES enabled, but
RC_DECODERS disabled:
```
CONFIG_RC_DEVICES=y
```
This breaks IR remote support and also leads to the following error on
every bootup when such a device is present as devices have a default
keymap which uses a protocols decoder, but these decoders are not
available:
```
rc_core: Loaded IR protocol module ir-rc6-decoder, but protocol rc-6 still not available
```
Fix this by also enabling RC_DECODERS in the kernel configuration.
[1] b7ccfc258a
[2] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=22756ae7319b0afc2a80fbdec365a6976a1ad350
These are required to debug kernel modules. Since we're now able to
do that, there's another reason besides BTF to enable DEBUG_INFO, so
I've done that for pre-BTF kernel modules as well here.
For GDB to get configured correctly, vmlinux-gdb.py has to be two
directories up from scripts/gdb, and vmlinux has to be next to
vmlinux-gdb.py. The least invasive way to satisfy these constraints
is to make vmlinux a symlink, which GDB will resolve before looking
for vmlinux-gdb.py.
Tested both ways of getting the scripts into GDB that I know of:
gdb /nix/store/7n77ijlxkxr6d613h02lr707kvjx6j1k-linux-6.1.19-dev/vmlinux \
-iex 'add-auto-load-safe-path /nix/store/7n77ijlxkxr6d613h02lr707kvjx6j1k-linux-6.1.19-dev/lib/modules/6.1.19/build/vmlinux-gdb.py' \
-ex 'lx-version' \
-ex 'q'
gdb /nix/store/7n77ijlxkxr6d613h02lr707kvjx6j1k-linux-6.1.19-dev/vmlinux \
-ex 'source /nix/store/7n77ijlxkxr6d613h02lr707kvjx6j1k-linux-6.1.19-dev/lib/modules/6.1.19/build/vmlinux-gdb.py' \
-ex 'lx-version' \
-ex 'q'
Also tested that the strip changes don't result in meaningful output
size changes (there's some small variation due to BTF data not always
coming out the same size, which is unrelated), and built every kernel
I can on x86_64 to make sure I'm not relying on build system behaviour
specific to newer kernels.