OpenCloudOS-Kernel/package/configs-generate.sh

50 lines
1.6 KiB
Bash
Raw Normal View History

#!/bin/bash
## Usage:
## cd to the top of kernel source dir, then run
## ./package/update_tkconfig.sh
## ./package/update_tkconfig.sh clean
if (( $# == 1 )); then
if [[ $1 == clean ]]; then
rm package/arm/config.*
rm package/default/config.*
exit 0
fi
fi
make tencentconfig
cp .config package/default/config.default
make tencentconfig nosign.config
cp .config package/default/config.default_nosign
make tencentconfig nosign.config debug.config
cp .config package/default/config.default_debug
cd package/default/ ; ln -s config.default_debug config.default_kasan 2>/dev/null ; cd -
make tencentconfig performance.config
cp .config package/default/config.default_performance
cp -a arch/x86/configs/config.pswitch package/default/config.pswitch
if [ -z "$A64_CROSS" ]; then
A64_CROSS=aarch64-linux-gnu-
fi
aarch64-linux-gnu-gcc -v 1>/dev/null 2>&1
if (( $? != 0 )); then
echo "There isn't aarch64-linux-gnu-*, please run \"yum install -y binutils-aarch64-linux-gnu gcc-aarch64-linux-gnu\"."
exit 1
fi
make ARCH=arm64 CROSS_COMPILE=$A64_CROSS tencentconfig
cp .config package/arm/config.default
make ARCH=arm64 CROSS_COMPILE=$A64_CROSS tencentconfig nosign.config debug.config
cp .config package/arm/config.default_debug
cd package/arm/ ; ln -s config.default_debug config.default_kasan 2>/dev/null ; cd -
make ARCH=arm64 CROSS_COMPILE=$A64_CROSS tencentconfig performance.config
cp .config package/default/config.default_performance
arch_name=$( uname -m )
if [[ $arch_name == x86_64 ]]; then
cp -a package/default/config.default .config
else
cp -a package/arm/config.default .config
fi