@@ -153,48 +153,6 @@ def autodetect_modules(self) -> None:
153153 self .logger .warning ("No kernel modules were autodetected." )
154154
155155
156- def _normalize_kconfig_option (self , option : str ) -> str :
157- """ Normalizes a kernel config option. """
158- option = option .upper ()
159- if not option .startswith ('CONFIG_' ):
160- option = 'CONFIG_' + option
161- return option
162-
163-
164- @contains ('_kernel_config_file' , "Cannot check config, kernel config file not found." )
165- def _check_kernel_config (self , option : str ):
166- """
167- Checks if an option is set in the kernel config file.
168- Checks that the line starts with the option, and is set to 'y' or 'm'.
169- If a match is found, return the line, otherwise return None
170- """
171- option = _normalize_kconfig_option (self , option )
172- with open (self ['_kernel_config_file' ], 'r' ) as f :
173- for line in f .readlines ():
174- if line .startswith (option ):
175- if line .split ('=' )[1 ].strip ()[0 ] in ['y' , 'm' ]:
176- self .logger .debug ("Kernel config option is set: %s" % option )
177- return line
178- else :
179- return self .logger .debug ("Kernel config option is not set: %s" % option )
180- self .logger .debug ("Kernel config option not found: %s" % option )
181-
182-
183- def find_kernel_config (self ) -> None :
184- """ Tries to find the kernel config file associated with the current kernel version. """
185- build_dir = self ['_kmod_dir' ] / 'build'
186- source_dir = self ['_kmod_dir' ] / 'source'
187- for d in [build_dir , source_dir ]:
188- if d .exists ():
189- config_file = d / '.config'
190- if config_file .exists ():
191- self .logger .info ("Found kernel config file: %s" % config_file )
192- self ['_kernel_config_file' ] = config_file
193- break
194- else :
195- self .logger .warning ("Kernel config file not found." )
196-
197-
198156def get_kernel_metadata (self ) -> None :
199157 """ Gets metadata for all kernel modules. """
200158 if not self .get ('kernel_version' ):
@@ -212,7 +170,6 @@ def get_kernel_metadata(self) -> None:
212170 self .logger .warning ("Kernel module directory does not exist, but no_kmod is set." )
213171 else :
214172 raise DependencyResolutionError (f"Kernel module directory does not exist for kernel: { self ['kernel_version' ]} " )
215- find_kernel_config (self ) # Used to check kernel config options
216173
217174
218175@contains ('kmod_init' , "kmod_init is empty, skipping." )
0 commit comments