Compare commits

3 Commits
v1 ... master

Author SHA1 Message Date
1f91bf6ad5 add export to use all cores
Some checks failed
Build Custom Kernel / build-kernel (push) Failing after 0s
2024-12-29 23:22:34 +01:00
564a7994d8 add cameras patch
Some checks failed
Build Custom Kernel / build-kernel (push) Has been cancelled
2024-12-19 19:03:38 +01:00
1c0957ab36 improve kernel build steps
Some checks failed
Build Custom Kernel / build-kernel (push) Has been cancelled
2024-12-19 18:58:50 +01:00
4 changed files with 29 additions and 22 deletions

View File

@@ -23,23 +23,23 @@ jobs:
ca-certificates ca-certificates
curl -L https://nixos.org/nix/install | sh -s -- --daemon curl -L https://nixos.org/nix/install | sh -s -- --daemon
# - name: Build custom kernel - name: Build custom kernel
# run: |
# export NIX_BUILD_CORES=0
# nix-build '<nixpkgs/nixos>' -A config.system.build.kernel --arg configuration ./custom-kernel.nix
# env:
# PATH: /nix/var/nix/profiles/default/bin:/nix/var/nix/profiles/default/sbin:/bin:/sbin:/usr/bin:/usr/sbin
- name: Create dummy files
run: | run: |
mkdir -p ./result export NIX_BUILD_CORES=0
echo "This is a dummy file" > ./result/dummy-file.txt nix-build '<nixpkgs/nixos>' -A config.system.build.kernel --arg configuration ./custom-kernel.nix
env:
PATH: /nix/var/nix/profiles/default/bin:/nix/var/nix/profiles/default/sbin:/bin:/sbin:/usr/bin:/usr/sbin
- name: Zip kernel artifacts - name: Prepare kernel artifacts
run: zip -r custom-kernel.zip ./result run: |
mkdir result-writable
cp -rL result/lib/modules/6.6.63/kernel result-writable/kernel
sudo chmod -R u+rwX,g+rwX,o+rX result-writable
tar -czf custom-kernel.tar.gz -C result-writable .
rm -rf result-writable
- name: Upload kernel artifacts - name: Upload kernel artifacts
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
with: with:
name: custom-kernel name: custom-kernel
path: ./custom-kernel.zip path: ./custom-kernel.tar.gz

1
.gitignore vendored
View File

@@ -1,2 +1,3 @@
/result /result
/result-writable
custom-kernel.tar.gz custom-kernel.tar.gz

View File

@@ -2,6 +2,7 @@
On a NIX machine: On a NIX machine:
```bash ```bash
export NIX_BUILD_CORES=0
nix-build '<nixpkgs/nixos>' -A config.system.build.kernel --arg configuration ./custom-kernel.nix nix-build '<nixpkgs/nixos>' -A config.system.build.kernel --arg configuration ./custom-kernel.nix
``` ```
@@ -9,13 +10,11 @@ nix-build '<nixpkgs/nixos>' -A config.system.build.kernel --arg configuration ./
1. Create a tarball of the built kernel: 1. Create a tarball of the built kernel:
```bash ```bash
tar -czf custom-kernel.tar.gz -C result . mkdir result-writable
cp -rL result/lib/modules/6.6.63/kernel result-writable/kernel
sudo chmod -R u+rwX,g+rwX,o+rX result-writable
tar -czf custom-kernel.tar.gz -C result-writable .
rm -rf result-writable
``` ```
2. Upload the tarball as an artifact to Gitea: 2. Create a new release on Gitea and upload the tarball
```bash
curl -X POST -H "Content-Type: application/octet-stream" \
-H "Authorization: token YOUR_GITEA_TOKEN" \
--data-binary @custom-kernel.tar.gz \
"https://gitea.example.com/api/v1/repos/your-username/your-repo/releases/YOUR_RELEASE_ID/assets?name=custom-kernel.tar.gz"
```

View File

@@ -12,5 +12,12 @@
VIDEO_OV5693 y VIDEO_OV5693 y
''; '';
} }
# cameras patch from linux-surface
{
name = "cameras-patch";
patch = null;
url = "https://github.com/linux-surface/linux-surface/raw/master/patches/6.12/0012-cameras.patch";
sha256 = "sha256-0759cl1xq3jdq6hd97y8gx8671g0y899b7azv623bzxjf1jz40ng";
}
]; ];
} }