summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSangYoun Kwak <sy.kwak@samsung.com>2024-05-17 19:22:50 +0900
committerSangYoun Kwak <sy.kwak@samsung.com>2024-05-27 13:54:46 +0900
commitd24a2c219070cdba27b3d1621c928bdcf17462df (patch)
tree99b4bb4f4ae064c1f26701d3ffdc9fffa7556db7
parent4ac658d8a2890a6ed0229ebbcea2e1af59590c9b (diff)
downloadrootstrap-data-common-d24a2c219070cdba27b3d1621c928bdcf17462df.tar.gz
rootstrap-data-common-d24a2c219070cdba27b3d1621c928bdcf17462df.tar.bz2
rootstrap-data-common-d24a2c219070cdba27b3d1621c928bdcf17462df.zip
Modify to be buildable for 64-bit architectures
To make hal-rootstrap buildable for 64-bit architectures, required scripts are modified as 32-bit scripts: * make_rootstrap_64.sh * rootstrap_gen_1.0_64.sh Change-Id: I76dd7deaecf526903adc5eee512a5a4024f13793 Signed-off-by: SangYoun Kwak <sy.kwak@samsung.com>
-rwxr-xr-xmake_rootstrap_64.sh52
-rw-r--r--packaging/hal-rootstrap.spec3
-rwxr-xr-xscript/rootstrap_gen_1.0_64.sh148
3 files changed, 113 insertions, 90 deletions
diff --git a/make_rootstrap_64.sh b/make_rootstrap_64.sh
index 2916cdc..bd704be 100755
--- a/make_rootstrap_64.sh
+++ b/make_rootstrap_64.sh
@@ -1,5 +1,7 @@
#!/bin/bash
+DEBUG_MODE=1
+
SCRIPT_NAME="$(basename ${BASH_SOURCE[0]})"
SCRIPT_FULLPATH="$(readlink -f ${BASH_SOURCE[0]})"
SCRIPT_BASE="$(dirname ${SCRIPT_FULLPATH})"
@@ -75,9 +77,9 @@ function callRootstrapGen () {
if [[ -z ${3} ]]
then
- FULL_RS_CMD="${CMD_RS_GEN} -t ${1} -u ${2} ${xmlList}"
+ FULL_RS_CMD="${CMD_RS_GEN} -t ${1} -u ${2} -q ${BUILD_REQUIRED_INSTALLED_PATH} -r ${GBS_BUILDROOT} ${xmlList}"
else
- FULL_RS_CMD="${CMD_RS_GEN} -t ${1} -u ${2} -b ${3} ${xmlList}"
+ FULL_RS_CMD="${CMD_RS_GEN} -t ${1} -u ${2} -b ${3} -q ${BUILD_REQUIRED_INSTALLED_PATH} -r ${GBS_BUILDROOT} ${xmlList}"
fi
FULL_RS_INFO_CMD="${CMD_RS_INFO} -t $1 -l ${xmlList} -p $PLATFORM_PROFILE -v $PLATFORM_VERSION"
@@ -317,36 +319,36 @@ if [ "$OPT_TARGET" = true ]; then
remove_dir ${DIR_TMP} ${DIR_TARGET}
callRootstrapGen target ${RPM_PKG_SVR_TARGET} ${BASE_PKG_SVR_TARGET}
- log "[INFO] Postscript ${DIR_TARGET}";
+ log "[INFO] Postscript ${GBS_BUILDROOT}";
- mv ${DIR_TARGET}/usr/include/asm-arm64 ${DIR_TARGET}/usr/include/asm
- mv ${DIR_TARGET}/usr/include/base/deprecated/* ${DIR_TARGET}/usr/include/base/
+ mv ${GBS_BUILDROOT}/usr/include/asm-arm64 ${GBS_BUILDROOT}/usr/include/asm
+ mv ${GBS_BUILDROOT}/usr/include/base/deprecated/* ${GBS_BUILDROOT}/usr/include/base/
if [ "$INTERNAL" = false ]; then
echo "remove Non-Public EFL API"
- $CMD_API_FILTER .target>/dev/null #EFL filter
+ $CMD_API_FILTER ${GBS_BUILDROOT} > /dev/null #EFL filter
echo "remove Non-Public GDBUS API"
- $CMD_API_GDBUS_FILTER .target>/dev/null #GDBUS filter
+ $CMD_API_GDBUS_FILTER ${GBS_BUILDROOT} > /dev/null #GDBUS filter
fi
#echo "remove Public GDBUS API"
- #$CMD_API_GDBUS_FILTER .target>/dev/null #GDBUS filter
+ #$CMD_API_GDBUS_FILTER .target>/dev/null #GDBUS filter
if [ "$INTERNAL" = true ]; then
log "[INFO] Skip .. removing dlog-internal.h"
- find ${DIR_TARGET} -name "dlog.h" -exec perl -pi -e 's/#include\ \"dlog-internal\.h\"//g' {} \;
+ find ${GBS_BUILDROOT} -name "dlog.h" -exec perl -pi -e 's/#include\ \"dlog-internal\.h\"//g' {} \;
else
- find ${DIR_TARGET} -name "dlog.h" -exec perl -pi -e 's/#include\ \"dlog-internal\.h\"//g' {} \;
+ find ${GBS_BUILDROOT} -name "dlog.h" -exec perl -pi -e 's/#include\ \"dlog-internal\.h\"//g' {} \;
fi
- if [ ! -d "${DIR_TARGET}/usr/lib" ]; then
- mkdir -p ${DIR_TARGET}/usr/lib
+ if [ ! -d "${GBS_BUILDROOT}/usr/lib" ]; then
+ mkdir -p ${GBS_BUILDROOT}/usr/lib
fi
- if [ ! -d "${DIR_TARGET}/usr/lib64" ]; then
- mkdir -p ${DIR_TARGET}/usr/lib64
+ if [ ! -d "${GBS_BUILDROOT}/usr/lib64" ]; then
+ mkdir -p ${GBS_BUILDROOT}/usr/lib64
fi
- for FILE in $(find ${DIR_TARGET} -name "*.so.*mobile");
+ for FILE in $(find ${GBS_BUILDROOT} -name "*.so.*mobile");
do
mv ${FILE} ${FILE%.mobile};
done;
@@ -356,10 +358,10 @@ if [ "$OPT_EMULATOR" = true ]; then
remove_dir ${DIR_TMP} ${DIR_EMULATOR}
callRootstrapGen emulator ${RPM_PKG_SVR_EMULATOR} ${BASE_PKG_SVR_EMULATOR}
- log "[INFO] Postscript ${DIR_EMULATOR}";
+ log "[INFO] Postscript ${GBS_BUILDROOT}";
- mv ${DIR_EMULATOR}/usr/include/asm-ia64 ${DIR_EMULATOR}/usr/include/asm
- mv ${DIR_EMULATOR}/usr/include/base/deprecated/* ${DIR_EMULATOR}/usr/include/base/
+ mv ${GBS_BUILDROOT}/usr/include/asm-ia64 ${GBS_BUILDROOT}/usr/include/asm
+ mv ${GBS_BUILDROOT}/usr/include/base/deprecated/* ${GBS_BUILDROOT}/usr/include/base/
if [ "$INTERNAL" = false ]; then
echo "remove Non-Public EFL API"
@@ -372,21 +374,21 @@ if [ "$OPT_EMULATOR" = true ]; then
if [ "$INTERNAL" = true ]; then
log "[INFO] Skip .. removing dlog-internal.h"
- find ${DIR_EMULATOR} -name "dlog.h" -exec perl -pi -e 's/#include\ \"dlog-internal\.h\"//g' {} \;
+ find ${GBS_BUILDROOT} -name "dlog.h" -exec perl -pi -e 's/#include\ \"dlog-internal\.h\"//g' {} \;
else
- find ${DIR_EMULATOR} -name "dlog.h" -exec perl -pi -e 's/#include\ \"dlog-internal\.h\"//g' {} \;
+ find ${GBS_BUILDROOT} -name "dlog.h" -exec perl -pi -e 's/#include\ \"dlog-internal\.h\"//g' {} \;
fi
- if [ ! -d "${DIR_EMULATOR}/usr/lib" ]; then
- mkdir -p ${DIR_EMULATOR}/usr/lib
+ if [ ! -d "${GBS_BUILDROOT}/usr/lib" ]; then
+ mkdir -p ${GBS_BUILDROOT}/usr/lib
fi
- if [ ! -d "${DIR_EMULATOR}/usr/lib64" ]; then
- mkdir -p ${DIR_EMULATOR}/usr/lib64
+ if [ ! -d "${GBS_BUILDROOT}/usr/lib64" ]; then
+ mkdir -p ${GBS_BUILDROOT}/usr/lib64
fi
- for FILE in $(find ${DIR_EMULATOR} -name "*.so.*mobile");
+ for FILE in $(find ${GBS_BUILDROOT} -name "*.so.*mobile");
do
mv ${FILE} ${FILE%.mobile};
done;
diff --git a/packaging/hal-rootstrap.spec b/packaging/hal-rootstrap.spec
index 4ecfd04..09e6902 100644
--- a/packaging/hal-rootstrap.spec
+++ b/packaging/hal-rootstrap.spec
@@ -9,7 +9,6 @@ Release: 1
#Group:
License: Apache-2.0
Source0: %{name}-%{version}.tar.gz
-ExclusiveArch: %{arm} %{ix86}
AutoReqProv: no
BuildRequires: cmake
@@ -440,7 +439,7 @@ cp packaging/hal-rootstrap.pc %{buildroot}%{_libdir}/pkgconfig/
%files
%{hal_rootstrap_install_path}/etc/*
-%{hal_rootstrap_install_path}/lib/*
+%{hal_rootstrap_install_path}/%{_lib}/*
%{hal_rootstrap_install_path}/usr/share/*
%{hal_rootstrap_install_path}/%{_libdir}/*
diff --git a/script/rootstrap_gen_1.0_64.sh b/script/rootstrap_gen_1.0_64.sh
index 37de889..49fc024 100755
--- a/script/rootstrap_gen_1.0_64.sh
+++ b/script/rootstrap_gen_1.0_64.sh
@@ -176,58 +176,84 @@ function unnecessary_files()
}
-function copy_header_and_so() # $1 : SRCDIR, $2 : DESTDIR, $3 xml
+function copy_header_and_so()
{
- log "***************** $FUNCNAME *****************"
- ALL=$(xmlstarlet sel -t -m "//necessary[count(file)=1]" -v "./file/text()" ${3})
- log "+ source directory : $1"
- log "+ destination directory : $2"
- log "+ xml source file : $3"
-
- TEMP_SRC_DIR="${1}";
- TEMP_DEST_DIR="${2}";
- COPY_ERROR=0;
- if [[ "${ALL}" == "*" ]] || [ "$INTERNAL" = true ]
- then
- (
- log "+ copy ALL file (h, a, o, so)"
- cd ${1}
- find . \( -name "*.h" -o -name "*.a" -o -name "*.o" -o -name "*.so" -o -name "*.so\.[0-9]*" -o -name "*.hpp" -o -name "*.ipp" -o -name "*.x" -o -name "*.def" -o -name "*.so.*" \) \
- -exec echo "+ copy file [{}]" \; \
- -exec cp -L -R --parents {} ${2} \;
- )
- else
- log "+ copy necessary files .."
- for i in $(xmlstarlet sel -t -m "//necessary/file" -o "." -v "text()" -o " " -n ${3})
- do
- #(
- cd ${1}
- log "+ copy file from [${i}]"
- cp -L -R --parents ${i} ${2}
- if [ "$?" -ne "0" ]; then
- get_author "../${3}"
- let "COPY_ERROR+=1"
- fi
- cd -
- #)
- done
- fi
+ local src_dir=$1
+ local dest_dir=$2
+ local xml_file=$3
+ local copy_error=0
+ local files=()
+ local dest_path=""
+
+ log "***************** $FUNCNAME *****************"
+ ALL=$(xmlstarlet sel -t -m "//necessary[count(file)=1]" -v "./file/text()" ${xml_file})
+ log "+ source directory : ${src_dir}"
+ log "+ destination directory : ${dest_dir}"
+ log "+ xml source file : ${xml_file}"
+
+ if [[ "${ALL}" == "*" ]] || [[ "${INTERNAL}" == true ]]; then
+ log "ALL(*) and internal is not supported"
+ return 1
+ else
+ log "+ copy necessary files .."
+ for i in $(xmlstarlet sel -t -m "//necessary/file" -o "." -v "text()" -o " " -n ${xml_file}); do
+ cd ${src_dir}
+ log "+ copy file from [${i}]"
+ files=($(ls ${i}))
+ for file in ${files[@]}; do
+ dest_path="${dest_dir}/$(dirname ${file})"
+ mkdir -p ${dest_path}
+ cp -L -R ${file} "${dest_path}/."
+ if [[ "$?" -ne "0" ]]; then
+ get_author "../${xml_file}"
+ let "COPY_ERROR+=1"
+ fi
+ done
+ cd -
+ done
+ fi
+
+ if [[ "${copy_error}" -ne 0 ]]; then
+ log "Error Occurred Copy file .... " 1>&2
+ exit $ERROR_NOT_EXIST_FILE
+ fi
+
+ return 0
+}
- if [ "$COPY_ERROR" -ne "0" ]; then
- log "Error Occurred Copy file .... " 1>&2
- exit $ERROR_NOT_EXIST_FILE
- fi
-#######
-# Pc
-#######
- if [ -d "${TEMP_SRC_DIR}/usr/lib64/pkgconfig" ]
- then
- (
- cd ${TEMP_SRC_DIR}
- cp -P -R --parents "./usr/lib64/pkgconfig" "${TEMP_DEST_DIR}" ;
- )
- fi
+function copy_package_config()
+{
+ local src_dir=$1
+ local dest_dir=$2
+ local xml_file=$3
+
+ log "***************** $FUNCNAME *****************"
+ log "+ source directory : ${src_dir}"
+ log "+ destination dierctory : ${dest_dir}"
+ log "+ xml source file : ${xml_file}"
+
+ local pc_fname=''
+ local src_pc_file_path=''
+ local dest_pc_path="${dest_dir}/usr/lib64/pkgconfig"
+ local pc_fnames=($(xmlstarlet sel -t -v '//rootstrap/pkgconfig/file' ${item}))
+ if [[ -z ${pc_fnames[@]} ]]; then
+ pc_fnames=("$(xmlstarlet sel -t -v '//rootstrap/@name' ${item}).pc")
+ fi
+
+ for pc_fname in ${pc_fnames[@]}; do
+ src_pc_file_path="${src_dir}/usr/lib64/pkgconfig/${pc_fname}"
+
+ if [[ ! -f "${src_pc_file_path}" ]]; then
+ log "+ no pkgconfig file(${src_pc_file_path})"
+ return 1
+ fi
+
+ mkdir -p ${dest_pc_path}
+ cp -P "${src_pc_file_path}" "${dest_pc_path}/."
+ done
+
+ return 0
}
function check_prerequisite()
@@ -244,7 +270,7 @@ function check_prerequisite()
#script start
check_prerequisite
-OPTS=`getopt -o -t:u:b:l:i:p:wh --long type:,url:,base:,list:,id:,pw:,withlogin,help,internal,log: -n 'rootstrap_gen_1.0_64' -- "$@"`
+OPTS=`getopt -o -t:u:b:l:i:p:whq:r: --long type:,url:,base:,list:,id:,pw:,withlogin,help,internal,log: -n 'rootstrap_gen_1.0_64' -- "$@"`
if [ $? != 0 ] ; then log "Failed parsing options." >&2 ; exit 1 ; fi
log ""
@@ -259,6 +285,8 @@ INTERNAL=false
while true; do
case "$1" in
+ -q ) BUILD_REQUIRED_INSTALLED_PATH="$2"; shift;shift ;;
+ -r ) GBS_BUILDROOT="$2"; shift;shift ;;
-t | --type ) ROOTSTRAP_TYPE="$2"; shift;shift ;;
-u | --url ) RPM_PKG_URL="$2"; shift;shift ;;
-b | --base ) BASE_PKG_URL="$2"; shift;shift ;;
@@ -404,21 +432,14 @@ do
continue;
fi
- #download rpm
- download_rpm $item
- if [ "$?" -ne "0" ]
- then
- continue;
+ #copy only header & so to dest
+ copy_header_and_so ${BUILD_REQUIRED_INSTALLED_PATH} ${GBS_BUILDROOT} ${item}
+ if [[ $? -ne 0 ]]; then
+ echo "Failed to copy_header_and_so for ${item}, skip."
+ continue
fi
-
- #unpack rpm
- unpack_rpm $item
- #remove unnessary header, so
- unnecessary_files $item
-
- #copy only header & so to dest
- copy_header_and_so ${TMP} ${DEST} ${item}
+ copy_package_config ${BUILD_REQUIRED_INSTALLED_PATH} ${GBS_BUILDROOT} ${item}
#get build option from xml
#get_build_option $item
@@ -435,5 +456,6 @@ do
done
log "Deleted needed field of so file"
+
log "######################## END [$SECONDS] Sec ##############################" 1>&2
exit 0