2 ##################################################################
3 #Set up linux kernel on MACCHIATObin for Edge Infrastructure #
4 #This script not support cross-compilation #
5 ##################################################################
10 # Hardcoded Build_param
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
18 echo -e "Please run shell script as root!"
20 # Check file defconfig-mcbin-edge
21 if [ ! -f "$DEFCONFIG_MCBIN" ]; then
22 echo -e "\tPlease copy defconfig-mcbin-edge to current directory!"
27 # Download Kernel Source
28 echo -e "Download marvell linux 18.09..."
32 git clone https://github.com/MarvellEmbeddedProcessors/linux-marvell .
33 git checkout linux-4.14.22-armada-18.09
36 # Download MUSDK Package
37 echo -e "Download MUSDK package 18.09..."
39 cd $MUSDK_PATH || exit
41 git clone https://github.com/MarvellEmbeddedProcessors/musdk-marvell .
42 git checkout musdk-armada-18.09
46 echo -e "Patch kernel..."
48 git am $MUSDK_PATH/patches/linux-4.14/*.patch
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))
60 echo -e "Install Kernel..."
62 cp ./arch/arm64/boot/Image /boot/
63 cp ./arch/arm64/boot/dts/marvell/armada-8040-mcbin.dtb /boot/
66 echo -e "Success! Please reboot!"