## @file
# Intel Binary Product Data Generation Tool (Intel BPDG).
# This tool provide a simple process for the creation of a binary file containing read-only
# configuration data for EDK II platforms that contain Dynamic and DynamicEx PCDs described
# in VPD sections. It also provide an option for specifying an alternate name for a mapping
# file of PCD layout for use during the build when the platform integrator selects to use
# automatic offset calculation.
#
# Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>
#
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of the license may be found at
#
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#
##
# Import Modules
#
import os
import sys
from Common.BuildToolError import *
import GenVpd
## Tool entrance method
#
# This method mainly dispatch specific methods per the command line options.
# If no error found, return zero value so the caller of this tool can know
# if it's executed successfully or not.
#
# @retval 0 Tool was successful
# @retval 1 Tool failed
#
def main():
# Initialize log system
ReturnCode = 0
if Options.opt_verbose:
elif Options.debug_level != None:
else:
if Options.bin_filename == None:
EdkLogger.error("BPDG", ATTRIBUTE_NOT_AVAILABLE, "Please use the -o option to specify the file name for the VPD binary file")
EdkLogger.error("BPDG", ATTRIBUTE_NOT_AVAILABLE, "Please use the -m option to specify the file name for the mapping file")
if (Args[0] != None) :
else :
EdkLogger.error("BPDG", ATTRIBUTE_NOT_AVAILABLE, "Please specify the file which contain the VPD pcd info.",
None)
return ReturnCode
## Parse command line options
#
# Using standard Python module optparse to parse command line option of this tool.
#
# @retval options A optparse.Values object containing the parsed options
# @retval args Target of BPDG command
#
def MyOptionParser():
#
# Process command line firstly.
#
description='',
prog='BPDG',
)
## Start BPDG and call the main functions
#
# This method mainly focus on call GenVPD class member functions to complete
# BPDG's target. It will process VpdFile override, and provide the interface file
# information.
#
# @Param InputFileName The filename include the vpd type pcd information
# @param MapFileName The filename of map file that stores vpd type pcd information.
# This file will be generated by the BPDG tool after fix the offset
# and adjust the offset to make the pcd data aligned.
# @param VpdFileName The filename of Vpd file that hold vpd pcd information.
# @param Force Override the exist Vpdfile or not.
#
print "\nFile %s already exist, Overwrite(Yes/No)?[Y]: " % VpdFileName
return
if __name__ == '__main__':
r = main()
## 0-127 is a safe return range, and 1 is a standard default error
if r < 0 or r > 127: r = 1