summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xgenerate_rootstrap.sh36
-rwxr-xr-xmake_rootstrap.sh18
-rwxr-xr-xmake_rootstrap_64.sh18
-rw-r--r--packaging/hal-rootstrap.spec10
4 files changed, 54 insertions, 28 deletions
diff --git a/generate_rootstrap.sh b/generate_rootstrap.sh
index 69e9b98..6c381bc 100755
--- a/generate_rootstrap.sh
+++ b/generate_rootstrap.sh
@@ -14,13 +14,15 @@ function prepare_generation {
}
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."
@@ -30,13 +32,15 @@ function generate_rootstrap_ix86 {
}
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."
@@ -46,13 +50,15 @@ function generate_rootstrap_x86_64 {
}
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."
@@ -62,13 +68,15 @@ function generate_rootstrap_arm {
}
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."
@@ -78,13 +86,15 @@ function generate_rootstrap_aarch64 {
}
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."
@@ -96,6 +106,7 @@ function generate_rootstrap_riscv64 {
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}"
@@ -103,23 +114,23 @@ function generate_rootstrap {
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 $?
;;
*)
@@ -132,11 +143,12 @@ function generate_rootstrap {
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}"
diff --git a/make_rootstrap.sh b/make_rootstrap.sh
index e3e44eb..16c6d7a 100755
--- a/make_rootstrap.sh
+++ b/make_rootstrap.sh
@@ -60,6 +60,7 @@ OPT_EMULATOR=false
OPT_CONF=""
OPT_ARCH=""
INTERNAL=false
+OPT_PROFILE=""
###############################################################################
# function usage
@@ -84,7 +85,7 @@ 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 ""
@@ -97,6 +98,7 @@ while true; do
-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;;
@@ -188,11 +190,12 @@ if [ "$OPT_TARGET" = true ]; 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
@@ -210,11 +213,12 @@ if [ "$OPT_EMULATOR" = true ]; 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
diff --git a/make_rootstrap_64.sh b/make_rootstrap_64.sh
index 6c40a2c..8a88267 100755
--- a/make_rootstrap_64.sh
+++ b/make_rootstrap_64.sh
@@ -60,6 +60,7 @@ OPT_EMULATOR=false
OPT_CONF=""
OPT_ARCH=""
INTERNAL=false
+OPT_PROFILE=""
###############################################################################
# function usage
@@ -84,7 +85,7 @@ 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 ""
@@ -97,6 +98,7 @@ while true; do
-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;;
@@ -188,11 +190,12 @@ if [ "$OPT_TARGET" = true ]; 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
@@ -214,11 +217,12 @@ if [ "$OPT_EMULATOR" = true ]; 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
diff --git a/packaging/hal-rootstrap.spec b/packaging/hal-rootstrap.spec
index 4becef8..9362f38 100644
--- a/packaging/hal-rootstrap.spec
+++ b/packaging/hal-rootstrap.spec
@@ -6,6 +6,12 @@
%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
@@ -64,13 +70,13 @@ mkdir %{buildroot}
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"