function clear_stdin()
(
    old_tty_settings=`stty -g`
    stty -icanon min 0 time 0

    while read none; do :; done

    stty "$old_tty_settings"
)
clear
KERNEL_COMPILE_CONFIG_FILE=config-6.4.0-rc5+
make KCONFIG_CONFIG=config_dir/$KERNEL_COMPILE_CONFIG_FILE O=build_dir/ubuntu-23.04 -j $(expr $(nproc) - 1)
echo Please check the log, if error, then press CTRL+C
:<<!
clear_stdin
read -n1 -p "else press any key to continue..."
make DT_CHECKER_FLAGS=-m O=build_dir/ubuntu-23.04 dt_binding_check -j $(expr $(nproc) - 1)
echo Please check the log, if error, then press CTRL+C
!
clear_stdin
read -n1 -p "else press any key to continue..."
make KCONFIG_CONFIG=config_dir/$KERNEL_COMPILE_CONFIG_FILE INSTALL_MOD_STRIP=1 O=build_dir/ubuntu-23.04 modules_install
echo Please check the log, if error, then press CTRL+C
clear_stdin
cp build_dir/ubuntu-23.04/config_dir/$KERNEL_COMPILE_CONFIG_FILE /boot/
read -n1 -p "else press any key to install the newly-built kernel and modules"
make KCONFIG_CONFIG=config_dir/$KERNEL_COMPILE_CONFIG_FILE O=build_dir/ubuntu-23.04 install
echo Installation completed! Pls reboot the system
