kernel_samsung_a53x/build.sh

97 lines
2.2 KiB
Bash
Raw Normal View History

2023-10-17 13:17:51 +02:00
#!/bin/bash
2024-11-17 22:11:18 +01:00
command_one() {
2025-01-15 16:32:35 +01:00
echo "Building without KernelSU Next..."
export FIREASF_VANILLA=true
./kernel_build/build-fireasf.sh "$(pwd)" || exit 1
2025-01-17 00:06:27 +01:00
exit 0
2024-11-17 22:11:18 +01:00
}
command_two() {
2025-01-15 16:32:35 +01:00
echo "Building with KernelSU Next..."
export FIREASF_VANILLA=false
./kernel_build/build-fireasf.sh "$(pwd)" || exit 1
2025-01-17 00:06:27 +01:00
exit 0
2024-11-17 22:11:18 +01:00
}
command_three() {
2024-12-03 18:20:43 +01:00
rm -rf setup.sh*
rm -rf KernelSU*
2025-01-29 16:48:25 +01:00
curl -LSs "https://raw.githubusercontent.com/rifsxd/KernelSU-Next/next/kernel/setup.sh" | bash -s next
cp $(pwd)/patches/Implement-SUSFS-v1.5.4-for-KernelSU-Next.patch $(pwd)/KernelSU-Next/Implement-SUSFS-v1.5.4-for-KernelSU-Next.patch
cd $(pwd)/KernelSU-Next/
patch -p1 < Implement-SUSFS-v1.5.4-for-KernelSU-Next.patch
cd ..
echo "Applied susfs4ksu"
}
command_four() {
2025-01-22 19:59:35 +01:00
if [ "$USE_CCACHE" = "1" ]; then
export USE_CCACHE=0
else
export USE_CCACHE=1
fi
}
command_five() {
2025-01-16 23:32:03 +01:00
echo "Regenerating defconfigs"
./kernel_build/regen.sh "$(pwd)" || exit 1
2025-01-17 00:06:27 +01:00
exit 0
2024-11-17 22:11:18 +01:00
}
2025-01-22 19:59:35 +01:00
command_six() {
OUTDIR="$(pwd)/out"
MODULES_OUTDIR="$(pwd)/modules_out"
TMPDIR="$(pwd)/kernel_build/tmp"
rm -rf "$TMPDIR"
rm -rf "$MODULES_OUTDIR"
rm -rf "$OUTDIR"
exit 0
}
2024-11-17 22:11:18 +01:00
# Main loop
while true; do
echo ""
echo "Choose what to do:"
2025-01-18 22:02:10 +01:00
echo "1: Build FireAsf kernel without KernelSU Next"
echo "2: Build FireAsf kernel with KernelSU Next"
2025-01-15 16:32:35 +01:00
echo "3: Setup KernelSU Next (run before 2)"
2025-01-22 19:59:35 +01:00
if [ "$USE_CCACHE" = "1" ]; then
echo "4: Disable ccache"
else
echo "4: Enable ccache"
fi
echo "5: Regenerate defconfigs"
echo "6: Clean build dirs"
2024-11-17 22:11:18 +01:00
echo "Type 'exit' to guess what? Exit, yeah exit!"
read -p "Make a good choice: " choice
case $choice in
1)
command_one
;;
2)
command_two
;;
3)
command_three
;;
2025-01-16 23:32:03 +01:00
4)
command_four
;;
5)
command_five
;;
2025-01-22 19:59:35 +01:00
6)
command_six
;;
2024-11-17 22:11:18 +01:00
exit)
echo "Exiting the program. Goodbye!"
break
;;
*)
echo "Invalid. Learn how to type."
;;
esac
done