diff --git a/alphaplan_fwr.py b/alphaplan_fwr.py index c12314314e64590de959a2c3c3e1ba4189b639f8..7cee5129c66ed670cb06aaa6685b5dbbb0712915 100755 --- a/alphaplan_fwr.py +++ b/alphaplan_fwr.py @@ -85,6 +85,7 @@ def generate_ap_subarticle( ap_dict = get_ap_dict(machine, machine_ap, release_name_ap) # Match artifacts and get path and md5sum for artifact in artifacts: + # Compare the artifact with the match from ap_key if artifact.casefold().endswith(ap_dict[ap_key][ApSubKeys.MATCH].casefold()): path = os.path.join(output_dir, machine, artifact) path = os.path.join(*(path.split(os.path.sep)[2:])) @@ -161,13 +162,21 @@ def generate_fwr_articles( attribute, stueckliste=stueckliste, ) - # If imx-boot is in artifacts_all (TANARO), add an uboot FWR package - if "imx-boot" in artifacts_all: - subarticles_uboot = [ - ApKeys.FNGSYS_UBOOT_UPDATE, - ApKeys.FNGSYS_UBOOT_IMAGE, - ApKeys.FNGSYS_UBOOT_CHECKSUM, - ] + # If imx-boot.tar.gz or deprecated imx-boot is in artifacts_all (imx8mX)i + # add an uboot FWR package + if "imx-boot.tar.gz" in artifacts_all or "imx-boot" in artifacts_all: + if "imx-boot.tar.gz" in artifacts_all: + subarticles_uboot = [ + ApKeys.FNGSYS_UBOOT_UPDATE, + ApKeys.FNGSYS_UBOOT_IMAGETAR, + ] + # this is not needed if the above tar.gz is used. + elif "imx-boot" in artifacts_all: + subarticles_uboot = [ + ApKeys.FNGSYS_UBOOT_UPDATE, + ApKeys.FNGSYS_UBOOT_IMAGE, + ApKeys.FNGSYS_UBOOT_CHECKSUM, + ] stueckliste_uboot = [] for key in subarticles_uboot: stueckliste_uboot.append( diff --git a/alphaplan_keys.py b/alphaplan_keys.py index 45bba3ac82aefdb28161f416d8dc5b920766f5e9..0b5e3293cacc2d3e5a18903d7e326d2bed8aef0b 100755 --- a/alphaplan_keys.py +++ b/alphaplan_keys.py @@ -16,6 +16,7 @@ class ApKeys(Flag): FNGSYS_UBOOT_UPDATE = auto() FNGSYS_UBOOT_IMAGE = auto() FNGSYS_UBOOT_CHECKSUM = auto() + FNGSYS_UBOOT_IMAGETAR = auto() class ApSubKeys(Flag): @@ -133,6 +134,17 @@ def get_ap_dict(machine, machine_ap, release_name_local): ApSubKeys.ATTRIBUTESET: "Firmware, Bestandteil eines SW-Paketes", } + ap_dict[ApKeys.FNGSYS_UBOOT_IMAGETAR] = { + ApSubKeys.MATCH: "imx-boot.tar.gz", + ApSubKeys.MATCHCODE: "FS", + ApSubKeys.BEZEICHNUNG: "{} U-Boot {} Bootloader Image".format( + machine_ap, release_name_local + ), + ApSubKeys.LANGTEXT: "", + ApSubKeys.TYP: "FS", + ApSubKeys.ATTRIBUTESET: "Firmware, Bestandteil eines SW-Paketes", + } + ap_dict[ApKeys.FNGSYS_UBOOT_CHECKSUM] = { ApSubKeys.MATCH: "imx-boot.md5", ApSubKeys.MATCHCODE: "TFTP",