Modify scripts to use build profile flags 43/320943/3
authorSangYoun Kwak <sy.kwak@samsung.com>
Tue, 26 Nov 2024 01:44:38 +0000 (10:44 +0900)
committerSangYoun Kwak <sy.kwak@samsung.com>
Wed, 27 Nov 2024 06:29:36 +0000 (15:29 +0900)
To clarify which build profile is used, flags per build profile is used
instead of the profile itself.
 * WITH_DA: 1 if profile is DA, else 0
 * WITH_VD: 1 if profile is VD, else 0
 * WITH_VD_MV: 1 if profile is movable, else 0

With VD profile, dlog-internal code should be included. According to
it, scripts are modified, too.

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

index 6c381bcdc3a479a7ba8c81fca0325db320c4703a..751dad90a5d98abff1200ef51aa3c09530292744 100755 (executable)
@@ -14,7 +14,7 @@ function prepare_generation {
 }
 
 function generate_rootstrap_ix86 {
-       local build_profile=$1
+       local include_internal_option=$1
 
        ./script/convert32.sh
        if [[ $? -ne 0 ]]; then
@@ -22,7 +22,7 @@ function generate_rootstrap_ix86 {
                return $?
        fi
 
-       ./make_rootstrap.sh -C rs-config ./rs_resource --emulator -A i686 -p "${build_profile}"
+       ./make_rootstrap.sh -C rs-config ./rs_resource --emulator -A i686 ${include_internal_option}
        RET=$?
        if [[ ${RET} -ne 0 ]]; then
                echo "Failed to create rootstrap."
@@ -32,7 +32,7 @@ function generate_rootstrap_ix86 {
 }
 
 function generate_rootstrap_x86_64 {
-       local build_profile=$1
+       local include_internal_option=$1
 
        ./script/convert64.sh
        if [[ $? -ne 0 ]]; then
@@ -40,7 +40,7 @@ function generate_rootstrap_x86_64 {
                return $?
        fi
 
-       ./make_rootstrap_64.sh -C rs-config ./rs_resource --emulator -A x86_64 -p "${build_profile}"
+       ./make_rootstrap_64.sh -C rs-config ./rs_resource --emulator -A x86_64 ${include_internal_option}
        RET=$?
        if [[ ${RET} -ne 0 ]]; then
                echo "Failed to create rootstrap."
@@ -50,7 +50,7 @@ function generate_rootstrap_x86_64 {
 }
 
 function generate_rootstrap_arm {
-       local build_profile=$1
+       local include_internal_option=$1
 
        ./script/convert32.sh
        if [[ $? -ne 0 ]]; then
@@ -58,7 +58,7 @@ function generate_rootstrap_arm {
                return $?
        fi
 
-       ./make_rootstrap.sh -C rs-config ./rs_resource --target -A arm -p "${build_profile}"
+       ./make_rootstrap.sh -C rs-config ./rs_resource --target -A arm ${include_internal_option}
        RET=$?
        if [[ ${RET} -ne 0 ]]; then
                echo "Failed to create rootstrap."
@@ -68,7 +68,7 @@ function generate_rootstrap_arm {
 }
 
 function generate_rootstrap_aarch64 {
-       local build_profile=$1
+       local include_internal_option=$1
 
        ./script/convert64.sh
        if [[ $? -ne 0 ]]; then
@@ -76,7 +76,7 @@ function generate_rootstrap_aarch64 {
                return $?
        fi
 
-       ./make_rootstrap_64.sh -C rs-config ./rs_resource --target -A aarch64 -p "${build_profile}"
+       ./make_rootstrap_64.sh -C rs-config ./rs_resource --target -A aarch64 ${include_internal_option}
        RET=$?
        if [[ ${RET} -ne 0 ]]; then
                echo "Failed to create rootstrap."
@@ -86,7 +86,7 @@ function generate_rootstrap_aarch64 {
 }
 
 function generate_rootstrap_riscv64 {
-       local build_profile=$1
+       local include_internal_option=$1
 
        ./script/convert64.sh
        if [[ $? -ne 0 ]]; then
@@ -94,7 +94,7 @@ function generate_rootstrap_riscv64 {
                return $?
        fi
 
-       ./make_rootstrap_64.sh -C rs-config ./rs_resource --target -A riscv64 -p "${build_profile}"
+       ./make_rootstrap_64.sh -C rs-config ./rs_resource --target -A riscv64 ${include_internal_option}
        RET=$?
        if [[ ${RET} -ne 0 ]]; then
                echo "Failed to create rootstrap."
@@ -106,31 +106,38 @@ function generate_rootstrap_riscv64 {
 function generate_rootstrap {
        local arch=$1
        local rootstrap_type=$2
-       local build_profile=$3
+       local include_internal=$3
+       local include_internal_option=''
        local rootstrap_resource_dir="./rs_resource"
 
+       if [[ ${include_internal} == 1 ]]; then
+               include_internal_option="--include-internal"
+       else
+               include_internal_option=""
+       fi
+
        rm -rf "${rootstrap_resource_dir}"
        cp -r "/tmp/rs_resource/${ROOTSTRAP_TYPE}" "${rootstrap_resource_dir}"
 
        case "${arch}" in
                "arm")
-                       generate_rootstrap_arm "${build_profile}"
+                       generate_rootstrap_arm "${include_internal_option}"
                        return $?
                        ;;
                "aarch64")
-                       generate_rootstrap_aarch64 "${build_profile}"
+                       generate_rootstrap_aarch64 "${include_internal_option}"
                        return $?
                        ;;
                "i386")
-                       generate_rootstrap_ix86 "${build_profile}"
+                       generate_rootstrap_ix86 "${include_internal_option}"
                        return $?
                        ;;
                "x86_64")
-                       generate_rootstrap_x86_64 "${build_profile}"
+                       generate_rootstrap_x86_64 "${include_internal_option}"
                        return $?
                        ;;
                "riscv64")
-                       generate_rootstrap_riscv64 "${build_profile}"
+                       generate_rootstrap_riscv64 "${include_internal_option}"
                        return $?
                        ;;
                *)
@@ -143,12 +150,13 @@ function generate_rootstrap {
 ARCH=$1
 ROOTSTRAP_TYPE=$2
 COPY_DEST=$3
-BUILD_PROFILE=$4
+INCLUDE_INTERNAL=$4
 
-if [[ -z "${ARCH}" ]] || [[ -z "${ROOTSTRAP_TYPE}" ]] || [[ -z "${COPY_DEST}" ]] || [[ -z "${BUILD_PROFILE}" ]]; then
-       echo "3 parameters are required: <architecture> <rootstrap type> <generate destination>"
+if [[ -z "${ARCH}" ]] || [[ -z "${ROOTSTRAP_TYPE}" ]] || [[ -z "${COPY_DEST}" ]] || [[ -z "${INCLUDE_INTERNAL}" ]]; then
+       echo "3 parameters are required: <architecture> <rootstrap type> <generate destination> <include internal>"
+       echo "<include internal>: 0(do not include internal), 1(include internal)"
        exit 1
 fi
 
 prepare_generation "${COPY_DEST}"
-generate_rootstrap "${ARCH}" "${ROOTSTRAP_TYPE}" "${BUILD_PROFILE}"
+generate_rootstrap "${ARCH}" "${ROOTSTRAP_TYPE}" "${INCLUDE_INTERNAL}"
index 16c6d7a16056266ccdb74ea8d087b30209c911c6..af6c83cefa6492df6d2645b86051ef0278016538 100755 (executable)
@@ -59,8 +59,7 @@ OPT_TARGET=false
 OPT_EMULATOR=false
 OPT_CONF=""
 OPT_ARCH=""
-INTERNAL=false
-OPT_PROFILE=""
+OPT_INCLUDE_INTERNAL=false
 
 ###############################################################################
 # function usage
@@ -85,7 +84,7 @@ function usage () {
 ###############################################################################
 ## Get Parameter
 ###############################################################################
-OPTS=`getopt -o -A:C:tedchvp: --long target,emulator,downloadrpm,help,version,internal,profile -- "$@"`
+OPTS=`getopt -o -A:C:tedchvi --long target,emulator,downloadrpm,help,version,include-internal -- "$@"`
 if [ $? != 0 ] ; then echo "Failed parsing options." >&2 ; exit 1 ; fi
 
 echo ""
@@ -98,10 +97,9 @@ 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;;
+               -i | --include-internal ) OPT_INCLUDE_INTERNAL=true; shift;;
                -- ) shift; break ;;
                *) #file or directory
                        if [ -d "${1}" ]  || [ -f "${1}" ]; then
@@ -128,10 +126,6 @@ echo "OPT_CONF=${OPT_CONF}"
 echo "OPT_TARGET = $OPT_TARGET"
 echo "OPT_EMULATOR = $OPT_EMULATOR"
 
-if [ "$RS_INTERNAL" = true ] || [ "$INTERNAL" = true ]; then
-       echo "OPT_INTERNAL=TRUE"
-fi
-
 echo "xmlList=$xmlList"
 printf "\n"
 
@@ -178,10 +172,6 @@ log "RPM_PKG_SVR_EMULATOR = ${RPM_PKG_SVR_EMULATOR}"
 log "RPM_PKG_SVR_TARGET = ${RPM_PKG_SVR_TARGET}"
 log ""
 
-if [ "$RS_INTERNAL" = true ] || [ "$INTERNAL" = true ]; then
-       CMD_RS_GEN="$CMD_RS_GEN --internal"
-fi
-
 ###############################################################################
 ## Rootstrap Generation
 ###############################################################################
@@ -190,7 +180,7 @@ if [ "$OPT_TARGET" = true ]; then
 
        log "[INFO] Postscript ${GBS_BUILDROOT}";
 
-       if [[ ${OPT_PROFILE} == "tv" ]]; then
+       if [[ ${OPT_INCLUDE_INTERNAL} == true ]]; then
                log "[INFO] Keep dlog.h to include dlog-internal.h in dlog.h"
        else
                log "[INFO] Remove dlog-internal.h from dlog.h"
@@ -213,7 +203,7 @@ if [ "$OPT_EMULATOR" = true ]; then
 
        log "[INFO] Postscript ${GBS_BUILDROOT}";
 
-       if [[ ${OPT_PROFILE} == "tv" ]]; then
+       if [[ ${OPT_INCLUDE_INTERNAL} == true ]]; then
                log "[INFO] Keep dlog.h to include dlog-internal.h in dlog.h"
        else
                log "[INFO] Remove dlog-internal.h from dlog.h"
index 8a8826711f9498add65ae501ae01e6c38d37da4e..f6f27a24af47f1359372392dea54b526bcce8e68 100755 (executable)
@@ -59,8 +59,7 @@ OPT_TARGET=false
 OPT_EMULATOR=false
 OPT_CONF=""
 OPT_ARCH=""
-INTERNAL=false
-OPT_PROFILE=""
+OPT_INCLUDE_INTERNAL=false
 
 ###############################################################################
 # function usage
@@ -85,7 +84,7 @@ function usage () {
 ###############################################################################
 ## Get Parameter
 ###############################################################################
-OPTS=`getopt -o -A:C:tedchvp: --long target,emulator,downloadrpm,help,version,internal,profile -- "$@"`
+OPTS=`getopt -o -A:C:tedchvi --long target,emulator,downloadrpm,help,version,include-internal -- "$@"`
 if [ $? != 0 ] ; then echo "Failed parsing options." >&2 ; exit 1 ; fi
 
 echo ""
@@ -98,10 +97,9 @@ 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;;
+               -i | --include-internal ) OPT_INCLUDE_INTERNAL=true; shift;;
                -- ) shift; break ;;
                *) #file or directory
                        if [ -d "${1}" ]  || [ -f "${1}" ]; then
@@ -128,10 +126,6 @@ echo "OPT_CONF=${OPT_CONF}"
 echo "OPT_TARGET = $OPT_TARGET"
 echo "OPT_EMULATOR = $OPT_EMULATOR"
 
-if [ "$RS_INTERNAL" = true ] || [ "$INTERNAL" = true ]; then
-       echo "OPT_INTERNAL=TRUE"
-fi
-
 echo "xmlList=$xmlList"
 printf "\n"
 
@@ -178,10 +172,6 @@ log "RPM_PKG_SVR_EMULATOR = ${RPM_PKG_SVR_EMULATOR}"
 log "RPM_PKG_SVR_TARGET = ${RPM_PKG_SVR_TARGET}"
 log ""
 
-if [ "$RS_INTERNAL" = true ] || [ "$INTERNAL" = true ]; then
-       CMD_RS_GEN="$CMD_RS_GEN --internal"
-fi
-
 ###############################################################################
 ## Rootstrap Generation
 ###############################################################################
@@ -190,7 +180,7 @@ if [ "$OPT_TARGET" = true ]; then
 
        log "[INFO] Postscript ${GBS_BUILDROOT}";
 
-       if [[ ${OPT_PROFILE} == "tv" ]]; then
+       if [[ ${OPT_INCLUDE_INTERNAL} == true ]]; then
                log "[INFO] Keep dlog.h to include dlog-internal.h in dlog.h"
        else
                log "[INFO] Remove dlog-internal.h from dlog.h"
@@ -217,7 +207,7 @@ if [ "$OPT_EMULATOR" = true ]; then
 
        log "[INFO] Postscript ${GBS_BUILDROOT}";
 
-       if [[ ${OPT_PROFILE} == "tv" ]]; then
+       if [[ ${OPT_INCLUDE_INTERNAL} == true ]]; then
                log "[INFO] Keep dlog.h to include dlog-internal.h in dlog.h"
        else
                log "[INFO] Remove dlog-internal.h from dlog.h"
index 9362f3850db6d507e8b17ae0d8ca592e0539d919..1ce874008fc42512517da3a9053a91b1d5f5ffaa 100644 (file)
@@ -6,10 +6,28 @@
 %define headed_devel_name                      hal-rootstrap-headed-devel
 %define hal_rootstrap_headed_install_path      /opt/data/hal-rootstrap/headed
 
+%if "%{_with_da_profile}" == "1"
+%define WITH_DA 1
+%else
+%define WITH_DA 0
+%endif
+
+%if "%{tizen_profile_name}" == "tv"
+%define WITH_VD 1
+%else
+%define WITH_VD 0
+%endif
+
 %if "%{mv_prj}" == "1"
-%define build_profile "tv"
+%define WITH_VD_MV 1
+%else
+%define WITH_VD_MV 0
+%endif
+
+%if "%{WITH_VD}" == "1" || "%{WITH_VD_MV}" == "1"
+%define INCLUDE_INTERNAL 1
 %else
-%define build_profile %{tizen_profile_name}
+%define INCLUDE_INTERNAL 0
 %endif
 
 Name:          hal-rootstrap
@@ -70,13 +88,13 @@ mkdir %{buildroot}
 mkdir -p %{buildroot}%{_libdir}/pkgconfig/
 
 # hal-rootstrap
-./generate_rootstrap.sh "%{_arch}" "common" "%{buildroot}%{hal_rootstrap_install_path}" "%{build_profile}"
+./generate_rootstrap.sh "%{_arch}" "common" "%{buildroot}%{hal_rootstrap_install_path}" "%{INCLUDE_INTERNAL}"
 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}" "%{build_profile}"
+./generate_rootstrap.sh "%{_arch}" "headed" "%{buildroot}%{hal_rootstrap_headed_install_path}" "%{INCLUDE_INTERNAL}"
 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"
index 79787709969c57d4f2ecd0ed1253e309d079b68e..75ab6527114ec7c6907f9d8e6c32c9086363ccad 100755 (executable)
@@ -94,8 +94,8 @@ function copy_header_and_so()
        log "+ destination directory : ${dest_dir}"
        log "+ xml source file : ${xml_file}"
 
-       if [[ "${ALL}" == "*" ]] || [[ "${INTERNAL}" == true ]]; then
-               log "ALL(*) and internal is not supported"
+       if [[ "${ALL}" == "*" ]]; then
+               log "ALL(*) is not supported"
                return 1
        else
                log "+ copy necessary files .."
@@ -175,7 +175,7 @@ function check_prerequisite()
 #script start
 check_prerequisite
 
-OPTS=`getopt -o -A:t:u:b:l:hq:r: --long type:,url:,base:,list:,help,internal,log: -n 'rootstrap_gen_1.0' -- "$@"`
+OPTS=`getopt -o -A:t:u:b:l:hq:r: --long type:,url:,base:,list:,help,log: -n 'rootstrap_gen_1.0' -- "$@"`
 if [ $? != 0 ] ; then log "Failed parsing options." >&2 ; exit 1 ; fi
 
 log ""
@@ -186,7 +186,6 @@ ROOTSTRAP_TYPE=""
 RPM_PKG_URL=""
 BASE_PKG_URL=""
 XML_INPUT_LIST=""
-INTERNAL=false
 BUILD_ARCH=""
 
 while true; do
@@ -199,7 +198,6 @@ while true; do
     -b | --base ) BASE_PKG_URL="$2"; shift;shift ;;
     -l | --list ) XML_INPUT_LIST="$2 "; shift; shift ;;
     --log ) LOGFILE="$2"; shift; shift ;;
-    --internal ) INTERNAL=true; shift;;
     -h | --help ) print_usage_exit $ERROR_USAGE; shift; shift ;;
     -- ) shift; break ;;
     * )
index a5d3d11f21cce125f0034e547ac2e220173f18d3..cd44746578e28d4030e64ed280d65e03a760f026 100755 (executable)
@@ -94,8 +94,8 @@ function copy_header_and_so()
        log "+ destination directory : ${dest_dir}"
        log "+ xml source file : ${xml_file}"
 
-       if [[ "${ALL}" == "*" ]] || [[ "${INTERNAL}" == true ]]; then
-               log "ALL(*) and internal is not supported"
+       if [[ "${ALL}" == "*" ]]; then
+               log "ALL(*) is not supported"
                return 1
        else
                log "+ copy necessary files .."
@@ -175,7 +175,7 @@ function check_prerequisite()
 #script start
 check_prerequisite
 
-OPTS=`getopt -o -A:t:u:b:l:hq:r: --long type:,url:,base:,list:,help,internal,log: -n 'rootstrap_gen_1.0_64' -- "$@"`
+OPTS=`getopt -o -A:t:u:b:l:hq:r: --long type:,url:,base:,list:,help,log: -n 'rootstrap_gen_1.0_64' -- "$@"`
 if [ $? != 0 ] ; then log "Failed parsing options." >&2 ; exit 1 ; fi
 
 log ""
@@ -186,7 +186,6 @@ ROOTSTRAP_TYPE=""
 RPM_PKG_URL=""
 BASE_PKG_URL=""
 XML_INPUT_LIST=""
-INTERNAL=false
 BUILD_ARCH=""
 
 while true; do
@@ -199,7 +198,6 @@ while true; do
     -b | --base ) BASE_PKG_URL="$2"; shift;shift ;;
     -l | --list ) XML_INPUT_LIST="$2 "; shift; shift ;;
     --log ) LOGFILE="$2"; shift; shift ;;
-    --internal ) INTERNAL=true; shift;;
     -h | --help ) print_usage_exit $ERROR_USAGE; shift; shift ;;
     -- ) shift; break ;;
     * )