Modify to include dlog-internal.h if profile is tv 46/320246/2 accepted/tizen/9.0/unified/20241114.015949
authorSangYoun Kwak <sy.kwak@samsung.com>
Mon, 11 Nov 2024 10:31:46 +0000 (19:31 +0900)
committerSangYoun Kwak <sy.kwak@samsung.com>
Mon, 11 Nov 2024 11:03:13 +0000 (20:03 +0900)
Since it is required to keep dlog-internal.h when the build profile is
'tv', rootstrap generating scripts are modified:
 * If the profile is 'tv', then the "including statement of
   dlog-internal.h" is not removed.
 * If the build profile is not 'tv', then dlog-internal.h file is not
   required, so it is removed when the build profile is not 'tv'.

Change-Id: I52c24e8260b17e829f2d6c715821735e6775e859
Signed-off-by: SangYoun Kwak <sy.kwak@samsung.com>
generate_rootstrap.sh
make_rootstrap.sh
make_rootstrap_64.sh
packaging/hal-rootstrap.spec

index 69e9b9841dd5bc75dbaaac11e576561e2d9c5314..6c381bcdc3a479a7ba8c81fca0325db320c4703a 100755 (executable)
@@ -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}"
index e3e44eb42604c3f6a63fc3dbcf32b3def10aecfb..16c6d7a16056266ccdb74ea8d087b30209c911c6 100755 (executable)
@@ -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
index 6c40a2c5705c02e8f42606c83fa30d3a54572983..8a8826711f9498add65ae501ae01e6c38d37da4e 100755 (executable)
@@ -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
index 4becef8bedd20cb0260c6572fcaab6be6a83a365..9362f3850db6d507e8b17ae0d8ca592e0539d919 100644 (file)
@@ -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"