Skip to content

Commit

Permalink
T3202: add single variable for Kernel dynamic debug settings
Browse files Browse the repository at this point in the history
  • Loading branch information
c-po committed Jun 20, 2024
1 parent d818788 commit 9495f90
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/conf_mode/system_option.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
ssh_config = r'/etc/ssh/ssh_config.d/91-vyos-ssh-client-options.conf'
systemd_action_file = '/lib/systemd/system/ctrl-alt-del.target'
usb_autosuspend = r'/etc/udev/rules.d/40-usb-autosuspend.rules'
kernel_dynamic_debug = r'/sys/kernel/debug/dynamic_debug/control'
time_format_to_locale = {
'12-hour': 'en_US.UTF-8',
'24-hour': 'en_GB.UTF-8'
Expand Down Expand Up @@ -160,6 +161,7 @@ def apply(options):
time_format = time_format_to_locale.get(options['time_format'])
cmd(f'localectl set-locale LC_TIME={time_format}')

# Reload UDEV, required for USB auto suspend
cmd('udevadm control --reload-rules')

# Enable/disable dynamic debugging for kernel modules
Expand All @@ -168,9 +170,9 @@ def apply(options):
for module in modules:
if module in modules_enabled:
check_kmod(module)
write_file('/sys/kernel/debug/dynamic_debug/control', f'module {module} +p')
write_file(kernel_dynamic_debug, f'module {module} +p')
else:
write_file('/sys/kernel/debug/dynamic_debug/control', f'module {module} -p')
write_file(kernel_dynamic_debug, f'module {module} -p')

if __name__ == '__main__':
try:
Expand Down

0 comments on commit 9495f90

Please sign in to comment.