summaryrefslogtreecommitdiffstats
path: root/meta-agl-distro
AgeCommit message (Expand)AuthorFilesLines
2017-06-01Add support for cflags for pi0/1Jan-Simon Möller1-1/+10
2017-05-25Add override for DISTRO_CODENAMEdab_3.99.1dab/3.99.13.99.1Jan-Simon Möller1-0/+1
2017-05-23Bump version for DARING DAB rc1Jan-Simon Möller1-1/+2
2017-05-16Fix build of mozjs, gpm and libatasmart due to SECURITY_%FLAGSJan-Simon Möller1-0/+9
2017-05-09x86_64-tune: fix KVM qemu optionsMartin Kelly1-0/+2
2017-05-06Enforce unified tunings across all target boards of AGLJan-Simon Möller5-20/+95
2017-04-25Temporary fix for the agl-sota featureJan-Simon Möller1-0/+3
2017-04-25poky-agl: exempt qtwebengine from security flagsMartin Kelly1-0/+3
2017-04-18Set a weak distro-wide DEFAULTTUNE for ARM 32bitJan-Simon Möller1-0/+3
2017-04-09LLVM3.3 build fix on qemux86-64Jan-Simon Möller1-1/+2
2017-03-29Fix version of gst-omxTadao Tanikawa1-7/+7
2017-03-28Re-enable security flags proposed in PokyStephane Desneux1-1/+1
2017-03-08Splice out distro configuration in own layer for compatibilityJan-Simon Möller3-0/+113
color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */ }
#!/bin/bash

# Configurable variables
[ -z "$BINDIR" ] && BINDIR=/usr/local/bin
[ -z "$XDS_CONFFILE" ] && XDS_CONFFILE=$HOME/.xds/config.json
[ -z "$XDS_SHAREDIR" ] && XDS_SHAREDIR=$HOME/.xds/share
[ -z "$ST_CONFDIR" ] && ST_CONFDIR=$HOME/.xds/syncthing-config
[ -z "$XDS_WWWDIR" ] && XDS_WWWDIR=webapp/dist
[ -z "$LOGLEVEL" ] && LOGLEVEL=info
[ -z "$LOGDIR" ] && LOGDIR=/tmp/xds-server/logs
[ -z "$PORT_GUI" ] && PORT_GUI=8384
[ -z "$API_KEY" ] && API_KEY="1234abcezam"
[ -z "$UPDATE_XDS_TARBALL" ] && UPDATE_XDS_TARBALL=0

[[ -f $BINDIR/xds-server ]] || { echo "Cannot find xds-server in BINDIR !"; exit 1; }

# Create config.json file when needed
if [ ! -f "${XDS_CONFFILE}" ]; then
    mv ${XDS_CONFFILE} ${XDS_CONFFILE}.old
    [ ! -f "$XDS_WWWDIR/index.html" ] && XDS_WWWDIR=$BINDIR/www-xds-server
    [ ! -f "$XDS_WWWDIR/index.html" ] && XDS_WWWDIR=/var/www/xds-server
    [ ! -f "$XDS_WWWDIR/index.html" ] && { echo "Cannot determine XDS-server webapp directory."; exit 1; }
    cat <<EOF > ${XDS_CONFFILE}
{
    "webAppDir": "${XDS_WWWDIR}",
    "shareRootDir": "${XDS_SHAREDIR}",
    "logsDir": "${LOGDIR}",
    "sdkRootDir": "/xdt/sdk",
    "syncthing": {
        "binDir": "${BINDIR}",
        "home": "${ST_CONFDIR}",
        "gui-address": "http://localhost:${PORT_GUI}",
        "gui-apikey": "${API_KEY}"
    }
}
EOF
fi

echo "### Configuration in config.json: "
cat ${XDS_CONFFILE}
echo ""

mkdir -p ${LOGDIR}
LOG_XDS=${LOGDIR}/xds-server.log

# Download xds-agent tarball
if [ "${UPDATE_XDS_TARBALL}" = 1 ]; then
    SCRIPT_GET_XDS_TARBALL=$BINDIR/xds-utils/get-xds-agent.sh
    if [ ! -f ${SCRIPT_GET_XDS_TARBALL} ]; then
        SCRIPT_GET_XDS_TARBALL=$(dirname $0)/xds-utils/get-xds-agent.sh
    fi
    if [ -f ${SCRIPT_GET_XDS_TARBALL} ]; then
        TARBALLDIR=${XDS_WWWDIR}/assets/xds-agent-tarballs
        [ ! -d "$TARBALLDIR" ] && TARBALLDIR=$BINDIR/www-xds-server/assets/xds-agent-tarballs
        [ ! -d "$TARBALLDIR" ] && TARBALLDIR=$(grep webAppDir ~/.xds/config.json|cut -d '"' -f 4)/assets/xds-agent-tarballs
        if [ -d "$TARBALLDIR" ]; then
            DEST_DIR=$TARBALLDIR $SCRIPT_GET_XDS_TARBALL
        else
            echo "WARNING: cannot download / update xds-agent tarballs (DESTDIR error)"
        fi
    else
        echo "WARNING: cannot download / update xds-agent tarballs"
    fi
fi


echo "### Start XDS server"
echo "nohup $BINDIR/xds-server --config $XDS_CONFFILE -log $LOGLEVEL > $LOG_XDS 2>&1"
if [ "$1" != "-dryrun" ]; then
    nohup $BINDIR/xds-server --config $XDS_CONFFILE -log $LOGLEVEL > $LOG_XDS 2>&1 &
    pid_xds=$(jobs -p)
    echo "pid=${pid_xds}"
fi