summaryrefslogtreecommitdiff
path: root/cross
diff options
context:
space:
mode:
authorpius.lee <pius.lee@samsung.com>2017-01-03 19:19:11 +0900
committerHyung-Kyu Choi <hk0110.choi@samsung.com>2017-01-05 18:44:26 +0900
commitb92ae42b6664271d335057c9f8519fb091211ae1 (patch)
tree929bc24944322b9410cd2713875932ad4617bec4 /cross
parent55a1b2f1ad9c1389712f064bb6cf58e1df71949e (diff)
downloadcoreclr-b92ae42b6664271d335057c9f8519fb091211ae1.tar.gz
coreclr-b92ae42b6664271d335057c9f8519fb091211ae1.tar.bz2
coreclr-b92ae42b6664271d335057c9f8519fb091211ae1.zip
Add a script to fetch tizen packages
Fetch packages for build RootFS by XML information in download.tizen.org Signed-off-by: pius.lee <pius.lee@samsung.com>
Diffstat (limited to 'cross')
-rwxr-xr-xcross/armel/tizen-build-rootfs.sh55
-rwxr-xr-xcross/armel/tizen-fetch.sh174
2 files changed, 177 insertions, 52 deletions
diff --git a/cross/armel/tizen-build-rootfs.sh b/cross/armel/tizen-build-rootfs.sh
index b77307c7ca..87c48e78fb 100755
--- a/cross/armel/tizen-build-rootfs.sh
+++ b/cross/armel/tizen-build-rootfs.sh
@@ -17,64 +17,15 @@ if [ -d "$ROOTFS_DIR" ]; then
fi
TIZEN_TMP_DIR=$ROOTFS_DIR/tizen_tmp
-TIZEN_TMP_DOWNLOAD_DIR=$TIZEN_TMP_DIR/download
-TIZEN_TMP_UNZIP_DIR=$TIZEN_TMP_DIR/unzip
-mkdir -p $TIZEN_TMP_DOWNLOAD_DIR
-mkdir -p $TIZEN_TMP_UNZIP_DIR
-
-download_files()
-{
- # TODO: There will be a stable Tizen rootfs available later.
- # Now we temporarily use live repo for developing dotnet for Tizen
-
- TIZEN_DOWNLOAD_OPTIONS="-P $TIZEN_TMP_DOWNLOAD_DIR"
- TIZEN_DOWNLOAD_CMD="wget $TIZEN_DOWNLOAD_OPTIONS"
-
- TIZEN_BASE_ARM="http://download.tizen.org/releases/weekly/tizen/base/latest/repos/arm/packages/armv7l"
- TIZEN_BASE_NOARCH="http://download.tizen.org/releases/weekly/tizen/base/latest/repos/arm/packages/noarch"
- TIZEN_MOBILE_ARM="http://download.tizen.org/releases/weekly/tizen/mobile/latest/repos/arm-wayland/packages/armv7l"
-
- # 1. basse packages
- $TIZEN_DOWNLOAD_CMD "$TIZEN_BASE_ARM/gcc-4.9.2-15.1.armv7l.rpm"
- $TIZEN_DOWNLOAD_CMD "$TIZEN_BASE_ARM/glibc-2.20-12.1.armv7l.rpm"
- $TIZEN_DOWNLOAD_CMD "$TIZEN_BASE_ARM/glibc-devel-2.20-12.1.armv7l.rpm"
- $TIZEN_DOWNLOAD_CMD "$TIZEN_BASE_NOARCH/linux-glibc-devel-3.10-1.3.noarch.rpm"
- $TIZEN_DOWNLOAD_CMD "$TIZEN_MOBILE_ARM/libicu-devel-57.1-14.2.armv7l.rpm"
-
- # 2. download rpms
- $TIZEN_DOWNLOAD_CMD "$TIZEN_BASE_ARM/lldb-3.8.1-2.7.armv7l.rpm"
- $TIZEN_DOWNLOAD_CMD "$TIZEN_BASE_ARM/lldb-devel-3.8.1-2.7.armv7l.rpm"
- $TIZEN_DOWNLOAD_CMD "$TIZEN_BASE_ARM/libuuid-2.28-8.1.armv7l.rpm"
- $TIZEN_DOWNLOAD_CMD "$TIZEN_BASE_ARM/libuuid-devel-2.28-8.1.armv7l.rpm"
- $TIZEN_DOWNLOAD_CMD "$TIZEN_BASE_ARM/libgcc-4.9.2-15.1.armv7l.rpm"
- $TIZEN_DOWNLOAD_CMD "$TIZEN_BASE_ARM/libstdc++-4.9.2-15.1.armv7l.rpm"
- $TIZEN_DOWNLOAD_CMD "$TIZEN_BASE_ARM/libstdc++-devel-4.9.2-15.1.armv7l.rpm"
- $TIZEN_DOWNLOAD_CMD "$TIZEN_MOBILE_ARM/libunwind-1.1-7.22.armv7l.rpm"
- $TIZEN_DOWNLOAD_CMD "$TIZEN_MOBILE_ARM/libunwind-devel-1.1-7.22.armv7l.rpm"
- $TIZEN_DOWNLOAD_CMD "$TIZEN_MOBILE_ARM/tizen-release-3.0.0-10.31.armv7l.rpm"
-
- # 3. for corefx
- $TIZEN_DOWNLOAD_CMD "$TIZEN_BASE_ARM/libcom_err-1.42.13-2.8.armv7l.rpm"
- $TIZEN_DOWNLOAD_CMD "$TIZEN_BASE_ARM/libcom_err-devel-1.42.13-2.8.armv7l.rpm"
- $TIZEN_DOWNLOAD_CMD "$TIZEN_BASE_ARM/zlib-1.2.8-1.17.armv7l.rpm"
- $TIZEN_DOWNLOAD_CMD "$TIZEN_BASE_ARM/zlib-devel-1.2.8-1.17.armv7l.rpm"
- $TIZEN_DOWNLOAD_CMD "$TIZEN_BASE_ARM/libopenssl-1.0.2j-10.1.armv7l.rpm"
- $TIZEN_DOWNLOAD_CMD "$TIZEN_BASE_ARM/libopenssl-devel-1.0.2j-10.1.armv7l.rpm"
- $TIZEN_DOWNLOAD_CMD "$TIZEN_MOBILE_ARM/gssdp-0.14.4-4.2.armv7l.rpm"
- $TIZEN_DOWNLOAD_CMD "$TIZEN_MOBILE_ARM/gssdp-devel-0.14.4-4.2.armv7l.rpm"
- $TIZEN_DOWNLOAD_CMD "$TIZEN_MOBILE_ARM/krb5-1.10.2-3.1.armv7l.rpm"
- $TIZEN_DOWNLOAD_CMD "$TIZEN_MOBILE_ARM/krb5-devel-1.10.2-3.1.armv7l.rpm"
- $TIZEN_DOWNLOAD_CMD "$TIZEN_MOBILE_ARM/libcurl-7.50.2-17.2.armv7l.rpm"
- $TIZEN_DOWNLOAD_CMD "$TIZEN_MOBILE_ARM/libcurl-devel-7.50.2-17.2.armv7l.rpm"
-}
+mkdir -p $TIZEN_TMP_DIR
# Download files
echo ">>Start downloading files"
-download_files
+VERBOSE=1 $__ARM_SOFTFP_CrossDir/tizen-fetch.sh $TIZEN_TMP_DIR
echo "<<Finish downloading files"
echo ">>Start constructing Tizen rootfs"
-TIZEN_RPM_FILES=`ls $TIZEN_TMP_DOWNLOAD_DIR/*.rpm`
+TIZEN_RPM_FILES=`ls $TIZEN_TMP_DIR/*.rpm`
cd $ROOTFS_DIR
for f in $TIZEN_RPM_FILES; do
rpm2cpio $f | cpio -idm --quiet
diff --git a/cross/armel/tizen-fetch.sh b/cross/armel/tizen-fetch.sh
new file mode 100755
index 0000000000..1252199481
--- /dev/null
+++ b/cross/armel/tizen-fetch.sh
@@ -0,0 +1,174 @@
+#!/usr/bin/env bash
+set -e
+
+if [[ -z "${VERBOSE// }" ]] || [ "$VERBOSE" -ne "$VERBOSE" ] 2>/dev/null; then
+ VERBOSE=0
+fi
+
+Log()
+{
+ if [ $VERBOSE -ge $1 ]; then
+ echo ${@:2}
+ fi
+}
+
+Inform()
+{
+ Log 1 -e "\x1B[0;34m$@\x1B[m"
+}
+
+Debug()
+{
+ Log 2 -e "\x1B[0;32m$@\x1B[m"
+}
+
+Error()
+{
+ >&2 Log 0 -e "\x1B[0;31m$@\x1B[m"
+}
+
+Fetch()
+{
+ URL=$1
+ FILE=$2
+ PROGRESS=$3
+ if [ $VERBOSE -ge 1 ] && [ $PROGRESS ]; then
+ CURL_OPT="--progress-bar"
+ else
+ CURL_OPT="--silent"
+ fi
+ curl $CURL_OPT $URL > $FILE
+}
+
+hash curl 2> /dev/null || { Error "Require 'curl' Aborting."; exit 1; }
+hash xmllint 2> /dev/null || { Error "Require 'xmllint' Aborting."; exit 1; }
+hash sha256sum 2> /dev/null || { Error "Require 'sha256sum' Aborting."; exit 1; }
+
+TMPDIR=$1
+if [ ! -d $TMPDIR ]; then
+ TMPDIR=./tizen_tmp
+ Debug "Create temporary directory : $TMPDIR"
+ mkdir -p $TMPDIR
+fi
+
+TIZEN_URL=http://download.tizen.org/releases/weekly/tizen
+BUILD_XML=build.xml
+REPOMD_XML=repomd.xml
+PRIMARY_XML=primary.xml
+TARGET_URL="http://__not_initialized"
+
+Xpath_get()
+{
+ XPATH_RESULT=''
+ XPATH=$1
+ XML_FILE=$2
+ RESULT=$(xmllint --xpath $XPATH $XML_FILE)
+ if [[ -z ${RESULT// } ]]; then
+ Error "Can not find target from $XML_FILE"
+ Debug "Xpath = $XPATH"
+ exit 1
+ fi
+ XPATH_RESULT=$RESULT
+}
+
+fetch_tizen_pkgs_init()
+{
+ TARGET=$1
+ PROFILE=$2
+ Debug "Initialize TARGET=$TARGET, PROFILE=$PROFILE"
+
+ TMP_PKG_DIR=$TMPDIR/tizen_${PROFILE}_pkgs
+ if [ -d $TMP_PKG_DIR ]; then rm -rf $TMP_PKG_DIR; fi
+ mkdir -p $TMP_PKG_DIR
+
+ PKG_URL=$TIZEN_URL/$PROFILE/latest
+
+ BUILD_XML_URL=$PKG_URL/$BUILD_XML
+ TMP_BUILD=$TMP_PKG_DIR/$BUILD_XML
+ TMP_REPOMD=$TMP_PKG_DIR/$REPOMD_XML
+ TMP_PRIMARY=$TMP_PKG_DIR/$PRIMARY_XML
+ TMP_PRIMARYGZ=${TMP_PRIMARY}.gz
+
+ Fetch $BUILD_XML_URL $TMP_BUILD
+
+ Debug "fetch $BUILD_XML_URL to $TMP_BUILD"
+
+ TARGET_XPATH="//build/buildtargets/buildtarget[@name=\"$TARGET\"]/repo[@type=\"binary\"]/text()"
+ Xpath_get $TARGET_XPATH $TMP_BUILD
+ TARGET_PATH=$XPATH_RESULT
+ TARGET_URL=$PKG_URL/$TARGET_PATH
+
+ REPOMD_URL=$TARGET_URL/repodata/repomd.xml
+ PRIMARY_XPATH='string(//*[local-name()="data"][@type="primary"]/*[local-name()="location"]/@href)'
+
+ Fetch $REPOMD_URL $TMP_REPOMD
+
+ Debug "fetch $REPOMD_URL to $TMP_REPOMD"
+
+ Xpath_get $PRIMARY_XPATH $TMP_REPOMD
+ PRIMARY_XML_PATH=$XPATH_RESULT
+ PRIMARY_URL=$TARGET_URL/$PRIMARY_XML_PATH
+
+ Fetch $PRIMARY_URL $TMP_PRIMARYGZ
+
+ Debug "fetch $PRIMARY_URL to $TMP_PRIMARYGZ"
+
+ gunzip $TMP_PRIMARYGZ
+
+ Debug "unzip $TMP_PRIMARYGZ to $TMP_PRIMARY"
+}
+
+fetch_tizen_pkgs()
+{
+ PROFILE=$1
+ PACKAGE_XPATH_TPL='string(//*[local-name()="metadata"]/*[local-name()="package"][*[local-name()="name"][text()="_PKG_"]]/*[local-name()="location"]/@href)'
+
+ PACKAGE_CHECKSUM_XPATH_TPL='string(//*[local-name()="metadata"]/*[local-name()="package"][*[local-name()="name"][text()="_PKG_"]]/*[local-name()="checksum"]/text())'
+
+ for pkg in ${@:2}
+ do
+ Inform "Fetching... $pkg"
+ XPATH=${PACKAGE_XPATH_TPL/_PKG_/$pkg}
+ Xpath_get $XPATH $TMP_PRIMARY
+ PKG_PATH=$XPATH_RESULT
+
+ XPATH=${PACKAGE_CHECKSUM_XPATH_TPL/_PKG_/$pkg}
+ Xpath_get $XPATH $TMP_PRIMARY
+ CHECKSUM=$XPATH_RESULT
+
+ PKG_URL=$TARGET_URL/$PKG_PATH
+ PKG_FILE=$(basename $PKG_PATH)
+ PKG_PATH=$TMPDIR/$PKG_FILE
+
+ Debug "Download $PKG_URL to $PKG_PATH"
+ Fetch $PKG_URL $PKG_PATH true
+
+ echo "$CHECKSUM $PKG_PATH" | sha256sum -c - > /dev/null
+ if [ $? -ne 0 ]; then
+ Error "Fail to fetch $PKG_URL to $PKG_PATH"
+ Debug "Checksum = $CHECKSUM"
+ exit 1
+ fi
+
+ done
+}
+
+Inform "Initialize arm base"
+fetch_tizen_pkgs_init arm base
+Inform "fetch base common packages"
+fetch_tizen_pkgs base gcc glibc glibc-devel linux-glibc-devel
+Inform "fetch base coreclr packages"
+fetch_tizen_pkgs base lldb lldb-devel libuuid libuuid-devel libgcc libstdc++ libstdc++-devel
+Inform "fetch base corefx packages"
+fetch_tizen_pkgs base libcom_err libcom_err-devel zlib zlib-devel libopenssl libopenssl-devel
+
+Inform "initialize arm mobile"
+fetch_tizen_pkgs_init arm-wayland mobile
+Inform "fetch mobile common packages"
+fetch_tizen_pkgs mobile libicu-devel
+Inform "fetch mobile coreclr packages"
+fetch_tizen_pkgs mobile libunwind libunwind-devel tizen-release
+Inform "fetch mobile corefx packages"
+fetch_tizen_pkgs mobile gssdp gssdp-devel krb5 krb5-devel libcurl libcurl-devel
+
+