blob: 1f5b0b8f101751c4847a2ae11231342d07463d20 [file] [log] [blame]
Matt Ploetzd8ee69a2016-08-26 12:45:30 -05001################################################################################
2#
3# witherspoon_xml
4#
5################################################################################
6
hostboot9c0767d2017-02-07 00:05:54 -06007WITHERSPOON_XML_VERSION ?= b92c88f3106bfea675874b14eb66968fd3e17264
Matt Ploetzd8ee69a2016-08-26 12:45:30 -05008WITHERSPOON_XML_SITE ?= $(call github,open-power,witherspoon-xml,$(WITHERSPOON_XML_VERSION))
9
10WITHERSPOON_XML_LICENSE = Apache-2.0
11WITHERSPOON_XML_DEPENDENCIES = hostboot-install-images openpower-mrw-install-images common-p8-xml-install-images
12
13WITHERSPOON_XML_INSTALL_IMAGES = YES
14WITHERSPOON_XML_INSTALL_TARGET = YES
15
16MRW_SCRATCH=$(STAGING_DIR)/openpower_mrw_scratch
17MRW_HB_TOOLS=$(STAGING_DIR)/hostboot_build_images
18
19# Defines for BIOS metadata creation
20BIOS_SCHEMA_FILE = $(MRW_HB_TOOLS)/bios.xsd
21WITHERSPOON_BIOS_XML_CONFIG_FILE = $(MRW_SCRATCH)/$(BR2_WITHERSPOON_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
30define 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 Gupta6aabb9e2016-11-17 17:20:48 -060035 perl -I $(MRW_HB_TOOLS) \
Matt Ploetzd8ee69a2016-08-26 12:45:30 -050036 $(MRW_HB_TOOLS)/processMrw.pl -x $(MRW_SCRATCH)/witherspoon.xml
Matt Ploetzeee3d752016-09-28 17:10:09 -050037
Prachi Guptaa40a3ac2016-11-29 23:17:19 -060038 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 Ploetzd8ee69a2016-08-26 12:45:30 -050048 # 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 Guptaa40a3ac2016-11-29 23:17:19 -060052 $(MRW_HB_TOOLS)/attribute_types_oppowervm.xml \
Matt Ploetzd8ee69a2016-08-26 12:45:30 -050053 $(MRW_HB_TOOLS)/target_types_merged.xml \
54 $(MRW_HB_TOOLS)/target_types_hb.xml \
Prachi Guptaa40a3ac2016-11-29 23:17:19 -060055 $(MRW_HB_TOOLS)/target_types_oppowervm.xml \
Matt Ploetzd8ee69a2016-08-26 12:45:30 -050056 $(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)
74endef
75
76define WITHERSPOON_XML_INSTALL_IMAGES_CMDS
77 mv $(MRW_HB_TOOLS)/targeting.bin $(MRW_HB_TOOLS)/$(BR2_OPENPOWER_TARGETING_BIN_FILENAME)
78endef
79
80define 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)
85endef
86
87$(eval $(generic-package))