blob: 5f631fd86a939ae0f325f986eec3a6b50ea02ed7 [file] [log] [blame]
Matt Ploetz43c30c92015-02-18 17:17:44 -06001################################################################################
2#
3# firestone_xml
4#
5################################################################################
6
hostboot37bad482016-02-25 00:07:23 -06007FIRESTONE_XML_VERSION ?= 15e371874a8dec1d8ef279aef2d0a0fed3ded8dd
Matt Ploetz43c30c92015-02-18 17:17:44 -06008FIRESTONE_XML_SITE ?= $(call github,open-power,firestone-xml,$(FIRESTONE_XML_VERSION))
9
10FIRESTONE_XML_LICENSE = Apache-2.0
11FIRESTONE_XML_DEPENDENCIES = hostboot-install-images openpower-mrw-install-images common-p8-xml-install-images
12
13FIRESTONE_XML_INSTALL_IMAGES = YES
Nick Bofferdingcd1357d2015-02-27 16:55:07 -060014FIRESTONE_XML_INSTALL_TARGET = YES
Matt Ploetz43c30c92015-02-18 17:17:44 -060015
16MRW_SCRATCH=$(STAGING_DIR)/openpower_mrw_scratch
17MRW_HB_TOOLS=$(STAGING_DIR)/hostboot_build_images
18
Nick Bofferdingcd1357d2015-02-27 16:55:07 -060019# Defines for BIOS metadata creation
20BIOS_SCHEMA_FILE = $(MRW_HB_TOOLS)/bios.xsd
21FIRESTONE_BIOS_XML_CONFIG_FILE = $(MRW_SCRATCH)/$(BR2_FIRESTONE_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
Matt Ploetz43c30c92015-02-18 17:17:44 -060030define FIRESTONE_XML_BUILD_CMDS
31 # copy the firestone xml where the common lives
32 bash -c 'mkdir -p $(MRW_SCRATCH) && cp -r $(@D)/* $(MRW_SCRATCH)'
33
34 # generate the system mrw xml
Matt Ploetzf44462f2015-02-23 14:38:03 -060035 perl -I $(MRW_HB_TOOLS) \
36 $(MRW_HB_TOOLS)/processMrw.pl -x $(MRW_SCRATCH)/firestone.xml
Nick Bofferdingcd1357d2015-02-27 16:55:07 -060037
Matt Ploetz43c30c92015-02-18 17:17:44 -060038 # merge in any system specific attributes, hostboot attributes
Matt Ploetzf44462f2015-02-23 14:38:03 -060039 $(MRW_HB_TOOLS)/mergexml.sh $(MRW_SCRATCH)/$(BR2_FIRESTONE_SYSTEM_XML_FILENAME) \
Matt Ploetz43c30c92015-02-18 17:17:44 -060040 $(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 \
44 $(MRW_SCRATCH)/$(BR2_FIRESTONE_MRW_XML_FILENAME) > $(MRW_HB_TOOLS)/temporary_hb.hb.xml;
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 Bofferdingcd1357d2015-02-27 16:55:07 -060052 --vmm-consts-file=$(MRW_HB_TOOLS)/vmmconst.h --noshort-enums \
53 --bios-xml-file=$(FIRESTONE_BIOS_XML_CONFIG_FILE) \
54 --bios-schema-file=$(BIOS_SCHEMA_FILE) \
55 --bios-output-file=$(BIOS_XML_METADATA_FILE)
Matt Ploetz43c30c92015-02-18 17:17:44 -060056
Nick Bofferdingcd1357d2015-02-27 16:55:07 -060057 # 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)
62endef
63
64define FIRESTONE_XML_INSTALL_IMAGES_CMDS
Matt Ploetz43c30c92015-02-18 17:17:44 -060065 mv $(MRW_HB_TOOLS)/targeting.bin $(MRW_HB_TOOLS)/$(BR2_OPENPOWER_TARGETING_BIN_FILENAME)
66endef
67
Nick Bofferdingcd1357d2015-02-27 16:55:07 -060068define FIRESTONE_XML_INSTALL_TARGET_CMDS
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)
73endef
74
Matt Ploetz43c30c92015-02-18 17:17:44 -060075$(eval $(generic-package))