Add a http performance test script based on wrk
[iec.git] / misc / type1 / macbin / setup-macbin-kernel.sh
1 #!/bin/bash
2 ##################################################################
3 #Set up linux kernel on MACCHIATObin for Edge Infrastructure     #
4 #This script not support cross-compilation                       #
5 ##################################################################
6
7 # Hardcoded Paths
8 export ROOTDIR=${PWD}
9
10 # Hardcoded Build_param
11 export ARCH=arm64
12
13 # Parameter Overridable Paths
14 export KDIR=${ROOTDIR}/kernel/4.14.22
15 export MUSDK_PATH=${ROOTDIR}/musdk
16 export DEFCONFIG_MCBIN=${ROOTDIR}/defconfig-mcbin-edge
17
18 echo -e "Please run shell script as root!"
19
20 # Check file defconfig-mcbin-edge
21 if [ ! -f "$DEFCONFIG_MCBIN" ]; then
22     echo -e "\tPlease copy defconfig-mcbin-edge to current directory!"
23     exit 1
24 fi
25
26
27 # Download Kernel Source
28 echo -e "Download marvell linux 18.09..."
29 mkdir -p $KDIR
30 cd $KDIR || exit
31 #touch kernel-test
32 git clone https://github.com/MarvellEmbeddedProcessors/linux-marvell .
33 git checkout linux-4.14.22-armada-18.09
34 cd $ROOTDIR || exit
35
36 # Download MUSDK Package
37 echo -e "Download MUSDK package 18.09..."
38 mkdir -p $MUSDK_PATH
39 cd $MUSDK_PATH || exit
40 #touch musdk-test
41 git clone https://github.com/MarvellEmbeddedProcessors/musdk-marvell .
42 git checkout musdk-armada-18.09
43
44 #Patch kernel
45 cd $KDIR || exit
46 echo -e "Patch kernel..."
47 #touch patch_kernel
48 git am $MUSDK_PATH/patches/linux-4.14/*.patch
49
50 # Build Kernel
51 echo -e "Backup mvebu_v8_lsp_defconfig"
52 mv $KDIR/arch/arm64/configs/mvebu_v8_lsp_defconfig $KDIR/arch/arm64/configs/mvebu_v8_lsp_defconfig.bac
53 echo -e "Replease kernel config by defconfig-mcbin-edge"
54 cp $DEFCONFIG_MCBIN $KDIR/arch/arm64/configs/mvebu_v8_lsp_defconfig
55 echo -e "Build Kernel..."
56 make mvebu_v8_lsp_defconfig
57 make -j$(($(nproc)+1))
58
59 #Install Kernel
60 echo -e "Install Kernel..."
61 make modules_install
62 cp ./arch/arm64/boot/Image /boot/
63 cp ./arch/arm64/boot/dts/marvell/armada-8040-mcbin.dtb  /boot/
64 sync
65
66 echo -e "Success! Please reboot!"