All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] ti-tisdk-install: Move SDK installation script
@ 2013-08-06 19:58 Franklin S. Cooper Jr
  2013-08-07  5:30 ` Maupin, Chase
  0 siblings, 1 reply; 4+ messages in thread
From: Franklin S. Cooper Jr @ 2013-08-06 19:58 UTC (permalink / raw)
  To: meta-arago; +Cc: Franklin S. Cooper Jr

Several steps are required before an SDK image is ready to be used.
1. Extract toolchain sdk (linuxdevkit.sh)
2. Update Rules.make variables.
3. Update CCS project information

The script that sdk-install.sh is based on was previously packaged and ran by
the SDK installed (based on InstallJammer).

By moving the logic outside of the installer. OE users can now create
a fully functioning SDK without any outside dependencies by simply running
sdk-install located in the root of the SDK image.

Signed-off-by: Franklin S. Cooper Jr <fcooper@ti.com>
---
Version 2 changes:
Remove debug mode (set -x)
Remove license since script is simple

 .../ti-tisdk-install/sdk-install.sh                |   85 ++++++++++++++++++++
 .../ti-tisdk-install/ti-tisdk-install_1.0.bb       |   15 ++++
 2 files changed, 100 insertions(+), 0 deletions(-)
 create mode 100644 meta-arago-distro/recipes-tisdk/ti-tisdk-install/ti-tisdk-install/sdk-install.sh
 create mode 100644 meta-arago-distro/recipes-tisdk/ti-tisdk-install/ti-tisdk-install_1.0.bb

diff --git a/meta-arago-distro/recipes-tisdk/ti-tisdk-install/ti-tisdk-install/sdk-install.sh b/meta-arago-distro/recipes-tisdk/ti-tisdk-install/ti-tisdk-install/sdk-install.sh
new file mode 100644
index 0000000..a7cd1a7
--- /dev/null
+++ b/meta-arago-distro/recipes-tisdk/ti-tisdk-install/ti-tisdk-install/sdk-install.sh
@@ -0,0 +1,85 @@
+
+#!/bin/sh
+
+# Process command line...
+while [ $# -gt 0 ]; do
+  case $1 in
+    --install_dir)
+      shift;
+      install_dir=$1;
+      ;;
+     *)
+      shift;
+      ;;
+  esac
+done
+
+if [ "x$install_dir" = "x" ]; then
+    # Verify that the script is being called within untar SDK directory
+    if [ ! -d "$PWD/board-support" -a ! -f "$PWD/Rules.make" ]; then
+        echo "Script must be called within untarred sdk directory"
+        exit 1
+    else
+        install_dir="$PWD"
+    fi
+fi
+
+# Get full path to SDK directory
+cd "$install_dir"
+install_dir="$PWD"
+cd -
+
+if [ ! -d $install_dir ]; then
+	echo "Installation directory does not exist"
+	exit 1
+fi
+
+# Remove any .svn directories that were packaged by the sourceipks
+rm -rf `find $install_dir -name ".svn"`
+
+
+# Update Rules.make variables
+
+sed -i -e s=__SDK__INSTALL_DIR__=$install_dir= $install_dir/Rules.make 
+
+# Find the linux directory name
+linux=`find $install_dir/board-support -maxdepth 1 -name "linux*"`
+linux=`basename $linux`
+sed -i -e s=__KERNEL_NAME__=$linux= $install_dir/Rules.make
+cd -
+
+
+# Install toolchain sdk
+$install_dir/linux-devkit.sh -y -d $install_dir/linux-devkit
+
+# Remove toolchain sdk
+rm $install_dir/linux-devkit.sh
+
+
+# Update example applications CCS project files
+
+# Grab some essential variables from environment-setup
+TARGET_SYS=`sed -n 's/^export TARGET_SYS=//p' $install_dir/linux-devkit/environment-setup`
+TOOLCHAIN_SYS=`sed -n 's/^export TOOLCHAIN_SYS=//p' $install_dir/linux-devkit/environment-setup`
+SDK_SYS=`sed -n 's/^export SDK_SYS=//p' $install_dir/linux-devkit/environment-setup`
+
+# Grab toolchain's GCC version
+GCC_VERSION=`ls $install_dir/linux-devkit/sysroots/$SDK_SYS/usr/lib/gcc/$TOOLCHAIN_SYS/`
+
+TOOLCHAIN_TARGET_INCLUDE_DIR="linux-devkit/sysroots/$TARGET_SYS/usr/include"
+TOOLCHAIN_INCLUDE_DIR="linux-devkit/sysroots/$SDK_SYS/usr/lib/gcc/$TOOLCHAIN_SYS/$GCC_VERSION/include"
+
+# Update CCS project files using important paths to headers
+
+find $install_dir/example-applications -type f -exec sed -i "s|<TOOLCHAIN_TARGET_INCLUDE_DIR>|$TOOLCHAIN_TARGET_INCLUDE_DIR|g" {} \;
+find $install_dir/example-applications -type f -exec sed -i "s|<TOOLCHAIN_INCLUDE_DIR>|$TOOLCHAIN_INCLUDE_DIR|g" {} \;
+
+
+if [ -f "$install_dir/sdk-install.sh" ]; then
+	# File is only able to run once so delete it from the SDK
+	rm "$install_dir/sdk-install.sh"
+fi
+
+echo "Installation completed!"
+exit 0
+
diff --git a/meta-arago-distro/recipes-tisdk/ti-tisdk-install/ti-tisdk-install_1.0.bb b/meta-arago-distro/recipes-tisdk/ti-tisdk-install/ti-tisdk-install_1.0.bb
new file mode 100644
index 0000000..1c96ae5
--- /dev/null
+++ b/meta-arago-distro/recipes-tisdk/ti-tisdk-install/ti-tisdk-install_1.0.bb
@@ -0,0 +1,15 @@
+DESCRIPTION = "Contains script to properly extract and update various files"
+LICENSE = "MIT"
+LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
+
+SRC_URI = "file://sdk-install.sh"
+
+PR = "r0"
+
+do_install () {
+    install -d ${D}/
+    install  ${WORKDIR}/sdk-install.sh ${D}/sdk-install.sh
+
+}
+
+FILES_${PN} = "/*"
-- 
1.7.0.4



^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-08-07 16:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-06 19:58 [PATCH v2] ti-tisdk-install: Move SDK installation script Franklin S. Cooper Jr
2013-08-07  5:30 ` Maupin, Chase
2013-08-07 15:10   ` Cooper Jr., Franklin
2013-08-07 16:51     ` Maupin, Chase

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.