Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
june-fish committed Feb 14, 2024
0 parents commit 9a88592
Show file tree
Hide file tree
Showing 10 changed files with 9,846 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Kernel Build
on:
dispatch_workflow:
push:
branches: ["mt8183"]
jobs:
build:
runs-on: ARM64
container:
image: registry.fedoraproject.org/fedora-minimal:39
steps:
- name: Install Toolchain
run: |
dnf5 up -y
dnf5 install -y make gcc ccache flex bison elfutils-devel xz bc tar openssl-devel rpmbuild
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup enviroment variables
run: |
echo "CCACHE_DIR=$(pwd)/ccache" >> $GITHUB_ENV
echo "KERNEL_COMMIT=$(git rev-parse HEAD)" >> $GITHUB_ENV
- name: Setup ccache cache
uses: actions/cache@v3
with:
path: ${{ env.CCACHE_DIR }}
key: ccache-${{ matrix.platform }}-${{ env.KERNEL_COMMIT }}-${{ hashFiles('kernel.config') }}
restore-keys: |
ccache-${{ matrix.platform }}-${{ env.KERNEL_COMMIT }}-
ccache-${{ matrix.platform }}-
- name: Make
run: make all
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
path: |
mt8183/rpmbuild/RPMS/aarch64/*.rpm
mt8183/rpmbuild/SRPMS/*.src.rpm
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
rpmbuild/
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "linux"]
path = linux
url = https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
11 changes: 11 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
project_name = kaibutsu

.PHONY: usage mt8183

usage:
@echo "usage: make [kernel_variant|all]"

all: mt8183

mt8183:
make -C mt8183 build
1 change: 1 addition & 0 deletions linux
Submodule linux added at ceb6a6
13 changes: 13 additions & 0 deletions mt8183/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
REF=$(shell cat ref)

ifeq ($(shell uname -m), x86_64)
CROSS=aarch64-linux-gnu-
endif

build:
cp *.patch ../linux
cp config ../linux/.config
cd ../linux && git reset --hard && git checkout $(REF) && git apply *.patch && sed -i 's/^EXTRAVERSION.*/EXTRAVERSION = -mt8183/' Makefile
ARCH=arm64 CROSS_COMPILE=$(CROSS) make -C ../linux olddefconfig rpm-pkg -j$(shell nproc)
cp -r ../linux/rpmbuild .
rm -rf ../linux/rpmbuild
12 changes: 12 additions & 0 deletions mt8183/add-dts-to-rpm.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
diff --git a/scripts/package/kernel.spec b/scripts/package/kernel.spec
index 3eee0143e0c5..311bb1cace55 100644
--- a/scripts/package/kernel.spec
+++ b/scripts/package/kernel.spec
@@ -65,6 +65,7 @@ cp $(%{make} %{makeflags} -s image_name) %{buildroot}/boot/vmlinuz-%{KERNELRELEA
%endif
%{make} %{makeflags} INSTALL_MOD_PATH=%{buildroot} modules_install
%{make} %{makeflags} INSTALL_HDR_PATH=%{buildroot}/usr headers_install
+%{make} %{makeflags} INSTALL_DTBS_PATH=%{buildroot}/boot/dtb-%{KERNELRELEASE} dtbs_install
cp System.map %{buildroot}/boot/System.map-%{KERNELRELEASE}
cp .config %{buildroot}/boot/config-%{KERNELRELEASE}
ln -fns /usr/src/kernels/%{KERNELRELEASE} %{buildroot}/lib/modules/%{KERNELRELEASE}/build
Loading

0 comments on commit 9a88592

Please sign in to comment.