mirror of
https://git.yoctoproject.org/meta-ti
synced 2026-07-16 22:38:04 +00:00
2a3c7305fb
* Commitd8fc4a6862addressed an issue where too many newlines characters were being sent since print by default already sends a newline character. This commit however resulted in bin files being installed in the WORKDIR and broke other recipes which commita94f765b98addressed. This lead to a very cluttered WORKDIR. * This patch updates ti-eula-unpack.inc to switch from using a print to a write. Since write doesn't automatically send newlines it is a bit more obvious when newlines are sent. * Part of the reason that bin files were being installed in the WORKDIR was due to TI_BIN_UNPK_WDEXT being blank for some recipes. For instance in the libgles-omap3 recipes, when the workdir command is set in TI_BIN_UNPK_CMDS the directory that the Graphics SDK will be installed into is workdir+TI_BIN_UNPK_WDEXT. A blank TI_BIN_UNPK_WDEXT means the SDK will be installed in WORKDIR. By setting TI_BIN_UNPK_WDEXT to a proper value the recipes can be sure it is installed in the proper directory. * Determine which file to download based on the defined BINFILE and not a hardcoded value. This idea was taken from arago. Signed-off-by: Franklin S. Cooper Jr <fcooper@ti.com> Acked-by: Chase Maupin <chase.maupin@ti.com> Signed-off-by: Denys Dmytriyenko <denys@ti.com>
79 lines
3.0 KiB
C++
79 lines
3.0 KiB
C++
# This file defines function used for unpacking the .bin file downloaded over
|
|
# the http and display EULA.
|
|
# BINFILE - name of the install jammer .bin file
|
|
# TARFILE - name of the tar file inside the install jammer
|
|
# TI_BIN_UNPK_CMDS - contains list of commands separated with colon to be
|
|
# passed while unpacking the bin file. The keyword
|
|
# workdir expands to WORKDIR and commands are appendded
|
|
# with '\n'. Eg. TI_BIN_UNPK_CMDS="Y:Y: qY:workdir"
|
|
# TI_BIN_UNPK_WDEXT - This variable extends workdir path, if user wants to put
|
|
# the output in some internal directory
|
|
|
|
python do_unpack () {
|
|
bb.build.exec_func('base_do_unpack', d)
|
|
bb.build.exec_func('ti_bin_do_unpack', d)
|
|
}
|
|
|
|
TI_BIN_UNPK_WDEXT ?= ""
|
|
python ti_bin_do_unpack() {
|
|
|
|
import os
|
|
|
|
# InstallJammer requires 32bit version of glibc
|
|
lib32path = '/lib'
|
|
if os.path.exists('/lib64') and (os.path.islink('/lib64') or os.path.islink('/lib') or os.path.exists('/lib32')):
|
|
lib32path = '/lib32'
|
|
if not os.path.exists('%s/libc.so.6' % lib32path):
|
|
bb.warn("TI installer requires 32bit glibc libraries for proper operation\nrun 'yum install glibc.i686' on Fedora or 'apt-get install ia32-libs' on Ubuntu/Debian")
|
|
|
|
localdata = bb.data.createCopy(d)
|
|
bb.data.update_data(localdata)
|
|
|
|
binfile = bb.data.getVar('BINFILE', localdata)
|
|
binfile = bb.data.expand(binfile, localdata)
|
|
|
|
# Change to the working directory
|
|
save_cwd = os.getcwd()
|
|
workdir = bb.data.getVar('WORKDIR', localdata)
|
|
workdir = bb.data.expand(workdir, localdata)
|
|
os.chdir(workdir)
|
|
|
|
# Get unpack commands
|
|
cmd_string = bb.data.getVar('TI_BIN_UNPK_CMDS', localdata)
|
|
cmd_list = cmd_string.split( ":" )
|
|
|
|
# Make the InstallJammer binary executable so we can run it
|
|
os.chmod(binfile, 0755)
|
|
|
|
# Run the InstallJammer binary and accept the EULA
|
|
filename = "HOME=%s ./%s --mode console" % (workdir, binfile)
|
|
|
|
# Test executable by printing installer version or help screen (--version currently broken for some installers)
|
|
# - this is currently broken in some IJ installers - comment out for now
|
|
#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":
|
|
wdext = bb.data.getVar('TI_BIN_UNPK_WDEXT', localdata)
|
|
wdext = bb.data.expand(wdext, localdata)
|
|
cmd = workdir+wdext
|
|
f.write(cmd+'\n');
|
|
f.close()
|
|
|
|
# Expand the tarball that was created if required
|
|
tarfile = bb.data.getVar('TARFILE', localdata)
|
|
if bool(tarfile) == True:
|
|
tarfile = bb.data.expand(tarfile, localdata)
|
|
tcmd = 'tar x --no-same-owner -f %s -C %s' % (tarfile, workdir)
|
|
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)
|
|
}
|
|
|