summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLei YU <mine260309@gmail.com>2019-12-31 14:35:00 +0800
committerLei YU <mine260309@gmail.com>2020-01-21 10:37:25 +0800
commit647d6134d448178e6b32892322596a5cc3d78b2d (patch)
tree635ec199bcdcdbe3111ec69683d28d83c958e1e3
parent00d8ade53c7fcea79ec6a71b74d431f2a4a6bf4b (diff)
downloadopenpower-pnor-code-mgmt-master.tar.gz
openpower-pnor-code-mgmt-master.zip
generate-tar: Add machine nameHEADmaster
The openbmc image manager expects "MachineName" in MANIFEST that matches the BMC's OPENBMC_TARGET_MACHINE in /etc/os-release. * If there is no MachineName in MANIFEST, it logs a warning for now; * If they do not match, an error is reported and the version is deleted. Add -m, --machine argument for generate-tar to make it support the "MachineName". Tested: Verify that when a correct machine name is given, the tarball is processed by image manager correctly; And if an invalid machine name is given, the tarball uploaded will get "Machine name doesn't match" error and is deleted. Signed-off-by: Lei YU <mine260309@gmail.com> Change-Id: I8fbb5060cb1be348c39e0688fe7306426cc4ed77
-rwxr-xr-xgenerate-tar11
1 files changed, 11 insertions, 0 deletions
diff --git a/generate-tar b/generate-tar
index d948f33e3..313b0151d 100755
--- a/generate-tar
+++ b/generate-tar
@@ -25,6 +25,8 @@ Options:
the private key file. Defaults to the bash variable
PRIVATE_KEY_PATH if available, or else uses the
open-source private key in this script.
+ -m, --machine <name> Optionally specify the target machine name of this
+ image.
-h, --help Display this help text and exit.
'
@@ -57,6 +59,7 @@ image_type=""
outfile=""
declare -a partitions=()
tocfile="pnor.toc"
+machine_name=""
while [[ $# -gt 0 ]]; do
key="$1"
@@ -78,6 +81,10 @@ while [[ $# -gt 0 ]]; do
shift 1
fi
;;
+ -m|--machine)
+ machine_name="$2"
+ shift 2
+ ;;
-h|--help)
echo "$help"
exit
@@ -231,6 +238,10 @@ echo "Creating MANIFEST for the image"
echo -e "purpose=xyz.openbmc_project.Software.Version.VersionPurpose.Host\nversion=$version\n\
extended_version=$extended_version" >> $manifest_location
+if [[ ! -z "${machine_name}" ]]; then
+ echo -e "MachineName=${machine_name}" >> $manifest_location
+fi
+
if [[ "${do_sign}" == true ]]; then
private_key_name=$(basename "${private_key_path}")
key_type="${private_key_name%.*}"
OpenPOWER on IntegriCloud