Brian Silver | 015b591 | 2014-08-07 15:50:15 -0500 | [diff] [blame] | 1 | ################################################################################ |
| 2 | # |
| 3 | # palmetto_xml |
| 4 | # |
| 5 | ################################################################################ |
| 6 | |
Matt Ploetz | 0b60ee2 | 2015-02-25 09:37:49 -0600 | [diff] [blame^] | 7 | PALMETTO_XML_VERSION = 0c1152643a1087c2481ca129d7baaf6225a2976d |
Brian Silver | 015b591 | 2014-08-07 15:50:15 -0500 | [diff] [blame] | 8 | PALMETTO_XML_SITE = $(call github,open-power,palmetto-xml,$(PALMETTO_XML_VERSION)) |
| 9 | |
| 10 | PALMETTO_XML_LICENSE = Apache-2.0 |
| 11 | PALMETTO_XML_DEPENDENCIES = hostboot-install-images openpower-mrw-install-images common-p8-xml-install-images |
| 12 | |
| 13 | PALMETTO_XML_INSTALL_IMAGES = YES |
Nick Bofferding | c00159f | 2015-02-16 23:52:36 -0600 | [diff] [blame] | 14 | PALMETTO_XML_INSTALL_TARGET = YES |
Brian Silver | 015b591 | 2014-08-07 15:50:15 -0500 | [diff] [blame] | 15 | |
| 16 | MRW_SCRATCH=$(STAGING_DIR)/openpower_mrw_scratch |
Brian Silver | 015b591 | 2014-08-07 15:50:15 -0500 | [diff] [blame] | 17 | MRW_HB_TOOLS=$(STAGING_DIR)/hostboot_build_images |
| 18 | |
Nick Bofferding | 8829b7d | 2015-02-16 23:26:06 -0600 | [diff] [blame] | 19 | # Defines for BIOS metadata creation |
| 20 | BIOS_SCHEMA_FILE = $(MRW_HB_TOOLS)/bios.xsd |
Nick Bofferding | 668c258 | 2015-02-17 01:00:01 -0600 | [diff] [blame] | 21 | PALMETTO_BIOS_XML_CONFIG_FILE = $(MRW_SCRATCH)/$(BR2_PALMETTO_BIOS_XML_FILENAME) |
Nick Bofferding | 8829b7d | 2015-02-16 23:26:06 -0600 | [diff] [blame] | 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 | |
Brian Silver | 015b591 | 2014-08-07 15:50:15 -0500 | [diff] [blame] | 30 | define PALMETTO_XML_BUILD_CMDS |
| 31 | # copy the palmetto xml where the common lives |
| 32 | bash -c 'mkdir -p $(MRW_SCRATCH) && cp -r $(@D)/* $(MRW_SCRATCH)' |
Brian Silver | 015b591 | 2014-08-07 15:50:15 -0500 | [diff] [blame] | 33 | |
Matt Ploetz | ed8800a | 2015-02-10 13:12:24 -0600 | [diff] [blame] | 34 | # generate the system mrw xml |
| 35 | perl -I $(MRW_HB_TOOLS) \ |
| 36 | $(MRW_HB_TOOLS)/processMrw.pl -x $(MRW_SCRATCH)/palmetto.xml |
Nick Bofferding | c00159f | 2015-02-16 23:52:36 -0600 | [diff] [blame] | 37 | |
Brian Silver | 015b591 | 2014-08-07 15:50:15 -0500 | [diff] [blame] | 38 | # merge in any system specific attributes, hostboot attributes |
Matt Ploetz | ed8800a | 2015-02-10 13:12:24 -0600 | [diff] [blame] | 39 | $(MRW_HB_TOOLS)/mergexml.sh $(MRW_SCRATCH)/$(BR2_PALMETTO_SYSTEM_XML_FILENAME) \ |
Brian Silver | 015b591 | 2014-08-07 15:50:15 -0500 | [diff] [blame] | 40 | $(MRW_HB_TOOLS)/attribute_types.xml \ |
| 41 | $(MRW_HB_TOOLS)/attribute_types_hb.xml \ |
| 42 | $(MRW_HB_TOOLS)/target_types_merged.xml \ |
| 43 | $(MRW_HB_TOOLS)/target_types_hb.xml \ |
Matt Ploetz | ed8800a | 2015-02-10 13:12:24 -0600 | [diff] [blame] | 44 | $(MRW_SCRATCH)/$(BR2_PALMETTO_MRW_XML_FILENAME) > $(MRW_HB_TOOLS)/temporary_hb.hb.xml; |
Brian Silver | 015b591 | 2014-08-07 15:50:15 -0500 | [diff] [blame] | 45 | |
| 46 | # creating the targeting binary |
| 47 | $(MRW_HB_TOOLS)/xmltohb.pl \ |
| 48 | --hb-xml-file=$(MRW_HB_TOOLS)/temporary_hb.hb.xml \ |
| 49 | --fapi-attributes-xml-file=$(MRW_HB_TOOLS)/fapiattrs.xml \ |
| 50 | --src-output-dir=none \ |
| 51 | --img-output-dir=$(MRW_HB_TOOLS)/ \ |
Nick Bofferding | 8829b7d | 2015-02-16 23:26:06 -0600 | [diff] [blame] | 52 | --vmm-consts-file=$(MRW_HB_TOOLS)/vmmconst.h --noshort-enums \ |
Nick Bofferding | 668c258 | 2015-02-17 01:00:01 -0600 | [diff] [blame] | 53 | --bios-xml-file=$(PALMETTO_BIOS_XML_CONFIG_FILE) \ |
Nick Bofferding | 8829b7d | 2015-02-16 23:26:06 -0600 | [diff] [blame] | 54 | --bios-schema-file=$(BIOS_SCHEMA_FILE) \ |
| 55 | --bios-output-file=$(BIOS_XML_METADATA_FILE) |
| 56 | |
| 57 | # Transform BIOS XML into Petitboot specific BIOS XML via the schema |
| 58 | xsltproc -o \ |
| 59 | $(PETITBOOT_BIOS_XML_METADATA_FILE) \ |
| 60 | $(PETITBOOT_XSLT_FILE) \ |
| 61 | $(BIOS_XML_METADATA_FILE) |
Nick Bofferding | c00159f | 2015-02-16 23:52:36 -0600 | [diff] [blame] | 62 | endef |
Nick Bofferding | 8829b7d | 2015-02-16 23:26:06 -0600 | [diff] [blame] | 63 | |
Nick Bofferding | c00159f | 2015-02-16 23:52:36 -0600 | [diff] [blame] | 64 | define PALMETTO_XML_INSTALL_IMAGES_CMDS |
| 65 | mv $(MRW_HB_TOOLS)/targeting.bin $(MRW_HB_TOOLS)/$(BR2_OPENPOWER_TARGETING_BIN_FILENAME) |
| 66 | endef |
| 67 | |
| 68 | define PALMETTO_XML_INSTALL_TARGET_CMDS |
Nick Bofferding | 8829b7d | 2015-02-16 23:26:06 -0600 | [diff] [blame] | 69 | # Install Petitboot specific BIOS XML into initramfs's usr/share/ dir |
| 70 | $(INSTALL) -D -m 0644 \ |
| 71 | $(PETITBOOT_BIOS_XML_METADATA_FILE) \ |
| 72 | $(PETITBOOT_BIOS_XML_METADATA_INITRAMFS_FILE) |
Brian Silver | 015b591 | 2014-08-07 15:50:15 -0500 | [diff] [blame] | 73 | endef |
| 74 | |
| 75 | $(eval $(generic-package)) |