-
Notifications
You must be signed in to change notification settings - Fork 2
/
04_build_linux.sh
executable file
·123 lines (96 loc) · 4.15 KB
/
04_build_linux.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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
#!/bin/bash
CORES=$(getconf _NPROCESSORS_ONLN)
wdir=`pwd`
CC=${CC:-"${wdir}/riscv-toolchain/bin/riscv64-linux-"}
cd ./linux/
cp -rv ../BeagleBoard-DeviceTrees/src/riscv/thead/*.dtsi ./arch/riscv/boot/dts/thead/
cp -rv ../BeagleBoard-DeviceTrees/src/riscv/thead/*.dts ./arch/riscv/boot/dts/thead/
#if [ ! -d ./arch/riscv/boot/dts/thead/overlays/ ] ; then
# mkdir -p ./arch/riscv/boot/dts/thead/overlays/
#fi
#cp -rv ../BeagleBoard-DeviceTrees/src/thead/overlays/*.dts ./arch/riscv/boot/dts/thead/overlays/
git diff > log.txt ; cat log.txt ; rm log.txt
cd ../BeagleBoard-DeviceTrees/
make clean ; make
cd ../linux
echo "make ARCH=riscv CROSS_COMPILE=${CC} clean"
make ARCH=riscv CROSS_COMPILE=${CC} clean
echo "make ARCH=riscv CROSS_COMPILE=${CC} defconfig"
make ARCH=riscv CROSS_COMPILE=${CC} defconfig
./scripts/config --disable CONFIG_LOCALVERSION_AUTO
./scripts/config --set-str CONFIG_LOCALVERSION "-$(date +%Y%m%d)"
./scripts/config --enable CONFIG_OF_OVERLAY
./scripts/config --enable CONFIG_MODULE_COMPRESS_ZSTD
#TH1520 MMC
./scripts/config --enable CONFIG_MMC_SDHCI_OF_DWCMSHC
./scripts/config --enable CONFIG_DW_AXI_DMAC
./scripts/config --disable CONFIG_ARCH_R9A07G043
#CONFIG_DMA_GLOBAL_POOL breaks ADMA
#TH1520 RESET
./scripts/config --enable CONFIG_RESET_TH1520
#GPIO:
./scripts/config --enable CONFIG_GPIO_SYSFS
./scripts/config --enable CONFIG_GPIO_DWAPB
#Cleanup large PCI/DRM...
./scripts/config --disable CONFIG_PCI
./scripts/config --disable CONFIG_DRM
#Optimize:
./scripts/config --enable CONFIG_IP_NF_IPTABLES
./scripts/config --enable CONFIG_NETFILTER_XTABLES
#iwd
./scripts/config --enable CONFIG_CRYPTO_USER_API_HASH
./scripts/config --enable CONFIG_CRYPTO_USER_API_SKCIPHER
./scripts/config --enable CONFIG_ASYMMETRIC_KEY_TYPE
./scripts/config --enable CONFIG_KEY_DH_OPERATIONS
./scripts/config --enable CONFIG_CRYPTO_ECB
./scripts/config --enable CONFIG_CRYPTO_MD4
./scripts/config --enable CONFIG_CRYPTO_MD5
./scripts/config --enable CONFIG_CRYPTO_CBC
./scripts/config --enable CONFIG_CRYPTO_SHA1
./scripts/config --enable CONFIG_CRYPTO_SHA256
./scripts/config --enable CONFIG_CRYPTO_SHA512
./scripts/config --enable CONFIG_CRYPTO_AES
./scripts/config --enable CONFIG_CRYPTO_DES
./scripts/config --enable CONFIG_ASYMMETRIC_PUBLIC_KEY_SUBTYPE
./scripts/config --enable CONFIG_CRYPTO_CMAC
./scripts/config --enable CONFIG_PKCS7_MESSAGE_PARSER
./scripts/config --enable CONFIG_CRYPTO_HMAC
./scripts/config --enable CONFIG_X509_CERTIFICATE_PARSER
./scripts/config --enable CONFIG_PKCS8_PRIVATE_KEY_PARSER
./scripts/config --disable CONFIG_RT_GROUP_SCHED
#Docker.io
./scripts/config --enable CONFIG_BLK_CGROUP
./scripts/config --enable CONFIG_CGROUP_WRITEBACK
./scripts/config --enable CONFIG_BLK_CGROUP_RWSTAT
./scripts/config --enable CONFIG_BLK_DEV_THROTTLING
./scripts/config --enable CONFIG_BFQ_GROUP_IOSCHED
./scripts/config --module CONFIG_NETFILTER_XT_MATCH_MARK
./scripts/config --module CONFIG_NETFILTER_XT_MATCH_BPF
echo "make ARCH=riscv CROSS_COMPILE=${CC} olddefconfig"
make ARCH=riscv CROSS_COMPILE=${CC} olddefconfig
echo "make -j${CORES} ARCH=riscv CROSS_COMPILE=${CC} Image modules dtbs"
make -j${CORES} ARCH=riscv CROSS_COMPILE="ccache ${CC}" Image modules dtbs
if [ ! -f ./arch/riscv/boot/Image ] ; then
echo "Build Failed"
exit 2
fi
KERNEL_UTS=$(cat "${wdir}/linux/include/generated/utsrelease.h" | awk '{print $3}' | sed 's/\"//g' )
make -s ARCH=riscv CROSS_COMPILE=${CC} modules_install INSTALL_MOD_PATH="${wdir}/deploy/tmp"
if [ -f "${wdir}/deploy/${KERNEL_UTS}-modules.tar.gz" ] ; then
rm -rf "${wdir}/deploy/${KERNEL_UTS}-modules.tar.gz" || true
fi
echo "Compressing ${KERNEL_UTS}-modules.tar.gz..."
echo "${KERNEL_UTS}" > "${wdir}/deploy/.modules"
cd "${wdir}/deploy/tmp" || true
tar --create --gzip --file "../${KERNEL_UTS}-modules.tar.gz" ./*
cd "${wdir}/linux/" || exit
rm -rf "${wdir}/deploy/tmp" || true
cp -v ./arch/riscv/boot/dts/thead/th1520-beaglev-ahead.dts ../BeagleBoard-DeviceTrees/src/riscv/thead/
cp -v ./.config ../patches/linux/beaglev_defconfig
cp -v ./arch/riscv/boot/Image ../deploy/
cp -v ./arch/riscv/boot/dts/thead/*.dtb ../deploy/
cd ../
git diff > log.txt ; cat log.txt ; rm log.txt
touch ./.05_generate_boot.sh
touch ./.06_generate_root.sh
#