forked from sipeed/LonganPi-3H-SDK
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmklinux.sh
executable file
·61 lines (53 loc) · 1018 Bytes
/
mklinux.sh
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/usr/bin/env bash
mkdir -p build
if [ -z "$URL" ]
then
export URL="https://github.com/torvalds/linux.git"
fi
if [ -z "$BRANCH" ]
then
export BRANCH="master"
fi
if [ -z "$CROSS_COMPILE" ]
then
export CROSS_COMPILE="aarch64-linux-gnu-"
fi
if [ -z "$CONFIG" ]
then
export CONFIG="longanpi_3h_defconfig"
fi
set -eux
if [ ! -e build/linux ]
then
git clone $URL build/linux --branch=${BRANCH}
cd build/linux
git checkout 3b47bc037bd44f142ac09848e8d3ecccc726be99
find ../../linux/ -name *.patch | sort | while read line
do
git am < $line
done
cd ../../
fi
cd build/linux
export ARCH=arm64
export INSTALL_PATH=$(pwd)/_install/boot/
export INSTALL_MOD_PATH=$(pwd)/_install/
rm -rf ${INSTALL_PATH}
rm -rf ${INSTALL_MOD_PATH}
mkdir -p ${INSTALL_PATH}
mkdir -p ${INSTALL_MOD_PATH}
make mrproper
make $CONFIG
make -j$(nproc)
make install
make dtbs_install
make modules_install
cd _install/boot
cp vmlinuz* Image
cd dtbs
cp -r $(ls)/* ./
cd ../../
mkdir usr
mv lib usr
cd ../
cp -r _install/* ../../overlay/