ocebuild.pipeline.ssdts#

Methods for retrieving and handling SSDT binaries and source code.

Module Contents#

Functions#

extract_iasl_binary(→ Generator[Callable[[List[str]], ...)

Extracts an iasl binary and yields a subprocess wrapper.

iasl_wrapper(→ Generator[Callable[[List[str]], str], ...)

Returns a subprocess wrapper for an existing or extracted iasl binary.

translate_ssdts(...)

Decompiles or compiles SSDT tables using iasl.

sort_ssdt_symbols(→ collections.OrderedDict)

Sorts the injection order of SSDT tables by resolving symbolic references.

extract_ssdts(→ dict)

Extracts the metadata of all SSDTs in a directory.

ocebuild.pipeline.ssdts.extract_iasl_binary(url: str | None = None, cache: bool = True, persist: bool = False) Generator[Callable[[List[str]], str], any, None][source]#

Extracts an iasl binary and yields a subprocess wrapper.

Parameters:
  • url – The URL to the iasl binary. If not provided, the URL will be automatically retrieved based on the current platform.

  • cache – Whether to cache the extracted iasl binary for subsequent calls.

  • persist – Whether to persist the binary wrapper outside the current context.

Yields:

A subprocess wrapper for the extracted iasl binary.

ocebuild.pipeline.ssdts.iasl_wrapper(cache: bool = True) Generator[Callable[[List[str]], str], any, None][source]#

Returns a subprocess wrapper for an existing or extracted iasl binary.

By default, this method will attempt to locate an existing iasl binary on the system. If one is not found, it will extract a temporary iasl binary from the Qonfused/iASL repository.

Parameters:

cache – Whether to cache the extracted iasl binary.

Yields:

A subprocess wrapper for the iasl binary.

ocebuild.pipeline.ssdts.translate_ssdts(filepaths: List[str | ocebuild.third_party.cpython.pathlib.Path], directory: str | ocebuild.third_party.cpython.pathlib.Path | None = None, persist: bool = False) Generator[List[ocebuild.third_party.cpython.pathlib.Path], any, None][source]#

Decompiles or compiles SSDT tables using iasl.

Parameters:
  • filepaths – A list of filepaths to SSDT *.aml or *.dsl files.

  • persist – Whether to persist the SSDT files.

Yields:

A list of filepaths to the compiled + decompiled SSDT files.

ocebuild.pipeline.ssdts.sort_ssdt_symbols(filepaths: List[str | ocebuild.third_party.cpython.pathlib.Path]) collections.OrderedDict[source]#

Sorts the injection order of SSDT tables by resolving symbolic references.

This is a naive implementation that does not prune conditional branches or build flags outside of standard ACPI spec. It is intended to be used as a baseline reference for the injection order of SSDT tables in the absence of information about the system’s DSDT.

Parameters:

filepaths – A list of filepaths to SSDT *.dsl files.

Returns:

An ordered dictionary of SSDT table names with their exported symbols.

ocebuild.pipeline.ssdts.extract_ssdts(directory: str | ocebuild.third_party.cpython.pathlib.Path) dict[source]#

Extracts the metadata of all SSDTs in a directory.