}
function generate_rootstrap_ix86 {
+ local build_profile=$1
+
./script/convert32.sh
if [[ $? -ne 0 ]]; then
echo "Failed to convert .xml files into 32-bit."
return $?
fi
- ./make_rootstrap.sh -C rs-config ./rs_resource --emulator -A i686
+ ./make_rootstrap.sh -C rs-config ./rs_resource --emulator -A i686 -p "${build_profile}"
RET=$?
if [[ ${RET} -ne 0 ]]; then
echo "Failed to create rootstrap."
}
function generate_rootstrap_x86_64 {
+ local build_profile=$1
+
./script/convert64.sh
if [[ $? -ne 0 ]]; then
echo "Failed to convert .xml files into 64-bit"
return $?
fi
- ./make_rootstrap_64.sh -C rs-config ./rs_resource --emulator -A x86_64
+ ./make_rootstrap_64.sh -C rs-config ./rs_resource --emulator -A x86_64 -p "${build_profile}"
RET=$?
if [[ ${RET} -ne 0 ]]; then
echo "Failed to create rootstrap."
}
function generate_rootstrap_arm {
+ local build_profile=$1
+
./script/convert32.sh
if [[ $? -ne 0 ]]; then
echo "Failed to convert .xml files into 32-bit."
return $?
fi
- ./make_rootstrap.sh -C rs-config ./rs_resource --target -A arm
+ ./make_rootstrap.sh -C rs-config ./rs_resource --target -A arm -p "${build_profile}"
RET=$?
if [[ ${RET} -ne 0 ]]; then
echo "Failed to create rootstrap."
}
function generate_rootstrap_aarch64 {
+ local build_profile=$1
+
./script/convert64.sh
if [[ $? -ne 0 ]]; then
echo "Failed to convert .xml files into 64-bit"
return $?
fi
- ./make_rootstrap_64.sh -C rs-config ./rs_resource --target -A aarch64
+ ./make_rootstrap_64.sh -C rs-config ./rs_resource --target -A aarch64 -p "${build_profile}"
RET=$?
if [[ ${RET} -ne 0 ]]; then
echo "Failed to create rootstrap."
}
function generate_rootstrap_riscv64 {
+ local build_profile=$1
+
./script/convert64.sh
if [[ $? -ne 0 ]]; then
echo "Failed to convert .xml files into 64-bit"
return $?
fi
- ./make_rootstrap_64.sh -C rs-config ./rs_resource --target -A riscv64
+ ./make_rootstrap_64.sh -C rs-config ./rs_resource --target -A riscv64 -p "${build_profile}"
RET=$?
if [[ ${RET} -ne 0 ]]; then
echo "Failed to create rootstrap."
function generate_rootstrap {
local arch=$1
local rootstrap_type=$2
+ local build_profile=$3
local rootstrap_resource_dir="./rs_resource"
rm -rf "${rootstrap_resource_dir}"
case "${arch}" in
"arm")
- generate_rootstrap_arm
+ generate_rootstrap_arm "${build_profile}"
return $?
;;
"aarch64")
- generate_rootstrap_aarch64
+ generate_rootstrap_aarch64 "${build_profile}"
return $?
;;
"i386")
- generate_rootstrap_ix86
+ generate_rootstrap_ix86 "${build_profile}"
return $?
;;
"x86_64")
- generate_rootstrap_x86_64
+ generate_rootstrap_x86_64 "${build_profile}"
return $?
;;
"riscv64")
- generate_rootstrap_riscv64
+ generate_rootstrap_riscv64 "${build_profile}"
return $?
;;
*)
ARCH=$1
ROOTSTRAP_TYPE=$2
COPY_DEST=$3
+BUILD_PROFILE=$4
-if [[ -z "${ARCH}" ]] || [[ -z "${ROOTSTRAP_TYPE}" ]] || [[ -z "${COPY_DEST}" ]]; then
+if [[ -z "${ARCH}" ]] || [[ -z "${ROOTSTRAP_TYPE}" ]] || [[ -z "${COPY_DEST}" ]] || [[ -z "${BUILD_PROFILE}" ]]; then
echo "3 parameters are required: <architecture> <rootstrap type> <generate destination>"
exit 1
fi
prepare_generation "${COPY_DEST}"
-generate_rootstrap "${ARCH}" "${ROOTSTRAP_TYPE}"
+generate_rootstrap "${ARCH}" "${ROOTSTRAP_TYPE}" "${BUILD_PROFILE}"
OPT_CONF=""
OPT_ARCH=""
INTERNAL=false
+OPT_PROFILE=""
###############################################################################
# function usage
###############################################################################
## Get Parameter
###############################################################################
-OPTS=`getopt -o -A:C:tedchv --long target,emulator,downloadrpm,help,version,internal -- "$@"`
+OPTS=`getopt -o -A:C:tedchvp: --long target,emulator,downloadrpm,help,version,internal,profile -- "$@"`
if [ $? != 0 ] ; then echo "Failed parsing options." >&2 ; exit 1 ; fi
echo ""
-C | --conf )OPT_CONF=$2;shift;shift;;
-t | --target )OPT_TARGET=true;shift;;
-e | --emulator )OPT_EMULATOR=true;shift;;
+ -p | --profile )OPT_PROFILE=$2;shift;shift;;
-h | --help )usage;exit 0;;
-v | --version )echo "${SCRIPT_NAME}" "version : $SCRIPT_VER"; exit 0 ;;
--internal ) INTERNAL=true; shift;;
log "[INFO] Postscript ${GBS_BUILDROOT}";
- if [ "$INTERNAL" = true ]; then
- log "[INFO] Skip .. removing dlog-internal.h"
- find ${GBS_BUILDROOT} -name "dlog.h" -exec perl -pi -e 's/#include\ \"dlog-internal\.h\"//g' {} \;
+ if [[ ${OPT_PROFILE} == "tv" ]]; then
+ log "[INFO] Keep dlog.h to include dlog-internal.h in dlog.h"
else
+ log "[INFO] Remove dlog-internal.h from dlog.h"
find ${GBS_BUILDROOT} -name "dlog.h" -exec perl -pi -e 's/#include\ \"dlog-internal\.h\"//g' {} \;
+ find ${GBS_BUILDROOT} -name "dlog-internal.h" -exec rm -f {} \;
fi
if [ ! -d "${GBS_BUILDROOT}/usr/lib" ]; then
log "[INFO] Postscript ${GBS_BUILDROOT}";
- if [ "$INTERNAL" = true ]; then
- log "[INFO] Skip .. removing dlog-internal.h"
- find ${GBS_BUILDROOT} -name "dlog.h" -exec perl -pi -e 's/#include\ \"dlog-internal\.h\"//g' {} \;
+ if [[ ${OPT_PROFILE} == "tv" ]]; then
+ log "[INFO] Keep dlog.h to include dlog-internal.h in dlog.h"
else
+ log "[INFO] Remove dlog-internal.h from dlog.h"
find ${GBS_BUILDROOT} -name "dlog.h" -exec perl -pi -e 's/#include\ \"dlog-internal\.h\"//g' {} \;
+ find ${GBS_BUILDROOT} -name "dlog-internal.h" -exec rm -f {} \;
fi
if [ ! -d "${GBS_BUILDROOT}/usr/lib" ]; then
OPT_CONF=""
OPT_ARCH=""
INTERNAL=false
+OPT_PROFILE=""
###############################################################################
# function usage
###############################################################################
## Get Parameter
###############################################################################
-OPTS=`getopt -o -A:C:tedchv --long target,emulator,downloadrpm,help,version,internal -- "$@"`
+OPTS=`getopt -o -A:C:tedchvp: --long target,emulator,downloadrpm,help,version,internal,profile -- "$@"`
if [ $? != 0 ] ; then echo "Failed parsing options." >&2 ; exit 1 ; fi
echo ""
-C | --conf )OPT_CONF=$2;shift;shift;;
-t | --target )OPT_TARGET=true;shift;;
-e | --emulator )OPT_EMULATOR=true;shift;;
+ -p | --profile )OPT_PROFILE=$2;shift;shift;;
-h | --help )usage;exit 0;;
-v | --version )echo "${SCRIPT_NAME}" "version : $SCRIPT_VER"; exit 0 ;;
--internal ) INTERNAL=true; shift;;
log "[INFO] Postscript ${GBS_BUILDROOT}";
- if [ "$INTERNAL" = true ]; then
- log "[INFO] Skip .. removing dlog-internal.h"
- find ${GBS_BUILDROOT} -name "dlog.h" -exec perl -pi -e 's/#include\ \"dlog-internal\.h\"//g' {} \;
+ if [[ ${OPT_PROFILE} == "tv" ]]; then
+ log "[INFO] Keep dlog.h to include dlog-internal.h in dlog.h"
else
+ log "[INFO] Remove dlog-internal.h from dlog.h"
find ${GBS_BUILDROOT} -name "dlog.h" -exec perl -pi -e 's/#include\ \"dlog-internal\.h\"//g' {} \;
+ find ${GBS_BUILDROOT} -name "dlog-internal.h" -exec rm -f {} \;
fi
if [ ! -d "${GBS_BUILDROOT}/usr/lib" ]; then
log "[INFO] Postscript ${GBS_BUILDROOT}";
- if [ "$INTERNAL" = true ]; then
- log "[INFO] Skip .. removing dlog-internal.h"
- find ${GBS_BUILDROOT} -name "dlog.h" -exec perl -pi -e 's/#include\ \"dlog-internal\.h\"//g' {} \;
+ if [[ ${OPT_PROFILE} == "tv" ]]; then
+ log "[INFO] Keep dlog.h to include dlog-internal.h in dlog.h"
else
+ log "[INFO] Remove dlog-internal.h from dlog.h"
find ${GBS_BUILDROOT} -name "dlog.h" -exec perl -pi -e 's/#include\ \"dlog-internal\.h\"//g' {} \;
+ find ${GBS_BUILDROOT} -name "dlog-internal.h" -exec rm -f {} \;
fi
if [ ! -d "${GBS_BUILDROOT}/usr/lib" ]; then
%define headed_devel_name hal-rootstrap-headed-devel
%define hal_rootstrap_headed_install_path /opt/data/hal-rootstrap/headed
+%if "%{mv_prj}" == "1"
+%define build_profile "tv"
+%else
+%define build_profile %{tizen_profile_name}
+%endif
+
Name: hal-rootstrap
Summary: Package for rootstrap of hal
Version: 0.1.0
mkdir -p %{buildroot}%{_libdir}/pkgconfig/
# hal-rootstrap
-./generate_rootstrap.sh "%{_arch}" "common" "%{buildroot}%{hal_rootstrap_install_path}"
+./generate_rootstrap.sh "%{_arch}" "common" "%{buildroot}%{hal_rootstrap_install_path}" "%{build_profile}"
cp packaging/hal-rootstrap.pc %{buildroot}%{_libdir}/pkgconfig/
./modify_pc.py "%{buildroot}%{_libdir}/pkgconfig/hal-rootstrap.pc" "%{buildroot}%{hal_rootstrap_install_path}/%{_libdir}/pkgconfig"
rm -f "%{buildroot}%{hal_rootstrap_install_path}/%{_libdir}/pkgconfig/*.pc"
# hal-rootstrap-headed
-./generate_rootstrap.sh "%{_arch}" "headed" "%{buildroot}%{hal_rootstrap_headed_install_path}"
+./generate_rootstrap.sh "%{_arch}" "headed" "%{buildroot}%{hal_rootstrap_headed_install_path}" "%{build_profile}"
cp packaging/hal-rootstrap-headed.pc %{buildroot}%{_libdir}/pkgconfig/
./modify_pc.py "%{buildroot}%{_libdir}/pkgconfig/hal-rootstrap-headed.pc" "%{buildroot}%{hal_rootstrap_headed_install_path}/%{_libdir}/pkgconfig"
rm -f "%{buildroot}%{hal_rootstrap_headed_install_path}/%{_libdir}/pkgconfig/*.pc"