File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -222,6 +222,30 @@ check_kernel_config() {
222222 return 0
223223}
224224
225+ # Check each given kernel config is set to y/m in /proc/config.gz, logs result, returns 0/1.
226+ check_optional_config () {
227+ cfgs=$1
228+ for config_key in $cfgs ; do
229+ if command -v zgrep > /dev/null 2>&1 ; then
230+ if zgrep -qE " ^${config_key} =(y|m)" /proc/config.gz 2> /dev/null; then
231+ log_pass " Kernel config $config_key is enabled"
232+ else
233+ log_warn " Kernel config $config_key is missing or not enabled"
234+ return 1
235+ fi
236+ else
237+ # Fallback if zgrep is unavailable
238+ if gzip -dc /proc/config.gz 2> /dev/null | grep -qE " ^${config_key} =(y|m)" ; then
239+ log_pass " Kernel config $config_key is enabled"
240+ else
241+ log_warn " Kernel config $config_key is missing or not enabled"
242+ return 1
243+ fi
244+ fi
245+ done
246+ return 0
247+ }
248+
225249check_dt_nodes () {
226250 node_paths=" $1 "
227251 log_info " $node_paths "
You can’t perform that action at this time.
0 commit comments