debian: create script to build acrn with debuild
$ debian/debian_build.sh -h
Usage: debian/debian_build.sh [--board_list ACRN_BOARDLIST] [--scenario_list ACRN_SCENARIOLIST] [--config_path CONFIGDIRS] [--release n|y] [acrn | board_inspector | clean]
Optional arguments:
-h, --help show this help message and exit
-b, --board_list list the boards to build, seperated by blank; build all scanned boards in the config path if specified as ""; build the default boards in debian rules if not specified
-s, --scenario_list list the scenarios to build, seperated by blank; build all scanned scenarios in the config path if specified as ""; build the default scenarios in debian rules if not specified
-c, --config_path specify the config path for the board and scenario configuration files, default use misc/config_tools/data if not specified
-r, --release build debug version with n, release version with y; default defined in debian rules if not specified
acrn|board_inspector|clean specify the build target, default value is acrn if not specified
Examples:
debian/debian_build.sh
debian/debian_build.sh -b nuc11tnbi5 -s shared
debian/debian_build.sh -b "nuc11tnbi5 tgl-vecow-spc-7100-Corei7" -s "shared hybrid" -c misc/config_tools/data -r y
debian/debian_build.sh -b "" -s shared
debian/debian_build.sh board_inspector
Tracked-On: #8246
Signed-off-by: szhen11 <shuang.zheng@intel.com>
Reviewed-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
2022-10-26 12:26:06 +08:00
#!/bin/bash
# Copyright (C) 2022 Intel Corporation.
# SPDX-License-Identifier: BSD-3-Clause
set -e
usage( ) {
echo " Usage: $0 [--board_list ACRN_BOARDLIST] [--scenario_list ACRN_SCENARIOLIST] [--config_path CONFIGDIRS] [--release n|y] [acrn | board_inspector | clean] "
echo "Optional arguments:"
echo " -h, --help show this help message and exit"
2023-05-12 18:06:02 +08:00
echo " -v, --verbose show verbose output"
debian: create script to build acrn with debuild
$ debian/debian_build.sh -h
Usage: debian/debian_build.sh [--board_list ACRN_BOARDLIST] [--scenario_list ACRN_SCENARIOLIST] [--config_path CONFIGDIRS] [--release n|y] [acrn | board_inspector | clean]
Optional arguments:
-h, --help show this help message and exit
-b, --board_list list the boards to build, seperated by blank; build all scanned boards in the config path if specified as ""; build the default boards in debian rules if not specified
-s, --scenario_list list the scenarios to build, seperated by blank; build all scanned scenarios in the config path if specified as ""; build the default scenarios in debian rules if not specified
-c, --config_path specify the config path for the board and scenario configuration files, default use misc/config_tools/data if not specified
-r, --release build debug version with n, release version with y; default defined in debian rules if not specified
acrn|board_inspector|clean specify the build target, default value is acrn if not specified
Examples:
debian/debian_build.sh
debian/debian_build.sh -b nuc11tnbi5 -s shared
debian/debian_build.sh -b "nuc11tnbi5 tgl-vecow-spc-7100-Corei7" -s "shared hybrid" -c misc/config_tools/data -r y
debian/debian_build.sh -b "" -s shared
debian/debian_build.sh board_inspector
Tracked-On: #8246
Signed-off-by: szhen11 <shuang.zheng@intel.com>
Reviewed-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
2022-10-26 12:26:06 +08:00
echo " -b, --board_list list the boards to build, seperated by blank; build all scanned boards in the config path if specified as \"\"; build the default boards in debian rules if not specified"
echo " -s, --scenario_list list the scenarios to build, seperated by blank; build all scanned scenarios in the config path if specified as \"\"; build the default scenarios in debian rules if not specified"
echo " -c, --config_path specify the config path for the board and scenario configuration files, default use misc/config_tools/data if not specified"
echo " -r, --release build debug version with n, release version with y; default defined in debian rules if not specified"
echo " acrn|board_inspector|clean specify the build target, default value is acrn if not specified"
echo "Examples: "
echo " $0 "
echo " $0 -b nuc11tnbi5 -s shared "
echo " $0 -b \"nuc11tnbi5 tgl-vecow-spc-7100-Corei7\" -s \"shared hybrid\" -c misc/config_tools/data -r y "
echo " $0 -b \"\" -s shared "
echo " $0 board_inspector "
}
invalid( ) {
echo " ERROR: Unrecognized argument: $1 " >& 2
usage
exit 1
}
verify_cmd( ) {
command -v $@ >/dev/null 2>& 1 || { echo >& 2 " ERROR: $@ is not installed which is required for running this script. Aborting. " ; exit 1; }
}
verify_cmd readlink
verify_cmd debuild
verify_cmd "gbp dch"
POSITIONAL_ARGS = ( )
board_list = "default"
scenario_list = "default"
config_path = "misc/config_tools/data"
release = "default"
while [ [ $# -gt 0 ] ] ; do
case $1 in
-b| --board_list)
board_list = " $2 "
shift 2
; ;
-s| --scenario_list)
scenario_list = " $2 "
shift 2
; ;
-c| --config_path)
config_path = " $2 "
shift 2
; ;
-r| --release)
release = " $2 "
shift 2
; ;
2023-05-12 18:06:02 +08:00
-v| --verbose)
verbose = 1
shift
; ;
debian: create script to build acrn with debuild
$ debian/debian_build.sh -h
Usage: debian/debian_build.sh [--board_list ACRN_BOARDLIST] [--scenario_list ACRN_SCENARIOLIST] [--config_path CONFIGDIRS] [--release n|y] [acrn | board_inspector | clean]
Optional arguments:
-h, --help show this help message and exit
-b, --board_list list the boards to build, seperated by blank; build all scanned boards in the config path if specified as ""; build the default boards in debian rules if not specified
-s, --scenario_list list the scenarios to build, seperated by blank; build all scanned scenarios in the config path if specified as ""; build the default scenarios in debian rules if not specified
-c, --config_path specify the config path for the board and scenario configuration files, default use misc/config_tools/data if not specified
-r, --release build debug version with n, release version with y; default defined in debian rules if not specified
acrn|board_inspector|clean specify the build target, default value is acrn if not specified
Examples:
debian/debian_build.sh
debian/debian_build.sh -b nuc11tnbi5 -s shared
debian/debian_build.sh -b "nuc11tnbi5 tgl-vecow-spc-7100-Corei7" -s "shared hybrid" -c misc/config_tools/data -r y
debian/debian_build.sh -b "" -s shared
debian/debian_build.sh board_inspector
Tracked-On: #8246
Signed-off-by: szhen11 <shuang.zheng@intel.com>
Reviewed-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
2022-10-26 12:26:06 +08:00
-h| --help)
usage
exit 0
; ;
-*| --*)
invalid $1
; ;
*)
POSITIONAL_ARGS += ( " $1 " )
shift
; ;
esac
done
set -- " ${ POSITIONAL_ARGS [@] } "
cmd = "debuild"
2023-05-12 18:06:02 +08:00
if [ -n " $verbose " ] ; then
cmd = " $cmd -eDH_VERBOSE=1 "
fi
debian: create script to build acrn with debuild
$ debian/debian_build.sh -h
Usage: debian/debian_build.sh [--board_list ACRN_BOARDLIST] [--scenario_list ACRN_SCENARIOLIST] [--config_path CONFIGDIRS] [--release n|y] [acrn | board_inspector | clean]
Optional arguments:
-h, --help show this help message and exit
-b, --board_list list the boards to build, seperated by blank; build all scanned boards in the config path if specified as ""; build the default boards in debian rules if not specified
-s, --scenario_list list the scenarios to build, seperated by blank; build all scanned scenarios in the config path if specified as ""; build the default scenarios in debian rules if not specified
-c, --config_path specify the config path for the board and scenario configuration files, default use misc/config_tools/data if not specified
-r, --release build debug version with n, release version with y; default defined in debian rules if not specified
acrn|board_inspector|clean specify the build target, default value is acrn if not specified
Examples:
debian/debian_build.sh
debian/debian_build.sh -b nuc11tnbi5 -s shared
debian/debian_build.sh -b "nuc11tnbi5 tgl-vecow-spc-7100-Corei7" -s "shared hybrid" -c misc/config_tools/data -r y
debian/debian_build.sh -b "" -s shared
debian/debian_build.sh board_inspector
Tracked-On: #8246
Signed-off-by: szhen11 <shuang.zheng@intel.com>
Reviewed-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
2022-10-26 12:26:06 +08:00
if [ " $board_list " != "default" ] ; then
echo " ACRN_BOARDLIST = ${ board_list @Q } "
cmd = " $cmd -eACRN_BOARDLIST= ${ board_list @Q } "
fi
if [ " $scenario_list " != "default" ] ; then
echo " ACRN_SCENARIOLIST = ${ scenario_list @Q } "
cmd = " $cmd -eACRN_SCENARIOLIST= ${ scenario_list @Q } "
fi
cmd = " $cmd -eCONFIGDIRS= ${ config_path @Q } "
echo " CONFIGDIRS = ${ config_path @Q } "
if [ " $release " != "default" ] ; then
echo " RELEASE = ${ release @Q } "
if [ " $release " != "n" ] && [ " $release " != "y" ] ; then
echo "ERROR: the release argument can only be n or y."
exit 1
fi
cmd = " $cmd -eRELEASE= ${ release @Q } "
fi
if [ -z $1 ] || [ " $1 " = = "acrn" ] ; then
cmd = " $cmd -- binary "
elif [ " $1 " = = "board_inspector" ] ; then
cmd = " $cmd -- binary-indep "
elif [ " $1 " = = "clean" ] ; then
cmd = " $cmd -- clean "
fi
SCRIPT = $( readlink -f " $0 " )
SCRIPT_PATH = $( dirname " $SCRIPT " )
cd $SCRIPT_PATH /../
source VERSION
rm -rf debian/changelog
2022-11-11 14:38:49 +08:00
if [ -z $EMAIL ] && [ -z $DEBEMAIL ] ; then
export DEBEMAIL = $( git config --get user.email)
if [ -z $DEBEMAIL ] ; then
export DEBEMAIL = "projectacrn@gmail.com"
fi
debian: create script to build acrn with debuild
$ debian/debian_build.sh -h
Usage: debian/debian_build.sh [--board_list ACRN_BOARDLIST] [--scenario_list ACRN_SCENARIOLIST] [--config_path CONFIGDIRS] [--release n|y] [acrn | board_inspector | clean]
Optional arguments:
-h, --help show this help message and exit
-b, --board_list list the boards to build, seperated by blank; build all scanned boards in the config path if specified as ""; build the default boards in debian rules if not specified
-s, --scenario_list list the scenarios to build, seperated by blank; build all scanned scenarios in the config path if specified as ""; build the default scenarios in debian rules if not specified
-c, --config_path specify the config path for the board and scenario configuration files, default use misc/config_tools/data if not specified
-r, --release build debug version with n, release version with y; default defined in debian rules if not specified
acrn|board_inspector|clean specify the build target, default value is acrn if not specified
Examples:
debian/debian_build.sh
debian/debian_build.sh -b nuc11tnbi5 -s shared
debian/debian_build.sh -b "nuc11tnbi5 tgl-vecow-spc-7100-Corei7" -s "shared hybrid" -c misc/config_tools/data -r y
debian/debian_build.sh -b "" -s shared
debian/debian_build.sh board_inspector
Tracked-On: #8246
Signed-off-by: szhen11 <shuang.zheng@intel.com>
Reviewed-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
Reviewed-by: Junjie Mao <junjie.mao@intel.com>
2022-10-26 12:26:06 +08:00
fi
gbp dch -S --git-log= "-n 10" --id-length= 10 --ignore-branch
sed -i " s/unknown/ $MAJOR_VERSION . $MINOR_VERSION $EXTRA_VERSION /g " debian/changelog
echo $cmd
echo $cmd | bash -
cd -