[oe-commits] Roger Monk : ti-eula-unpack: Force Console Mode, add Error Prints

git version control git at git.openembedded.org
Tue May 18 06:31:25 UTC 2010


Module: openembedded.git
Branch: org.openembedded.dev
Commit: 725f882c29f6822ecf0fd06fc744e825e6cb158e
URL:    http://gitweb.openembedded.net/?p=openembedded.git&a=commit;h=725f882c29f6822ecf0fd06fc744e825e6cb158e

Author: Roger Monk <r-monk at ti.com>
Date:   Mon May 17 20:59:39 2010 +0100

ti-eula-unpack: Force Console Mode, add Error Prints

   * ti-eula-unpack runs installjammer installers to install ti components
   * installjammer can run in GUI mode or console mode
   * ti-eula-unpack passes options and string paths to the installer
     which need to be run in console mode
   * GUI mode is automatically selected if an X11 Display is found which
     means that script options won't get passed to the installer

   * This patch forces use of console mode in the installer, so that the
     GUI will never be invoked for these scripted installs even if an X
     Display is found

   * Downside is ti-eula-unpack is now tighter coupled to installjammer, but
     all current ti installers are ij based so not an issue currently

   * Extra error checks and prints added with failure returns on error
   * This also helps if the installer can't run, for example if run on
     64bit host without 32bit compat libs (currently required by these
     installjammer installers)

Signed-off-by: Roger Monk <r-monk at ti.com>
Signed-off-by: Koen Kooi <k-kooi at ti.com>

---

 recipes/ti/ti-eula-unpack.inc |   14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/recipes/ti/ti-eula-unpack.inc b/recipes/ti/ti-eula-unpack.inc
index bcd2d3a..947ca14 100644
--- a/recipes/ti/ti-eula-unpack.inc
+++ b/recipes/ti/ti-eula-unpack.inc
@@ -9,8 +9,6 @@
 #  TI_BIN_UNPK_WDEXT  - This variable extends workdir path, if user wants to put
 #                       the output in some internal directory
 
-export DISPLAY = ""
-
 python do_unpack () {
     bb.build.exec_func('base_do_unpack', d)
     bb.build.exec_func('ti_bin_do_unpack', d)
@@ -41,7 +39,13 @@ python ti_bin_do_unpack() {
     os.chmod(binfile, 0755)
 
     # Run the InstallJammer binary and accept the EULA
-    filename = "HOME=%s ./%s" % (workdir, binfile)
+    filename = "HOME=%s ./%s --mode console" % (workdir, binfile)
+    
+    # Test executable by printing installer version
+    if os.system(filename + " --version") != 0:
+        print "ERROR: ti-eula-unpack: failed to execute binary installer"
+        raise bb.build.FuncFailed()
+ 
     f = os.popen(filename,'w')
     for cmd in cmd_list:
         if cmd == "workdir":
@@ -56,7 +60,9 @@ python ti_bin_do_unpack() {
     if bool(tarfile) == True:
         tarfile  = bb.data.expand(tarfile, localdata)
         tcmd = 'tar xz --no-same-owner -f %s -C %s' % (tarfile, workdir)
-        os.system(tcmd)
+        if os.system(tcmd) != 0:
+            print "ERROR: ti-eula-unpack: failed to extract tarfile"
+            raise bb.build.FuncFailed()
 
     # Return to the previous directory
     os.chdir(save_cwd)





More information about the Openembedded-commits mailing list