From d06103b3d68eff371751c0ab21c478077718a937 Mon Sep 17 00:00:00 2001 From: FreeArtMan Date: Sun, 3 Sep 2023 14:22:47 +0100 Subject: Add compilable and running arm64 --- create_kernel/create_kernel_pi4.sh | 47 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100755 create_kernel/create_kernel_pi4.sh (limited to 'create_kernel/create_kernel_pi4.sh') diff --git a/create_kernel/create_kernel_pi4.sh b/create_kernel/create_kernel_pi4.sh new file mode 100755 index 0000000..12df75f --- /dev/null +++ b/create_kernel/create_kernel_pi4.sh @@ -0,0 +1,47 @@ +#!/bin/dash +# https://www.raspberrypi.com/documentation/computers/linux_kernel.html + +#KERNEL_VERSION=5.15.113 +#KERNEL_VERSION=4.4.187 +#KERNEL_VERSION=4.9.120 +#KERNEL_VERSION=4.14.63 +KERNEL_VERSION=pi4 +#KERNEL_MAJOR_VERSION=v5.x +#KERNEL_MAJOR_VERSION=v4.x + +#git clone --depth=1 https://github.com/raspberrypi/linux + +KERNEL_PAGE=https://github.com/raspberrypi/linux +DEVICE_NAME=pi4 +OUT_DIRECTORY=out-pi4 + +#prepare +_PWD=`pwd` +mkdir -p $OUT_DIRECTORY/lib/modules + +echo "Download kernel" +if [ ! -d linux-raspberypi ]; then + git clone --depth=1 https://github.com/raspberrypi/linux linux-pi4 +fi + +#echo "Unpack kernel" +#tar -xvf linux-$KERNEL_VERSION.tar.xz -o linux-$KERNEL_VERSION-arm64 +echo "Copy config to kernel" +cp configs/$DEVICE_NAME/generic-pi4 ./linux-pi4/.config +echo "Compile kernel" +cd ./linux-pi4 + +KERNEL=kernel8 +make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- bcm2711_defconfig +make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- Image modules dtbs -j4 + +#make -j4 +#make INSTALL_MOD_PATH=$_PWD/$OUT_DIRECTORY/ modules_install + + + +#output results +#echo "Copy results to out" +#cd $_PWD +#cp ./linux-$KERNEL_VERSION/arch/x86_64/boot/bzImage $_PWD/$OUT_DIRECTORY/vmlinuz-xos +#cp ./linux-$KERNEL_VERSION/vmlinux $_PWD/$OUT_DIRECTORY/vmlinux-xos -- cgit v1.2.3