[meta-freescale] [meta-fsl-ppc denzil] cryptodev kernel module recipe

Otavio Salvador otavio at ossystems.com.br
Wed Nov 28 09:57:54 PST 2012


On Wed, Nov 28, 2012 at 2:50 PM, McClintock Matthew-B29882
<B29882 at freescale.com> wrote:
> On Wed, Nov 28, 2012 at 5:17 AM, Otavio Salvador
> <otavio at ossystems.com.br> wrote:
>> On Wed, Nov 28, 2012 at 3:15 AM, Zhenhua Luo <b19537 at freescale.com> wrote:
>>> From: Yashpal Dutta <yashpal.dutta at freescale.com>
>>>
>>> This is a /dev/crypto device driver, equivalent to those in OpenBSD or FreeBSD.
>>> The main idea is to access of existing ciphers in kernel space from userspace,
>>> thus enabling re-use of a hardware implementation of a cipher.
>>>
>>> Signed-off-by: Yashpal Dutta <yashpal.dutta at freescale.com>
>>> Signed-off-by: Zhenhua Luo <b19537 at freescale.com>
>>
>> I think this should be send to meta-oe as it is not SoC specific,
>> however I have some comments in the recipe so you can fix them before
>> it...
>>
>>> ---
>>>  recipes-kernel/cryptodev/cryptodev_1.5.bb          |   17 +++++++++++++
>>>  .../cryptodev/files/makefile_fixup.patch           |   26 ++++++++++++++++++++
>>>  2 files changed, 43 insertions(+)
>>>  create mode 100644 recipes-kernel/cryptodev/cryptodev_1.5.bb
>>>  create mode 100644 recipes-kernel/cryptodev/files/makefile_fixup.patch
>>>
>>> diff --git a/recipes-kernel/cryptodev/cryptodev_1.5.bb b/recipes-kernel/cryptodev/cryptodev_1.5.bb
>>> new file mode 100644
>>> index 0000000..0696e2a
>>> --- /dev/null
>>> +++ b/recipes-kernel/cryptodev/cryptodev_1.5.bb
>>> @@ -0,0 +1,17 @@
>>> +SECTION = "devel"
>>> +SUMMARY = "Linux Cryptodev KERNEL MODULE"
>>> +DESCRIPTION = "The Cryptodev package contains the kernel /dev/crypto module"
>>> +LICENSE = "GPLv2"
>>> +LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"
>>> +RCONFLICTS_${PN} = "ocf-linux"
>>> +
>>> +inherit module
>>> +
>>> +SRCREV = "1c24a0aa996630518d47826a2e3fea129ea094c7"
>>> +
>>> +SRC_URI = "git://repo.or.cz/cryptodev-linux.git;protocol=git \
>>> +           file://makefile_fixup.patch"
>>> +
>>> +EXTRA_OEMAKE='KERNEL_DIR="${STAGING_KERNEL_DIR}" PREFIX="${D}"'
>>>
>>> +S = "${WORKDIR}/git"
>>> diff --git a/recipes-kernel/cryptodev/files/makefile_fixup.patch b/recipes-kernel/cryptodev/files/makefile_fixup.patch
>>> new file mode 100644
>>> index 0000000..323aacd
>>> --- /dev/null
>>> +++ b/recipes-kernel/cryptodev/files/makefile_fixup.patch
>>> @@ -0,0 +1,26 @@
>>> +diff --git a/Makefile b/Makefile
>>> +index 2be8825..b36d68c 100644
>>> +--- a/Makefile
>>> ++++ b/Makefile
>>> +@@ -1,6 +1,7 @@
>>> + KBUILD_CFLAGS += -I$(src)
>>> + KERNEL_DIR = /lib/modules/$(shell uname -r)/build
>>
>> Please rename the KERNEL_DIR variable to KERNEL_SRC so it follow the
>> standard variables used by modules in general and you can avoid
>> setting it in the bb file.
>
> You made the same mistake reveiwing this Darren did... these are NOT
> in our recipe they are in the projects Makefile that we don't control.
> We are just patching up the Makefile a bit so it works properly and
> don't want to redefine variables this project has been using.
>
> OTOH this patch needs an upstream-status and also needs to be sent upstream.

Yes I know it is inside of the project Makefile however you're
patching it anyway so better to make it us the standards and send
upstream.

>>> + VERSION = 1.5
>>> ++PREFIX =
>>
>> The expected variable is DESTDIR. In fact you should have both, read bellow...
>
> You are right here... it should be ${DESTDIR)$(PREFIX)
>
> -M
>
>>
>>> + cryptodev-objs = ioctl.o main.o cryptlib.o authenc.o zc.o util.o
>>> +
>>> +@@ -12,10 +13,10 @@ build: version.h
>>> + version.h: Makefile
>>> +       @echo "#define VERSION \"$(VERSION)\"" > version.h
>>> +
>>> +-install:
>>> ++modules_install:
>>> +       make -C $(KERNEL_DIR) SUBDIRS=`pwd` modules_install
>>> +-      @echo "Installing cryptodev.h in /usr/include/crypto ..."
>>> +-      @install -D crypto/cryptodev.h /usr/include/crypto/cryptodev.h
>>> ++      @echo "Installing cryptodev.h in $(PREFIX)/usr/include/crypto ..."
>>> ++      @install -D crypto/cryptodev.h $(PREFIX)/usr/include/crypto/cryptodev.h
>>
>> Use $(DESTDIR)$(PREFIX)/include/...
>>
>>> + clean:
>>> +       make -C $(KERNEL_DIR) SUBDIRS=`pwd` clean
>>
>>
>>
>> --
>> Otavio Salvador                             O.S. Systems
>> E-mail: otavio at ossystems.com.br  http://www.ossystems.com.br
>> Mobile: +55 53 9981-7854              http://projetos.ossystems.com.br
>> _______________________________________________
>> meta-freescale mailing list
>> meta-freescale at yoctoproject.org
>> https://lists.yoctoproject.org/listinfo/meta-freescale



-- 
Otavio Salvador                             O.S. Systems
E-mail: otavio at ossystems.com.br  http://www.ossystems.com.br
Mobile: +55 53 9981-7854              http://projetos.ossystems.com.br



More information about the meta-freescale mailing list