Matt Ploetz | d8ee69a | 2016-08-26 12:45:30 -0500 | [diff] [blame] | 1 | ################################################################################ |
| 2 | # |
| 3 | # witherspoon_xml |
| 4 | # |
| 5 | ################################################################################ |
| 6 | |
hostboot | 9c0767d | 2017-02-07 00:05:54 -0600 | [diff] [blame^] | 7 | WITHERSPOON_XML_VERSION ?= b92c88f3106bfea675874b14eb66968fd3e17264 |
Matt Ploetz | d8ee69a | 2016-08-26 12:45:30 -0500 | [diff] [blame] | 8 | WITHERSPOON_XML_SITE ?= $(call github,open-power,witherspoon-xml,$(WITHERSPOON_XML_VERSION)) |
| 9 | |
| 10 | WITHERSPOON_XML_LICENSE = Apache-2.0 |
| 11 | WITHERSPOON_XML_DEPENDENCIES = hostboot-install-images openpower-mrw-install-images common-p8-xml-install-images |
| 12 | |
| 13 | WITHERSPOON_XML_INSTALL_IMAGES = YES |
| 14 | WITHERSPOON_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 | WITHERSPOON_BIOS_XML_CONFIG_FILE = $(MRW_SCRATCH)/$(BR2_WITHERSPOON_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 WITHERSPOON_XML_BUILD_CMDS |
| 31 | # copy the witherspoon xml where the common lives |
| 32 | bash -c 'mkdir -p $(MRW_SCRATCH) && cp -r $(@D)/* $(MRW_SCRATCH)' |
| 33 | |
| 34 | # generate the system mrw xml |
Prachi Gupta | 6aabb9e | 2016-11-17 17:20:48 -0600 | [diff] [blame] | 35 | perl -I $(MRW_HB_TOOLS) \ |
Matt Ploetz | d8ee69a | 2016-08-26 12:45:30 -0500 | [diff] [blame] | 36 | $(MRW_HB_TOOLS)/processMrw.pl -x $(MRW_SCRATCH)/witherspoon.xml |
Matt Ploetz | eee3d75 | 2016-09-28 17:10:09 -0500 | [diff] [blame] | 37 | |
Prachi Gupta | a40a3ac | 2016-11-29 23:17:19 -0600 | [diff] [blame] | 38 | chmod +x $(MRW_HB_TOOLS)/filter_out_unwanted_attributes.pl |
| 39 | |
| 40 | $(MRW_HB_TOOLS)/filter_out_unwanted_attributes.pl \ |
| 41 | --tgt-xml $(MRW_HB_TOOLS)/target_types_merged.xml \ |
| 42 | --tgt-xml $(MRW_HB_TOOLS)/target_types_hb.xml \ |
| 43 | --tgt-xml $(MRW_HB_TOOLS)/target_types_oppowervm.xml \ |
| 44 | --mrw-xml $(MRW_SCRATCH)/WITHERSPOON_hb.mrw.xml |
| 45 | |
| 46 | cp $(MRW_SCRATCH)/WITHERSPOON_hb.mrw.xml.updated $(MRW_SCRATCH)/WITHERSPOON_hb.mrw.xml |
| 47 | |
Matt Ploetz | d8ee69a | 2016-08-26 12:45:30 -0500 | [diff] [blame] | 48 | # merge in any system specific attributes, hostboot attributes |
| 49 | $(MRW_HB_TOOLS)/mergexml.sh $(MRW_SCRATCH)/$(BR2_WITHERSPOON_SYSTEM_XML_FILENAME) \ |
| 50 | $(MRW_HB_TOOLS)/attribute_types.xml \ |
| 51 | $(MRW_HB_TOOLS)/attribute_types_hb.xml \ |
Prachi Gupta | a40a3ac | 2016-11-29 23:17:19 -0600 | [diff] [blame] | 52 | $(MRW_HB_TOOLS)/attribute_types_oppowervm.xml \ |
Matt Ploetz | d8ee69a | 2016-08-26 12:45:30 -0500 | [diff] [blame] | 53 | $(MRW_HB_TOOLS)/target_types_merged.xml \ |
| 54 | $(MRW_HB_TOOLS)/target_types_hb.xml \ |
Prachi Gupta | a40a3ac | 2016-11-29 23:17:19 -0600 | [diff] [blame] | 55 | $(MRW_HB_TOOLS)/target_types_oppowervm.xml \ |
Matt Ploetz | d8ee69a | 2016-08-26 12:45:30 -0500 | [diff] [blame] | 56 | $(MRW_SCRATCH)/$(BR2_WITHERSPOON_MRW_XML_FILENAME) > $(MRW_HB_TOOLS)/temporary_hb.hb.xml; |
| 57 | |
| 58 | # creating the targeting binary |
| 59 | $(MRW_HB_TOOLS)/xmltohb.pl \ |
| 60 | --hb-xml-file=$(MRW_HB_TOOLS)/temporary_hb.hb.xml \ |
| 61 | --fapi-attributes-xml-file=$(MRW_HB_TOOLS)/fapiattrs.xml \ |
| 62 | --src-output-dir=none \ |
| 63 | --img-output-dir=$(MRW_HB_TOOLS)/ \ |
| 64 | --vmm-consts-file=$(MRW_HB_TOOLS)/vmmconst.h --noshort-enums \ |
| 65 | --bios-xml-file=$(WITHERSPOON_BIOS_XML_CONFIG_FILE) \ |
| 66 | --bios-schema-file=$(BIOS_SCHEMA_FILE) \ |
| 67 | --bios-output-file=$(BIOS_XML_METADATA_FILE) |
| 68 | |
| 69 | # Transform BIOS XML into Petitboot specific BIOS XML via the schema |
| 70 | xsltproc -o \ |
| 71 | $(PETITBOOT_BIOS_XML_METADATA_FILE) \ |
| 72 | $(PETITBOOT_XSLT_FILE) \ |
| 73 | $(BIOS_XML_METADATA_FILE) |
| 74 | endef |
| 75 | |
| 76 | define WITHERSPOON_XML_INSTALL_IMAGES_CMDS |
| 77 | mv $(MRW_HB_TOOLS)/targeting.bin $(MRW_HB_TOOLS)/$(BR2_OPENPOWER_TARGETING_BIN_FILENAME) |
| 78 | endef |
| 79 | |
| 80 | define WITHERSPOON_XML_INSTALL_TARGET_CMDS |
| 81 | # Install Petitboot specific BIOS XML into initramfs's usr/share/ dir |
| 82 | $(INSTALL) -D -m 0644 \ |
| 83 | $(PETITBOOT_BIOS_XML_METADATA_FILE) \ |
| 84 | $(PETITBOOT_BIOS_XML_METADATA_INITRAMFS_FILE) |
| 85 | endef |
| 86 | |
| 87 | $(eval $(generic-package)) |