From 54b5f54e8fa2a5724c2132fe30bb1b6805636ae9 Mon Sep 17 00:00:00 2001 From: Alex Gonzalez Date: Thu, 13 Dec 2012 12:57:46 +0100 Subject: [PATCH] meta-digi-del: Add crda package. This is based on the recipe found in the openembedded layer. http://cgit.openembedded.org/openembedded/log/recipes/crda/crda_1.1.1.bb It needs to compile with libnl 2.0, so we set a distro preferred version for it. Also, we make the recipe configurable to compile without gcrypt. The Makefile is patched to compile without gcrypt. Compiling with gcrypt would need the addition of the python-m2crypto-native recipe which is not done so it is currently broken. The compilation without gcrypt is how DEL is currently doing it so this should be enough for our needs. Also, the device manager is configurable and set to busybox-mdev by default. Signed-off-by: Alex Gonzalez --- meta-digi-del/conf/distro/del.conf | 1 + .../recipes-connectivity/crda/crda_1.1.2.bb | 51 +++++++++++++++++++ .../files/0001-Make-crypto-optional.patch | 24 +++++++++ .../tasks/task-del-wireless.bb | 1 + 4 files changed, 77 insertions(+) create mode 100644 meta-digi-del/recipes-connectivity/crda/crda_1.1.2.bb create mode 100644 meta-digi-del/recipes-connectivity/crda/files/0001-Make-crypto-optional.patch diff --git a/meta-digi-del/conf/distro/del.conf b/meta-digi-del/conf/distro/del.conf index ce71fb38d..2956aa70a 100644 --- a/meta-digi-del/conf/distro/del.conf +++ b/meta-digi-del/conf/distro/del.conf @@ -28,6 +28,7 @@ PREFERRED_VERSION_linux-yocto_qemux86-64 ?= "3.2%" PREFERRED_VERSION_linux-yocto_qemuarm ?= "3.2%" PREFERRED_VERSION_linux-yocto_qemumips ?= "3.2%" PREFERRED_VERSION_linux-yocto_qemuppc ?= "3.2%" +PREFERRED_VERSION_libnl ?= "2.0" SDK_NAME = "${DISTRO}-${TCLIBC}-${SDK_ARCH}-${TARGET_ARCH}" SDKPATH = "/opt/${DISTRO}/${SDK_VERSION}" diff --git a/meta-digi-del/recipes-connectivity/crda/crda_1.1.2.bb b/meta-digi-del/recipes-connectivity/crda/crda_1.1.2.bb new file mode 100644 index 000000000..fe3bddcf8 --- /dev/null +++ b/meta-digi-del/recipes-connectivity/crda/crda_1.1.2.bb @@ -0,0 +1,51 @@ +DESCRIPTION = "Wireless Central Regulatory Domain Agent" +HOMEPAGE = "http://wireless.kernel.org/en/developers/Regulatory/CRDA" +SECTION = "base" +PRIORITY = "optional" +LIC_FILES_CHKSUM = "file://LICENSE;md5=07c4f6dea3845b02a18dc00c8c87699c" +LICENSE = "ISC" +PR = "+del.r0" + +# Virtual runtime settings can be overriden by the distribution. +VIRTUAL-RUNTIME_crda_use_gcrypt ?= "0" + +# The distribution could set this to its device manger, for example udev. +VIRTUAL-RUNTIME_device_manager ?= "busybox-mdev" + +DEPENDS = "libnl ${@base_conditional('VIRTUAL-RUNTIME_crda_use_gcrypt', '1' , 'libgcrypt python-m2crypto-native python-native', '', d)}" +RDEPENDS_${PN} = '${VIRTUAL-RUNTIME_device_manager}' + +FILESEXTRAPATHS_prepend := "${THISDIR}/files:" + +# Original SRC_URIs +# http://wireless.kernel.org/download/crda/${P}.tar.bz2;name=crda \ +# http://wireless.kernel.org/download/wireless-regdb/regulatory.bins/2011.04.28-regulatory.bin;name=reg \ + +SRC_URI = "${DIGI_LOG_MIRROR}${PN}-${PV}.tar.bz2;name=crda \ + ${DIGI_LOG_MIRROR}2011.04.28-regulatory.bin;name=reg \ + " + +SRC_URI += '${@base_conditional("VIRTUAL-RUNTIME_crda_use_gcrypt", "1" , "", "file://0001-Make-crypto-optional.patch", d)}' + +CFLAGS += " -DCONFIG_LIBNL20" + +EXTRA_OEMAKE = "MAKEFLAGS=" +do_compile() { + oe_runmake all_noverify +} + +do_install() { + oe_runmake DESTDIR=${D} install + install -d ${D}/usr/lib/crda/ + install -m 0644 ${WORKDIR}/2011.04.28-regulatory.bin ${D}/usr/lib/crda/regulatory.bin +} + +SRC_URI[crda.md5sum] = "5226f65aebacf94baaf820f8b4e06df4" +SRC_URI[crda.sha256sum] = "e469348a5d0bb933df31995869130f68901de9be02e666437f52125698851864" +SRC_URI[reg.md5sum] = "1535e98bcaba732e2f8e8f62dac6f369" +SRC_URI[reg.sha256sum] = "bb6ba6f5dcdf7106a19c588b0e4d43ab7af26f6474fe01011a318b3dceaba33b" + +FILES_${PN} += "\ + /lib/udev/rules.d/85-regulatory.rules \ + /usr/lib/crda/regulatory.bin \ + " diff --git a/meta-digi-del/recipes-connectivity/crda/files/0001-Make-crypto-optional.patch b/meta-digi-del/recipes-connectivity/crda/files/0001-Make-crypto-optional.patch new file mode 100644 index 000000000..3bb2854ae --- /dev/null +++ b/meta-digi-del/recipes-connectivity/crda/files/0001-Make-crypto-optional.patch @@ -0,0 +1,24 @@ +From 3c5e208ba7780e4c65dd94f2aca7ee95c164f9f3 Mon Sep 17 00:00:00 2001 +From: Alex Gonzalez +Date: Thu, 13 Dec 2012 11:34:01 +0100 +Subject: [PATCH] Make crypto optional. + +Signed-off-by: Alex Gonzalez +--- + Makefile | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/Makefile b/Makefile +index b8bc7d3..208ebbd 100644 +--- a/Makefile ++++ b/Makefile +@@ -35,7 +35,8 @@ LDLIBS += `pkg-config --libs openssl` + + reglib.o: keys-ssl.c + +-else ++endif ++ifeq ($(USE_GCRYPT),1) + CFLAGS += -DUSE_GCRYPT + LDLIBS += -lgcrypt + diff --git a/meta-digi-del/recipes-connectivity/tasks/task-del-wireless.bb b/meta-digi-del/recipes-connectivity/tasks/task-del-wireless.bb index 103316071..a1fe2d6af 100644 --- a/meta-digi-del/recipes-connectivity/tasks/task-del-wireless.bb +++ b/meta-digi-del/recipes-connectivity/tasks/task-del-wireless.bb @@ -23,6 +23,7 @@ PACKAGES = "\ RDEPENDS_task-del-wireless = "\ wpa-supplicant \ wireless-tools \ + crda \ ${MACHINE_ESSENTIAL_EXTRA_RDEPENDS}" RRECOMMENDS_task-del-wireless = "\