forked from Mirror/pmbootstrap
kconfig check: config_file -> config_path
Rename config_file to config_path for consistency with the rest of the file. Both are used to point to the full path of the config file. Reviewed-by: Clayton Craft <clayton@craftyguy.net> Link: https://lists.sr.ht/~postmarketos/pmbootstrap-devel/%3C20230312151325.1968-5-ollieparanoid@postmarketos.org%3E
This commit is contained in:
parent
1a124ec2b6
commit
a568cf4520
1 changed files with 10 additions and 10 deletions
|
@ -234,9 +234,9 @@ def check(args, pkgname, components_list=[], details=False, must_exist=True):
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
|
|
||||||
def extract_arch(config_file):
|
def extract_arch(config_path):
|
||||||
# Extract the architecture out of the config
|
# Extract the architecture out of the config
|
||||||
with open(config_file) as f:
|
with open(config_path) as f:
|
||||||
config = f.read()
|
config = f.read()
|
||||||
if is_set(config, "ARM"):
|
if is_set(config, "ARM"):
|
||||||
return "armv7"
|
return "armv7"
|
||||||
|
@ -252,9 +252,9 @@ def extract_arch(config_file):
|
||||||
return "unknown"
|
return "unknown"
|
||||||
|
|
||||||
|
|
||||||
def extract_version(config_file):
|
def extract_version(config_path):
|
||||||
# Try to extract the version string out of the comment header
|
# Try to extract the version string out of the comment header
|
||||||
with open(config_file) as f:
|
with open(config_path) as f:
|
||||||
# Read the first 3 lines of the file and get the third line only
|
# Read the first 3 lines of the file and get the third line only
|
||||||
text = [next(f) for x in range(3)][2]
|
text = [next(f) for x in range(3)][2]
|
||||||
ver_match = re.match(r"# Linux/\S+ (\S+) Kernel Configuration", text)
|
ver_match = re.match(r"# Linux/\S+ (\S+) Kernel Configuration", text)
|
||||||
|
@ -266,18 +266,18 @@ def extract_version(config_file):
|
||||||
return "unknown"
|
return "unknown"
|
||||||
|
|
||||||
|
|
||||||
def check_file(config_file, components_list=[], details=False):
|
def check_file(config_path, components_list=[], details=False):
|
||||||
"""
|
"""
|
||||||
Check for necessary kernel config options in a kconfig file.
|
Check for necessary kernel config options in a kconfig file.
|
||||||
|
|
||||||
:param config_file: full path to kernel config file
|
:param config_path: full path to kernel config file
|
||||||
:param components_list: what to check for, e.g. ["waydroid", "iwd"]
|
:param components_list: what to check for, e.g. ["waydroid", "iwd"]
|
||||||
:param details: print all warnings if True, otherwise one generic warning
|
:param details: print all warnings if True, otherwise one generic warning
|
||||||
:returns: True when the check was successful, False otherwise
|
:returns: True when the check was successful, False otherwise
|
||||||
"""
|
"""
|
||||||
arch = extract_arch(config_file)
|
arch = extract_arch(config_path)
|
||||||
version = extract_version(config_file)
|
version = extract_version(config_path)
|
||||||
logging.debug(f"Check kconfig: parsed arch={arch}, version={version} from "
|
logging.debug(f"Check kconfig: parsed arch={arch}, version={version} from "
|
||||||
f"file: {config_file}")
|
f"file: {config_path}")
|
||||||
return check_config(config_file, arch, version, components_list,
|
return check_config(config_path, arch, version, components_list,
|
||||||
details=details)
|
details=details)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue