summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSangYoun Kwak <sy.kwak@samsung.com>2024-06-19 10:35:53 +0900
committerSangYoun Kwak <sy.kwak@samsung.com>2024-06-21 18:26:37 +0900
commit9cd9025bd011eea181e10d50a8ffec6cdc8a8e86 (patch)
treec8140b061810ca09b1a0f83e2dc1d9c2fb0a4c3d
parent124eac7f22e467294678a395d0b679d654e28535 (diff)
downloadrootstrap-9cd9025bd011eea181e10d50a8ffec6cdc8a8e86.tar.gz
rootstrap-9cd9025bd011eea181e10d50a8ffec6cdc8a8e86.tar.bz2
rootstrap-9cd9025bd011eea181e10d50a8ffec6cdc8a8e86.zip
Modify to copy necessary files per architecture
In the .xml files, necessary files are specified and they are copied to the final .rpm product. These files are depends on the architecture being built. Previously, necessary files are separated with only 32-bit and 64-bit, but there are differences of necessary files between other architectures, like x86_64 and i686. Thus, tags below are added to distinguish them: * <file_arm> for armv7l and armv7hl * <file_aarch64> for aarch64 * <file_i686> for i686 * <file_x86_64> for x86_64 Change-Id: I9f7537b396e48036f4f73a366c15e4c3ccb5bd59 Signed-off-by: SangYoun Kwak <sy.kwak@samsung.com>
-rwxr-xr-xgenerate_rootstrap.sh28
-rwxr-xr-xmake_rootstrap.sh14
-rwxr-xr-xmake_rootstrap_64.sh14
-rw-r--r--rs_resource/OSS/baserpm/glibc-rs.xml27
-rw-r--r--rs_resource/OSS/glib2-rs.xml14
-rw-r--r--rs_resource/OSS/libdrm-rs.xml18
-rwxr-xr-xscript/rootstrap_gen_1.0.sh10
-rwxr-xr-xscript/rootstrap_gen_1.0_64.sh10
8 files changed, 104 insertions, 31 deletions
diff --git a/generate_rootstrap.sh b/generate_rootstrap.sh
index 8f48d09..60465ba 100755
--- a/generate_rootstrap.sh
+++ b/generate_rootstrap.sh
@@ -19,7 +19,7 @@ function generate_rootstrap_ix86 {
return $?
fi
- ./make_rootstrap.sh -C rs-config ./rs_resource --clean --emulator
+ ./make_rootstrap.sh -C rs-config ./rs_resource --clean --emulator -A i686
RET=$?
if [[ ${RET} -ne 0 ]]; then
echo "Failed to create rootstrap."
@@ -35,7 +35,7 @@ function generate_rootstrap_x86_64 {
return $?
fi
- ./make_rootstrap_64.sh -C rs-config ./rs_resource --clean --emulator
+ ./make_rootstrap_64.sh -C rs-config ./rs_resource --clean --emulator -A x86_64
RET=$?
if [[ ${RET} -ne 0 ]]; then
echo "Failed to create rootstrap."
@@ -51,7 +51,7 @@ function generate_rootstrap_arm {
return $?
fi
- ./make_rootstrap.sh -C rs-config ./rs_resource --clean --target
+ ./make_rootstrap.sh -C rs-config ./rs_resource --clean --target -A arm
RET=$?
if [[ ${RET} -ne 0 ]]; then
echo "Failed to create rootstrap."
@@ -67,7 +67,23 @@ function generate_rootstrap_aarch64 {
return $?
fi
- ./make_rootstrap_64.sh -C rs-config ./rs_resource --clean --target
+ ./make_rootstrap_64.sh -C rs-config ./rs_resource --clean --target -A aarch64
+ RET=$?
+ if [[ ${RET} -ne 0 ]]; then
+ echo "Failed to create rootstrap."
+ fi
+
+ return ${RET}
+}
+
+function generate_rootstrap_riscv64 {
+ ./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 --clean --target -A riscv64
RET=$?
if [[ ${RET} -ne 0 ]]; then
echo "Failed to create rootstrap."
@@ -96,6 +112,10 @@ function generate_rootstrap {
generate_rootstrap_x86_64
return $?
;;
+ "riscv64")
+ generate_rootstrap_riscv64
+ return $?
+ ;;
*)
echo "Architecture not supported: ${arch}"
exit 1
diff --git a/make_rootstrap.sh b/make_rootstrap.sh
index b49b2d7..c36ce6e 100755
--- a/make_rootstrap.sh
+++ b/make_rootstrap.sh
@@ -77,9 +77,9 @@ function callRootstrapGen () {
if [[ -z ${3} ]]
then
- FULL_RS_CMD="${CMD_RS_GEN} -t ${1} -u ${2} -q ${BUILD_REQUIRED_INSTALLED_PATH} -r ${GBS_BUILDROOT} ${xmlList}"
+ FULL_RS_CMD="${CMD_RS_GEN} -t ${1} -u ${2} -q ${BUILD_REQUIRED_INSTALLED_PATH} -r ${GBS_BUILDROOT} -A ${OPT_ARCH} ${xmlList}"
else
- FULL_RS_CMD="${CMD_RS_GEN} -t ${1} -u ${2} -b ${3} -q ${BUILD_REQUIRED_INSTALLED_PATH} -r ${GBS_BUILDROOT} ${xmlList}"
+ FULL_RS_CMD="${CMD_RS_GEN} -t ${1} -u ${2} -b ${3} -q ${BUILD_REQUIRED_INSTALLED_PATH} -r ${GBS_BUILDROOT} -A ${OPT_ARCH} ${xmlList}"
fi
FULL_RS_INFO_CMD="${CMD_RS_INFO} -t $1 -l ${xmlList} -p $PLATFORM_PROFILE -v $PLATFORM_VERSION"
@@ -144,6 +144,7 @@ OPT_EMULATOR=false
OPT_DOWNLOAD_RPM=false
OPT_CLEAN=true
OPT_CONF=""
+OPT_ARCH=""
INTERNAL=false
###############################################################################
@@ -155,6 +156,7 @@ function usage () {
echo " -e, --emulator : Make Rootstrap for Emulator"
echo " -t, --target : Make Rootstrap for Target"
echo " -c, --clean : Delete .rpm cache folder"
+ echo " -A, --arch : Architecture for building"
echo " -h, --help"
echo " -v, --version : Display script version information"
echo ""
@@ -178,7 +180,7 @@ function usage () {
###############################################################################
## Get Parameter
###############################################################################
-OPTS=`getopt -o -C:tedchv --long target,emulator,downloadrpm,clean,help,version,internal -- "$@"`
+OPTS=`getopt -o -A:C:tedchv --long target,emulator,downloadrpm,clean,help,version,internal -- "$@"`
if [ $? != 0 ] ; then echo "Failed parsing options." >&2 ; exit 1 ; fi
echo ""
@@ -187,6 +189,7 @@ eval set -- "$OPTS"
while true; do
case "$1" in
+ -A )OPT_ARCH=$2;shift;shift;;
-C | --conf )OPT_CONF=$2;shift;shift;;
-t | --target )OPT_TARGET=true;shift;;
-e | --emulator )OPT_EMULATOR=true;shift;;
@@ -239,6 +242,11 @@ if [[ "$xmlList" == "" ]]; then
exit 1
fi
+if [[ -z ${OPT_ARCH} ]]; then
+ log "[Error] No architecture specified"
+ exit 1
+fi
+
if [[ -e ${OPT_CONF} ]]; then
log "source ${OPT_CONF}"
source "${OPT_CONF}"
diff --git a/make_rootstrap_64.sh b/make_rootstrap_64.sh
index bd704be..740a959 100755
--- a/make_rootstrap_64.sh
+++ b/make_rootstrap_64.sh
@@ -77,9 +77,9 @@ function callRootstrapGen () {
if [[ -z ${3} ]]
then
- FULL_RS_CMD="${CMD_RS_GEN} -t ${1} -u ${2} -q ${BUILD_REQUIRED_INSTALLED_PATH} -r ${GBS_BUILDROOT} ${xmlList}"
+ FULL_RS_CMD="${CMD_RS_GEN} -t ${1} -u ${2} -q ${BUILD_REQUIRED_INSTALLED_PATH} -r ${GBS_BUILDROOT} -A ${OPT_ARCH} ${xmlList}"
else
- FULL_RS_CMD="${CMD_RS_GEN} -t ${1} -u ${2} -b ${3} -q ${BUILD_REQUIRED_INSTALLED_PATH} -r ${GBS_BUILDROOT} ${xmlList}"
+ FULL_RS_CMD="${CMD_RS_GEN} -t ${1} -u ${2} -b ${3} -q ${BUILD_REQUIRED_INSTALLED_PATH} -r ${GBS_BUILDROOT} -A ${OPT_ARCH} ${xmlList}"
fi
FULL_RS_INFO_CMD="${CMD_RS_INFO} -t $1 -l ${xmlList} -p $PLATFORM_PROFILE -v $PLATFORM_VERSION"
@@ -144,6 +144,7 @@ OPT_EMULATOR=false
OPT_DOWNLOAD_RPM=false
OPT_CLEAN=true
OPT_CONF=""
+OPT_ARCH=""
INTERNAL=false
###############################################################################
@@ -155,6 +156,7 @@ function usage () {
echo " -e, --emulator : Make Rootstrap for Emulator"
echo " -t, --target : Make Rootstrap for Target"
echo " -c, --clean : Delete .rpm cache folder"
+ echo " -A, --arch : Architecture for building"
echo " -h, --help"
echo " -v, --version : Display script version information"
echo ""
@@ -178,7 +180,7 @@ function usage () {
###############################################################################
## Get Parameter
###############################################################################
-OPTS=`getopt -o -C:tedchv --long target,emulator,downloadrpm,clean,help,version,internal -- "$@"`
+OPTS=`getopt -o -A:C:tedchv --long target,emulator,downloadrpm,clean,help,version,internal -- "$@"`
if [ $? != 0 ] ; then echo "Failed parsing options." >&2 ; exit 1 ; fi
echo ""
@@ -187,6 +189,7 @@ eval set -- "$OPTS"
while true; do
case "$1" in
+ -A )OPT_ARCH=$2;shift;shift;;
-C | --conf )OPT_CONF=$2;shift;shift;;
-t | --target )OPT_TARGET=true;shift;;
-e | --emulator )OPT_EMULATOR=true;shift;;
@@ -239,6 +242,11 @@ if [[ "$xmlList" == "" ]]; then
exit 1
fi
+if [[ -z ${OPT_ARCH} ]]; then
+ log "[Error] No architecture specified"
+ exit 1
+fi
+
if [[ -e ${OPT_CONF} ]]; then
log "source ${OPT_CONF}"
source "${OPT_CONF}"
diff --git a/rs_resource/OSS/baserpm/glibc-rs.xml b/rs_resource/OSS/baserpm/glibc-rs.xml
index 41d54d8..65fdd51 100644
--- a/rs_resource/OSS/baserpm/glibc-rs.xml
+++ b/rs_resource/OSS/baserpm/glibc-rs.xml
@@ -853,17 +853,26 @@
<file>/usr/lib/Mcrt1.o</file>
<file>/usr/lib/Scrt1.o</file>
<file>/usr/include/gnu/*.h</file>
- <file>/usr/include/sys/debugreg.h</file>
- <file>/usr/include/sys/io.h</file>
- <file>/usr/include/sys/perm.h</file>
- <file>/usr/include/sys/reg.h</file>
- <file>/usr/include/sys/vm86.h</file>
- <file_32>/lib/ld-linux.so.*</file_32>
+ <file_arm>/lib/ld-linux.so.*</file_arm>
- <file_64>/lib64/ld-linux-*</file_64>
- <file_64>/lib/ld-linux-*</file_64>
- <file_64>/usr/include/sys/ifunc.h$</file_64>
+ <file_i686>/lib/ld-linux.so.*</file_i686>
+ <file_i686>/usr/include/sys/debugreg.h</file_i686>
+ <file_i686>/usr/include/sys/io.h</file_i686>
+ <file_i686>/usr/include/sys/perm.h</file_i686>
+ <file_i686>/usr/include/sys/reg.h</file_i686>
+ <file_i686>/usr/include/sys/vm86.h</file_i686>
+
+ <file_aarch64>/lib64/ld-linux-*</file_aarch64>
+ <file_aarch64>/lib/ld-linux-*</file_aarch64>
+ <file_aarch64>/usr/include/sys/ifunc.h</file_aarch64>
+
+ <file_x86_64>/lib64/ld-linux-*</file_x86_64>
+ <file_x86_64>/usr/include/sys/debugreg.h</file_x86_64>
+ <file_x86_64>/usr/include/sys/io.h</file_x86_64>
+ <file_x86_64>/usr/include/sys/perm.h</file_x86_64>
+ <file_x86_64>/usr/include/sys/reg.h</file_x86_64>
+ <file_x86_64>/usr/include/sys/vm86.h</file_x86_64>
</necessary>
<unnecessary>
diff --git a/rs_resource/OSS/glib2-rs.xml b/rs_resource/OSS/glib2-rs.xml
index 313f017..7eeab69 100644
--- a/rs_resource/OSS/glib2-rs.xml
+++ b/rs_resource/OSS/glib2-rs.xml
@@ -335,11 +335,17 @@
<file>/usr/lib/libgthread-2.0.so.0</file>
<file>/usr/lib/libgthread-2.0.so.0.7800.4</file>
- <file_32>/usr/share/gdb/auto-load/usr/lib/libglib-2.0.so.0.7800.4-gdb.py</file_32>
- <file_32>/usr/share/gdb/auto-load/usr/lib/libgobject-2.0.so.0.7800.4-gdb.py</file_32>
+ <file_arm>/usr/share/gdb/auto-load/usr/lib/libglib-2.0.so.0.7800.4-gdb.py</file_arm>
+ <file_arm>/usr/share/gdb/auto-load/usr/lib/libgobject-2.0.so.0.7800.4-gdb.py</file_arm>
- <file_64>/usr/share/gdb/auto-load/usr/lib64/libglib-2.0.so.0.7800.4-gdb.py</file_64>
- <file_64>/usr/share/gdb/auto-load/usr/lib64/libgobject-2.0.so.0.7800.4-gdb.py</file_64>
+ <file_i686>/usr/share/gdb/auto-load/usr/lib/libglib-2.0.so.0.7800.4-gdb.py</file_i686>
+ <file_i686>/usr/share/gdb/auto-load/usr/lib/libgobject-2.0.so.0.7800.4-gdb.py</file_i686>
+
+ <file_aarch64>/usr/share/gdb/auto-load/usr/lib64/libglib-2.0.so.0.7800.4-gdb.py</file_aarch64>
+ <file_aarch64>/usr/share/gdb/auto-load/usr/lib64/libgobject-2.0.so.0.7800.4-gdb.py</file_aarch64>
+
+ <file_x86_64>/usr/share/gdb/auto-load/usr/lib64/libglib-2.0.so.0.7800.4-gdb.py</file_x86_64>
+ <file_x86_64>/usr/share/gdb/auto-load/usr/lib64/libgobject-2.0.so.0.7800.4-gdb.py</file_x86_64>
</necessary>
<include_path>/usr/include/gio-unix-2.0</include_path>
diff --git a/rs_resource/OSS/libdrm-rs.xml b/rs_resource/OSS/libdrm-rs.xml
index 38808a9..ffc7d81 100644
--- a/rs_resource/OSS/libdrm-rs.xml
+++ b/rs_resource/OSS/libdrm-rs.xml
@@ -35,8 +35,6 @@
<file>/usr/include/libdrm/sis_drm.h</file>
<file>/usr/include/libdrm/tegra_drm.h</file>
<file>/usr/include/libdrm/vc4_drm.h</file>
- <file>/usr/include/libdrm/vc4_packet.h</file>
- <file>/usr/include/libdrm/vc4_qpu_defines.h</file>
<file>/usr/include/libdrm/via_drm.h</file>
<file>/usr/include/libdrm/vigs.h</file>
<file>/usr/include/libdrm/virtgpu_drm.h</file>
@@ -55,5 +53,21 @@
<file>/usr/lib/libdrm_vigs.so</file>
<file>/usr/lib/libdrm_vigs.so.10</file>
<file>/usr/lib/libdrm_vigs.so.10.0.0</file>
+
+ <file_armv7l>/usr/include/libdrm/vc4_packet.h</file_armv7l>
+ <file_armv7l>/usr/include/libdrm/vc4_qpu_defines.h</file_armv7l>
+
+ <file_aarch64>/usr/include/libdrm/vc4_packet.h</file_aarch64>
+ <file_aarch64>/usr/include/libdrm/vc4_qpu_defines.h</file_aarch64>
+
+ <file_i686>/usr/include/libdrm/intel_aub.h</file_i686>
+ <file_i686>/usr/include/libdrm/intel_bufmgr.h</file_i686>
+ <file_i686>/usr/include/libdrm/intel_debug.h</file_i686>
+ <file_i686>/usr/lib/libdrm_intel.so</file_i686>
+
+ <file_x86_64>/usr/include/libdrm/intel_aub.h</file_x86_64>
+ <file_x86_64>/usr/include/libdrm/intel_bufmgr.h</file_x86_64>
+ <file_x86_64>/usr/include/libdrm/intel_debug.h</file_x86_64>
+ <file_x86_64>/usr/lib64/libdrm_intel.so</file_x86_64>
</necessary>
</rootstrap>
diff --git a/script/rootstrap_gen_1.0.sh b/script/rootstrap_gen_1.0.sh
index 733833f..7dd8935 100755
--- a/script/rootstrap_gen_1.0.sh
+++ b/script/rootstrap_gen_1.0.sh
@@ -181,6 +181,8 @@ function copy_header_and_so()
local src_dir=$1
local dest_dir=$2
local xml_file=$3
+ local build_arch=$4
+ local file_tag="file_${build_arch}"
local copy_error=0
local dest_path=""
local -a files
@@ -198,7 +200,7 @@ function copy_header_and_so()
else
log "+ copy necessary files .."
necessary_files=($(xmlstarlet sel -t -m "//necessary/file" -o "." -v "text()" -o " " -n ${xml_file}))
- necessary_files+=($(xmlstarlet sel -t -m "//necessary/file_32" -o "." -v "text()" -o " " -n ${xml_file}))
+ necessary_files+=($(xmlstarlet sel -t -m "//necessary/${file_tag}" -o "." -v "text()" -o " " -n ${xml_file}))
for i in ${necessary_files[@]}; do
cd ${src_dir}
log "+ copy file from [${i}]"
@@ -273,7 +275,7 @@ function check_prerequisite()
#script start
check_prerequisite
-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' -- "$@"`
+OPTS=`getopt -o -A:t:u:b:l:i:p:whq:r: --long type:,url:,base:,list:,id:,pw:,withlogin,help,internal,log: -n 'rootstrap_gen_1.0' -- "$@"`
if [ $? != 0 ] ; then log "Failed parsing options." >&2 ; exit 1 ; fi
log ""
@@ -285,11 +287,13 @@ RPM_PKG_URL=""
BASE_PKG_URL=""
XML_INPUT_LIST=""
INTERNAL=false
+BUILD_ARCH=""
while true; do
case "$1" in
-q ) BUILD_REQUIRED_INSTALLED_PATH="$2"; shift;shift ;;
-r ) GBS_BUILDROOT="$2"; shift;shift ;;
+ -A ) BUILD_ARCH="$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 ;;
@@ -436,7 +440,7 @@ do
fi
#copy only header & so to dest
- copy_header_and_so ${BUILD_REQUIRED_INSTALLED_PATH} ${GBS_BUILDROOT} ${item}
+ copy_header_and_so ${BUILD_REQUIRED_INSTALLED_PATH} ${GBS_BUILDROOT} ${item} ${BUILD_ARCH}
if [[ $? -ne 0 ]]; then
echo "Failed to copy_header_and_so for ${item}, skip."
continue
diff --git a/script/rootstrap_gen_1.0_64.sh b/script/rootstrap_gen_1.0_64.sh
index eb4ca84..555142a 100755
--- a/script/rootstrap_gen_1.0_64.sh
+++ b/script/rootstrap_gen_1.0_64.sh
@@ -181,6 +181,8 @@ function copy_header_and_so()
local src_dir=$1
local dest_dir=$2
local xml_file=$3
+ local build_arch=$4
+ local file_tag="file_${build_arch}"
local copy_error=0
local dest_path=""
local -a files
@@ -198,7 +200,7 @@ function copy_header_and_so()
else
log "+ copy necessary files .."
necessary_files=($(xmlstarlet sel -t -m "//necessary/file" -o "." -v "text()" -o " " -n ${xml_file}))
- necessary_files+=($(xmlstarlet sel -t -m "//necessary/file_64" -o "." -v "text()" -o " " -n ${xml_file}))
+ necessary_files+=($(xmlstarlet sel -t -m "//necessary/${file_tag}" -o "." -v "text()" -o " " -n ${xml_file}))
for i in ${necessary_files[@]}; do
cd ${src_dir}
log "+ copy file from [${i}]"
@@ -273,7 +275,7 @@ function check_prerequisite()
#script start
check_prerequisite
-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' -- "$@"`
+OPTS=`getopt -o -A: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 ""
@@ -285,11 +287,13 @@ RPM_PKG_URL=""
BASE_PKG_URL=""
XML_INPUT_LIST=""
INTERNAL=false
+BUILD_ARCH=""
while true; do
case "$1" in
-q ) BUILD_REQUIRED_INSTALLED_PATH="$2"; shift;shift ;;
-r ) GBS_BUILDROOT="$2"; shift;shift ;;
+ -A ) BUILD_ARCH="$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 ;;
@@ -436,7 +440,7 @@ do
fi
#copy only header & so to dest
- copy_header_and_so ${BUILD_REQUIRED_INSTALLED_PATH} ${GBS_BUILDROOT} ${item}
+ copy_header_and_so ${BUILD_REQUIRED_INSTALLED_PATH} ${GBS_BUILDROOT} ${item} ${BUILD_ARCH}
if [[ $? -ne 0 ]]; then
echo "Failed to copy_header_and_so for ${item}, skip."
continue