moby: kernel: enable full config
camera works so long as i blacklist some new modules
This commit is contained in:
@@ -17,6 +17,15 @@ in
|
|||||||
# the filtering/calibration is bad that it causes the screen to go fully dark at times.
|
# the filtering/calibration is bad that it causes the screen to go fully dark at times.
|
||||||
# boot.blacklistedKernelModules = [ "stk3310" ];
|
# boot.blacklistedKernelModules = [ "stk3310" ];
|
||||||
|
|
||||||
|
boot.blacklistedKernelModules = [
|
||||||
|
# XXX: un-blacklisting these modules MAY break the camera (i didn't narrow down the exact set)
|
||||||
|
"gc2145_mipi"
|
||||||
|
"leds_group_multicolor"
|
||||||
|
"pinctrl_axp209"
|
||||||
|
# "led_class_multicolor"
|
||||||
|
# "v4l2_cci"
|
||||||
|
];
|
||||||
|
|
||||||
boot.extraModprobeConfig = ''
|
boot.extraModprobeConfig = ''
|
||||||
# 2024-09-01: disable power-saving if using the rtw88 rtl8723cs WiFi driver
|
# 2024-09-01: disable power-saving if using the rtw88 rtl8723cs WiFi driver
|
||||||
# power saving was observed to cause frequent disconnections and reconnections
|
# power saving was observed to cause frequent disconnections and reconnections
|
||||||
|
@@ -41,7 +41,7 @@ in
|
|||||||
boot.kernelPackages = pkgs.linuxPackagesFor (pkgs.linux-armbian.override {
|
boot.kernelPackages = pkgs.linuxPackagesFor (pkgs.linux-armbian.override {
|
||||||
usePmosConfig = true;
|
usePmosConfig = true;
|
||||||
withNixpkgsConfig = true;
|
withNixpkgsConfig = true;
|
||||||
withFullConfig = false;
|
withFullConfig = true;
|
||||||
withModemPower = true;
|
withModemPower = true;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@@ -9,7 +9,7 @@
|
|||||||
sane-kernel-tools,
|
sane-kernel-tools,
|
||||||
usePmosConfig ? true,
|
usePmosConfig ? true,
|
||||||
withNixpkgsConfig ? true,
|
withNixpkgsConfig ? true,
|
||||||
withFullConfig ? false,
|
withFullConfig ? true,
|
||||||
withModemPower ? true,
|
withModemPower ? true,
|
||||||
#VVV nixpkgs calls `.override` on the kernel to configure additional things, but we don't care about those things
|
#VVV nixpkgs calls `.override` on the kernel to configure additional things, but we don't care about those things
|
||||||
...
|
...
|
||||||
@@ -26,7 +26,7 @@ linux_latest.override {
|
|||||||
|
|
||||||
DTB = true; #< XXX: not sure if actually needed
|
DTB = true; #< XXX: not sure if actually needed
|
||||||
autoModules = withFullConfig;
|
autoModules = withFullConfig;
|
||||||
preferBuiltin = withFullConfig;
|
preferBuiltin = true;
|
||||||
|
|
||||||
enableCommonConfig = withNixpkgsConfig;
|
enableCommonConfig = withNixpkgsConfig;
|
||||||
|
|
||||||
@@ -271,7 +271,7 @@ linux_latest.override {
|
|||||||
# # byName."Defconfigs-for-all-my-devices"
|
# # byName."Defconfigs-for-all-my-devices"
|
||||||
# # byName."Update-defconfigs"
|
# # byName."Update-defconfigs"
|
||||||
# ] ++
|
# ] ++
|
||||||
lib.optionals withNixpkgsConfig [
|
lib.optionals withFullConfig [
|
||||||
{
|
{
|
||||||
name = "fix-compilation-specific-to-megi";
|
name = "fix-compilation-specific-to-megi";
|
||||||
patch = null;
|
patch = null;
|
||||||
@@ -285,6 +285,8 @@ linux_latest.override {
|
|||||||
# make[3]: *** [../scripts/Makefile.build:289: drivers/video/fbdev/sun5i-eink-neon.o] Error 1
|
# make[3]: *** [../scripts/Makefile.build:289: drivers/video/fbdev/sun5i-eink-neon.o] Error 1
|
||||||
FB_SUN5I_EINK = no;
|
FB_SUN5I_EINK = no;
|
||||||
BES2600 = no; # fails to compile (implicit declaration of function 'ieee80211_tx_status'; did you mean 'ieee80211_tx_status_ni')
|
BES2600 = no; # fails to compile (implicit declaration of function 'ieee80211_tx_status'; did you mean 'ieee80211_tx_status_ni')
|
||||||
|
|
||||||
|
# SUN8I_DE2_CCU = lib.mkForce module; #< want:y, got:M
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
# {
|
# {
|
||||||
@@ -304,88 +306,88 @@ linux_latest.override {
|
|||||||
# DRM = lib.mkForce module;
|
# DRM = lib.mkForce module;
|
||||||
# };
|
# };
|
||||||
# }
|
# }
|
||||||
{
|
# {
|
||||||
name = "enable-rtw88-wifi-drivers";
|
# name = "enable-rtw88-wifi-drivers";
|
||||||
patch = null;
|
# patch = null;
|
||||||
extraStructuredConfig = with lib.kernel; {
|
# extraStructuredConfig = with lib.kernel; {
|
||||||
# default nixpkgs/pmos config enables RTW88, but not RTW88_8723CS.
|
# # default nixpkgs/pmos config enables RTW88, but not RTW88_8723CS.
|
||||||
# but the pinephone uses a 8723BS/8723CS chipset, so enable these
|
# # but the pinephone uses a 8723BS/8723CS chipset, so enable these
|
||||||
# and anything else that could possibly be needed, since these things are tangled.
|
# # and anything else that could possibly be needed, since these things are tangled.
|
||||||
# TODO: reduce this, this is surely more than i actually need
|
# # TODO: reduce this, this is surely more than i actually need
|
||||||
# RTL8187_LEDS=y
|
# # RTL8187_LEDS=y
|
||||||
# RTLWIFI_DEBUG=y
|
# # RTLWIFI_DEBUG=y
|
||||||
RTL8180 = module;
|
# # RTL8180 = module;
|
||||||
RTL8187 = module;
|
# # RTL8187 = module;
|
||||||
RTL8188EE = module;
|
# # RTL8188EE = module;
|
||||||
RTL8192CE = module;
|
# # RTL8192CE = module;
|
||||||
RTL8192CU = module;
|
# # RTL8192CU = module;
|
||||||
RTL8192C_COMMON = module;
|
# # RTL8192C_COMMON = module;
|
||||||
RTL8192DE = module;
|
# # RTL8192DE = module;
|
||||||
RTL8192D_COMMON = module;
|
# # RTL8192D_COMMON = module;
|
||||||
RTL8192EE = module;
|
# # RTL8192EE = module;
|
||||||
RTL8192SE = module;
|
# # RTL8192SE = module;
|
||||||
RTL8723AE = module;
|
# # RTL8723AE = module;
|
||||||
RTL8723BE = module;
|
# # RTL8723BE = module;
|
||||||
RTL8723_COMMON = module;
|
# # RTL8723_COMMON = module;
|
||||||
RTL8821AE = module;
|
# # RTL8821AE = module;
|
||||||
RTL8XXXU = module;
|
# # RTL8XXXU = module;
|
||||||
RTLBTCOEXIST = module;
|
# # RTLBTCOEXIST = module;
|
||||||
RTLWIFI = module;
|
# # RTLWIFI = module;
|
||||||
RTLWIFI_PCI = module;
|
# # RTLWIFI_PCI = module;
|
||||||
RTLWIFI_USB = module;
|
# # RTLWIFI_USB = module;
|
||||||
RTW88_8703B = module;
|
# RTW88_8703B = module;
|
||||||
RTW88_8723CS = module;
|
# RTW88_8723CS = module;
|
||||||
RTW88_8723D = module;
|
# RTW88_8723D = module;
|
||||||
RTW88_8723DE = module;
|
# RTW88_8723DE = module;
|
||||||
RTW88_8723DS = module;
|
# RTW88_8723DS = module;
|
||||||
RTW88_8723DU = module;
|
# RTW88_8723DU = module;
|
||||||
RTW88_8723X = module;
|
# RTW88_8723X = module;
|
||||||
RTW88_8821C = module;
|
# RTW88_8821C = module;
|
||||||
RTW88_8821CE = module;
|
# RTW88_8821CE = module;
|
||||||
RTW88_8821CS = module;
|
# RTW88_8821CS = module;
|
||||||
RTW88_8821CU = module;
|
# RTW88_8821CU = module;
|
||||||
RTW88_8822BS = module;
|
# RTW88_8822BS = module;
|
||||||
RTW88_8822BU = module;
|
# RTW88_8822BU = module;
|
||||||
RTW88_8822CS = module;
|
# RTW88_8822CS = module;
|
||||||
RTW88_8822CU = module;
|
# RTW88_8822CU = module;
|
||||||
RTW88_SDIO = module;
|
# RTW88_SDIO = module;
|
||||||
RTW88_USB = module;
|
# RTW88_USB = module;
|
||||||
};
|
# };
|
||||||
}
|
# }
|
||||||
{
|
# {
|
||||||
# this could be enabled for *all* systems, but i'm not sure i really want that.
|
# # this could be enabled for *all* systems, but i'm not sure i really want that.
|
||||||
name = "quality-of-life";
|
# name = "quality-of-life";
|
||||||
patch = null;
|
# patch = null;
|
||||||
extraStructuredConfig = with lib.kernel; {
|
# extraStructuredConfig = with lib.kernel; {
|
||||||
# optimize for faster builds.
|
# # optimize for faster builds.
|
||||||
# see <repo:kernel.org/linux:Documentation/admin-guide/quickly-build-trimmed-linux.rst>
|
# # see <repo:kernel.org/linux:Documentation/admin-guide/quickly-build-trimmed-linux.rst>
|
||||||
# note that several options can re-enable DEBUG_KERNEL (such as DEBUG_LIST)
|
# # note that several options can re-enable DEBUG_KERNEL (such as DEBUG_LIST)
|
||||||
# DEBUG_KERNEL = lib.mkForce no; # option group which seems to just gate the other DEBUG_ opts?
|
# # DEBUG_KERNEL = lib.mkForce no; # option group which seems to just gate the other DEBUG_ opts?
|
||||||
DEBUG_INFO = lib.mkForce no; # for gdb debugging (does it impact kernel stacktraces, too?)
|
# DEBUG_INFO = lib.mkForce no; # for gdb debugging (does it impact kernel stacktraces, too?)
|
||||||
# DEBUG_INFO_NONE = lib.mkForce no;
|
# # DEBUG_INFO_NONE = lib.mkForce no;
|
||||||
DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT = lib.mkForce no;
|
# DEBUG_INFO_DWARF_TOOLCHAIN_DEFAULT = lib.mkForce no;
|
||||||
# DEBUG_LIST = lib.mkForce no;
|
# # DEBUG_LIST = lib.mkForce no;
|
||||||
# DEBUG_MISC = lib.mkForce no;
|
# # DEBUG_MISC = lib.mkForce no;
|
||||||
# DEBUG_FS = no;
|
# # DEBUG_FS = no;
|
||||||
|
|
||||||
DEBUG_INFO_BTF = lib.mkForce no; # BPF debug symbols. rec by <https://nixos.wiki/wiki/Linux_kernel#Too_high_ram_usage>
|
# DEBUG_INFO_BTF = lib.mkForce no; # BPF debug symbols. rec by <https://nixos.wiki/wiki/Linux_kernel#Too_high_ram_usage>
|
||||||
# SCHED_DEBUG = lib.mkForce no; # determines /sys/kernel/debug/sched
|
# # SCHED_DEBUG = lib.mkForce no; # determines /sys/kernel/debug/sched
|
||||||
SUNRPC_DEBUG = lib.mkForce no;
|
# SUNRPC_DEBUG = lib.mkForce no;
|
||||||
# shave 500ms off Pinephone boot time (dmesg | grep raid6)
|
# # shave 500ms off Pinephone boot time (dmesg | grep raid6)
|
||||||
# - by default raid6 (on behalf of btrfs) will compute the fastest algorithms at boot.
|
# # - by default raid6 (on behalf of btrfs) will compute the fastest algorithms at boot.
|
||||||
# - AFAICT, this only comes into effect if using raid (i don't).
|
# # - AFAICT, this only comes into effect if using raid (i don't).
|
||||||
# - in any case, on moby, the fastest benchmark happens to be the default anyway.
|
# # - in any case, on moby, the fastest benchmark happens to be the default anyway.
|
||||||
# - on lappy/servo/desko, the default is about 3% slower than the fastest. but they compute this in < 100ms.
|
# # - on lappy/servo/desko, the default is about 3% slower than the fastest. but they compute this in < 100ms.
|
||||||
RAID6_PQ_BENCHMARK = no;
|
# RAID6_PQ_BENCHMARK = lib.mkForce no;
|
||||||
};
|
# };
|
||||||
}
|
# }
|
||||||
] ++ lib.optionals withModemPower [
|
] ++ lib.optionals withModemPower [
|
||||||
{
|
{
|
||||||
name = "enable-megi-modem-power";
|
name = "enable-megi-modem-power";
|
||||||
patch = null;
|
patch = null;
|
||||||
extraStructuredConfig = with lib.kernel; {
|
extraStructuredConfig = with lib.kernel; {
|
||||||
# enable /sys/class/modem-power, a thing specific to Megi's kernel/patches
|
# enable /sys/class/modem-power, a thing specific to Megi's kernel/patches
|
||||||
MODEM_POWER = yes;
|
MODEM_POWER = module;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
# ] ++ lib.optionals withNixpkgsConfig [
|
# ] ++ lib.optionals withNixpkgsConfig [
|
||||||
@@ -402,7 +404,7 @@ linux_latest.override {
|
|||||||
(sane-kernel-tools.parseDefconfigStructuredNonempty linux-postmarketos-allwinner.defconfigStr)
|
(sane-kernel-tools.parseDefconfigStructuredNonempty linux-postmarketos-allwinner.defconfigStr)
|
||||||
([
|
([
|
||||||
# remove attrs which nixpkgs wants to set for itself, only because the kernel config options are so fucked that i can't figure out how to override things without breaking eval
|
# remove attrs which nixpkgs wants to set for itself, only because the kernel config options are so fucked that i can't figure out how to override things without breaking eval
|
||||||
"RAID6_PQ_BENCHMARK"
|
# "RAID6_PQ_BENCHMARK"
|
||||||
|
|
||||||
# these options have changed since the version which pmos ships? or pmos just ships invalid values
|
# these options have changed since the version which pmos ships? or pmos just ships invalid values
|
||||||
# "repeated questions"
|
# "repeated questions"
|
||||||
@@ -432,12 +434,14 @@ linux_latest.override {
|
|||||||
"NLS_ISO8859_1" #< nixpkgs:m, pmos:y
|
"NLS_ISO8859_1" #< nixpkgs:m, pmos:y
|
||||||
"NR_CPUS"
|
"NR_CPUS"
|
||||||
|
|
||||||
# "PREEMPT" #< nixpkgs:(n), pmos:y
|
"CMA_SIZE_MBYTES"
|
||||||
# "STANDALONE"
|
"DEFAULT_MMAP_MIN_ADDR"
|
||||||
# "TRANSPARENT_HUGEPAGE_ALWAYS"
|
"PREEMPT"
|
||||||
# "UEVENT_HELPER"
|
"STANDALONE"
|
||||||
# "USB_SERIAL"
|
"TRANSPARENT_HUGEPAGE_ALWAYS"
|
||||||
# "ZSMALLOC"
|
"UEVENT_HELPER"
|
||||||
|
"USB_SERIAL"
|
||||||
|
"ZSMALLOC"
|
||||||
|
|
||||||
# "DRM_LIMA"
|
# "DRM_LIMA"
|
||||||
# "DRM_PANFROST"
|
# "DRM_PANFROST"
|
||||||
@@ -448,14 +452,19 @@ linux_latest.override {
|
|||||||
"CC_VERSION_TEXT"
|
"CC_VERSION_TEXT"
|
||||||
"GCC_VERSION"
|
"GCC_VERSION"
|
||||||
] ++ lib.optionals (withNixpkgsConfig && withFullConfig) [
|
] ++ lib.optionals (withNixpkgsConfig && withFullConfig) [
|
||||||
"BLK_DEV_DM" #< want:y, actual:m
|
# "STMMAC_ETH" #< autoModules:m, pmos:y
|
||||||
"VFIO" #< want:y, actual:m
|
# "STMMAC_PLATFORM" #< autoModules:m, pmos:y
|
||||||
|
# "DWMAC_GENERIC" #< autoModules:m, pmos:y
|
||||||
|
# "DWMAC_SUNXI" #< autoModules:m, pmos:y
|
||||||
|
# "DWMAC_SUN8I" #< autoModules:m, pmos:y
|
||||||
|
"BLK_DEV_DM" #< autoModules:m, pmos:y
|
||||||
|
"VFIO" #< autoModules:m, pmos:y
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
] ++ lib.optionals (withNixpkgsConfig || !usePmosConfig) [
|
] ++ lib.optionals (!usePmosConfig) [
|
||||||
{
|
{
|
||||||
name = "enable options for libcamera";
|
name = "enable options for Pinephone";
|
||||||
patch = null;
|
patch = null;
|
||||||
extraStructuredConfig = with lib.kernel; {
|
extraStructuredConfig = with lib.kernel; {
|
||||||
# borrowed from postmarketOS, "to enable libcamera development"
|
# borrowed from postmarketOS, "to enable libcamera development"
|
||||||
@@ -468,32 +477,35 @@ linux_latest.override {
|
|||||||
# - pinephone in mainline linux, postmarketOS, defaults to 7
|
# - pinephone in mainline linux, postmarketOS, defaults to 7
|
||||||
# - nixos defaults to ... 19?
|
# - nixos defaults to ... 19?
|
||||||
CMA_AREAS = freeform "7";
|
CMA_AREAS = freeform "7";
|
||||||
DRM_ACCEL = lib.mkForce no;
|
# DRM_ACCEL = lib.mkForce no;
|
||||||
|
|
||||||
CMA_SIZE_MBYTES = lib.mkForce (freeform "256"); #< also available at boot time via `cma=256M` CLI
|
# CMA_SIZE_MBYTES = lib.mkForce (freeform "256"); #< also available at boot time via `cma=256M` CLI
|
||||||
|
|
||||||
# #vvv aside from SUN50I_IOMMU, this is just upgrading modules to `y`
|
# #vvv aside from SUN50I_IOMMU, this is just upgrading modules to `y`
|
||||||
# DMA_SUN6I = yes;
|
# DMA_SUN6I = yes;
|
||||||
# SUN50I_IOMMU = yes;
|
SUN50I_IOMMU = yes;
|
||||||
# VIDEOBUF2_CORE = yes;
|
# VIDEOBUF2_CORE = yes;
|
||||||
# VIDEOBUF2_V4L2 = yes;
|
# VIDEOBUF2_V4L2 = yes;
|
||||||
# VIDEOBUF2_MEMOPS = yes;
|
# VIDEOBUF2_MEMOPS = yes;
|
||||||
# VIDEOBUF2_DMA_CONTIG = yes;
|
# VIDEOBUF2_DMA_CONTIG = yes;
|
||||||
|
|
||||||
# VIDEO_SUNXI = yes;
|
VIDEO_SUNXI = yes;
|
||||||
# # VIDEO_SUNXI_CEDRUS = yes; #< implied (i think)
|
VIDEO_SUNXI_CEDRUS = yes;
|
||||||
|
# # VIDEO_SUNXI_CEDRUS = module; #< implied by VIDEO_SUNXI
|
||||||
# #^^^ this isn't enough to get camera working
|
# #^^^ this isn't enough to get camera working
|
||||||
|
|
||||||
# DRM = lib.mkForce yes; #< upgrade from module to builtin
|
MFD_SUN6I_PRCM = yes;
|
||||||
DEFAULT_MMAP_MIN_ADDR = lib.mkForce (freeform "4096");
|
|
||||||
STANDALONE = lib.mkForce no;
|
# # DRM = lib.mkForce yes; #< upgrade from module to builtin
|
||||||
PREEMPT = lib.mkForce yes;
|
# DEFAULT_MMAP_MIN_ADDR = lib.mkForce (freeform "4096");
|
||||||
TRANSPARENT_HUGEPAGE_ALWAYS = lib.mkForce yes;
|
# STANDALONE = lib.mkForce no;
|
||||||
ZSMALLOC = lib.mkForce no;
|
# PREEMPT = lib.mkForce yes;
|
||||||
UEVENT_HELPER = lib.mkForce yes;
|
# TRANSPARENT_HUGEPAGE_ALWAYS = lib.mkForce yes;
|
||||||
USB_SERIAL = lib.mkForce module;
|
# ZSMALLOC = lib.mkForce no;
|
||||||
ZSWAP = lib.mkForce no;
|
# UEVENT_HELPER = lib.mkForce yes;
|
||||||
# ZPOOL = lib.mkForce no;
|
# USB_SERIAL = lib.mkForce module;
|
||||||
|
# ZSWAP = lib.mkForce no;
|
||||||
|
# # ZPOOL = lib.mkForce no;
|
||||||
|
|
||||||
# see: <https://gitlab.com/postmarketOS/pmaports/-/merge_requests/5541/>
|
# see: <https://gitlab.com/postmarketOS/pmaports/-/merge_requests/5541/>
|
||||||
# UDMABUF = yes; #< not needed (nixos default)
|
# UDMABUF = yes; #< not needed (nixos default)
|
||||||
|
Reference in New Issue
Block a user