diff --git a/.github/workflows/build-arm64.yml b/.github/workflows/build-arm64.yml index f3f6208..be22e54 100644 --- a/.github/workflows/build-arm64.yml +++ b/.github/workflows/build-arm64.yml @@ -8,7 +8,7 @@ jobs: build: strategy: matrix: - variant: ["mt8192", "mt8183", "sc7180", "rpi5"] + variant: ["mt8192", "mt8183", "sc7180", "rpi5", "rpi4"] runs-on: x86-64-lg container: image: registry.fedoraproject.org/fedora-minimal:40 diff --git a/rpi4/Makefile b/rpi4/Makefile new file mode 100644 index 0000000..7db27f6 --- /dev/null +++ b/rpi4/Makefile @@ -0,0 +1,27 @@ +REF=$(shell cat ref) + +ifeq ($(shell uname -m), x86_64) + CROSS=aarch64-linux-gnu- +endif + +setup: + rm -rf ../linux/*.patch + cp *.patch ../linux + cd ../linux; \ + git remote remove raspberrypi; \ + git remote add raspberrypi https://github.com/raspberrypi/linux.git; \ + git checkout master; \ + git branch -D $(REF); \ + git fetch -f raspberrypi refs/heads/$(REF):refs/heads/$(REF); \ + git reset --hard raspberrypi/$(REF); \ + git clean -df; \ + for patch in $$(ls *.patch); do patch -p1 < "$$patch"; done; \ + git -c commit.gpgsign=false commit -a -m 'removing -dirty suffix after patches'; \ + make ARCH=arm64 bcm2711_defconfig + +compile: + ARCH=arm64 CROSS_COMPILE=$(CROSS) make -C ../linux olddefconfig rpm-pkg -j$(shell nproc) + cp -r ../linux/rpmbuild . + rm -rf ../linux/rpmbuild + +build: setup compile diff --git a/rpi4/ref b/rpi4/ref new file mode 100644 index 0000000..7d6ce86 --- /dev/null +++ b/rpi4/ref @@ -0,0 +1 @@ +rpi-6.6.y diff --git a/rpi4/scripts-package-kernel-spec-install-dtbs-and-installkernel-fix.patch b/rpi4/scripts-package-kernel-spec-install-dtbs-and-installkernel-fix.patch new file mode 100644 index 0000000..cc52ed9 --- /dev/null +++ b/rpi4/scripts-package-kernel-spec-install-dtbs-and-installkernel-fix.patch @@ -0,0 +1,25 @@ +diff --git a/scripts/package/kernel.spec b/scripts/package/kernel.spec +index 3eee0143e0c5..a11b779a4033 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 +@@ -77,11 +78,7 @@ rm -rf %{buildroot} + + %post + if [ -x /sbin/installkernel -a -r /boot/vmlinuz-%{KERNELRELEASE} -a -r /boot/System.map-%{KERNELRELEASE} ]; then +-cp /boot/vmlinuz-%{KERNELRELEASE} /boot/.vmlinuz-%{KERNELRELEASE}-rpm +-cp /boot/System.map-%{KERNELRELEASE} /boot/.System.map-%{KERNELRELEASE}-rpm +-rm -f /boot/vmlinuz-%{KERNELRELEASE} /boot/System.map-%{KERNELRELEASE} +-/sbin/installkernel %{KERNELRELEASE} /boot/.vmlinuz-%{KERNELRELEASE}-rpm /boot/.System.map-%{KERNELRELEASE}-rpm +-rm -f /boot/.vmlinuz-%{KERNELRELEASE}-rpm /boot/.System.map-%{KERNELRELEASE}-rpm ++/sbin/installkernel %{KERNELRELEASE} /boot/vmlinuz-%{KERNELRELEASE} /boot/System.map-%{KERNELRELEASE} + fi + + %preun diff --git a/rpi4/scripts-package-kernel-spec-rename-package.patch b/rpi4/scripts-package-kernel-spec-rename-package.patch new file mode 100644 index 0000000..29e282c --- /dev/null +++ b/rpi4/scripts-package-kernel-spec-rename-package.patch @@ -0,0 +1,22 @@ +diff --git a/scripts/package/kernel.spec b/scripts/package/kernel.spec +index 3eee0143e0c5..ddc52d125f7c 100644 +--- a/scripts/package/kernel.spec ++++ b/scripts/package/kernel.spec +@@ -5,7 +5,7 @@ + %define __spec_install_post /usr/lib/rpm/brp-compress || : + %define debug_package %{nil} + +-Name: kernel ++Name: kernel-rpi4 + Summary: The Linux Kernel + Version: %(echo %{KERNELRELEASE} | sed -e 's/-/_/g') + Release: %{pkg_release} +@@ -41,7 +41,7 @@ glibc package. + Summary: Development package for building kernel modules to match the %{version} kernel + Group: System Environment/Kernel + AutoReqProv: no +-%description -n kernel-devel ++%description -n kernel-rpi4-devel + This package provides kernel headers and makefiles sufficient to build modules + against the %{version} kernel package. + %endif