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 <alex.gonzalez@digi.com>
This commit is contained in:
Alex Gonzalez 2012-12-13 12:57:46 +01:00
parent fd7e53800d
commit 54b5f54e8f
4 changed files with 77 additions and 0 deletions

View File

@ -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}"

View File

@ -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 \
"

View File

@ -0,0 +1,24 @@
From 3c5e208ba7780e4c65dd94f2aca7ee95c164f9f3 Mon Sep 17 00:00:00 2001
From: Alex Gonzalez <alex.gonzalez@digi.com>
Date: Thu, 13 Dec 2012 11:34:01 +0100
Subject: [PATCH] Make crypto optional.
Signed-off-by: Alex Gonzalez <alex.gonzalez@digi.com>
---
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

View File

@ -23,6 +23,7 @@ PACKAGES = "\
RDEPENDS_task-del-wireless = "\
wpa-supplicant \
wireless-tools \
crda \
${MACHINE_ESSENTIAL_EXTRA_RDEPENDS}"
RRECOMMENDS_task-del-wireless = "\