@@ -443,19 +443,30 @@ def get_runtime_checker_metadata() -> Dict:
443443 return yaml .safe_load (meta )
444444
445445 @staticmethod
446- def get_exclude_list_from_custom_exclude_files (root_dir : str ) -> List :
446+ def _parse_exclude_file (root_dir : str , exclude_filename : str ) -> List :
447447 """
448- Provides the list of folders that are excluded by the
449- optional metadata file image/exclude_files.yaml
448+ Retrieves an exclusion list from the provided metadata file
450449
451- :return: list of file and directory names
450+ The file should contain a YAML dictionary with a top-level key
451+ named 'exclude' and the list of exclusions as its value.
452+
453+ The list of exclusions may include:
454+ * file paths
455+ * folder paths
456+ * glob patterns
457+
458+ Paths and patterns should be relative to the filesystem or
459+ directory that they're being excluded from.
460+
461+ :return: list of paths and glob patterns
452462
453463 :param string root_dir: image root directory
464+ :param string exclude_filename: file exclusion YAML metadata file
454465
455466 :rtype: list
456467 """
457468 exclude_file = os .sep .join (
458- [root_dir , 'image' , 'exclude_files.yaml' ]
469+ [root_dir , 'image' , exclude_filename ]
459470 )
460471 exclude_list = []
461472 if os .path .isfile (exclude_file ):
@@ -473,6 +484,36 @@ def get_exclude_list_from_custom_exclude_files(root_dir: str) -> List:
473484 )
474485 return exclude_list
475486
487+ @staticmethod
488+ def get_exclude_list_from_custom_exclude_files (root_dir : str ) -> List :
489+ """
490+ Gets the list of excluded items for the root filesystem from
491+ the optional metadata file image/exclude_files.yaml
492+
493+ :return: list of paths and glob patterns
494+
495+ :param string root_dir: image root directory
496+
497+ :rtype: list
498+ """
499+ return Defaults ._parse_exclude_file (root_dir , 'exclude_files.yaml' )
500+
501+ @staticmethod
502+ def get_exclude_list_from_custom_exclude_files_for_efifatimage (root_dir : str ) -> List :
503+ """
504+ Gets the list of excluded items for the ESP's EFI folder from
505+ the optional metadata file image/exclude_files_efifatimage.yaml
506+
507+ Excluded items must be relative to the ESP's /EFI directory.
508+
509+ :return: list of paths and glob patterns
510+
511+ :param string root_dir: EFI root directory
512+
513+ :rtype: list
514+ """
515+ return Defaults ._parse_exclude_file (root_dir , 'exclude_files_efifatimage.yaml' )
516+
476517 @staticmethod
477518 def get_exclude_list_for_non_physical_devices ():
478519 """
0 commit comments