-
Notifications
You must be signed in to change notification settings - Fork 2
/
build_linux_menuconfig.sh
executable file
·62 lines (46 loc) · 1.99 KB
/
build_linux_menuconfig.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
#!/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
echo "make ARCH=riscv CROSS_COMPILE=${CC} menuconfig"
make ARCH=riscv CROSS_COMPILE=${CC} menuconfig
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 ../
touch ./.05_generate_boot.sh
touch ./.06_generate_root.sh
#