blob: 12df75fb2136089a4c70c22dd66f1e43c9fbb72d (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
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
|