From 03dab630421cd0692df951e0254629da0db9625e Mon Sep 17 00:00:00 2001 From: Colin Date: Wed, 22 May 2024 22:35:04 +0000 Subject: [PATCH] moby: ship a bunch of kernel modules in the initrd: this allows the postmarketos kernel to boot to graphics! --- hosts/by-name/moby/kernel.nix | 237 ++++++++++++++++++++++++++++++++++ 1 file changed, 237 insertions(+) diff --git a/hosts/by-name/moby/kernel.nix b/hosts/by-name/moby/kernel.nix index c1e9bb5a..360e6879 100644 --- a/hosts/by-name/moby/kernel.nix +++ b/hosts/by-name/moby/kernel.nix @@ -45,6 +45,12 @@ in # - linux-postmarketos: boots to ssh, no graphics # boot.kernelPackages = pkgs.linuxPackagesFor pkgs.linux-postmarketos; boot.kernelPackages = pkgs.linuxPackagesFor pkgs.linux-megous; + # boot.kernelPackages = pkgs.linuxPackagesFor (pkgs.linux-megous.override { + # withMegiPinephoneConfig = true; #< TODO: untested! + # }); + # boot.kernelPackages = pkgs.linuxPackagesFor (pkgs.linux-megous.override { + # withFullConfig = false; #< TODO: untested! + # }); # boot.kernelPackages = pkgs.linuxPackagesFor pkgs.linux-manjaro; # boot.kernelPackages = pkgs.linuxPackagesFor pkgs.linux_latest; @@ -67,6 +73,237 @@ in # target = "zImage"; # <-- confuses other parts of nixos :-( }; + # boot.initrd.kernelModules = [ + # "drm" #< force drm to be plugged + # ]; + boot.initrd.availableKernelModules = [ + # these aren't (likely) all needed, however without at least the display-related modules then display initialization is unpredictable. + # without this, linux-megous with autoModules and preferBuiltin initializes the display fine, but linux-postmarketos fails. + # either way, providing display modules in initrd allows the display to be initialized much earlier in boot (like 20s earlier). + # megous/nixpkgs modules: + # - `lsmod | sort | cut -d ' ' -f 1` + #"8723cs" + "anx7688" + "axp20x_adc" + "axp20x_battery" + "axp20x_pek" + "axp20x_usb_power" + "backlight" + "blake2b_generic" + # "bluetooth" + # "bridge" + # "btbcm" + # "btqca" + # "btrfs" + # "btrtl" + # "cec" + # "cfg80211" + # "chacha_neon" + # "crc_ccitt" + # "crct10dif_ce" + # "crypto_engine" + # "display_connector" #< NOT FOUND in pmos + "drm" + "drm_display_helper" + "drm_dma_helper" + "drm_kms_helper" + "drm_shmem_helper" + "dw_hdmi" + # "dw_hdmi_cec" #< NOT FOUND in pmos + "dw_hdmi_i2s_audio" + # "ecc" + # "ecdh_generic" + "fuse" + "gc2145" + "goodix_ts" + "gpio_vibra" + "gpu_sched" + "hci_uart" + "i2c_gpio" + "inv_mpu6050" + "inv_mpu6050_i2c" + "inv_sensors_timestamp" + # "ip6t_rpfilter" + # "ip6_udp_tunnel" + # "ip_set" + # "ip_set_hash_ipport" + # "ip_tables" + # "ipt_rpfilter" + # "joydev" + "led_class_flash" + "leds_sgm3140" + "ledtrig_pattern" + # "libarc4" + # "libchacha" + # "libchacha20poly1305" + # "libcrc32c" + # "libcurve25519_generic" + "lima" + # "llc" + # "mac80211" + # "macvlan" + "mc" + # "modem_power" + # "mousedev" + # "nf_conntrack" + # "nf_defrag_ipv4" + # "nf_defrag_ipv6" + # "nf_log_syslog" + # "nf_nat" + # "nfnetlink" + # "nf_tables" + # "nft_chain_nat" + # "nft_compat" + # "nls_cp437" + # "nls_iso8859_1" + # "nvmem_reboot_mode" + "ov5640" + "panel_sitronix_st7703" + "phy_sun6i_mipi_dphy" + # "pinctrl_axp209" #< NOT FOUND in pmos + "pinephone_keyboard" + # "poly1305_neon" + # "polyval_ce" + # "polyval_generic" + "ppkb_manager" + "pwm_bl" + "pwm_sun4i" + # "qrtr" + # "raid6_pq" + # "rfkill" + # "rtw88_8703b" + # "rtw88_8723cs" + # "rtw88_8723x" + # "rtw88_core" + # "rtw88_sdio" + # "sch_fq_codel" + # "sm4" + "snd_soc_bt_sco" + "snd_soc_ec25" + "snd_soc_hdmi_codec" + "snd_soc_simple_amplifier" + "snd_soc_simple_card" + "snd_soc_simple_card_utils" + "stk3310" + "st_magn" + "st_magn_i2c" + # "st_magn_spi" #< NOT FOUND in pmos + # "stp" + "st_sensors" + "st_sensors_i2c" + # "st_sensors_spi" #< NOT FOUND in pmos + "sun4i_drm" + "sun4i_i2s" + "sun4i_lradc_keys" + "sun4i_tcon" + "sun50i_codec_analog" + "sun6i_csi" + "sun6i_dma" + "sun6i_mipi_dsi" + "sun8i_a33_mbus" + "sun8i_adda_pr_regmap" + # "sun8i_ce" #< NOT FOUND in pmos + "sun8i_codec" + "sun8i_di" + "sun8i_drm_hdmi" + "sun8i_mixer" + "sun8i_rotate" + "sun8i_tcon_top" + "sun9i_hdmi_audio" + # "sunxi_wdt" #< NOT FOUND in pmos + # "tap" + # "typec" #< NOT FOUND in pmos + # "udp_tunnel" + # "uio" #< NOT FOUND in pmos + # "uio_pdrv_genirq" + "v4l2_async" + # "v4l2_cci" #< NOT FOUND in pmos + "v4l2_flash_led_class" + "v4l2_fwnode" + "v4l2_mem2mem" + "videobuf2_common" + "videobuf2_dma_contig" + "videobuf2_memops" + "videobuf2_v4l2" + "videodev" + # "wireguard" + # "xor" + # "x_tables" + # "xt_conntrack" + # "xt_LOG" + # "xt_nat" + # "xt_pkttype" + # "xt_set" + # "xt_tcpudp" + # "zram" + + # # postmarketOS modules + # # - `lsmod | sort | cut -d ' ' -f 1` + # # "8723cs" + # "anx7688" + # # "bluetooth" + # # "bnep" + # # "bridge" + # "btbcm" + # "btrfs" + # "btrtl" + # # "ecc" + # # "ecdh_generic" + # "gc2145" + # "gpio_vibra" + # "hci_uart" + # "i2c_algo_bit" + # "i2c_gpio" + # "industrialio_triggered_buffer" + # "inv_mpu6050" + # "inv_mpu6050_i2c" + # "inv_sensors_timestamp" + # # "ip6_udp_tunnel" + # "kfifo_buf" + # # "libchacha20poly1305" + # # "libcurve25519_generic" + # "llc" + # # "macvlan" + # # "nf_tables" + # # "nft_chain_nat" + # # "nft_compat" + # "ov5640" + # "pinephone_keyboard" + # "ppkb_manager" + # "raid6_pq" + # "snd" + # "snd_pcm" + # "snd_pcm_dmaengine" + # "snd_soc_bt_sco" + # "snd_soc_core" + # "snd_soc_ec25" + # "snd_soc_simple_amplifier" + # "snd_soc_simple_card" + # "snd_soc_simple_card_utils" + # "snd_timer" + # "soundcore" + # "stk3310" + # "st_magn" + # "st_magn_i2c" + # # "stp" + # "st_sensors" + # "st_sensors_i2c" + # "sun4i_i2s" + # "sun4i_lradc_keys" + # "sun50i_codec_analog" + # "sun8i_a33_mbus" + # "sun8i_adda_pr_regmap" + # "sun8i_codec" + # "sun9i_hdmi_audio" + # # "udp_tunnel" + # # "wireguard" + # # "xor" + # # "zram" + # # "zsmalloc" + # # "zstd" + # # "zstd_compress" + ]; + # disable proximity sensor. # the filtering/calibration is bad that it causes the screen to go fully dark at times. # boot.blacklistedKernelModules = [ "stk3310" ];