summaryrefslogtreecommitdiff
path: root/create_kernel/create_kernel.sh
blob: 7f29d018eb11f1c09b892838b7b635ccc54c0a64 (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
#!/bin/dash

KERNEL_VERSION=4.4.148
#KERNEL_VERSION=4.9.120
#KERNEL_VERSION=4.14.63
KERNEL_MAJOR_VERSION=v4.x
KERNEL_PAGE=https://cdn.kernel.org
DEVICE_NAME=generic
OUT_DIRECTORY=out

#prepare
_PWD=`pwd`
mkdir -p $OUT_DIRECTORY/lib/modules

echo "Download kernel"
wget -c $KERNEL_PAGE/pub/linux/kernel/$KERNEL_MAJOR_VERSION/linux-$KERNEL_VERSION.tar.xz
echo "Unpack kernel"
tar -xvf linux-$KERNEL_VERSION.tar.xz
echo "Copy config to kernel"
cp configs/$DEVICE_NAME/generic-$KERNEL_VERSION ./linux-$KERNEL_VERSION/.config
echo "Compile kernel"
cd ./linux-$KERNEL_VERSION
make -j4
make INSTALL_MOD_PATH=$_PWD/$OUT_DIRECTORY/  modules_install
echo "Copy results to out"

#output results
cd ..
cp ./linux-$KERNEL_VERSION/arch/x86_64/boot/bzImage $_PWD/$OUT_DIRECTORY