Skip to content

Commit

Permalink
Add: resource for kernel config file
Browse files Browse the repository at this point in the history
This file might be absent for different resasons:
  - disabled in kernel configuration
  - stored in a different location than the defautl one here (/boot/config-*)

Signed-off-by: Alexandre Esse <[email protected]>
  • Loading branch information
ahresse committed Sep 27, 2023
1 parent e1be216 commit ec53c87
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
3 changes: 3 additions & 0 deletions providers/base/units/tracers/jobs.pxu
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ _description:
The test initiates tracing using the ptrace syscall with ptrace_test binary (c source code).

id: tracers/ftrace
category_id: com.canonical.plainbox::tracers
plugin: shell
command:
if grep -q -e "^CONFIG_FTRACE=y" /boot/config-"$(uname -r)"
Expand All @@ -25,6 +26,8 @@ _summary:
Tests ftrace kernel tracing infrastructure is enable
_description:
Check if kernel configuration item CONFIG_FTRACE bool is set to 'y'.
requires:
kernel_config_file.state == 'supported'

id: tracers/tracefs
plugin: shell
Expand Down
12 changes: 12 additions & 0 deletions providers/base/units/tracers/resource.pxu
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
id: kernel_config_file
plugin: resource
_summary:
Kernel config file resource
command:
if [[ -f "/boot/config-$(uname -r)" ]]
then
echo "state: supported"
else
echo "state: unsupported"
fi
_description: Creates resource info for kernel config file

0 comments on commit ec53c87

Please sign in to comment.