Skip to contentSkip to conversation

package-sdks: restructure the binary package and add scripts to support OOB usage

PATCH New Hongmei Gou 1 participant 2 messages Nov 15, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 package-sdks: restructure the binary package and add scripts to support OOB usage

* rename the top-level folder with the same name as the full installer, but with "-bin" added before the version number for differentiation
* restructure filesystem to the top-level, following structure of the full installer
* add bin folder and setup.sh to the binary package

---
 lib/oesdk/package-sdks | 28 +++++++++++++++++++++++-----
 1 file changed, 23 insertions(+), 5 deletions(-)
lib/oesdk/package-sdks +23 -5
index 720b62a..1e5ee00 100644
@@ -239,9 +239,11 @@ package_web_content() {
 
     # Now Create the pre-built binaries tarball.  Make a temporary directory
     # to copy contents to here so that we can get the right extraction name.
-    tmp_dir="$exports_root/board-support-bin"
-    mkdir -p $tmp_dir
-    cp -rf board-support/prebuilt-images $tmp_dir/
+    tmp_dir="$exports_root/${INSTALLER_PREFIX}-$m-bin-${TISDK_VERSION}"
+    tmp_dir_bs="$tmp_dir/board-support"
+    mkdir -p $tmp_dir_bs
+
+    cp -rf board-support/prebuilt-images $tmp_dir_bs
     if [ "$?" != 0 ]
     then
         echo "Could not copy prebuilt-images"
@@ -257,8 +259,24 @@ package_web_content() {
         return 1
     fi
 
+    cp -rf bin $tmp_dir/
+    if [ "$?" != 0 ]
+    then
+        echo "Could not copy bin folder"
+        echo "FAILED" > $LOG_DIR/$m-web-results.txt
+        return 1
+    fi
+
+    cp -f setup.sh $tmp_dir/
+    if [ "$?" != 0 ]
+    then
+        echo "Could not copy setup.sh"
+        echo "FAILED" > $LOG_DIR/$m-web-results.txt
+        return 1
+    fi
+
     cd $exports_root
-    tar cJf $m-sdk-bin-$TISDK_VERSION.tar.xz board-support-bin/*
+    tar cJf $m-sdk-bin-$TISDK_VERSION.tar.xz ${INSTALLER_PREFIX}-$m-bin-${TISDK_VERSION}/*
     if [ "$?" != 0 ]
     then
         echo "Could not create SDK binaries tarball"
@@ -266,7 +284,7 @@ package_web_content() {
         return 1
     fi
 
-    rm -rf board-support-bin
+    rm -rf ${INSTALLER_PREFIX}-$m-bin-${TISDK_VERSION}
 
     if [ "$EXPORT_ARAGO_SRC" == "1" ]
     then
Signature · 1 line
1.9.1
#1 lore raw

PATCH 2/2 package-sdks: patching scripts of the binary package to allow OOB usage

---
 lib/oesdk/package-sdks | 38 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 38 insertions(+)
lib/oesdk/package-sdks +38 -0
index 1e5ee00..2316d40 100644
@@ -267,6 +267,44 @@ package_web_content() {
         return 1
     fi
 
+    # remove scripts which have dependency on devkit
+    rm  $tmp_dir/bin/unshallow-repositories.sh
+    rm  $tmp_dir/bin/create-ubifs.sh
+
+    # modify create-sdcard.sh to use the tarball extraction directory
+    sed -i -e "s|ti-sdk.*\[0-9\]|${tmp_dir##*/}|g" $tmp_dir/bin/create-sdcard.sh
+
+    # modify setup-target-nfs.sh to get the absolute path when running the scripts
+    # 1. remove the line to set up "SDKinstall" with TI_SDK_PATH
+    sed -i -e '/^SDKinstall/d' $tmp_dir/bin/setup-targetfs-nfs.sh
+
+    # 2. add the lines before setting dstdefault to get the absolute path of the scripts and SDKinstall,
+    #    using the same way as in create-sdcard.sh: PWD=`pwd`; EXE=`echo $0 | sed s=$PWD==`;
+    #    EXEPATH="$PWD"/"$EXE"; SDKinstall=`echo $EXEPATH | grep -o .*ti-sdk.*.[0-9]`
+    sed -i -e '/dstdefault=$SDKinstall\/targetNFS/i\PWD=`pwd`\nEXE=`echo $0 | sed s=$PWD==`\nEXEPATH="$PWD"/"$EXE"\nSDKinstall=`echo $EXEPATH | grep -o '.*ti-sdk.*.[0-9]'`\n' $tmp_dir/bin/setup-targetfs-nfs.sh
+
+    # 3. use the tarball extraction directory for SDKinstall
+    sed -i -e "s|ti-sdk.*\[0-9\]|${tmp_dir##*/}|g" $tmp_dir/bin/setup-targetfs-nfs.sh
+
+    # create Rules.make with variables to be used from the binary package
+    echo "#platform" >> $tmp_dir/Rules.make
+    echo "PLATFORM=$m" >> $tmp_dir/Rules.make
+    echo >> $tmp_dir/Rules.make
+
+    echo "#root of the target file system for installing applications" >> $tmp_dir/Rules.make
+    echo "DESTDIR=__DESTDIR__" >> $tmp_dir/Rules.make
+    echo >> $tmp_dir/Rules.make
+
+    echo "# Set EXEC_DIR to install example binaries" >> $tmp_dir/Rules.make
+    echo "EXEC_DIR=__EXEC_DIR__" >> $tmp_dir/Rules.make
+
+    if [ "$?" != 0 ]
+    then
+        echo "Could not create Rules.make"
+        echo "FAILED" > $LOG_DIR/$m-web-results.txt
+        return 1
+    fi
+
     cp -f setup.sh $tmp_dir/
     if [ "$?" != 0 ]
     then
Signature · 1 line
1.9.1