From d27b938371ea8fee0d283bc6768808c4e859e8a6 Mon Sep 17 00:00:00 2001 From: Loosetooth Date: Mon, 16 Dec 2024 15:41:50 +0100 Subject: [PATCH] first commit --- .gitea/build-kernel.yaml | 30 ++++++++++++++++++++++++++++++ .gitignore | 2 ++ README.md | 21 +++++++++++++++++++++ custom-kernel.nix | 16 ++++++++++++++++ 4 files changed, 69 insertions(+) create mode 100644 .gitea/build-kernel.yaml create mode 100644 .gitignore create mode 100644 README.md create mode 100644 custom-kernel.nix diff --git a/.gitea/build-kernel.yaml b/.gitea/build-kernel.yaml new file mode 100644 index 0000000..5286761 --- /dev/null +++ b/.gitea/build-kernel.yaml @@ -0,0 +1,30 @@ +name: Build Custom Kernel + +on: + push: + branches: + - master + +jobs: + build-kernel: + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Set up Nix + run: | + curl -L https://nixos.org/nix/install | sh + source ~/.nix-profile/etc/profile.d/nix.sh + + - name: Build custom kernel + run: | + export NIX_BUILD_CORES=0 + nix-build '' -A config.system.build.kernel --arg configuration ./custom-kernel.nix + + - name: Upload kernel artifacts + uses: actions/upload-artifact@v2 + with: + name: custom-kernel + path: ./result \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b6a8206 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +/result +custom-kernel.tar.gz \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..671a2b4 --- /dev/null +++ b/README.md @@ -0,0 +1,21 @@ +# Building the custom kernel + +On a NIX machine: +```bash +nix-build '' -A config.system.build.kernel --arg configuration ./custom-kernel.nix +``` + +# Uploading the kernel as an artifact to Gitea + +1. Create a tarball of the built kernel: +```bash +tar -czf custom-kernel.tar.gz -C result . +``` + +2. Upload the tarball as an artifact to Gitea: +```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" +``` \ No newline at end of file diff --git a/custom-kernel.nix b/custom-kernel.nix new file mode 100644 index 0000000..6ccd729 --- /dev/null +++ b/custom-kernel.nix @@ -0,0 +1,16 @@ +{ config, pkgs, ... }: +{ + boot.kernelPackages = pkgs.linuxPackages_6_6; + boot.kernelPatches = [ + { + name = "enable-ov5693"; + patch = null; + extraConfig = '' + MEDIA_SUPPORT y + VIDEO_DEV y + VIDEO_CAMERA_SENSOR y + VIDEO_OV5693 y + ''; + } + ]; +} \ No newline at end of file