blob: 9d1993be4dea3db998c635b2d3d776216c29bb2d [file] [log] [blame]
Brian Silver015b5912014-08-07 15:50:15 -05001################################################################################
2#
3# palmetto_xml
4#
5################################################################################
6
Matt Ploetz940dcf62015-02-13 13:52:56 -06007PALMETTO_XML_VERSION = 283937a8237092addf07b7ab4c436337bab89e37
Brian Silver015b5912014-08-07 15:50:15 -05008PALMETTO_XML_SITE = $(call github,open-power,palmetto-xml,$(PALMETTO_XML_VERSION))
9
10PALMETTO_XML_LICENSE = Apache-2.0
11PALMETTO_XML_DEPENDENCIES = hostboot-install-images openpower-mrw-install-images common-p8-xml-install-images
12
13PALMETTO_XML_INSTALL_IMAGES = YES
14PALMETTO_XML_INSTALL_TARGET = NO
15
16MRW_SCRATCH=$(STAGING_DIR)/openpower_mrw_scratch
Brian Silver015b5912014-08-07 15:50:15 -050017MRW_HB_TOOLS=$(STAGING_DIR)/hostboot_build_images
18
Nick Bofferding8829b7d2015-02-16 23:26:06 -060019# Defines for BIOS metadata creation
20BIOS_SCHEMA_FILE = $(MRW_HB_TOOLS)/bios.xsd
21BIOS_XML_CONFIG_FILE = $(MRW_SCRATCH)/$(BR2_PALMETTO_BIOS_XML_FILENAME)
22BIOS_XML_METADATA_FILE = \
23 $(MRW_HB_TOOLS)/$(BR2_OPENPOWER_CONFIG_NAME)_bios_metadata.xml
24PETITBOOT_XSLT_FILE = $(MRW_HB_TOOLS)/bios_metadata_petitboot.xslt
25PETITBOOT_BIOS_XML_METADATA_FILE = \
26 $(MRW_HB_TOOLS)/$(BR2_OPENPOWER_CONFIG_NAME)_bios_metadata_petitboot.xml
27PETITBOOT_BIOS_XML_METADATA_INITRAMFS_FILE = \
28 $(TARGET_DIR)/usr/share/bios_metadata.xml
29
Brian Silver015b5912014-08-07 15:50:15 -050030define 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 Silver015b5912014-08-07 15:50:15 -050033
Matt Ploetzed8800a2015-02-10 13:12:24 -060034 # generate the system mrw xml
35 perl -I $(MRW_HB_TOOLS) \
36 $(MRW_HB_TOOLS)/processMrw.pl -x $(MRW_SCRATCH)/palmetto.xml
Brian Silver015b5912014-08-07 15:50:15 -050037endef
38
39define PALMETTO_XML_INSTALL_IMAGES_CMDS
40
41 # merge in any system specific attributes, hostboot attributes
Matt Ploetzed8800a2015-02-10 13:12:24 -060042 $(MRW_HB_TOOLS)/mergexml.sh $(MRW_SCRATCH)/$(BR2_PALMETTO_SYSTEM_XML_FILENAME) \
Brian Silver015b5912014-08-07 15:50:15 -050043 $(MRW_HB_TOOLS)/attribute_types.xml \
44 $(MRW_HB_TOOLS)/attribute_types_hb.xml \
45 $(MRW_HB_TOOLS)/target_types_merged.xml \
46 $(MRW_HB_TOOLS)/target_types_hb.xml \
Matt Ploetzed8800a2015-02-10 13:12:24 -060047 $(MRW_SCRATCH)/$(BR2_PALMETTO_MRW_XML_FILENAME) > $(MRW_HB_TOOLS)/temporary_hb.hb.xml;
Brian Silver015b5912014-08-07 15:50:15 -050048
49 # creating the targeting binary
50 $(MRW_HB_TOOLS)/xmltohb.pl \
51 --hb-xml-file=$(MRW_HB_TOOLS)/temporary_hb.hb.xml \
52 --fapi-attributes-xml-file=$(MRW_HB_TOOLS)/fapiattrs.xml \
53 --src-output-dir=none \
54 --img-output-dir=$(MRW_HB_TOOLS)/ \
Nick Bofferding8829b7d2015-02-16 23:26:06 -060055 --vmm-consts-file=$(MRW_HB_TOOLS)/vmmconst.h --noshort-enums \
56 --bios-xml-file=$(BIOS_XML_CONFIG_FILE) \
57 --bios-schema-file=$(BIOS_SCHEMA_FILE) \
58 --bios-output-file=$(BIOS_XML_METADATA_FILE)
59
60 # Transform BIOS XML into Petitboot specific BIOS XML via the schema
61 xsltproc -o \
62 $(PETITBOOT_BIOS_XML_METADATA_FILE) \
63 $(PETITBOOT_XSLT_FILE) \
64 $(BIOS_XML_METADATA_FILE)
65
66 # Install Petitboot specific BIOS XML into initramfs's usr/share/ dir
67 $(INSTALL) -D -m 0644 \
68 $(PETITBOOT_BIOS_XML_METADATA_FILE) \
69 $(PETITBOOT_BIOS_XML_METADATA_INITRAMFS_FILE)
Brian Silver015b5912014-08-07 15:50:15 -050070
71 mv $(MRW_HB_TOOLS)/targeting.bin $(MRW_HB_TOOLS)/$(BR2_OPENPOWER_TARGETING_BIN_FILENAME)
72endef
73
74$(eval $(generic-package))