Robert Lippert | aed5d2b | 2016-11-22 16:32:06 -0800 | [diff] [blame] | 1 | ################################################################################ |
| 2 | # |
| 3 | # zaius_xml |
| 4 | # |
| 5 | ################################################################################ |
| 6 | |
Robert Lippert | 851e4c3 | 2016-12-19 12:31:25 -0800 | [diff] [blame] | 7 | ZAIUS_XML_VERSION ?= db53313f3873fc0a822121c0d95f257604387a76 |
Robert Lippert | 58a08b4 | 2016-12-22 11:44:06 -0800 | [diff] [blame^] | 8 | ZAIUS_XML_SITE ?= $(call github,open-power,zaius-xml,$(ZAIUS_XML_VERSION)) |
Robert Lippert | aed5d2b | 2016-11-22 16:32:06 -0800 | [diff] [blame] | 9 | |
| 10 | ZAIUS_XML_LICENSE = Apache-2.0 |
| 11 | ZAIUS_XML_DEPENDENCIES = hostboot-install-images openpower-mrw-install-images common-p8-xml-install-images |
| 12 | |
| 13 | ZAIUS_XML_INSTALL_IMAGES = YES |
| 14 | ZAIUS_XML_INSTALL_TARGET = YES |
| 15 | |
| 16 | MRW_SCRATCH=$(STAGING_DIR)/openpower_mrw_scratch |
| 17 | MRW_HB_TOOLS=$(STAGING_DIR)/hostboot_build_images |
| 18 | |
| 19 | # Defines for BIOS metadata creation |
| 20 | BIOS_SCHEMA_FILE = $(MRW_HB_TOOLS)/bios.xsd |
| 21 | ZAIUS_BIOS_XML_CONFIG_FILE = $(MRW_SCRATCH)/$(BR2_ZAIUS_BIOS_XML_FILENAME) |
| 22 | BIOS_XML_METADATA_FILE = \ |
| 23 | $(MRW_HB_TOOLS)/$(BR2_OPENPOWER_CONFIG_NAME)_bios_metadata.xml |
| 24 | PETITBOOT_XSLT_FILE = $(MRW_HB_TOOLS)/bios_metadata_petitboot.xslt |
| 25 | PETITBOOT_BIOS_XML_METADATA_FILE = \ |
| 26 | $(MRW_HB_TOOLS)/$(BR2_OPENPOWER_CONFIG_NAME)_bios_metadata_petitboot.xml |
| 27 | PETITBOOT_BIOS_XML_METADATA_INITRAMFS_FILE = \ |
| 28 | $(TARGET_DIR)/usr/share/bios_metadata.xml |
| 29 | |
| 30 | define ZAIUS_XML_BUILD_CMDS |
| 31 | # copy the zaius xml where the common lives |
| 32 | bash -c 'mkdir -p $(MRW_SCRATCH) && cp -r $(@D)/* $(MRW_SCRATCH)' |
| 33 | |
| 34 | # generate the system mrw xml |
| 35 | perl -I $(MRW_HB_TOOLS) \ |
| 36 | $(MRW_HB_TOOLS)/processMrw.pl -x $(MRW_SCRATCH)/zaius.xml |
| 37 | |
Robert Lippert | 851e4c3 | 2016-12-19 12:31:25 -0800 | [diff] [blame] | 38 | # filter out unwanted attributes |
| 39 | chmod +x $(MRW_HB_TOOLS)/filter_out_unwanted_attributes.pl |
| 40 | |
| 41 | $(MRW_HB_TOOLS)/filter_out_unwanted_attributes.pl \ |
| 42 | --tgt-xml $(MRW_HB_TOOLS)/target_types_merged.xml \ |
| 43 | --tgt-xml $(MRW_HB_TOOLS)/target_types_hb.xml \ |
| 44 | --tgt-xml $(MRW_HB_TOOLS)/target_types_oppowervm.xml \ |
| 45 | --mrw-xml $(MRW_SCRATCH)/$(BR2_ZAIUS_MRW_XML_FILENAME) |
| 46 | |
| 47 | cp $(MRW_SCRATCH)/$(BR2_ZAIUS_MRW_XML_FILENAME).updated \ |
| 48 | $(MRW_SCRATCH)/$(BR2_ZAIUS_MRW_XML_FILENAME) |
| 49 | |
Robert Lippert | aed5d2b | 2016-11-22 16:32:06 -0800 | [diff] [blame] | 50 | # merge in any system specific attributes, hostboot attributes |
| 51 | $(MRW_HB_TOOLS)/mergexml.sh $(MRW_SCRATCH)/$(BR2_ZAIUS_SYSTEM_XML_FILENAME) \ |
| 52 | $(MRW_HB_TOOLS)/attribute_types.xml \ |
| 53 | $(MRW_HB_TOOLS)/attribute_types_hb.xml \ |
| 54 | $(MRW_HB_TOOLS)/attribute_types_oppowervm.xml \ |
| 55 | $(MRW_HB_TOOLS)/target_types_merged.xml \ |
| 56 | $(MRW_HB_TOOLS)/target_types_hb.xml \ |
| 57 | $(MRW_HB_TOOLS)/target_types_oppowervm.xml \ |
| 58 | $(MRW_SCRATCH)/$(BR2_ZAIUS_MRW_XML_FILENAME) > $(MRW_HB_TOOLS)/temporary_hb.hb.xml; |
| 59 | |
| 60 | # creating the targeting binary |
| 61 | $(MRW_HB_TOOLS)/xmltohb.pl \ |
| 62 | --hb-xml-file=$(MRW_HB_TOOLS)/temporary_hb.hb.xml \ |
| 63 | --fapi-attributes-xml-file=$(MRW_HB_TOOLS)/fapiattrs.xml \ |
| 64 | --src-output-dir=none \ |
| 65 | --img-output-dir=$(MRW_HB_TOOLS)/ \ |
| 66 | --vmm-consts-file=$(MRW_HB_TOOLS)/vmmconst.h --noshort-enums \ |
| 67 | --bios-xml-file=$(ZAIUS_BIOS_XML_CONFIG_FILE) \ |
| 68 | --bios-schema-file=$(BIOS_SCHEMA_FILE) \ |
| 69 | --bios-output-file=$(BIOS_XML_METADATA_FILE) |
| 70 | |
| 71 | # Transform BIOS XML into Petitboot specific BIOS XML via the schema |
| 72 | xsltproc -o \ |
| 73 | $(PETITBOOT_BIOS_XML_METADATA_FILE) \ |
| 74 | $(PETITBOOT_XSLT_FILE) \ |
| 75 | $(BIOS_XML_METADATA_FILE) |
| 76 | endef |
| 77 | |
| 78 | define ZAIUS_XML_INSTALL_IMAGES_CMDS |
| 79 | mv $(MRW_HB_TOOLS)/targeting.bin $(MRW_HB_TOOLS)/$(BR2_OPENPOWER_TARGETING_BIN_FILENAME) |
| 80 | endef |
| 81 | |
| 82 | define ZAIUS_XML_INSTALL_TARGET_CMDS |
| 83 | # Install Petitboot specific BIOS XML into initramfs's usr/share/ dir |
| 84 | $(INSTALL) -D -m 0644 \ |
| 85 | $(PETITBOOT_BIOS_XML_METADATA_FILE) \ |
| 86 | $(PETITBOOT_BIOS_XML_METADATA_INITRAMFS_FILE) |
| 87 | endef |
| 88 | |
| 89 | $(eval $(generic-package)) |