@@ -2,6 +2,7 @@ use anyhow::{Result, bail};
22use async_trait:: async_trait;
33use flate2:: read:: GzDecoder ;
44use futures:: { FutureExt , future:: join_all} ;
5+ use procfs:: Current ;
56use std:: {
67 io:: Read ,
78 path:: { Path , PathBuf } ,
@@ -36,6 +37,7 @@ impl SystemRecorder {
3637 self . record_cmdline ( ) . boxed ( ) ,
3738 self . record_grub_cfg ( ) . boxed ( ) ,
3839 self . record_kernel_cfg ( ) . boxed ( ) ,
40+ self . record_loaded_modules ( ) . boxed ( ) ,
3941 ] )
4042 . await ;
4143
@@ -187,6 +189,23 @@ impl SystemRecorder {
187189 )
188190 }
189191
192+ async fn record_loaded_modules ( & self ) -> CheckResult {
193+ let name = "Record current host kernel loaded modules" ;
194+ match self
195+ . host_executor
196+ . spawn_in_host_ns ( async move { procfs:: KernelModules :: current ( ) } )
197+ . await
198+ {
199+ Ok ( Ok ( list) ) => CheckResult :: new_with_output (
200+ name,
201+ Passed ,
202+ Some ( list. 0 . into_keys ( ) . collect :: < Vec < _ > > ( ) . join ( "\n " ) ) ,
203+ ) ,
204+ Ok ( Err ( e) ) => CheckResult :: new ( name, Errored ( e. to_string ( ) ) ) ,
205+ Err ( e) => CheckResult :: new ( name, Skipped ( e. to_string ( ) ) ) ,
206+ }
207+ }
208+
190209 async fn current_kernel_version ( & self ) -> Result < String > {
191210 self . host_executor
192211 . spawn_in_host_ns ( async {
0 commit comments