From af66e6e6c6587f4b57fd57a7eb4647f868f50cde Mon Sep 17 00:00:00 2001 From: Colin Date: Mon, 23 Sep 2024 05:05:09 +0000 Subject: [PATCH] moby: enable nixpkgs kernel options it requires a lot of additional options before it actually boots: not sure which ones here are critical. --- hosts/modules/hal/pine64-pinephone-pro.nix | 1 + .../linux-sane-pinephonepro/default.nix | 151 +++++++++++++++++- 2 files changed, 151 insertions(+), 1 deletion(-) diff --git a/hosts/modules/hal/pine64-pinephone-pro.nix b/hosts/modules/hal/pine64-pinephone-pro.nix index e556087d6..64264718b 100644 --- a/hosts/modules/hal/pine64-pinephone-pro.nix +++ b/hosts/modules/hal/pine64-pinephone-pro.nix @@ -14,6 +14,7 @@ in # - firewall.service fails b/c extensions "LOG" and "tcp" are missing # - battery status is unknown # - cameras, sound, etc untested + # - linux-sane-pinephonepro (6.11.0; pmos config + nixpkgs config): FAILS TO BOOT # boot.kernelPackages = pkgs.linuxPackagesFor pkgs.linux-postmarketos-pinephonepro; boot.kernelPackages = pkgs.linuxPackagesFor pkgs.linux-sane-pinephonepro; diff --git a/pkgs/additional/linux-sane-pinephonepro/default.nix b/pkgs/additional/linux-sane-pinephonepro/default.nix index 1e01b5805..8e64e95fc 100644 --- a/pkgs/additional/linux-sane-pinephonepro/default.nix +++ b/pkgs/additional/linux-sane-pinephonepro/default.nix @@ -10,7 +10,7 @@ linux_latest.override { DTB = true; #< XXX: not sure if actually needed autoModules = false; - enableCommonConfig = false; + enableCommonConfig = true; #< enable nixpkgs config options kernelPatches = [ { @@ -29,6 +29,27 @@ linux_latest.override { "DRM_PANEL_SIMPLE" # pmos: =y, but option only supports m "FSCACHE" # pmos: =y, but option only supports m + # these options conflict with nixos defaults + "BINFMT_MISC" # pmos:m, nixpkgs:y + "BPF_JIT_ALWAYS_ON" # pmos:y, nixpkgs:n + "CMA_SIZE_MBYTES" # pmos:256, nixpkgs:32 + "CRYPTO_TEST" # pmos:m, nixpkgs:n + "DEFAULT_MMAP_MIN_ADDR" # pmos:4096, nixpkgs:32768 + "IP_DCCP_CCID3" # pmos:y, nixpkgs:n + "IP_NF_TARGET_REDIRECT" # pmos:y, nixpkgs:m + "IP_PNP" # pmos:y, nixpkgs:n + "MMC_BLOCK_MINORS" # pmos:256, nixpkgs:32 + "NET_DROP_MONITOR" # pmos:m, nixpkgs:y + "NLS_UTF8" # pmos:y, nixpkgs:m + "NOTIFIER_ERROR_INJECTION" # pmos:m, nixpkgs:n + "NR_CPUS" # pmos:64, nixpkgs:384 + "PREEMPT" # pmos:y, nixpkgs:n + "STANDALONE" # pmos:y, nixpkgs:n + "TRANSPARENT_HUGEPAGE_ALWAYS" # pmos:y, nixpkgs:n + "UEVENT_HELPER" # pmos:y, nixpkgs:n + "USB_SERIAL" # pmos:m, nixpkgs:y + "ZSMALLOC" # pmos:m, nixpkgs:y + # these options don't break build, but are nonsensical "BASE_FULL" "CC_VERSION_TEXT" @@ -44,5 +65,133 @@ linux_latest.override { DRM_PANEL_SIMPLE = module; }; } + { + name = "reset-nixpkgs-overrides"; + patch = null; + extraStructuredConfig = with lib.kernel; { + NR_CPUS = lib.mkForce (freeform "64"); + ACPI_FPDT = lib.mkForce no; + UNINLINE_SPIN_UNLOCK = yes; #< DOESN'T TAKE EFFECT + SLAB_BUCKETS = lib.mkForce no; + RANDOM_KMALLOC_CACHES = lib.mkForce no; + SHUFFLE_PAGE_ALLOCATOR = lib.mkForce no; + DEFAULT_MMAP_MIN_ADDR = lib.mkForce (freeform "4096"); + TRANSPARENT_HUGEPAGE_ALWAYS = lib.mkForce yes; + TRANSPARENT_HUGEPAGE_MADVISE = lib.mkForce no; + ZONE_DEVICE = lib.mkForce no; + BT_HCIUART_BCSP = lib.mkForce no; + HOTPLUG_PCI_PCIE = lib.mkForce no; + UEVENT_HELPER = lib.mkForce yes; + SYSFB_SIMPLEFB = lib.mkForce no; + LOGO = lib.mkForce yes; + LOGO_LINUX_CLUT224 = yes; + DRM_ACCEL = lib.mkForce no; + POWERCAP = lib.mkForce no; + CMA_SIZE_MBYTES = lib.mkForce (freeform "256"); + CPUMASK_OFFSTACK = no; + KFENCE = lib.mkForce no; + # SOFTLOCKUP_DETECTOR_INTR_STORM = no; + HARDLOCKUP_DETECTOR = lib.mkForce no; + + HID_BPF = lib.mkForce no; + USB_SERIAL = lib.mkForce module; + U_SERIAL_CONSOLE = lib.mkForce no; + + WATCH_QUEUE = lib.mkForce no; + SCHED_CORE = lib.mkForce no; + BPF_JIT_ALWAYS_ON = lib.mkForce yes; + PARAVIRT_TIME_ACCOUNTING = lib.mkForce no; + ARCH_HAS_GENERIC_CRASHKERNEL_RESERVATION = yes; #< does not take effect + COMPAT_ALIGNMENT_FIXUPS = lib.mkForce no; + BLK_INLINE_ENCRYPTION = lib.mkForce no; + LDM_PARTITION = lib.mkForce no; + IDLE_PAGE_TRACKING = lib.mkForce no; + PAGE_IDLE_FLAG = no; + DAMON = lib.mkForce no; + SKB_DECRYPTED = no; #< does not take effect + CFG80211_CERTIFICATION_ONUS = lib.mkForce no; + MAC80211_DEBUGFS = lib.mkForce no; + SOCK_VALIDATE_XMIT = no; #< does not take effect + FSL_MC_UAPI_SUPPORT = lib.mkForce no; + ZRAM_MULTI_COMP = lib.mkForce no; + FUSION = lib.mkForce no; + NET_FC = lib.mkForce no; + NET_VENDOR_MEDIATEK = lib.mkForce no; + HIPPI = lib.mkForce no; + ATH10K_DFS_CERTIFIED = lib.mkForce no; + BRCMFMAC_PCIE = lib.mkForce no; + WAN = lib.mkForce no; + MOUSE_ELAN_I2C_SMBUS = lib.mkForce no; + PINCTRL_AMD = lib.mkForce no; + MEDIA_PCI_SUPPORT = lib.mkForce no; + AUXDISPLAY = lib.mkForce no; + DRM_DISPLAY_DP_AUX_CEC = lib.mkForce no; + DRM_DISPLAY_DP_AUX_CHARDEV = lib.mkForce no; + DRM_NOUVEAU_GSP_DEFAULT = lib.mkForce no; + DRM_VC4_HDMI_CEC = lib.mkForce no; + MMC_BLOCK_MINORS = lib.mkForce (freeform "256"); + ACCESSIBILITY = lib.mkForce no; + VIRTIO_MMIO_CMDLINE_DEVICES = lib.mkForce no; + DEBUG_INFO = no; + SCHED_DEBUG = lib.mkForce no; + FUNCTION_PROFILER = lib.mkForce no; + SCHED_TRACER = lib.mkForce no; + DEBUG_INFO_NONE = yes; + EFI_ZBOOT = lib.mkForce no; + + NO_HZ_IDLE = yes; + NO_HZ_FULL = lib.mkForce no; + CONTEXT_TRACKING_USER = no; + PREEMPTION = yes; + PREEMPT = lib.mkForce yes; + PREEMPT_BUILD = yes; + PREEMPT_COUNT = yes; + PREEMPT_RCU = yes; + PREEMPT_VOLUNTARY_BUILD = no; + TICK_CPU_ACCOUNTING = yes; + VIRT_CPU_ACCOUNTING = no; + TASKS_RCU = yes; + PRINTK_INDEX = lib.mkForce no; + CRASH_RESERVE = yes; + CRASH_DUMP = lib.mkForce yes; + + TLS = lib.mkForce no; + XFRM_ESPINTCP = no; + XDP_SOCKETS_DIAG = lib.mkForce no; + + IP_PNP = lib.mkForce yes; + IP_PNP_DHCP = yes; + IP_PNP_BOOTP = yes; + + IP_DCCP_CCID3 = lib.mkForce yes; + IP_DCCP_TFRC_LIB = yes; + + STANDALONE = lib.mkForce yes; + RTW88 = lib.mkForce no; + MOUSE_PS2_ELANTECH = lib.mkForce no; + MEDIA_CEC_RC = lib.mkForce no; + INFINIBAND = lib.mkForce no; + CHROMEOS_TBMC = lib.mkForce no; + IO_STRICT_DEVMEM = no; + + CRYPTO_TEST = lib.mkForce module; + RUNTIME_TESTING_MENU = lib.mkForce yes; + + # upgrade `m` -> `y` + INPUT_MATRIXKMAP = lib.mkForce yes; + I2C_CROS_EC_TUNNEL = yes; + CHARGER_CROS_PCHG = yes; + CHARGER_CROS_CONTROL = yes; + SENSORS_CROS_EC = yes; + MFD_CROS_EC_DEV = yes; + REGULATOR_CROS_EC = yes; + RTC_DRV_CROS_EC = yes; + CROS_EC = lib.mkForce yes; + CROS_EC_I2C = lib.mkForce yes; + CROS_EC_SPI = lib.mkForce yes; + EXTCON_USBC_CROS_EC = yes; + PROC_VMCORE = yes; #< does not take effect ?? + }; + } ]; }