175 lines
3.2 KiB
Bash
175 lines
3.2 KiB
Bash
#!/bin/sh
|
|
|
|
# I have my automake
|
|
export ACLOCAL_PATH=/usr/share/aclocal
|
|
|
|
export ROKU_NFS_ROOT=$HOME/roku/nfs
|
|
export ROKU_NFS_IP=192.168.0.64
|
|
export EXPORTROOT=${ROKU_NFS_ROOT}
|
|
|
|
# This is needed to be able to set brake point on /bin/Application
|
|
export PAX_DEBUG=on
|
|
|
|
build_help()
|
|
{
|
|
cat <<EOF
|
|
platform:
|
|
bailey, marlin
|
|
icecream:
|
|
local, icecc
|
|
target:
|
|
all, addon-checksums, addon-checksum-check, clobber
|
|
EOF
|
|
}
|
|
|
|
build()
|
|
{
|
|
local BUILD_PLATFORM=marlin
|
|
local ENABLE_ICECC=0
|
|
local JOBS=$(nproc)
|
|
local TARGET=all
|
|
local BUILD_MODE=dev
|
|
local PAX_DEBUG=on
|
|
local OPTIONS=
|
|
|
|
local BUILD_ROOT=$(git rev-parse --show-toplevel)/os
|
|
if [ "$?" -ne "0" ]; then
|
|
BUILD_ROOT=$(p4 -Ztag -F %clientRoot% info)/os
|
|
fi
|
|
echo $BUILD_ROOT
|
|
|
|
# args=$(getopt fhstuec $*)
|
|
# if [ $? -ne 0 ]; then
|
|
# usage
|
|
# fi
|
|
# set -- $args
|
|
|
|
while [ $# -gt 0 ]; do
|
|
case "$1" in
|
|
unittests)
|
|
TARGET=build-tests-all
|
|
PAX_DEBUG=off
|
|
BUILD_PLATFORM=hostunittests
|
|
;;
|
|
unity|\
|
|
native)
|
|
PAX_DEBUG=off
|
|
BUILD_PLATFORM=$1
|
|
;;
|
|
reno|\
|
|
bailey|\
|
|
marlin|\
|
|
madison)
|
|
BUILD_PLATFORM=$1
|
|
;;
|
|
icecc)
|
|
ENABLE_ICECC=1
|
|
JOBS=256
|
|
;;
|
|
local)
|
|
ENABLE_ICECC=0
|
|
JOBS=$(nproc)
|
|
;;
|
|
all|\
|
|
addon-checksums|\
|
|
addon-checksum-check|\
|
|
clean|\
|
|
clobber|\
|
|
build-tests-all|\
|
|
build-tests-ZipMountServerTest|\
|
|
build-tests-FuseServerTest|\
|
|
build-tests-PluginPackageManagemnetPluginUnitTests|\
|
|
clobber-all)
|
|
TARGET=$1
|
|
;;
|
|
build-integration-tests)
|
|
OPTIONS+="BUILD_INTEGRATION_TESTS=true"
|
|
;;
|
|
here)
|
|
BUILD_ROOT="."
|
|
;;
|
|
nopax)
|
|
PAX_DEBUG=off
|
|
;;
|
|
debug)
|
|
BUILD_MODE=dbg
|
|
;;
|
|
help)
|
|
build_help
|
|
return
|
|
;;
|
|
*)
|
|
echo "Really? Do you mean that?"
|
|
return
|
|
;;
|
|
esac
|
|
shift
|
|
done
|
|
|
|
|
|
make \
|
|
ENABLE_ICECC=$ENABLE_ICECC \
|
|
BUILD_MODE=$BUILD_MODE \
|
|
PAX_DEBUG=$PAX_DEBUG \
|
|
BUILD_PLATFORM=$BUILD_PLATFORM \
|
|
$OPTIONS \
|
|
-j $JOBS \
|
|
-C $BUILD_ROOT $TARGET
|
|
#make ENABLE_ICECC=1 PAX_DEBUG=on BUILD_PLATFORM=$1 -j $(nproc) -C os all
|
|
}
|
|
###############################################################################
|
|
#
|
|
# Logging
|
|
#
|
|
LOGDIR="${HOME}/roku/logs"
|
|
|
|
lfile()
|
|
{
|
|
echo ${LOGDIR}/$(ls -t -1 ${LOGDIR} | head -1)
|
|
}
|
|
|
|
lless()
|
|
{
|
|
less $(lfile)
|
|
}
|
|
|
|
lcat()
|
|
{
|
|
cat $(lfile)
|
|
}
|
|
|
|
lgrep()
|
|
{
|
|
lcat | grep -a --color "$*"
|
|
}
|
|
|
|
ltail()
|
|
{
|
|
if [ $# -gt 0 ]; then
|
|
tail -f $(lfile) | grep "$*"
|
|
else
|
|
tail -f $(lfile)
|
|
fi
|
|
}
|
|
|
|
ldevice()
|
|
{
|
|
minicom -C $LOGDIR/minicom.log.$(date +%Y-%m-%d--%H-%M-%S)
|
|
}
|
|
|
|
|
|
|
|
rokuget()
|
|
{
|
|
wget --no-check-certificate --user=vkhachatryan --ask-password $1
|
|
}
|
|
|
|
###############################################################################
|
|
#
|
|
# Other helpers
|
|
#
|
|
startvnc()
|
|
{
|
|
x11vnc -safer -nopw -many --usepw --ncache 10
|
|
}
|