moby: ship a mainline kernel for the pinephone pro
not perfect, but it does boot
This commit is contained in:
@@ -8,7 +8,15 @@ in
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
boot.kernelPackages = pkgs.linuxPackagesFor pkgs.linux-postmarketos-pinephonepro;
|
||||
# kernel compat (2024/09/22):
|
||||
# - linux-postmarketos-pinephonepro (6.6.0): boots to graphics; WiFi; Ethernet
|
||||
# - linux-sane-pinephonepro (6.11.0; pmos config ONLY): boots to graphics; Wifi; no ethernet
|
||||
# - firewall.service fails b/c extensions "LOG" and "tcp" are missing
|
||||
# - battery status is unknown
|
||||
# - cameras, sound, etc untested
|
||||
# boot.kernelPackages = pkgs.linuxPackagesFor pkgs.linux-postmarketos-pinephonepro;
|
||||
boot.kernelPackages = pkgs.linuxPackagesFor pkgs.linux-sane-pinephonepro;
|
||||
|
||||
boot.initrd.availableKernelModules = [
|
||||
# see <repo:postmarketOS/pmaports:device/community/device-pine64-pinephonepro/modules-initfs>
|
||||
# - pmos includes: gpu_sched dw_wdt fusb302 panel_himax_hx8394 goodix_ts
|
||||
|
@@ -30,7 +30,14 @@ let
|
||||
modDirVersion = "6.6.0"; # or X.Y.Z-rcN
|
||||
# ^^^ sources
|
||||
|
||||
defconfigStr = (builtins.readFile "${pmaports}/device/community/linux-pine64-pinephonepro/config-pine64-pinephonepro.aarch64") + ''
|
||||
defconfigRaw = builtins.readFile "${pmaports}/device/community/linux-pine64-pinephonepro/config-pine64-pinephonepro.aarch64";
|
||||
defconfigStr =
|
||||
# fix build:
|
||||
# make[3]: *** [../scripts/Makefile.build:243: crypto/aegis128-neon-inner.o] Error 1
|
||||
# /build/ccUPpJiV.s:596: Error: selected processor does not support aese v2.16b,v11.16b
|
||||
(lib.replaceStrings [ "CONFIG_CRYPTO_AEGIS128_SIMD=y" ] [ "CONFIG_CRYPTO_AEGIS128_SIMD=n" ] defconfigRaw)
|
||||
# add options i used in linux-postmarketos-allwinner to get nixos-flavored linux working as expected:
|
||||
+ ''
|
||||
#
|
||||
# Extra nixpkgs-specific options
|
||||
# nixos/modules/system/boot/systemd.nix wants CONFIG_DMIID
|
||||
@@ -46,13 +53,6 @@ let
|
||||
CONFIG_LSM="landlock,lockdown,yama,loadpin,safesetid,selinux,smack,tomoyo,apparmor,bpf";
|
||||
'';
|
||||
|
||||
#
|
||||
# Fix build issues
|
||||
#
|
||||
# make[3]: *** [../scripts/Makefile.build:243: crypto/aegis128-neon-inner.o] Error 1
|
||||
# /build/ccUPpJiV.s:596: Error: selected processor does not support aese v2.16b,v11.16b
|
||||
defconfigStr' = lib.replaceStrings [ "CONFIG_CRYPTO_AEGIS128_SIMD=y" ] [ "CONFIG_CRYPTO_AEGIS128_SIMD=n" ] defconfigStr;
|
||||
|
||||
in (linuxManualConfig {
|
||||
inherit src version modDirVersion randstructSeed;
|
||||
# inherit (linux-megous) extraMakeFlags modDirVersion src version;
|
||||
@@ -60,7 +60,7 @@ in (linuxManualConfig {
|
||||
|
||||
configfile = writeTextFile {
|
||||
name = "config-pine64-pinephonepro.aarch64";
|
||||
text = defconfigStr';
|
||||
text = defconfigStr;
|
||||
};
|
||||
# nixpkgs requires to know the config as an attrset, to do various eval-time assertions.
|
||||
# that config is sourced from the pmaports repo, hence this is import-from-derivation.
|
||||
@@ -69,6 +69,7 @@ in (linuxManualConfig {
|
||||
}).overrideAttrs (base: {
|
||||
passthru = (base.passthru or {}) // {
|
||||
inherit defconfigStr;
|
||||
structuredConfig = sane-kernel-tools.parseDefconfigStructuredNonempty defconfigStr;
|
||||
};
|
||||
})
|
||||
|
||||
|
48
pkgs/additional/linux-sane-pinephonepro/default.nix
Normal file
48
pkgs/additional/linux-sane-pinephonepro/default.nix
Normal file
@@ -0,0 +1,48 @@
|
||||
{
|
||||
lib,
|
||||
linux_latest,
|
||||
linux-postmarketos-pinephonepro,
|
||||
#VVV nixpkgs calls `.override` on the kernel to configure additional things, but we don't care about those things
|
||||
...
|
||||
}:
|
||||
|
||||
linux_latest.override {
|
||||
DTB = true; #< XXX: not sure if actually needed
|
||||
|
||||
autoModules = false;
|
||||
enableCommonConfig = false;
|
||||
|
||||
kernelPatches = [
|
||||
{
|
||||
name = "pmos-config";
|
||||
patch = null;
|
||||
extraStructuredConfig = builtins.removeAttrs
|
||||
linux-postmarketos-pinephonepro.structuredConfig
|
||||
[
|
||||
"BASE_SMALL" # pmos: =0 ???
|
||||
"BRIDGE_NETFILTER" # pmos: =y, but option only supports m
|
||||
"NFT_COMPAT" # pmos: =y, but option only supports m
|
||||
"NETFILTER_XT_TARGET_CHECKSUM" # pmos: =y, but option only supports m
|
||||
"NETFILTER_XT_MATCH_IPVS" # pmos: =y, but option only supports m
|
||||
"IP_NF_MATCH_RPFILTER" # pmos: =y, but option only supports m
|
||||
"DRM_PANEL_HIMAX_HX8394" # pmos: =y, but option only supports m
|
||||
"DRM_PANEL_SIMPLE" # pmos: =y, but option only supports m
|
||||
"FSCACHE" # pmos: =y, but option only supports m
|
||||
|
||||
# these options don't break build, but are nonsensical
|
||||
"BASE_FULL"
|
||||
"CC_VERSION_TEXT"
|
||||
"GCC_VERSION"
|
||||
]
|
||||
;
|
||||
}
|
||||
{
|
||||
name = "add-removed";
|
||||
patch = null;
|
||||
extraStructuredConfig = with lib.kernel; {
|
||||
DRM_PANEL_HIMAX_HX8394 = module;
|
||||
DRM_PANEL_SIMPLE = module;
|
||||
};
|
||||
}
|
||||
];
|
||||
}
|
@@ -68,6 +68,7 @@ let
|
||||
linux-postmarketos-allwinner = callPackage ./additional/linux-postmarketos-allwinner { };
|
||||
linux-postmarketos-exynos5 = callPackage ./additional/linux-postmarketos-exynos5 { };
|
||||
linux-postmarketos-pinephonepro = callPackage ./additional/linux-postmarketos-pinephonepro { };
|
||||
linux-sane-pinephonepro = callPackage ./additional/linux-sane-pinephonepro { };
|
||||
listparser = callPackage ./additional/listparser { };
|
||||
mcg = callPackage ./additional/mcg { };
|
||||
megapixels-next = callPackage ./additional/megapixels-next { };
|
||||
|
Reference in New Issue
Block a user