...
 
Commits (2)
......@@ -48,8 +48,7 @@ config-env()
export ${wp^^}_TOOLCHAIN_DIR=$toolchain/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi
export ${wp^^}_TOOLCHAIN_PREFIX=arm-poky-linux-gnueabi-
export CROSS_COMPILE=arm-poky-linux-gnueabi-
PATH=${PATH%%:$PWD*} # remove old
PATH+=:$WP76XX_TOOLCHAIN_DIR;
expr match "$PATH" "$WP76XX_TOOLCHAIN_DIR" || PATH+=:$WP76XX_TOOLCHAIN_DIR;
export LEGATO_ROOT=$PWD/legato
export MANGOH_ROOT=$PWD/mangOH
export LEGATO_SYSROOT=$toolchain/sysroots/armv7a-neon-poky-linux-gnueabi
......@@ -63,6 +62,7 @@ config-env()
wget atool jq
cpio bash ninja-build bc unzip libxml2-utils gcovr
{libcurl4-gnutls,zlib1g,libbz2,libssl,libsdl1.2}-dev
bison flex gperf
bsdiff autoconf automake iputils-ping)
}
......@@ -91,6 +91,27 @@ unpack()
fi
}
legato-from-repo()
{
test -e $LEGATO_ROOT || tar xaf $(download legato-repo.tgz)
if [ ! -e $LEGATO_ROOT ]; then
echo legato ...
pushd $(dirname $LEGATO_ROOT)
repo init --no-repo-verify -u https://github.com/legatoproject/manifest -m legato/releases/$legato_release.xml
repo sync --no-repo-verify
popd
fi
if ! find legato/synced -mtime -1 -print; then
git -C .repo/manifests clean -d --force
git -C .repo/repo clean -d --force
repo sync
repo init https://github.com/legatoproject/manifest -m legato/releases/$legato_release.xml
repo sync
touch legato/synced
git -C legato checkout ${legato_release%.*}-release
fi
}
prepare()
{
if [ -t 1 ]; then # in terminal only, don't run from pipeline
......@@ -124,7 +145,7 @@ prepare()
which ${CROSS_COMPILE}gcc || config-env # update $toolchain
if [ ! -e $toolchain ]; then
toolchain_dl=$(echo "$components" \
| grep -o 'http.*x86_64.*toolchain.*sh')
| grep -o 'http.*x86_64.*toolchain.*sh' | tail -n 1)
if toolchain_i=$(download $toolchain_dl); then
chmod +x $toolchain_i
bash $toolchain_i -n -y -d $toolchain
......@@ -132,23 +153,12 @@ prepare()
fi
# first try to unpack saved tgz
test -e $LEGATO_ROOT || tar xaf $(download legato-repo.tgz)
if [ ! -e $LEGATO_ROOT ]; then
echo legato ...
pushd $(dirname $LEGATO_ROOT)
repo init --no-repo-verify -u https://github.com/legatoproject/manifest -m legato/releases/$legato_release.xml
repo sync --no-repo-verify
popd
fi
# legato-from-repo
# still don't exist, fallback to tarball
if [ ! -e $LEGATO_ROOT ]; then
local legato="$(unpack $(echo "$components" | grep -o 'http.*legato.*'))"
local legato="$(unpack $(echo "$components" | grep -o 'http.*legato.*' | tail -n1))"
test "$legato" && symlink $legato $LEGATO_ROOT
fi
repo sync
repo init https://github.com/legatoproject/manifest -m legato/releases/$legato_release.xml
repo sync
test -e $MANGOH_ROOT || unpack mangOH.tgz
test -e $MANGOH_ROOT || {
echo mangOH ...
......@@ -164,7 +174,7 @@ prepare()
test $(readlink -f /bin/sh) == /bin/dash && sudo ln -sfv bash /bin/sh
local yocto_dl=$(echo "$components" | grep -o 'http.*Legato-Dist-Source.*bz2')
local yocto_dl=$(echo "$components" | grep -o 'http.*Legato-Dist-Source.*bz2' | tail -n 1)
local y=$(tarbasename "$yocto_dl")
if [ ! -e $y/Makefile ]; then
yocto_i=$(download $yocto_dl) && unpack $yocto_i
......@@ -206,7 +216,7 @@ _status()
yocto/meta-swi-extras/meta-swi-mdm9x28*/files/fw-version \
${LEGATO_ROOT/$PWD\//}/build/wp76xx/system/staging/version \
$toolchain/version*
echo -n 'legato '; git -C ${LEGATO_ROOT} describe
echo -n 'legato '; git -C ${LEGATO_ROOT} describe --contains
echo -n 'linux '; make -s -C yocto/kernel/ kernelversion
}
......@@ -252,7 +262,7 @@ all()
{
prepare
unset LD_LIBRARY_PATH
. $toolchain/environment-setup-armv7a-neon-poky-linux-gnueabi
source $toolchain/environment-setup-armv7a-neon-poky-linux-gnueabi
expr match $- '.*x' > /dev/null && echo $PATH
#make -C $LEGATO_ROOT clean
make -C $LEGATO_ROOT -k
......