aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolas Dechesne <nicolas.dechesne@linaro.org>2015-10-12 22:56:29 +0100
committerNicolas Dechesne <nicolas.dechesne@linaro.org>2015-10-13 16:09:53 +0100
commit8dafe1f167e1fd2dab90d87824dc4a89c4827bd7 (patch)
tree268cc4244677a07378da7c3646599082d8d50799
parente73b2550b41ed3f58df20f422ebc3bbf2fcc729a (diff)
downloadmeta-qcom-8dafe1f167e1fd2dab90d87824dc4a89c4827bd7.tar.gz
meta-qcom-8dafe1f167e1fd2dab90d87824dc4a89c4827bd7.tar.bz2
meta-qcom-8dafe1f167e1fd2dab90d87824dc4a89c4827bd7.zip
firmware: add recipe for DragonBoard 410c firmware file
The firmware for DragonBoard 410c are publicly available on Qualcomm Developer Network website, but distributed with a specific EULA. To manage the EULA, we are reusing the unpack functions from meta-fsl-arm, and the user is required to explicitely accept the EULA by adding the following in local.conf: ACCEPT_QCOM_EULA="1" If that variable is set, it is assumed that EULA was accepted and the firmware can be added into the image. Signed-off-by: Nicolas Dechesne <nicolas.dechesne@linaro.org>
-rw-r--r--conf/layer.conf1
-rw-r--r--recipes-bsp/firmware/firmware-qcom-dragonboard410c_1.1.0.bb84
2 files changed, 85 insertions, 0 deletions
diff --git a/conf/layer.conf b/conf/layer.conf
index 1475211..4b1d983 100644
--- a/conf/layer.conf
+++ b/conf/layer.conf
@@ -9,3 +9,4 @@ BBFILE_COLLECTIONS += "qualcomm"
BBFILE_PATTERN_qualcomm := "^${LAYERDIR}/"
BBFILE_PRIORITY_qualcomm = "5"
+QCOM_EULA_FILE = "${LAYERDIR}/conf/EULA"
diff --git a/recipes-bsp/firmware/firmware-qcom-dragonboard410c_1.1.0.bb b/recipes-bsp/firmware/firmware-qcom-dragonboard410c_1.1.0.bb
new file mode 100644
index 0000000..58fdffb
--- /dev/null
+++ b/recipes-bsp/firmware/firmware-qcom-dragonboard410c_1.1.0.bb
@@ -0,0 +1,84 @@
+DESCRIPTION = "QCOM Firmware for DragonBoard 410c"
+
+LICENSE = "Proprietary"
+LIC_FILES_CHKSUM = "file://LICENSE;md5=003cae816e20ae44589f8f7cc022cb54"
+
+SRC_URI = "http://developer.qualcomm.com/download/db410c/firmware-410c-${PV}.bin;qcom-eula=true"
+SRC_URI[md5sum] = "dffdd5da9fb45e15d786b0ae15a94dab"
+SRC_URI[sha256sum] = "751bc33b648d98121a544692f7a66b736c7ae389ba04beea93f5d3acff73ac9b"
+
+COMPATIBLE_MACHINE = "(dragonboard-410c)"
+PACKAGE_ARCH = "${MACHINE_ARCH}"
+
+S = "${WORKDIR}/linux-ubuntu-board-support-package-v1.1"
+
+python qcom_bin_do_unpack() {
+ src_uri = (d.getVar('SRC_URI', True) or "").split()
+ if len(src_uri) == 0:
+ return
+
+ localdata = bb.data.createCopy(d)
+ bb.data.update_data(localdata)
+
+ rootdir = localdata.getVar('WORKDIR', True)
+ fetcher = bb.fetch2.Fetch(src_uri, localdata)
+
+ for url in fetcher.ud.values():
+ save_cwd = os.getcwd()
+ # Check for supported fetchers
+ if url.type in ['http', 'https', 'ftp', 'file']:
+ if url.parm.get('qcom-eula', False):
+ # If download has failed, do nothing
+ if not os.path.exists(url.localpath):
+ bb.debug(1, "Exiting as '%s' cannot be found" % url.basename)
+ return
+
+ # Change to the working directory
+ bb.note("Handling file '%s' as a Qualcomm's EULA binary." % url.basename)
+ save_cwd = os.getcwd()
+ os.chdir(rootdir)
+
+ cmd = "sh %s --auto-accept --force" % (url.localpath)
+ bb.fetch2.runfetchcmd(cmd, d, quiet=True)
+
+ # Return to the previous directory
+ os.chdir(save_cwd)
+}
+
+python do_unpack() {
+ eula = d.getVar('ACCEPT_QCOM_EULA', True)
+ eula_file = d.getVar('QCOM_EULA_FILE', True)
+ pkg = d.getVar('PN', True)
+ if eula == None:
+ bb.fatal("To use '%s' you need to accept the EULA at '%s'. "
+ "Please read it and in case you accept it, write: "
+ "ACCEPT_QCOM_EULA = \"1\" in your local.conf." % (pkg, eula_file))
+ elif eula == '0':
+ bb.fatal("To use '%s' you need to accept the EULA." % pkg)
+ else:
+ bb.note("EULA has been accepted for '%s'" % pkg)
+
+ # The binary unpack needs to be done first so 'S' is valid
+ bb.build.exec_func('qcom_bin_do_unpack', d)
+
+ try:
+ bb.build.exec_func('base_do_unpack', d)
+ except:
+ raise
+}
+
+do_compile() {
+ :
+}
+
+do_install() {
+ install -d ${D}/lib/firmware/
+ rm -f ./proprietary-ubuntu/firmware.tar
+ cp -r ./proprietary-ubuntu/* ${D}/lib/firmware/
+
+ install -d ${D}${sysconfdir}/
+ install -m 0644 LICENSE ${D}${sysconfdir}/license.txt
+}
+
+FILES_${PN} += "/lib/firmware/*"
+INSANE_SKIP_${PN} += "arch"