#!/bin/sh # Emit a useful diagnostic if something fails: bb_exit_handler() { ret=$? case $ret in 0) ;; *) case $BASH_VERSION in "") echo "WARNING: exit code $ret from a shell command.";; *) echo "WARNING: ${BASH_SOURCE[0]}:${BASH_LINENO[0]} exit $ret from '$BASH_COMMAND'";; esac exit $ret esac } trap 'bb_exit_handler' 0 set -e export CXX="arm-linux-gnueabihf-g++ -march=armv7-a -marm -mfpu=neon -mfloat-abi=hard --sysroot=/home/signal/TI_SDK/sdk_oe/tisdk/build/arago-tmp-external-linaro-toolchain/sysroots/am335x-evm" export PKG_CONFIG_SYSTEM_LIBRARY_PATH="/lib:/usr/lib" export CXXFLAGS=" -isystem/home/signal/TI_SDK/sdk_oe/gcc-linaro-6.2.1-2016.11-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include -O2 -pipe -g -feliminate-unused-debug-types -fdebug-prefix-map=/home/signal/TI_SDK/sdk_oe/tisdk/build/arago-tmp-external-linaro-toolchain/work/am335x_evm-linux-gnueabi/linux-ti-staging-rt/4.9.28+gitAUTOINC+786e64041b-r22c.arago1.tisdk3=/usr/src/debug/linux-ti-staging-rt/4.9.28+gitAUTOINC+786e64041b-r22c.arago1.tisdk3 -fdebug-prefix-map=/home/signal/TI_SDK/sdk_oe/tisdk/build/arago-tmp-external-linaro-toolchain/sysroots/x86_64-linux= -fdebug-prefix-map=/home/signal/TI_SDK/sdk_oe/tisdk/build/arago-tmp-external-linaro-toolchain/sysroots/am335x-evm= " export localstatedir="/var" export TARGET_CFLAGS=" -isystem/home/signal/TI_SDK/sdk_oe/gcc-linaro-6.2.1-2016.11-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include -O2 -pipe -g -feliminate-unused-debug-types -fdebug-prefix-map=/home/signal/TI_SDK/sdk_oe/tisdk/build/arago-tmp-external-linaro-toolchain/work/am335x_evm-linux-gnueabi/linux-ti-staging-rt/4.9.28+gitAUTOINC+786e64041b-r22c.arago1.tisdk3=/usr/src/debug/linux-ti-staging-rt/4.9.28+gitAUTOINC+786e64041b-r22c.arago1.tisdk3 -fdebug-prefix-map=/home/signal/TI_SDK/sdk_oe/tisdk/build/arago-tmp-external-linaro-toolchain/sysroots/x86_64-linux= -fdebug-prefix-map=/home/signal/TI_SDK/sdk_oe/tisdk/build/arago-tmp-external-linaro-toolchain/sysroots/am335x-evm= " export AR="arm-linux-gnueabihf-ar" export USER="signal" export nonarch_libdir="/usr/lib" export BUILD_CXXFLAGS="-isystem/home/signal/TI_SDK/sdk_oe/tisdk/build/arago-tmp-external-linaro-toolchain/sysroots/x86_64-linux/usr/include -O2 -pipe -D_GLIBCXX_USE_CXX11_ABI=0" export PSEUDO_DISABLED="1" export prefix="/usr" export ARCH="arm" export oldincludedir="/usr/include" export TARGET_CPPFLAGS=" -isystem/home/signal/TI_SDK/sdk_oe/gcc-linaro-6.2.1-2016.11-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include " export BUILD_CCLD="gcc " export STRIP="arm-linux-gnueabihf-strip" export CCACHE_DIR="/home/signal/.ccache" export BUILD_CPPFLAGS="-isystem/home/signal/TI_SDK/sdk_oe/tisdk/build/arago-tmp-external-linaro-toolchain/sysroots/x86_64-linux/usr/include" export TERM="xterm-256color" export OBJCOPY="arm-linux-gnueabihf-objcopy" export docdir="/usr/share/doc" export nonarch_base_libdir="/lib" export PKG_CONFIG_LIBDIR="/home/signal/TI_SDK/sdk_oe/tisdk/build/arago-tmp-external-linaro-toolchain/sysroots/am335x-evm/usr/lib/pkgconfig" export BUILD_FC="gfortran " export CCACHE_DISABLE="1" export CCLD="arm-linux-gnueabihf-gcc -march=armv7-a -marm -mfpu=neon -mfloat-abi=hard --sysroot=/home/signal/TI_SDK/sdk_oe/tisdk/build/arago-tmp-external-linaro-toolchain/sysroots/am335x-evm" export BUILD_CXX="g++ " export libdir="/usr/lib" export PATH="/home/signal/TI_SDK/sdk_oe/tisdk/sources/oe-core/scripts:/home/signal/TI_SDK/sdk_oe/tisdk/build/arago-tmp-external-linaro-toolchain/sysroots/x86_64-linux/usr/bin/arm-linux-gnueabi:/home/signal/TI_SDK/sdk_oe/tisdk/build/arago-tmp-external-linaro-toolchain/sysroots/am335x-evm/usr/bin/crossscripts:/home/signal/TI_SDK/sdk_oe/tisdk/build/arago-tmp-external-linaro-toolchain/sysroots/x86_64-linux/usr/sbin:/home/signal/TI_SDK/sdk_oe/tisdk/build/arago-tmp-external-linaro-toolchain/sysroots/x86_64-linux/usr/bin:/home/signal/TI_SDK/sdk_oe/tisdk/build/arago-tmp-external-linaro-toolchain/sysroots/x86_64-linux/sbin:/home/signal/TI_SDK/sdk_oe/tisdk/build/arago-tmp-external-linaro-toolchain/sysroots/x86_64-linux/bin:/home/signal/TI_SDK/sdk_oe/gcc-linaro-6.2.1-2016.11-x86_64_arm-linux-gnueabihf/bin:/home/signal/TI_SDK/sdk_oe/gcc-linaro-6.2.1-2016.11-x86_64_arm-linux-gnueabihf/bin:/home/signal/TI_SDK/sdk_oe/tisdk/sources/meta-browser/scripts:/home/signal/TI_SDK/sdk_oe/tisdk/sources/oe-core/scripts:/home/signal/TI_SDK/sdk_oe/tisdk/sources/bitbake/bin:/home/signal/TI_SDK/ti-processor-sdk-linux-rt-am335x-evm-04.00.00.04/linux-devkit/sysroots/x86_64-arago-linux/usr/bin:/home/signal/bin:/home/signal/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin" export TARGET_LDFLAGS=" -L/home/signal/TI_SDK/sdk_oe/gcc-linaro-6.2.1-2016.11-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/lib -Wl,-rpath-link,/home/signal/TI_SDK/sdk_oe/gcc-linaro-6.2.1-2016.11-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/lib -Wl,-O1 -Wl,--hash-style=gnu" export BUILD_STRIP="strip" export BUILD_CFLAGS="-isystem/home/signal/TI_SDK/sdk_oe/tisdk/build/arago-tmp-external-linaro-toolchain/sysroots/x86_64-linux/usr/include -O2 -pipe" export systemd_system_unitdir="/lib/systemd/system" export OBJDUMP="arm-linux-gnueabihf-objdump" export CC="arm-linux-gnueabihf-gcc -march=armv7-a -marm -mfpu=neon -mfloat-abi=hard --sysroot=/home/signal/TI_SDK/sdk_oe/tisdk/build/arago-tmp-external-linaro-toolchain/sysroots/am335x-evm" export libexecdir="/usr/libexec" export STRINGS="arm-linux-gnueabihf-strings" export OS="linux-gnueabi" export PSEUDO_UNLOAD="1" export LC_ALL="en_US.UTF-8" export NM="arm-linux-gnueabihf-nm" export base_sbindir="/sbin" export BUILD_LD="ld " export BUILD_CPP="gcc -E" export CMDLINE_CONSOLE="console=ttyS0" export BUILD_AR="ar" export CFLAGS=" -isystem/home/signal/TI_SDK/sdk_oe/gcc-linaro-6.2.1-2016.11-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include -O2 -pipe -g -feliminate-unused-debug-types -fdebug-prefix-map=/home/signal/TI_SDK/sdk_oe/tisdk/build/arago-tmp-external-linaro-toolchain/work/am335x_evm-linux-gnueabi/linux-ti-staging-rt/4.9.28+gitAUTOINC+786e64041b-r22c.arago1.tisdk3=/usr/src/debug/linux-ti-staging-rt/4.9.28+gitAUTOINC+786e64041b-r22c.arago1.tisdk3 -fdebug-prefix-map=/home/signal/TI_SDK/sdk_oe/tisdk/build/arago-tmp-external-linaro-toolchain/sysroots/x86_64-linux= -fdebug-prefix-map=/home/signal/TI_SDK/sdk_oe/tisdk/build/arago-tmp-external-linaro-toolchain/sysroots/am335x-evm= " export BUILD_AS="as " unset TARGET_ARCH unset DISTRO export MAKE="make" export LOGNAME="signal" export base_bindir="/bin" export servicedir="/srv" export base_prefix="" export sysconfdir="/etc" export base_libdir="/lib" unset MACHINE export TARGET_CXXFLAGS=" -isystem/home/signal/TI_SDK/sdk_oe/gcc-linaro-6.2.1-2016.11-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include -O2 -pipe -g -feliminate-unused-debug-types -fdebug-prefix-map=/home/signal/TI_SDK/sdk_oe/tisdk/build/arago-tmp-external-linaro-toolchain/work/am335x_evm-linux-gnueabi/linux-ti-staging-rt/4.9.28+gitAUTOINC+786e64041b-r22c.arago1.tisdk3=/usr/src/debug/linux-ti-staging-rt/4.9.28+gitAUTOINC+786e64041b-r22c.arago1.tisdk3 -fdebug-prefix-map=/home/signal/TI_SDK/sdk_oe/tisdk/build/arago-tmp-external-linaro-toolchain/sysroots/x86_64-linux= -fdebug-prefix-map=/home/signal/TI_SDK/sdk_oe/tisdk/build/arago-tmp-external-linaro-toolchain/sysroots/am335x-evm= " export AS="arm-linux-gnueabihf-as " export LDFLAGS=" -L/home/signal/TI_SDK/sdk_oe/gcc-linaro-6.2.1-2016.11-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/lib -Wl,-rpath-link,/home/signal/TI_SDK/sdk_oe/gcc-linaro-6.2.1-2016.11-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/lib -Wl,-O1 -Wl,--hash-style=gnu" export infodir="/usr/share/info" export PKG_CONFIG_SYSROOT_DIR="/home/signal/TI_SDK/sdk_oe/tisdk/build/arago-tmp-external-linaro-toolchain/sysroots/am335x-evm" export LD="arm-linux-gnueabihf-ld --sysroot=/home/signal/TI_SDK/sdk_oe/tisdk/build/arago-tmp-external-linaro-toolchain/sysroots/am335x-evm " export BUILD_LDFLAGS="-L/home/signal/TI_SDK/sdk_oe/tisdk/build/arago-tmp-external-linaro-toolchain/sysroots/x86_64-linux/usr/lib -L/home/signal/TI_SDK/sdk_oe/tisdk/build/arago-tmp-external-linaro-toolchain/sysroots/x86_64-linux/lib -Wl,-rpath-link,/home/signal/TI_SDK/sdk_oe/tisdk/build/arago-tmp-external-linaro-toolchain/sysroots/x86_64-linux/usr/lib -Wl,-rpath-link,/home/signal/TI_SDK/sdk_oe/tisdk/build/arago-tmp-external-linaro-toolchain/sysroots/x86_64-linux/lib -Wl,-rpath,/home/signal/TI_SDK/sdk_oe/tisdk/build/arago-tmp-external-linaro-toolchain/sysroots/x86_64-linux/usr/lib -Wl,-rpath,/home/signal/TI_SDK/sdk_oe/tisdk/build/arago-tmp-external-linaro-toolchain/sysroots/x86_64-linux/lib -Wl,-O1" export BUILD_NM="nm" export mandir="/usr/share/man" export UBOOT_ARCH="arm" export READELF="arm-linux-gnueabihf-readelf" export CPP="arm-linux-gnueabihf-gcc -E --sysroot=/home/signal/TI_SDK/sdk_oe/tisdk/build/arago-tmp-external-linaro-toolchain/sysroots/am335x-evm -march=armv7-a -marm -mfpu=neon -mfloat-abi=hard" export CPPFLAGS=" -isystem/home/signal/TI_SDK/sdk_oe/gcc-linaro-6.2.1-2016.11-x86_64_arm-linux-gnueabihf/arm-linux-gnueabihf/include " export BUILD_CC="gcc " export bindir="/usr/bin" export FC="arm-linux-gnueabihf-gfortran -march=armv7-a -marm -mfpu=neon -mfloat-abi=hard --sysroot=/home/signal/TI_SDK/sdk_oe/tisdk/build/arago-tmp-external-linaro-toolchain/sysroots/am335x-evm" export PKG_CONFIG_DISABLE_UNINSTALLED="yes" unset SHELL export HOME="/home/signal" export PKG_CONFIG_DIR="/home/signal/TI_SDK/sdk_oe/tisdk/build/arago-tmp-external-linaro-toolchain/sysroots/am335x-evm/usr/lib/pkgconfig" export PKG_CONFIG_PATH="/home/signal/TI_SDK/sdk_oe/tisdk/build/arago-tmp-external-linaro-toolchain/sysroots/am335x-evm/usr/lib/pkgconfig:/home/signal/TI_SDK/sdk_oe/tisdk/build/arago-tmp-external-linaro-toolchain/sysroots/am335x-evm/usr/share/pkgconfig" export RANLIB="arm-linux-gnueabihf-ranlib" export datadir="/usr/share" export sbindir="/usr/sbin" export PKG_CONFIG_SYSTEM_INCLUDE_PATH="/usr/include" export exec_prefix="/usr" export CROSS_COMPILE="arm-linux-gnueabihf-" export systemd_unitdir="/lib/systemd" export includedir="/usr/include" export sharedstatedir="/com" export systemd_user_unitdir="/usr/lib/systemd/user" export BUILD_RANLIB="ranlib" do_create_srcipk() { sourceipk_do_create_srcipk } sourceipk_do_create_srcipk() { if [ 1 != "0" ] then tmp_dir="/home/signal/TI_SDK/sdk_oe/tisdk/build/arago-tmp-external-linaro-toolchain/work/am335x_evm-linux-gnueabi/linux-ti-staging-rt/4.9.28+gitAUTOINC+786e64041b-r22c.arago1.tisdk3/sourceipk-tmp" srcipk_dir="/home/signal/TI_SDK/sdk_oe/tisdk/build/arago-tmp-external-linaro-toolchain/work/am335x_evm-linux-gnueabi/linux-ti-staging-rt/4.9.28+gitAUTOINC+786e64041b-r22c.arago1.tisdk3/sourceipk-data" mkdir -p $tmp_dir/CONTROL mkdir -p $srcipk_dir control_file="$tmp_dir/CONTROL/control" # Write the control file echo "Package: linux-ti-staging-rt-src" > $control_file echo "Version: 4.9.28+gitAUTOINC+786e64041b-r22c.arago1.tisdk3" >> $control_file echo "Description: Patched sources for linux-ti-staging-rt" >> $control_file echo "Section: kernel" >> $control_file echo "Priority: Optional" >> $control_file echo "Maintainer: OE-Core Developers " >> $control_file echo "License: GPLv2" >> $control_file echo "Architecture: am335x_evm" >> $control_file srcuri=" git://git.ti.com/processor-sdk/processor-sdk-linux.git;protocol=git;branch=processor-sdk-linux-rt-04.00.00 file://defconfig file://am335x-pru-uio.dtsi file://jailhouse.cfg" if [ "$srcuri" = "" ] then srcuri="OpenEmbedded" fi echo "Source: $srcuri" >> $control_file #Write the control tarball tar -C $tmp_dir/CONTROL --owner=0 --group=0 -czf $srcipk_dir/control.tar.gz . # Get rid of temporary control file rm -rf $tmp_dir/CONTROL # Copy sources for packaging mkdir -p $tmp_dir/board-support/linux-rt-4.9.28+gitAUTOINC+786e64041b-g786e64041b if [ -e /home/signal/TI_SDK/sdk_oe/tisdk/build/arago-tmp-external-linaro-toolchain/work/am335x_evm-linux-gnueabi/linux-ti-staging-rt/4.9.28+gitAUTOINC+786e64041b-r22c.arago1.tisdk3/git ]; then if [ "/home/signal/TI_SDK/sdk_oe/tisdk/build/arago-tmp-external-linaro-toolchain/work/am335x_evm-linux-gnueabi/linux-ti-staging-rt/4.9.28+gitAUTOINC+786e64041b-r22c.arago1.tisdk3/git" = "/home/signal/TI_SDK/sdk_oe/tisdk/build/arago-tmp-external-linaro-toolchain/work/am335x_evm-linux-gnueabi/linux-ti-staging-rt/4.9.28+gitAUTOINC+786e64041b-r22c.arago1.tisdk3" ]; then excludes='--exclude ./temp --exclude ./sourceipk-tmp --exclude ./sourceipk-data' fi tar -C /home/signal/TI_SDK/sdk_oe/tisdk/build/arago-tmp-external-linaro-toolchain/work/am335x_evm-linux-gnueabi/linux-ti-staging-rt/4.9.28+gitAUTOINC+786e64041b-r22c.arago1.tisdk3/git -cO $excludes . | tar -C $tmp_dir/board-support/linux-rt-4.9.28+gitAUTOINC+786e64041b-g786e64041b -xpf - fi # Fix up patches/ directory to contain actual patches instead of symlinks if [ -e $tmp_dir/board-support/linux-rt-4.9.28+gitAUTOINC+786e64041b-g786e64041b/patches ] then mv $tmp_dir/board-support/linux-rt-4.9.28+gitAUTOINC+786e64041b-g786e64041b/patches $tmp_dir/board-support/linux-rt-4.9.28+gitAUTOINC+786e64041b-g786e64041b/patches-links cp -rL $tmp_dir/board-support/linux-rt-4.9.28+gitAUTOINC+786e64041b-g786e64041b/patches-links $tmp_dir/board-support/linux-rt-4.9.28+gitAUTOINC+786e64041b-g786e64041b/patches rm -rf $tmp_dir/board-support/linux-rt-4.9.28+gitAUTOINC+786e64041b-g786e64041b/patches-links fi if [ 0 != "0" ] then sourceipk_create_readme $tmp_dir/board-support/linux-rt-4.9.28+gitAUTOINC+786e64041b-g786e64041b/ cp /home/signal/TI_SDK/sdk_oe/tisdk/sources/meta-ti/recipes-kernel/linux/linux-ti-staging-rt_4.9.bb $tmp_dir/board-support/linux-rt-4.9.28+gitAUTOINC+786e64041b-g786e64041b/ fi # Adjust the git repository if there is one. Do this adjustment # here so we don't have to modify the original sources. adjust_git #Write the data tarball tar -C $tmp_dir --owner=0 --group=0 -czf $srcipk_dir/data.tar.gz . # Create the debian-binary file echo "2.0" > $srcipk_dir/debian-binary #Write the ipk file mkdir -p /home/signal/TI_SDK/sdk_oe/tisdk/build/arago-tmp-external-linaro-toolchain/work/am335x_evm-linux-gnueabi/linux-ti-staging-rt/4.9.28+gitAUTOINC+786e64041b-r22c.arago1.tisdk3/deploy-src/am335x_evm pkg_file=/home/signal/TI_SDK/sdk_oe/tisdk/build/arago-tmp-external-linaro-toolchain/work/am335x_evm-linux-gnueabi/linux-ti-staging-rt/4.9.28+gitAUTOINC+786e64041b-r22c.arago1.tisdk3/deploy-src/am335x_evm/linux-ti-staging-rt-src_4.9.28+gitAUTOINC+786e64041b-r22c.arago1.tisdk3_am335x_evm.ipk rm -f $pkg_file ( cd $srcipk_dir && ar -crf $pkg_file ./debian-binary ./control.tar.gz ./data.tar.gz ) # Remove the temporary directory rm -rf $tmp_dir fi } sourceipk_create_readme() { readme="$1/README.linux-ti-staging-rt-src" touch $readme echo 'This package contains the patched sources for linux-ti-staging-rt that' >> $readme echo 'were used to generate the linux-ti-staging-rt binary ipk package(s).' >> $readme echo 'This package does not build or generate the binaries' >> $readme echo 'directly. To build the binaries you must either' >> $readme echo 'configure and build the sources yourself or use:' >> $readme echo ' bitbake linux-ti-staging-rt' >> $readme echo '' >> $readme echo 'NOTE: The patches applied to the sources can be found in' >> $readme echo " the \"patches\" directory" >> $readme } adjust_git() { orig_dir="$PWD" cd $tmp_dir/board-support/linux-rt-4.9.28+gitAUTOINC+786e64041b-g786e64041b if [ -d ".git" ] then if [ "true" = "true" ] then # If SRCIPK_SHALLOW_CLONE is true then make a shallow copy of the # git repository and then fix up the git URLs if [ "true" == "true" ] then limit_git_history fi # Repackage the repository so its a proper clone of the original # (remote) git repository git repack -a -d if [ "processor-sdk-local" != "" -a "Create local branch\\n\\nThe below commit is used for this local branch and is the one used by\\nthis sdk:\\n786e64041bf4d0a479a00e1d70c8e24c5d7eae25.\\n\\nTo reduce the size of the SDK installer only a portion of the git commit\\nhistory has been preserved. Also links to remote branches and tags do\\nnot exist in this copy of the repository.\\nTo fix this please run the unshallow-repositories.sh\\nscript located in the sdk\'s bin directory\\n\\nThe script may take several minutes but you will then have a full copy of\\nthe git repository including its entire git history.\\n" != "" ] then # Create local git config settings to create commit git config user.email "<>" git config user.name "Texas Instruments SDK Builder" # For recipes like the kernel which may end up running # sourceipk more than once. branch_exist=`git branch | grep processor-sdk-local` || echo "" if [ "$branch_exist" != "" -a -f TISDK-README ] then git add -A git commit --amend else echo -e Create local branch\\n\\nThe below commit is used for this local branch and is the one used by\\nthis sdk:\\n786e64041bf4d0a479a00e1d70c8e24c5d7eae25.\\n\\nTo reduce the size of the SDK installer only a portion of the git commit\\nhistory has been preserved. Also links to remote branches and tags do\\nnot exist in this copy of the repository.\\nTo fix this please run the unshallow-repositories.sh\\nscript located in the sdk\'s bin directory\\n\\nThe script may take several minutes but you will then have a full copy of\\nthe git repository including its entire git history.\\n > TISDK-README git add -A git commit -F TISDK-README git checkout -b "processor-sdk-local" fi # Delete local git config settings previously set git config --unset user.email git config --unset user.name fi rm -f .git/objects/info/alternates else rm -rf .git fi fi cd $orig_dir } limit_git_history() { # Temporary directory to make shallow clones in gitshallowclone="/home/signal/TI_SDK/sdk_oe/tisdk/build/arago-tmp-external-linaro-toolchain/work/am335x_evm-linux-gnueabi/linux-ti-staging-rt/4.9.28+gitAUTOINC+786e64041b-r22c.arago1.tisdk3/temp-git-shallow-clone" # Change directory to the git repository to be safe cd $tmp_dir/board-support/linux-rt-4.9.28+gitAUTOINC+786e64041b-g786e64041b # Create a temporary directory to hold the shallow git clone mkdir -p $gitshallowclone remote=`get_remote $PWD` # Clone a shallow version of the workdir repo so that the preserved git # points to the commit used in the build. git clone --depth 400 --branch processor-sdk-linux-rt-04.00.00 file://$PWD/.git $gitshallowclone # remove original kernel clone since we will replace it with the shallow # clone rm -rf $tmp_dir/board-support/linux-rt-4.9.28+gitAUTOINC+786e64041b-g786e64041b/.git # replace the original kernel git data with the shallow clone git data mv $gitshallowclone/.git $tmp_dir/board-support/linux-rt-4.9.28+gitAUTOINC+786e64041b-g786e64041b/ rm -rf $gitshallowclone # Remove the local remote git remote rm origin # This is forceful, but unfortuantely, removing the origin remote does not # remove all origin refs, and that causes problems. rm -rf ./.git/refs/remotes/origin # Point remote back to upstream git remote add origin $remote cd - } get_remote() { git_repo="$1" if [ "$git_repo" == "" ] then echo "git_repo not passed to get_remote" exit 1 fi cd $git_repo # Get the remote repository fetch URL remote=`git remote -v | grep "(fetch)" | cut -d ' ' -f 1 | cut -c 7- | tr -d ' '` # Since the echo'ed value of this statment is the returned value redirect # the output of this command to /dev/null cd - > /dev/null # echo back the remote repository URL as the output of this function echo $remote return 0 } cd '/home/signal/TI_SDK/sdk_oe/tisdk/build/arago-tmp-external-linaro-toolchain/work/am335x_evm-linux-gnueabi/linux-ti-staging-rt/4.9.28+gitAUTOINC+786e64041b-r22c.arago1.tisdk3/deploy-src' do_create_srcipk # cleanup ret=$? trap '' 0 exit $ret