Compare commits

...

13 commits

Author SHA1 Message Date
Martin Wurm 757ba49d65 Merge pull request 'main' (#1) from adamcstephens/nixos-x13s:main into main
Reviewed-on: https://codeberg.org/mart-w/nixos-x13s/pulls/1
2024-06-26 09:20:29 +00:00
Adam Stephens dccc4a2c35
flake.lock: Update
Flake lock file updates:

• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/c7b821ba2e1e635ba5a76d299af62821cbcb09f3' (2024-06-09)
  → 'github:NixOS/nixpkgs/2893f56de08021cffd9b6b6dfc70fd9ccd51eb60' (2024-06-24)
2024-06-25 14:48:00 -04:00
Adam Stephens 4f3bbdaeca
add update script for kernel 2024-06-25 14:47:58 -04:00
Adam Stephens 4ea1f591bc
jhovold: 6.10.0-rc3 -> 6.10.0-rc5 2024-06-25 14:44:55 -04:00
Adam Stephens a95fcbdb0b
jhovold: 6.10.0-rc2 -> 6.10.0-rc3 2024-06-11 14:57:07 -04:00
Adam Stephens bece952194
flake.lock: Update
Flake lock file updates:

• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/e8057b67ebf307f01bdcc8fba94d94f75039d1f6' (2024-06-05)
  → 'github:NixOS/nixpkgs/c7b821ba2e1e635ba5a76d299af62821cbcb09f3' (2024-06-09)
2024-06-11 14:54:49 -04:00
Adam Stephens 65b22fab10
fix: wrap build in tini 2024-06-08 11:41:56 -04:00
Adam Stephens 0cf1cf36b8
flake.lock: Update
Flake lock file updates:

• Updated input 'flake-parts':
    'github:hercules-ci/flake-parts/8dc45382d5206bd292f9c2768b8058a8fd8311d9' (2024-05-16)
  → 'github:hercules-ci/flake-parts/2a55567fcf15b1b1c7ed712a2c6fadaec7412ea8' (2024-06-01)
• Updated input 'flake-parts/nixpkgs-lib':
    '50eb7ecf4c.tar.gz?narHash=sha256-QBx10%2Bk6JWz6u7VsohfSw8g8hjdBZEf8CFzXH1/1Z94%3D' (2024-05-02)
  → 'eb9ceca17d.tar.gz?narHash=sha256-lIbdfCsf8LMFloheeE6N31%2BBMIeixqyQWbSr2vk79EQ%3D' (2024-06-01)
• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/ad57eef4ef0659193044870c731987a6df5cf56b' (2024-05-29)
  → 'github:NixOS/nixpkgs/e8057b67ebf307f01bdcc8fba94d94f75039d1f6' (2024-06-05)
2024-06-08 09:36:49 -04:00
Adam Stephens bbe240e612
jhovold: 6.10.0-rc1 -> 6.10.0-rc2 2024-06-08 09:27:27 -04:00
Adam Stephens ce01289423
add camera udev rule and modem symlink 2024-05-30 11:52:04 -04:00
Adam Stephens eb0287f9c0
jhovold: 6.9.0 -> 6.10.0-rc1 2024-05-30 11:33:49 -04:00
Adam Stephens 6a1f04ae97
flake.lock: Update
Flake lock file updates:

• Updated input 'flake-parts':
    'github:hercules-ci/flake-parts/e5d10a24b66c3ea8f150e47dfdb0416ab7c3390e' (2024-05-02)
  → 'github:hercules-ci/flake-parts/8dc45382d5206bd292f9c2768b8058a8fd8311d9' (2024-05-16)
• Updated input 'nixpkgs':
    'github:NixOS/nixpkgs/2057814051972fa1453ddfb0d98badbea9b83c06' (2024-05-12)
  → 'github:NixOS/nixpkgs/ad57eef4ef0659193044870c731987a6df5cf56b' (2024-05-29)
2024-05-30 11:31:17 -04:00
Adam Stephens 3a002c5a64
fix: pd-mapper can't read zstd firmware files
nixos unstable and 24.05 switched to zstd compression for firmware
files. Roll back to the previous setup of creating a package of the
qcom firmware uncompressed, and patching pd-mapper.

closes #14
2024-05-27 12:11:12 -04:00
9 changed files with 128 additions and 22 deletions

View file

@ -11,7 +11,7 @@ steps:
- name: build - name: build
image: bash image: bash
commands: commands:
- nix develop .#ci -c just -- build - tini -s nix -- develop .#ci -c just -- build
- name: upload - name: upload
image: bash image: bash

View file

@ -5,11 +5,11 @@
"nixpkgs-lib": "nixpkgs-lib" "nixpkgs-lib": "nixpkgs-lib"
}, },
"locked": { "locked": {
"lastModified": 1714641030, "lastModified": 1717285511,
"narHash": "sha256-yzcRNDoyVP7+SCNX0wmuDju1NUCt8Dz9+lyUXEI0dbI=", "narHash": "sha256-iKzJcpdXih14qYVcZ9QC9XuZYnPc6T8YImb6dX166kw=",
"owner": "hercules-ci", "owner": "hercules-ci",
"repo": "flake-parts", "repo": "flake-parts",
"rev": "e5d10a24b66c3ea8f150e47dfdb0416ab7c3390e", "rev": "2a55567fcf15b1b1c7ed712a2c6fadaec7412ea8",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -20,11 +20,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1715534503, "lastModified": 1719254875,
"narHash": "sha256-5ZSVkFadZbFP1THataCaSf0JH2cAH3S29hU9rrxTEqk=", "narHash": "sha256-ECni+IkwXjusHsm9Sexdtq8weAq/yUyt1TWIemXt3Ko=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "2057814051972fa1453ddfb0d98badbea9b83c06", "rev": "2893f56de08021cffd9b6b6dfc70fd9ccd51eb60",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -36,14 +36,14 @@
}, },
"nixpkgs-lib": { "nixpkgs-lib": {
"locked": { "locked": {
"lastModified": 1714640452, "lastModified": 1717284937,
"narHash": "sha256-QBx10+k6JWz6u7VsohfSw8g8hjdBZEf8CFzXH1/1Z94=", "narHash": "sha256-lIbdfCsf8LMFloheeE6N31+BMIeixqyQWbSr2vk79EQ=",
"type": "tarball", "type": "tarball",
"url": "https://github.com/NixOS/nixpkgs/archive/50eb7ecf4cd0a5756d7275c8ba36790e5bd53e33.tar.gz" "url": "https://github.com/NixOS/nixpkgs/archive/eb9ceca17df2ea50a250b6b27f7bf6ab0186f198.tar.gz"
}, },
"original": { "original": {
"type": "tarball", "type": "tarball",
"url": "https://github.com/NixOS/nixpkgs/archive/50eb7ecf4cd0a5756d7275c8ba36790e5bd53e33.tar.gz" "url": "https://github.com/NixOS/nixpkgs/archive/eb9ceca17df2ea50a250b6b27f7bf6ab0186f198.tar.gz"
} }
}, },
"root": { "root": {

View file

@ -28,6 +28,11 @@
pkgs.cachix pkgs.cachix
pkgs.jq pkgs.jq
pkgs.just pkgs.just
(pkgs.python3.withPackages (py: [
py.PyGithub
py.packaging
]))
pkgs.pyright
]; ];
}; };
}; };

View file

@ -2,6 +2,7 @@
{ {
config, config,
lib, lib,
options,
pkgs, pkgs,
... ...
}: }:
@ -40,7 +41,14 @@ in
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
environment.systemPackages = [ pkgs.efibootmgr ]; environment.systemPackages = [
pkgs.efibootmgr
(x13sPackages.uncompressed-firmware.override {
firmwareFilesList = lib.flatten options.hardware.firmware.definitions;
})
];
environment.pathsToLink = [ "/share/uncompressed-firmware" ];
hardware.enableAllFirmware = true; hardware.enableAllFirmware = true;
hardware.firmware = [ x13sPackages."x13s/extra-firmware" ]; hardware.firmware = [ x13sPackages."x13s/extra-firmware" ];
@ -104,6 +112,14 @@ in
}; };
}; };
# https://github.com/jhovold/linux/wiki/X13s#modem
networking.networkmanager.fccUnlockScripts = [
{
id = "105b:e0c3";
path = "${pkgs.modemmanager}/share/ModemManager/fcc-unlock.available.d/105b";
}
];
nixpkgs.overlays = [ nixpkgs.overlays = [
(_: super: { (_: super: {
# don't try and use zfs # don't try and use zfs
@ -119,6 +135,12 @@ in
# default is performance # default is performance
powerManagement.cpuFreqGovernor = "ondemand"; powerManagement.cpuFreqGovernor = "ondemand";
# https://github.com/jhovold/linux/wiki/X13s#camera
services.udev.extraRules = ''
ACTION=="add", SUBSYSTEM=="dma_heap", KERNEL=="linux,cma", GROUP="video", MODE="0660"
ACTION=="add", SUBSYSTEM=="dma_heap", KERNEL=="system", GROUP="video", MODE="0660"
'';
systemd.services.bluetooth-x13s-mac = { systemd.services.bluetooth-x13s-mac = {
wantedBy = [ "multi-user.target" ]; wantedBy = [ "multi-user.target" ];
before = [ "bluetooth.service" ]; before = [ "bluetooth.service" ];

View file

@ -7,10 +7,10 @@
"owner": "jhovold", "owner": "jhovold",
"repo": "linux" "repo": "linux"
}, },
"branch": "wip/sc8280xp-6.9", "branch": "wip/sc8280xp-6.10-rc5",
"revision": "357c0f0c7ad2d7d95a3200b6cfd7bef43299de04", "revision": "fb34a1d838d061d9e2199656b832bb2ebc2dc5e3",
"url": "https://github.com/jhovold/linux/archive/357c0f0c7ad2d7d95a3200b6cfd7bef43299de04.tar.gz", "url": "https://github.com/jhovold/linux/archive/fb34a1d838d061d9e2199656b832bb2ebc2dc5e3.tar.gz",
"hash": "1n6cv149rafgk7wkb8cjixy6car4zq0dhhz39b7gjnzr599mqwxn" "hash": "07gsf26954qi9lspbzlc4xsan4vbiyzbfnpwbwyaxcqfibzfg6vg"
} }
}, },
"version": 3 "version": 3

View file

@ -15,11 +15,9 @@ let
); );
in in
rec { rec {
linux_jhovold = linux_jhovold_6_9; linux_jhovold = pkgs.callPackage linux_x13s_pkg {
linux_jhovold_6_9 = pkgs.callPackage linux_x13s_pkg {
src = sources.linux-jhovold; src = sources.linux-jhovold;
version = "6.9.0"; version = "6.10.0-rc5";
defconfig = "johan_defconfig"; defconfig = "johan_defconfig";
}; };
@ -27,4 +25,6 @@ rec {
qrtr = pkgs.callPackage ./qrtr { }; qrtr = pkgs.callPackage ./qrtr { };
"x13s/extra-firmware" = pkgs.callPackage ./extra-firmware.nix { }; "x13s/extra-firmware" = pkgs.callPackage ./extra-firmware.nix { };
uncompressed-firmware = pkgs.callPackage ./uncompressed-firmware.nix { };
} }

View file

@ -7,7 +7,7 @@ index 65c4b80..669d9a0 100644
#ifndef ANDROID #ifndef ANDROID
-#define FIRMWARE_BASE "/lib/firmware/" -#define FIRMWARE_BASE "/lib/firmware/"
+#define FIRMWARE_BASE "/run/current-system/firmware/" +#define FIRMWARE_BASE "/run/current-system/sw/share/uncompressed-firmware/"
#else #else
#define FIRMWARE_BASE "/vendor/firmware/" #define FIRMWARE_BASE "/vendor/firmware/"
#endif #endif

View file

@ -0,0 +1,24 @@
{
runCommand,
buildEnv,
firmwareFilesList ? [ ],
}:
runCommand "qcom-modem-uncompressed-firmware-share"
{
firmwareFiles = buildEnv {
name = "qcom-modem-uncompressed-firmware";
paths = firmwareFilesList;
pathsToLink = [
"/lib/firmware/rmtfs"
"/lib/firmware/qcom"
];
};
}
''
PS4=" $ "
(
set -x
mkdir -p $out/share/
ln -s $firmwareFiles/lib/firmware/ $out/share/uncompressed-firmware
)
''

55
update.py Executable file
View file

@ -0,0 +1,55 @@
#!/usr/bin/env python3
from github import Github
import sys
import re
from packaging.version import Version
from subprocess import run
latest_version: str = "0"
latest_branch: str = ""
previous_version: str = ""
with Github() as gh:
for branch in gh.get_user("jhovold").get_repo("linux").get_branches():
v = re.match("wip/sc8280xp-((v?6.[0-9]+)(-rc[0-9]+)?)", branch.name)
if v != None and Version(v.group(1)) > Version(latest_version):
# add .0 to version
latest_version = f"{v.group(2)}.0{v.group(3) or ''}"
latest_branch = v.group(0)
print("branch: " + latest_branch)
print("latest: " + latest_version)
with open("packages/default.nix", "r") as f:
lines = f.readlines()
for line in lines:
v = re.match(r'^\s*version = "(6[.0-9-rc]+)";.*$', line)
if v != None:
previous_version = v.group(1)
print("previous: " + previous_version)
if previous_version == latest_version:
print("No update found, exiting.")
sys.exit(1)
with open("packages/default.nix", "w") as f:
for line in lines:
f.write(
re.sub(
r'^(\s*version = ")6[.0-9-rc]+(";.*$)',
rf"\g<1>{latest_version}\2",
line,
)
)
run(
f"npins add --name linux-jhovold github --branch {latest_branch} jhovold linux".split(
" "
)
)
run("git add npins/ packages/default.nix".split(" "))
run(["git", "commit", "-m", f"jhovold: {previous_version} -> {latest_version}"])