Skip to content

Commit c4cf46a

Browse files
committed
feat: Changed timer interrupt to 1000Hz
1 parent 2731cbc commit c4cf46a

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

src/compile_kernel_preemptrt

+6
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,13 @@ function install_kernel_interactive() {
3131
apply_patch_to_kernel "${PREEMPTRT_FILE}" "${KERNEL_FILE}"
3232
generate_new_kernel_configuration
3333
success_msg "Patch applied successfully!"
34+
35+
info_msg "Setting recommended PREEMPT_RT settings..."
36+
set_recommended_preemptrt_settings
3437
info_msg "Forcing unsigned kernel..."
3538
unsign_kernel_configuration
39+
info_msg "Override any settings if desired, else simply exit the menu..."
40+
make menuconfig
3641

3742
local INSTALLATION_MODE=$(select_installation_mode)
3843
if [ "${INSTALLATION_MODE}" == "Debian" ]
@@ -69,6 +74,7 @@ function install_kernel_noninteractive() {
6974
local PREEMPTRT_FILE=$(download_and_extract_preemptrt "${PREEMPTRT_FULL_VERSION}")
7075
apply_patch_to_kernel "${PREEMPTRT_FILE}" "${KERNEL_FILE}"
7176
generate_new_kernel_configuration
77+
set_recommended_preemptrt_settings
7278
unsign_kernel_configuration
7379
generate_preemptrt_kernel_debian_package
7480
install_preemptrt_kernel_debian_package "${PREEMPTRT_FULL_VERSION}"

src/lib_compile_kernel.sh

+12
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,18 @@ function unsign_kernel_configuration() {
194194
find_and_replace_in_config "${KERNEL_CONFIG_FILE}" "CONFIG_SYSTEM_REVOCATION_KEYS" '""'
195195
}
196196

197+
function set_recommended_preemptrt_settings() {
198+
declare desc="Set recommended PREEMPT_RT kernel configuration"
199+
local KERNEL_CONFIG_FILE=".config"
200+
comment_out_in_config "${KERNEL_CONFIG_FILE}" "CONFIG_HZ_250"
201+
find_and_replace_in_config "${KERNEL_CONFIG_FILE}" "CONFIG_HZ_1000" "y"
202+
find_and_replace_in_config "${KERNEL_CONFIG_FILE}" "CONFIG_HZ" "1000"
203+
find_and_replace_in_config "${KERNEL_CONFIG_FILE}" "CONFIG_NO_HZ_IDLE" "y"
204+
find_and_replace_in_config "${KERNEL_CONFIG_FILE}" "CONFIG_NO_HZ" "y"
205+
find_and_replace_in_config "${KERNEL_CONFIG_FILE}" "CONFIG_HIGH_RES_TIMERS" "y"
206+
find_and_replace_in_config "${KERNEL_CONFIG_FILE}" "CONFIG_CPU_ISOLATION" "y"
207+
}
208+
197209
function select_installation_mode() {
198210
declare desc="Select installation modality"
199211
echo $(dialog --keep-tite --stdout --default-item "Debian package" --menu "Select the desired installation mode:" 0 0 5 "Debian" "Debian package" "Classic" "Install directly")

0 commit comments

Comments
 (0)