예제 #1
0
    "pe32": ["tmp.pe32", "-s", "EFI_SECTION_PE32"],
    "depex": ["tmp.dpx", "-s", "EFI_SECTION_PEI_DEPEX"],
    "cmprs": ["tmp.cmps", "-s", "EFI_SECTION_COMPRESSION", "-c"]
}

# gets the firmware file system type needed for genFFs
FFS_FILETYPE = {
    "free": "EFI_FV_FILETYPE_FREEFORM",
    "gop": "EFI_FV_FILETYPE_DRIVER",
    "peim": "EFI_FV_FILETYPE_PEIM",
}

# Translate IP_OPTIONS dict into a GUID-to-NAME lookup dict
section_name_lookup_table = {
    option[-1][1]: option[0][1]
    for option in IP_OPTIONS.values()
}


def ip_info_from_guid(lookup_val):
    """ returns the key and corresponding value """
    return get_key_and_value(IP_OPTIONS, lookup_val, [-1, 1])


def guid_section(sec_type, guid, guid_attrib, inputfile):
    """ generates the GUID defined section """
    cmd = ["tmp.guid", "-s", "EFI_SECTION_GUID_DEFINED", "-g"]
    cmd += [guid, "-r", guid_attrib, inputfile]
    return cmd

예제 #2
0
    "guid": ["tmp.guid", "-s", "EFI_SECTION_GUID_DEFINED", "-g"],
    "pe32": ["tmp.pe32", "-s", "EFI_SECTION_PE32"],
    "depex": ["tmp.dpx", "-s", "EFI_SECTION_PEI_DEPEX"],
    "cmprs": ["tmp.cmps", "-s", "EFI_SECTION_COMPRESSION", "-c"]
}

# gets the firmware file system type needed for genFFs
FFS_FILETYPE = {
    "free": "EFI_FV_FILETYPE_FREEFORM",
    "gop": "EFI_FV_FILETYPE_DRIVER",
    "peim": "EFI_FV_FILETYPE_PEIM",
}

# Translate IP_OPTIONS dict into a GUID-to-NAME lookup dict
section_name_lookup_table = {
    option[-1][1]: option[0][1] for option in IP_OPTIONS.values()}


def ip_info_from_guid(lookup_val):
    """ returns the key and corresponding value """
    return get_key_and_value(IP_OPTIONS, lookup_val, [-1, 1])


def guid_section(sec_type, guid, guid_attrib, inputfile):
    """ generates the GUID defined section """
    cmd = ["tmp.guid", "-s", "EFI_SECTION_GUID_DEFINED", "-g"]
    cmd += [guid, "-r", guid_attrib, inputfile]
    return cmd


def generate_section(inputfiles, align_sizes):