forked from jcadduono/android_kernel_samsung_klte
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmenuconfig.sh
executable file
·51 lines (45 loc) · 1.53 KB
/
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
#!/bin/bash
# simple script for executing menuconfig
# root directory of NetHunter klte git repo (default is this script's location)
RDIR=$(pwd)
# directory containing cross-compile arm toolchain
TOOLCHAIN=$HOME/build/toolchain/gcc-linaro-4.9-2016.02-x86_64_arm-linux-gnueabihf
export ARCH=arm
export CROSS_COMPILE=$TOOLCHAIN/bin/arm-linux-gnueabihf-
[ "$TARGET" ] || TARGET=nethunter
[ "$DEVICE" ] || DEVICE=klte
DEFCONFIG="${TARGET}_${DEVICE}_defconfig"
DEFCONFIG_FILE=$RDIR/arch/$ARCH/configs/$DEFCONFIG
[ -f "$RDIR/arch/$ARCH/configs/$DEFCONFIG" ] || {
echo "Config $DEFCONFIG not found in $ARCH configs!"
exit 1
}
cd "$RDIR"
echo "Cleaning build..."
rm -rf build
mkdir build
make -s -i -C "$RDIR" O=build "$DEFCONFIG" menuconfig
echo "Showing differences between old config and new config"
echo "-----------------------------------------------------"
if command -v colordiff >/dev/null 2>&1; then
diff -Bwu --label "old config" "$DEFCONFIG_FILE" --label "new config" build/.config | colordiff
else
diff -Bwu --label "old config" "$DEFCONFIG_FILE" --label "new config" build/.config
echo "-----------------------------------------------------"
echo "Consider installing the colordiff package to make diffs easier to read"
fi
echo "-----------------------------------------------------"
echo -n "Are you satisfied with these changes? Y/N: "
read option
case $option in
y|Y)
cp build/.config "$DEFCONFIG_FILE"
echo "Copied new config to $DEFCONFIG_FILE"
;;
*)
echo "That's unfortunate"
;;
esac
echo "Cleaning build..."
rm -rf build
echo "Done."