diff options
author | 2014-11-21 11:41:35 -0800 | |
---|---|---|
committer | 2014-11-21 11:41:35 -0800 | |
commit | 76b3ac9eff95e385e59ff2706b11facd695234fd (patch) | |
tree | 556642165fe473e948aba95243ec6d23b9aab3c7 /platform_tools | |
parent | 09a22e9597e271c44dc7c2b71c72cf62a7de1e19 (diff) |
Simplfy DEPS: always pull all deps, remove unused barelinux platform.
Left some notes about where we might further clean up.
BUG=skia:
Review URL: https://codereview.chromium.org/753633002
Diffstat (limited to 'platform_tools')
-rwxr-xr-x | platform_tools/barelinux/bin/arm64_download | 150 | ||||
-rwxr-xr-x | platform_tools/barelinux/bin/arm64_make | 55 | ||||
-rwxr-xr-x | platform_tools/barelinux/bin/barelinux_make | 83 | ||||
-rwxr-xr-x | platform_tools/barelinux/bin/download_deps | 29 |
4 files changed, 0 insertions, 317 deletions
diff --git a/platform_tools/barelinux/bin/arm64_download b/platform_tools/barelinux/bin/arm64_download deleted file mode 100755 index 257d464be1..0000000000 --- a/platform_tools/barelinux/bin/arm64_download +++ /dev/null @@ -1,150 +0,0 @@ -#!/bin/sh - -# Copyright 2014 Google Inc. -# -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - - -usage() { - cat >&2 <<EOF -arm64_download - this script downloads the Linaro's ARMv8 Aarch64 -toolchain and minimal embedded Linux system as well as ARM's -foundation model. The required files are mirrored on Google Cloud. - -If the files are already located in the working directory, the -download can be skipped if the checksums match. - -The script then starts a emulated Arm64 Linux system in the -background. After the boot is complete, you can SSH into the system -at port 8022 via user@localhost. The SSH key will be downloaded into -the working directery as well. - -Requires gsutil, xz, tar, and gunzip. - -Usage: - $0 WORKING_DIRECTORY - ssh-add WORKING_DIRECTORY/key - ...wait... - ssh -p 8022 user@localhost -EOF - return 1 -} - -try() { - # print an error on nonzero return code - "$@" - local ret=$? - if [ $ret != 0 ] ; then - echo "'$@' failed and returned ${ret}." >&2 - return $ret - fi -} - -download_necessary_software_to_dir() ( - cd "$1" - local location="chromium-skia-gm/arm64env" - try gsutil cp "gs://${location}/md5sum.txt" . || return - if md5sum -c --quiet "md5sum.txt"; then - return 0 - fi - try gsutil cp "gs://${location}/*" . || return -) - -install_compiler() { - local working_dir="$1" - local toolchain="gcc-linaro-aarch64-linux-gnu-4.8-2013.12_linux" - ( - try cd "$working_dir" || return - try test -f "${toolchain}.tar.xz" || return - try xz --decompress --stdout < "${toolchain}.tar.xz" | \ - try tar xf - || return - ) - local dir="${working_dir}/${toolchain}" - try test -d "$dir" || return - try test -x "${dir}/bin/aarch64-linux-gnu-gcc" || return - try test -x "${dir}/bin/aarch64-linux-gnu-g++" || return -} - -install_runtime() { - local working_dir="$1" - - local firmware='img-foundation.axf' - local rootfs='vexpress64-openembedded_lamp-armv8-gcc-4.8_20131215-557' - local compressed_rootfs="${rootfs}.img.CLEAN_AND_CONFIGURED.xz" - local compressed_foundation_model='FM000-KT-00035-r0p8-52rel06.tgz' - local keyfile='CLEAN_AND_CONFIGURED_key' - - try cp "${working_dir}/$firmware" "${working_dir}/firmware" || return - - try xz --decompress --stdout \ - < "${working_dir}/${compressed_rootfs}" \ - > "${working_dir}/rootfs" || return - try test -f "${working_dir}/rootfs" || return - - ( - try cd "$working_dir" || return - try test -f "$compressed_foundation_model" || return - try gunzip -c "$compressed_foundation_model" | try tar xf - || return - try test -d "Foundation_v8pkg" || return # Assert. - ) - - try cp "${working_dir}/${keyfile}" "${working_dir}/key" || return - chmod 'go=' "${working_dir}/key" -} - -start_arm64_image() { - local working_dir="$1" - local foundation_dir="${working_dir}/Foundation_v8pkg" - local foundation="${foundation_dir}/models/Linux64_GCC-4.1/Foundation_v8" - local firmware="${working_dir}/firmware" - local rootfs="${working_dir}/rootfs" - - try test -d "$foundation_dir" || return - try test -x "$foundation" || return - try test -f "$firmware" || return - try test -f "$rootfs" || return - - for PID in $(ps -o 'pid=' -C 'Foundation_v8') ; do - kill $PID - done - - DISPLAY='' nohup \ - "$foundation" \ - --image="${firmware}" \ - --cores=4 \ - --block-device="${rootfs}" \ - --network="nat" \ - --network-nat-subnet="192.168.31.0/24" \ - --network-nat-ports="8022=22" \ - > /dev/null 2>&1 & - echo 'Waiting for foundation model to boot...' - while ! ssh -i "${working_dir}/key" \ - -o NoHostAuthenticationForLocalhost=yes \ - -p 8022 user@localhost true 2> /dev/null; do - sleep 5 - done - echo 'Listening to SSH on port 8022.' -} - -arm64_download() { - local working_directory="$1" - try mkdir -p "$working_directory" || return - - try download_necessary_software_to_dir "$working_directory" || return - - try install_compiler "$working_directory" || return - - try install_runtime "$working_directory" || return - - try start_arm64_image "$working_directory" || return -} - -for command in gsutil xz tar md5sum gunzip; do - try command -v "$command" > /dev/null || usage || exit -done - -if [ -z "$1" ] ; then - usage || exit -fi -try arm64_download "$1" diff --git a/platform_tools/barelinux/bin/arm64_make b/platform_tools/barelinux/bin/arm64_make deleted file mode 100755 index 9797df8cdd..0000000000 --- a/platform_tools/barelinux/bin/arm64_make +++ /dev/null @@ -1,55 +0,0 @@ -#!/bin/sh - -# Copyright 2014 Google Inc. -# -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -set -e # When any command fails, the shell will immediately exit. - -usage() { - cat >&2 <<EOF -arm64_make - this script builds a AArch64 version of skia that -does not depend on external libraries, perfect for putting in an -embedded system running Linux. - -Assumes that you have already run the download_deps script. - -Usage: - $0 \\ - [-o SKIA_OUT_DIR] [-c CC_EXE] [-x CXX_EXE] \\ - [-t Debug | Release | Coverage | Release_Developer] \\ - -Example use: - $0 \\ - -o ~/build/skia/arg64gcc \\ - -c ~/local/arm64/bin/aarch64-linux-gnu-gcc \\ - -x ~/local/arm64/bin/aarch64-linux-gnu-g++ \\ -EOF - return 1 -} - -# BUILD_TYPE should be one of: -# Coverage, Debug, Release, or Release_Developer -BUILD_TYPE='Debug' - -while getopts ":c:x:o:t:h" opt ; do - case $opt in - c) export CC="$OPTARG" ;; - x) export CXX="$OPTARG" ;; - o) export SKIA_OUT="$OPTARG";; - t) BUILD_TYPE="$OPTARG";; - h) usage || exit;; - ?) echo "unknown option '$OPTARG'" >&2; - usage || exit;; - esac -done -OPTIND=1 # Reset this variable for calling barelinux_make with -t command flag. - -export GYP_DEFINES="${GYP_DEFINES} \ - skia_gpu=0 \ - skia_arch_type=arm64 \ - " - -. "$(dirname "$0")/barelinux_make" -t "$BUILD_TYPE" - diff --git a/platform_tools/barelinux/bin/barelinux_make b/platform_tools/barelinux/bin/barelinux_make deleted file mode 100755 index 7673fd2631..0000000000 --- a/platform_tools/barelinux/bin/barelinux_make +++ /dev/null @@ -1,83 +0,0 @@ -#!/bin/sh - -# Copyright 2014 Google Inc. -# -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -set -e # When any command fails, the shell will immediately exit. - -if echo $- | grep -q 'x'; then - # Debug mode - trap 'echo exit status = $?' EXIT -fi - -usage() { - cat >&2 <<EOF -barelinux_make - this script builds a version of skia that does not -depend on external libraries, perfect for putting in an embedded -system running Linux. - -Assumes that you have already run the download_deps script. - -Usage: - $0 \\ - [-o SKIA_OUT_DIR] [-c CC_EXE] [-x CXX_EXE] \\ - [-t Debug | Release | Coverage | Release_Developer] \\ - [GYP_DEFINES...] - -Example use: - $0 \\ - -o ~/build/skia/arg64gcc \\ - -c ~/local/arm64/bin/aarch64-linux-gnu-gcc \\ - -x ~/local/arm64/bin/aarch64-linux-gnu-g++ \\ - skia_gpu=0 skia_arch_type=arm skia_arch_width=64 \\ - armv7=1 armv8=1 arm_neon=0 arm_thumb=0 -EOF - return 1 -} - -# BUILD_TYPE should be one of: -# Coverage, Debug, Release, or Release_Developer -BUILD_TYPE='Debug' - -while getopts ":c:x:o:t:h" opt ; do - case $opt in - c) export CC="$OPTARG" ;; - x) export CXX="$OPTARG" ;; - o) export SKIA_OUT="$OPTARG";; - t) BUILD_TYPE="$OPTARG";; - h) usage || exit;; - ?) echo "unknown option '$OPTARG'" >&2; - usage || exit;; - esac -done -# Append exra arguments to GYP_DEFINES variable. -shift $(( $OPTIND - 1 )) -GYP_DEFINES="${GYP_DEFINES} $*" - -# If you move this script, this must be changed. -SKIA_SRC_DIR="$(cd "$(dirname "$0")/../../.."; pwd)" - -# Set a reasonable default. -export SKIA_OUT="${SKIA_OUT:-${SKIA_SRC_DIR}/out/barelinux}" - -mkdir -p "$SKIA_OUT" - -export GYP_GENERATORS="ninja" -export GYP_GENERATOR_FLAGS="" -export GYP_DEFINES="${GYP_DEFINES} \ - skia_warnings_as_errors=0 \ - skia_giflib_static=1 \ - skia_libpng_static=1 \ - skia_zlib_static=1 \ - skia_freetype_static=1 \ - skia_no_fontconfig=1 \ - skia_poppler_enabled=0 \ - skia_skip_gui=1 \ - " - -"${SKIA_SRC_DIR}/gyp_skia" - -ninja -C "${SKIA_OUT}/${BUILD_TYPE}" - diff --git a/platform_tools/barelinux/bin/download_deps b/platform_tools/barelinux/bin/download_deps deleted file mode 100755 index 06769613b3..0000000000 --- a/platform_tools/barelinux/bin/download_deps +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/sh - -# Copyright 2014 Google Inc. -# -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -# download_deps - download Skia's dependencies for a bare Linux system -# (the normal dependecies plus giflib, libpng, and zlib.) - -try() { - # print an error on nonzero return code - "$@" - local ret=$? - if [ $ret != 0 ] ; then - echo "'$@' failed and returned ${ret}." >&2 - return $ret - fi -} - -try command -v gclient > /dev/null || exit -cd "$(dirname "$0")/../../.." - -try gclient config --unmanaged --name . \ - 'https://skia.googlesource.com/skia.git' || exit - -echo 'target_os = ["barelinux"]' >> ./.gclient - -try gclient sync --jobs=1 || exit |