All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yann E. MORIN <yann.morin.1998@free.fr>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 23/52] package/dahdi-linux: new package
Date: Fri, 30 Dec 2016 11:29:24 +0100	[thread overview]
Message-ID: <5db9996be45b255652f014dd9510b2d0103925f6.1483093662.git.yann.morin.1998@free.fr> (raw)
In-Reply-To: <cover.1483093662.git.yann.morin.1998@free.fr>

dahdi-linux provides kernel modules to drive a variety of telephony
cards, ranging from low-end one-channel to higher-end multi-channel
cards. It also provides headers for userland to talk to those cards.

With a bit of love, dahdi-linux can use our kernel-module
infrastructure. Wee! :-)

Still, there are a few specificities about dahdi-linux.

First, it needs to install a few binary firmware blobs, which it wants
to download at install time. Since we do want to be able to do
completely off-line builds, we need to downlaod them manually. So we
have the full list of firmware blobs (even if some can only be used on
an i386/x86_64 target, we still uconditionally download them), for which
we have locally-computed sha256 (no hash provided by upstream for the
blobs).

Second, the install procedure for the firmware blobs needs to have
access to the Linux kernel .config file, so it can decide whether to
install the blobs or not. We can force not to install them, but we can't
force to install them... :-/ And anyway, we'd have to do the same check
as is already done by dahdi-linux, so no need to duplicate that.

Finally, the licensing is relatively weird. Although it is obvious and
straightforward for the most part of dahdi-linux, consisting of mostly
GPLv2 and a few LGPLv2.1, there is one gotcha.

Of the firmware blobs, one is provided as a .o file, with no licensing
information whatsoever, without any source available from upstream, but
is directly linked to a GPLv2 file.

This is very concerning, but there is not much we can do about it,
except delegate to the legal reviewer whether that is acceptable or not.

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
---
 package/Config.in                    |  1 +
 package/dahdi-linux/Config.in        | 15 ++++++
 package/dahdi-linux/dahdi-linux.hash | 23 ++++++++++
 package/dahdi-linux/dahdi-linux.mk   | 88 ++++++++++++++++++++++++++++++++++++
 4 files changed, 127 insertions(+)
 create mode 100644 package/dahdi-linux/Config.in
 create mode 100644 package/dahdi-linux/dahdi-linux.hash
 create mode 100644 package/dahdi-linux/dahdi-linux.mk

diff --git a/package/Config.in b/package/Config.in
index 2938443..3de7c57 100644
--- a/package/Config.in
+++ b/package/Config.in
@@ -356,6 +356,7 @@ endmenu
 	source "package/cdrkit/Config.in"
 	source "package/cryptsetup/Config.in"
 	source "package/cwiid/Config.in"
+	source "package/dahdi-linux/Config.in"
 	source "package/dbus/Config.in"
 	source "package/dbus-cpp/Config.in"
 	source "package/dbus-glib/Config.in"
diff --git a/package/dahdi-linux/Config.in b/package/dahdi-linux/Config.in
new file mode 100644
index 0000000..599b0c2
--- /dev/null
+++ b/package/dahdi-linux/Config.in
@@ -0,0 +1,15 @@
+config BR2_PACKAGE_DAHDI_LINUX
+	bool "dhadi-linux"
+	depends on BR2_LINUX_KERNEL
+	help
+	  DAHDI (Digium/Asterisk Hardware Device Interface) is the open
+	  source device interface technology used to control Digium and
+	  other legacy telephony interface cards.
+
+	  DAHDI Linux is the open source device driver framework used to
+	  interface Asterisk with telephony hardware.
+
+	  http://www.asterisk.org/downloads/dahdi
+
+comment "dahdi-linux needs a Linux kernel to be built"
+	depends on !BR2_LINUX_KERNEL
diff --git a/package/dahdi-linux/dahdi-linux.hash b/package/dahdi-linux/dahdi-linux.hash
new file mode 100644
index 0000000..532c0a8
--- /dev/null
+++ b/package/dahdi-linux/dahdi-linux.hash
@@ -0,0 +1,23 @@
+# sha1 from: http://downloads.asterisk.org/pub/telephony/dahdi-linux/releases
+# sha256 locally computed
+sha1    8cbd55b8611c6ed80bcdf84d537566b4934f3def  dahdi-linux-2.11.1.tar.gz
+sha256  f59f382365118205e77d2874f1c0e1546e936247bcc45f07a43bc21778bee9df  dahdi-linux-2.11.1.tar.gz
+
+# Firmware files have no upstream hash, so sha56 locally computed
+sha256  3ff26cf80555fd7470b43a87c51d03c1db2a75abcd4561d79f69b6c48298e4a1  dahdi-fwload-vpmadt032-1.25.0.tar.gz
+sha256  d5b6ab6851e431afcfec2ecc39d95fa88fe3939ffdb2e3d4f28a43cabf30e95b  dahdi-fw-a4a-a0017.tar.gz
+sha256  e039af8bec36407b74e1dd9ebdd49ba077469eda79d4e6093721ed2836d4536f  dahdi-fw-a4b-d001e.tar.gz
+sha256  5064f9877b8aec99b19fd57988216fe1a9c0b7c07853dd3b32b5a55ab7b418e6  dahdi-fw-a8a-1d0017.tar.gz
+sha256  09a8992786309e025aa60b400a2c7d21226ac9bb6f1b66f562a5e7e9dc892b03  dahdi-fw-a8b-1f001e.tar.gz
+sha256  449ab3fd03d55d808e999efb7677cd04de202b92c9fcb039539a7e48a39a80f5  dahdi-fw-hx8-2.06.tar.gz
+sha256  7a006073202d67e45f1d5ff1e9c6e8663e6056cef9dc4c5abae86a1018db349c  dahdi-fw-oct6114-032-1.05.01.tar.gz
+sha256  56bac1f2024c76ecf9b6f40992eeea29a1fbee676bb2a37a058179bacfbb1c91  dahdi-fw-oct6114-064-1.05.01.tar.gz
+sha256  e1146749d205c41603b9b76852c3f8104dac233d0025d700db24504d10c99775  dahdi-fw-oct6114-128-1.05.01.tar.gz
+sha256  5fe5036a2766cf0e8a968b0c58b700507d86e1cde9296ca437170cc626a9c79c  dahdi-fw-oct6114-256-1.05.01.tar.gz
+sha256  11dd8d009809e41fc9a3a36766f59ff73d29075eede5b8724331d9a6e5259774  dahdi-fw-tc400m-MR6.12.tar.gz
+sha256  511c1966295a20df673bb87af30245f0ad165efd6ccb92b4d8ed535ca7f5ac65  dahdi-fw-te133-7a001e.tar.gz
+sha256  99f7c410bf47d2a5ae687d717e51448ce5b52aca902830bf39bffe683150fa2d  dahdi-fw-te134-780017.tar.gz
+sha256  c8f55d57cc0bf332e8d96cdf9ff6dd0e322f33581e1efc24c2b9a0e0c5eb7ee4  dahdi-fw-te435-13001e.tar.gz
+sha256  0980f4a8d191c6872aa27d971758046f0e7827ac161549f2cc1b0eeab0ae9333  dahdi-fw-te436-10017.tar.gz
+sha256  5b823e25828e2c1c6548886ad408b2e31dbc8cd17170c52592792d9c754a199c  dahdi-fw-te820-1.76.tar.gz
+sha256  6b199cf836f150f9cb35f763f0f502fb52cfa2724a449b500429c746973904ad  dahdi-fw-vpmoct032-1.12.0.tar.gz
diff --git a/package/dahdi-linux/dahdi-linux.mk b/package/dahdi-linux/dahdi-linux.mk
new file mode 100644
index 0000000..33db9fb
--- /dev/null
+++ b/package/dahdi-linux/dahdi-linux.mk
@@ -0,0 +1,88 @@
+################################################################################
+#
+# dahdi-linux
+#
+################################################################################
+
+DAHDI_LINUX_VERSION = 2.11.1
+DAHDI_LINUX_SITE = http://downloads.asterisk.org/pub/telephony/dahdi-linux/releases
+
+# We need to download all thoe firmware blobs ourselves, otherwise
+# dahdi-linux will try to download them at install time.
+DAHDI_LINUX_FW_SITE = http://downloads.digium.com/pub/telephony/firmware/releases
+DAHDI_LINUX_FW_FILES = \
+	dahdi-fwload-vpmadt032-1.25.0.tar.gz \
+	dahdi-fw-oct6114-032-1.05.01.tar.gz \
+	dahdi-fw-oct6114-064-1.05.01.tar.gz \
+	dahdi-fw-oct6114-128-1.05.01.tar.gz \
+	dahdi-fw-oct6114-256-1.05.01.tar.gz \
+	dahdi-fw-tc400m-MR6.12.tar.gz \
+	dahdi-fw-hx8-2.06.tar.gz \
+	dahdi-fw-vpmoct032-1.12.0.tar.gz \
+	dahdi-fw-te820-1.76.tar.gz \
+	dahdi-fw-te133-7a001e.tar.gz \
+	dahdi-fw-te134-780017.tar.gz \
+	dahdi-fw-a8b-1f001e.tar.gz \
+	dahdi-fw-a8a-1d0017.tar.gz \
+	dahdi-fw-a4b-d001e.tar.gz \
+	dahdi-fw-a4a-a0017.tar.gz \
+	dahdi-fw-te435-13001e.tar.gz \
+	dahdi-fw-te436-10017.tar.gz
+
+DAHDI_LINUX_EXTRA_DOWNLOADS = \
+	$(patsubst %,$(DAHDI_LINUX_FW_SITE)/%,$(DAHDI_LINUX_FW_FILES))
+
+# dahdi-linux claims to be GPLv2 with parts LGPLv2.1 (not 'or later'),
+# but there are the so-called firmware files (downloaded above) for
+# which the license is unclear: the header claims to be GPLv2, the
+# 'loader-wrapper' claims to be GPLv2, but there are two so-called
+# 'firmware' binary-only .o blobs for which the license is not
+# explicited, which look like they end up as part of a kernel module,
+# and for which the source is nowhere to be found on the upstream site
+# (they are only for x86/x86_64, but we still list them unconditionally).
+DAHDI_LINUX_LICENSE = GPLv2, LGPLv2.1, unknown (firmware files)
+DAHDI_LINUX_LICENSE_FILES = LICENSE LICENSE.LGPL
+
+DAHDI_LINUX_INSTALL_STAGING = YES
+
+DAHDI_LINUX_MODULE_SUBDIRS = drivers/dahdi
+
+DAHDI_LINUX_MODULE_MAKE_OPTS = \
+	KSRC=$(LINUX_DIR) \
+	KVERS=$(LINUX_VERSION_PROBED) \
+	DAHDI_BUILD_ALL=m \
+	DAHDI_INCLUDE=$(@D)/include \
+	INSTALL_MOD_DIR=dahdi
+
+define DAHDI_LINUX_EXTRACT_FW
+	$(foreach f,$(DAHDI_LINUX_FW_FILES),\
+		cp $(BR2_DL_DIR)/$(f) $(@D)/drivers/dahdi/firmware/$(f)$(sep))
+endef
+DAHDI_LINUX_POST_EXTRACT_HOOKS += DAHDI_LINUX_EXTRACT_FW
+
+# Need to pass the same options as for building the modules, because
+# it wants to scan Linux' .config file to check whether some options
+# are set or not (like CONFIG_FW_LOADER).
+define DAHDI_LINUX_CONFIGURE_CMDS
+	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) \
+		$(DAHDI_LINUX_MODULE_MAKE_OPTS) \
+		prereq
+endef
+
+define DAHDI_LINUX_INSTALL_STAGING_CMDS
+	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) \
+		$(DAHDI_LINUX_MODULE_MAKE_OPTS) \
+		DESTDIR=$(STAGING_DIR) \
+		install-include
+endef
+
+define DAHDI_LINUX_INSTALL_TARGET_CMDS
+	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) \
+		$(DAHDI_LINUX_MODULE_MAKE_OPTS) \
+		DESTDIR=$(TARGET_DIR) \
+		install-firmware \
+		install-xpp-firm
+endef
+
+$(eval $(kernel-module))
+$(eval $(generic-package))
-- 
2.7.4

  parent reply	other threads:[~2016-12-30 10:29 UTC|newest]

Thread overview: 61+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-30 10:29 [Buildroot] [PATCH 00/52] Add a rather complete asterisk stack Yann E. MORIN
2016-12-30 10:29 ` [Buildroot] [PATCH 01/52] package/libpjsip: disable remaining unspecified options Yann E. MORIN
2017-01-04 13:16   ` Luca Ceresoli
2017-01-04 17:12     ` Yann E. MORIN
2016-12-30 10:29 ` [Buildroot] [PATCH 02/52] package/libpjsip: drop path to staging to find libsrtp Yann E. MORIN
2017-01-04 13:21   ` Luca Ceresoli
2016-12-30 10:29 ` [Buildroot] [PATCH 03/52] package/asterisk: new package Yann E. MORIN
2017-01-22 20:31   ` Romain Naour
2017-01-22 21:40     ` Yann E. MORIN
2016-12-30 10:29 ` [Buildroot] [PATCH 04/52] package/asterisk: enable backtrace when available Yann E. MORIN
2016-12-30 10:29 ` [Buildroot] [PATCH 05/52] package/libgsm: new package Yann E. MORIN
2017-01-27 19:38   ` Thomas Petazzoni
2016-12-30 10:29 ` [Buildroot] [PATCH 06/52] package/asterisk: add optional libgsm dependency Yann E. MORIN
2016-12-30 10:29 ` [Buildroot] [PATCH 07/52] package/asterisk: add optional zlib dependency Yann E. MORIN
2016-12-30 10:29 ` [Buildroot] [PATCH 08/52] package/asterisk: add optional support for SSL Yann E. MORIN
2016-12-30 10:29 ` [Buildroot] [PATCH 09/52] package/asterisk: add optional alsa-lib dependency Yann E. MORIN
2016-12-30 10:29 ` [Buildroot] [PATCH 10/52] package/asterisk: add optional curl dependency Yann E. MORIN
2016-12-30 10:29 ` [Buildroot] [PATCH 11/52] package/asterisk: add optional neon dependency Yann E. MORIN
2016-12-30 10:29 ` [Buildroot] [PATCH 12/52] package/asterisk: add optional libogg dependency Yann E. MORIN
2016-12-30 10:29 ` [Buildroot] [PATCH 13/52] package/asterisk: add optional bluez_utils dependency Yann E. MORIN
2016-12-30 10:29 ` [Buildroot] [PATCH 14/52] package/asterisk: add optional opus dependency Yann E. MORIN
2016-12-30 10:29 ` [Buildroot] [PATCH 15/52] package/asterisk: add optional speex dependency Yann E. MORIN
2016-12-30 10:29 ` [Buildroot] [PATCH 16/52] package/asterisk: add optional libvorbis dependency Yann E. MORIN
2016-12-30 10:29 ` [Buildroot] [PATCH 17/52] package/asterisk: add optional libilbc dependency Yann E. MORIN
2016-12-30 10:29 ` [Buildroot] [PATCH 18/52] package/asterisk: add optional portaudio dependency Yann E. MORIN
2016-12-30 10:29 ` [Buildroot] [PATCH 19/52] package/asterisk: add optional libical dependency Yann E. MORIN
2016-12-30 10:29 ` [Buildroot] [PATCH 20/52] package/asterisk: add optional openldap dependency Yann E. MORIN
2016-12-30 10:29 ` [Buildroot] [PATCH 21/52] package/asterisk: add optional freeradius-client dependency Yann E. MORIN
2016-12-30 10:29 ` [Buildroot] [PATCH 22/52] package/asterisk: add optional libsrtp dependency Yann E. MORIN
2016-12-30 10:29 ` Yann E. MORIN [this message]
2016-12-30 10:29 ` [Buildroot] [PATCH 24/52] package/dahdi-tools: new package Yann E. MORIN
2016-12-30 10:29 ` [Buildroot] [PATCH 25/52] package/dahdi-tools: add USB support Yann E. MORIN
2016-12-30 10:29 ` [Buildroot] [PATCH 26/52] package/asterisk: add support for dahdi Yann E. MORIN
2016-12-30 10:29 ` [Buildroot] [PATCH 27/52] package/libss7: new package Yann E. MORIN
2016-12-30 10:29 ` [Buildroot] [PATCH 28/52] package/asterisk: add support for SS7 Yann E. MORIN
2016-12-30 10:29 ` [Buildroot] [PATCH 29/52] package/libpri: new package Yann E. MORIN
2016-12-30 10:29 ` [Buildroot] [PATCH 30/52] package/asterisk: add support for PRI signalling Yann E. MORIN
2016-12-30 10:29 ` [Buildroot] [PATCH 31/52] package/spandsp: new package Yann E. MORIN
2016-12-30 10:29 ` [Buildroot] [PATCH 32/52] package/asterisk: add optional spandsp support Yann E. MORIN
2016-12-30 10:29 ` [Buildroot] [PATCH 33/52] package/libqb: new package Yann E. MORIN
2016-12-30 10:29 ` [Buildroot] [PATCH 34/52] package/corosync: " Yann E. MORIN
2016-12-30 10:29 ` [Buildroot] [PATCH 35/52] package/corosync: add optional dbus support Yann E. MORIN
2016-12-30 10:29 ` [Buildroot] [PATCH 36/52] package/corosync: add optional snmp support Yann E. MORIN
2016-12-30 10:29 ` [Buildroot] [PATCH 37/52] package/asterisk: add optional corosync dependency Yann E. MORIN
2016-12-30 10:29 ` [Buildroot] [PATCH 38/52] package/libpjsip: add option to enable GSM codec Yann E. MORIN
2016-12-30 10:29 ` [Buildroot] [PATCH 39/52] package/asterisk: add optional netsnmp dependency Yann E. MORIN
2016-12-30 10:29 ` [Buildroot] [PATCH 40/52] package/libpjsip: add option to enable SPEEX codec Yann E. MORIN
2016-12-30 10:29 ` [Buildroot] [PATCH 41/52] package/libpjsip: add option to enable G.711 codec Yann E. MORIN
2016-12-30 10:29 ` [Buildroot] [PATCH 42/52] package/libpjsip: add option to enable G.722 codec Yann E. MORIN
2016-12-30 10:29 ` [Buildroot] [PATCH 43/52] package/libpjsip: add option to enable G.7221 codec Yann E. MORIN
2017-01-27 17:06   ` Adam Duskett
2017-01-27 17:07     ` Yann E. MORIN
2016-12-30 10:29 ` [Buildroot] [PATCH 44/52] package/libpjsip: add option to enable iLBC codec Yann E. MORIN
2016-12-30 10:29 ` [Buildroot] [PATCH 45/52] package/libpjsip: add option to enable L16 codec Yann E. MORIN
2016-12-30 10:29 ` [Buildroot] [PATCH 46/52] package/libpjsip: add optional portaudio support Yann E. MORIN
2016-12-30 10:29 ` [Buildroot] [PATCH 47/52] package/asterisk: add optional pjsip support Yann E. MORIN
2016-12-30 10:29 ` [Buildroot] [PATCH 48/52] package/asterisk: add optional libcap dependency Yann E. MORIN
2016-12-30 10:29 ` [Buildroot] [PATCH 49/52] package/asterisk: add optional iconv support Yann E. MORIN
2016-12-30 10:29 ` [Buildroot] [PATCH 50/52] package/asterisk: enable inotify when possible Yann E. MORIN
2016-12-30 10:29 ` [Buildroot] [PATCH 51/52] package/asterisk: add optional unixodbc dependency Yann E. MORIN
2016-12-30 10:29 ` [Buildroot] [PATCH 52/52] package/asterisk: add optional jack2 dependency Yann E. MORIN

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5db9996be45b255652f014dd9510b2d0103925f6.1483093662.git.yann.morin.1998@free.fr \
    --to=yann.morin.1998@free.fr \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.