From d7dd8b623e5012443837cfc6c9981c2b5cd083ff Mon Sep 17 00:00:00 2001 From: Salvador Fuentes Date: Wed, 28 Mar 2018 10:05:27 -0600 Subject: [PATCH] qemu: Add script to generate hypervisor configure options. This script will ensure we use a single source of qemu build options for the Kata Containers project. Fixes: #7. Signed-off-by: Salvador Fuentes --- scripts/configure-hypervisor.sh | 393 ++++++++++++++++++++++++++++++++ 1 file changed, 393 insertions(+) create mode 100755 scripts/configure-hypervisor.sh diff --git a/scripts/configure-hypervisor.sh b/scripts/configure-hypervisor.sh new file mode 100755 index 00000000..ed11cc8d --- /dev/null +++ b/scripts/configure-hypervisor.sh @@ -0,0 +1,393 @@ +#!/bin/bash +# +# Copyright (c) 2018 Intel Corporation +# +# SPDX-License-Identifier: Apache-2.0 + +#--------------------------------------------------------------------- +# Description: This script is the *ONLY* place where "qemu*" build options +# should be defined. +# +# Note to maintainers: +# +# XXX: Every option group *MUST* be documented explaining why it has +# been specified. +#--------------------------------------------------------------------- + +script_name=${0##*/} + +typeset -A recognised_tags + +recognised_tags=( + [arch]="architecture-specific" + [functionality]="required functionality" + [minimal]="specified to avoid building unnecessary elements" + [misc]="miscellaneous" + [security]="specified for security reasons" + [size]="minimise binary size" + [speed]="maximise startup speed" +) + +# Display message to stderr and exit indicating script failed. +die() +{ + local msg="$*" + echo >&2 "$script_name: ERROR: $msg" + exit 1 +} + +# Display usage to stdout. +usage() +{ +cat < + +Options: + + -d : Dump all options along with the tags explaining why each option + is specified. + -h : Display this help. + -m : Display options one per line (includes continuation characters). + +Example: + + $ $script_name qemu-lite + +EOT +} + +show_tags_header() +{ + local keys + local key + local value + + cat <