Skip to contentSkip to conversation

cmem: Adding new recipe for cmem

PATCH New Sam Nelson 3 participants 4 messages Dec 18, 2013 – Jan 28, 2014

lore
Share & tools
lore

Sam Nelson

author
#0 lore raw

PATCH v4 1/1 cmem: Adding new recipe for cmem

cmem module provides user space contiguous memory allocation

---
Fixed compared to previous version
- Updated recipe to use commit id
- Updated make targets module_clean-->modules_clean, module_install --> modules_install
---

---
 recipes-bsp/cmem/cmem-mod_git.bb |   24 ++++++++++++++++++++++++
 recipes-bsp/cmem/cmem.inc        |   10 ++++++++++
 recipes-bsp/cmem/cmem_git.bb     |   15 +++++++++++++++
 3 files changed, 49 insertions(+)
 create mode 100644 recipes-bsp/cmem/cmem-mod_git.bb
 create mode 100644 recipes-bsp/cmem/cmem.inc
 create mode 100644 recipes-bsp/cmem/cmem_git.bb
recipes-bsp/cmem/cmem-mod_git.bb new file +24 -0
new file mode 100644
index 0000000..5809d08
@@ -0,0 +1,24 @@
+DESCRIPTION="Contiguous memory allocation kernel module for contiguous memory allocation from userspace "
+
+include cmem.inc
+
+# This package builds a kernel module, use kernel PR as base and append a local
+PR = "${MACHINE_KERNEL_PR}"
+PR_append = "a"
+
+S = "${WORKDIR}/git"
+
+inherit module
+
+do_compile () {
+    unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS
+    cd ${S}
+    make -f lu.mak modules_clean
+    make -f lu.mak module KERNEL_INSTALL_DIR=${STAGING_KERNEL_DIR} TOOLCHAIN_PREFIX=${CROSS_COMPILE}
+}
+
+do_install () {
+    unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS
+    cd ${S}
+    make -f lu.mak modules_install KERNEL_INSTALL_DIR="${STAGING_KERNEL_DIR}" EXEC_DIR="${D}/lib/modules/${KERNEL_VERSION}/extra" INSTALL_MOD_PATH="${D}"
+}
recipes-bsp/cmem/cmem.inc new file +10 -0
new file mode 100644
index 0000000..b1f441a
@@ -0,0 +1,10 @@
+HOMEPAGE="http://processors.wiki.ti.com/index.php/Category:CMEM"
+
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://include/ti/cmem.h;beginline=1;endline=30;md5=b86138d4028fb8310b3b983024edc620"
+
+BRANCH ?= "master"
+# This corresponds to version 4.00.01.08
+SRCREV = "0b68dfe9f155a1978cdb2178e052dc0d6f1e705b"
+
+SRC_URI = "git://git.ti.com/ipc/ludev.git;protocol=git;branch=${BRANCH}"
recipes-bsp/cmem/cmem_git.bb new file +15 -0
new file mode 100644
index 0000000..ca3ed89
@@ -0,0 +1,15 @@
+DESCRIPTION="The cmem component supports contiguous memory allocation from userspace "
+
+include cmem.inc
+
+RDEPENDS_${PN} = "cmem-mod"
+
+S = "${WORKDIR}/git"
+
+PR = "r0"
+
+PACKAGES =+ "${PN}-test"
+
+FILES_${PN}-test = "${bindir}/*"
+
+inherit autotools
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH 1/1 cmem: numerous generic recipe fixes

From: Denys Dmytriyenko <[email protected]>

Sam, please review these fixes that I made on top of your submission. This is just for your reference to illustrate the feedback comments given previously. Feel free to ask questions. I'll squash this patch before pushing changes in.

---
 recipes-bsp/cmem/cmem-mod_git.bb | 20 ++++----------------
 recipes-bsp/cmem/cmem.inc        |  4 +++-
 recipes-bsp/cmem/cmem_git.bb     |  4 +---
 3 files changed, 8 insertions(+), 20 deletions(-)
recipes-bsp/cmem/cmem-mod_git.bb +4 -16
index 5809d08..2bdf9c0 100644
@@ -1,24 +1,12 @@
-DESCRIPTION="Contiguous memory allocation kernel module for contiguous memory allocation from userspace "
+DESCRIPTION = "Kernel module for contiguous memory allocation from userspace"
 
 include cmem.inc
 
 # This package builds a kernel module, use kernel PR as base and append a local
+MACHINE_KERNEL_PR_append = "a+gitr${SRCPV}"
 PR = "${MACHINE_KERNEL_PR}"
-PR_append = "a"
-
-S = "${WORKDIR}/git"
 
 inherit module
 
-do_compile () {
-    unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS
-    cd ${S}
-    make -f lu.mak modules_clean
-    make -f lu.mak module KERNEL_INSTALL_DIR=${STAGING_KERNEL_DIR} TOOLCHAIN_PREFIX=${CROSS_COMPILE}
-}
-
-do_install () {
-    unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS
-    cd ${S}
-    make -f lu.mak modules_install KERNEL_INSTALL_DIR="${STAGING_KERNEL_DIR}" EXEC_DIR="${D}/lib/modules/${KERNEL_VERSION}/extra" INSTALL_MOD_PATH="${D}"
-}
+EXTRA_OEMAKE += '-f lu.mak KERNEL_INSTALL_DIR="${STAGING_KERNEL_DIR}" TOOLCHAIN_PREFIX="${TOOLCHAIN_PREFIX}" EXEC_DIR="${D}/lib/modules/${KERNEL_VERSION}/extra"'
+MAKE_TARGETS = "module"
recipes-bsp/cmem/cmem.inc +3 -1
index b1f441a..7927839 100644
@@ -1,4 +1,4 @@
-HOMEPAGE="http://processors.wiki.ti.com/index.php/Category:CMEM"
+HOMEPAGE = "http://processors.wiki.ti.com/index.php/Category:CMEM"
 
 LICENSE = "GPLv2"
 LIC_FILES_CHKSUM = "file://include/ti/cmem.h;beginline=1;endline=30;md5=b86138d4028fb8310b3b983024edc620"
@@ -8,3 +8,5 @@ BRANCH ?= "master"
 SRCREV = "0b68dfe9f155a1978cdb2178e052dc0d6f1e705b"
 
 SRC_URI = "git://git.ti.com/ipc/ludev.git;protocol=git;branch=${BRANCH}"
+
+S = "${WORKDIR}/git"
recipes-bsp/cmem/cmem_git.bb +1 -3
index ca3ed89..bab9238 100644
@@ -1,11 +1,9 @@
-DESCRIPTION="The cmem component supports contiguous memory allocation from userspace "
+DESCRIPTION = "The cmem component supports contiguous memory allocation from userspace"
 
 include cmem.inc
 
 RDEPENDS_${PN} = "cmem-mod"
 
-S = "${WORKDIR}/git"
-
 PR = "r0"
 
 PACKAGES =+ "${PN}-test"
Signature · 1 line
1.8.3.2
#2 lore raw

Re: [PATCH] cmem: numerous generic recipe fixes

Sam,

Please see my comments inline explaining what changes I've made.

Quoted 18 lines · Denys Dmytriyenko

From: Denys Dmytriyenko <[email protected]>

Sam, please review these fixes that I made on top of your submission. This is just for your reference to illustrate the feedback comments given previously. Feel free to ask questions. I'll squash this patch before pushing changes in.

---
 recipes-bsp/cmem/cmem-mod_git.bb | 20 ++++----------------
 recipes-bsp/cmem/cmem.inc        |  4 +++-
 recipes-bsp/cmem/cmem_git.bb     |  4 +---
 3 files changed, 8 insertions(+), 20 deletions(-)
recipes-bsp/cmem/cmem-mod_git.bb +0 -0
index 5809d08..2bdf9c0 100644

recipes-bsp/cmem/cmem-mod_git.bb line 1

Quoted 2 lines
recipes-bsp/cmem/cmem-mod_git.bb +1 -1
@@ -1,24 +1,12 @@
-DESCRIPTION="Contiguous memory allocation kernel module for contiguous memory allocation from userspace "
+DESCRIPTION = "Kernel module for contiguous memory allocation from userspace"

Not important, just a cosmetic one.

recipes-bsp/cmem/cmem-mod_git.bb line 7

Quoted 6 lines
recipes-bsp/cmem/cmem-mod_git.bb +1 -1
 include cmem.inc
 
 # This package builds a kernel module, use kernel PR as base and append a local
+MACHINE_KERNEL_PR_append = "a+gitr${SRCPV}"
 PR = "${MACHINE_KERNEL_PR}"
-PR_append = "a"

This is to revert the order of PR and MACHINE_KERNEL_PR assignments, so it works when machine_kernel_pr.bbclass is not inherited (i.e. for distros other than Arago or Angstrom)...

recipes-bsp/cmem/cmem-mod_git.bb line 7

Quoted 1 line
recipes-bsp/cmem/cmem-mod_git.bb +0 -1
-S = "${WORKDIR}/git"

This moved to cmem.inc

Quoted 4 lines
recipes-bsp/cmem/cmem-mod_git.bb +0 -2
 inherit module
 
-do_compile () {
-    unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS

recipes-bsp/cmem/cmem-mod_git.bb line 24

Quoted 10 lines
recipes-bsp/cmem/cmem-mod_git.bb +0 -10
-    cd ${S}
-    make -f lu.mak modules_clean
-    make -f lu.mak module KERNEL_INSTALL_DIR=${STAGING_KERNEL_DIR} TOOLCHAIN_PREFIX=${CROSS_COMPILE}
-}
-
-do_install () {
-    unset CFLAGS CPPFLAGS CXXFLAGS LDFLAGS
-    cd ${S}
-    make -f lu.mak modules_install KERNEL_INSTALL_DIR="${STAGING_KERNEL_DIR}" EXEC_DIR="${D}/lib/modules/${KERNEL_VERSION}/extra" INSTALL_MOD_PATH="${D}"
-}

Ok, this is the major change - module.bbclass already provides do_compile() and do_install() functions with most of the code in there. All we need is to pass few additional variables.

recipes-bsp/cmem/cmem-mod_git.bb line 11

Quoted 1 line
recipes-bsp/cmem/cmem-mod_git.bb +1 -0
+EXTRA_OEMAKE += '-f lu.mak KERNEL_INSTALL_DIR="${STAGING_KERNEL_DIR}" TOOLCHAIN_PREFIX="${TOOLCHAIN_PREFIX}" EXEC_DIR="${D}/lib/modules/${KERNEL_VERSION}/extra"'

This is the list of additional variables to pass to "make" when running do_compile() and do_install(). I reduced it to bare minimum that cmem Makefiles require.

recipes-bsp/cmem/cmem-mod_git.bb line 12

Quoted 1 line
recipes-bsp/cmem/cmem-mod_git.bb +1 -0
+MAKE_TARGETS = "module"

This is the default target for do_compile() function.

recipes-bsp/cmem/cmem.inc line 1

Quoted 7 lines
recipes-bsp/cmem/cmem.inc +1 -1
index b1f441a..7927839 100644
@@ -1,4 +1,4 @@
-HOMEPAGE="http://processors.wiki.ti.com/index.php/Category:CMEM"
+HOMEPAGE = "http://processors.wiki.ti.com/index.php/Category:CMEM"

Again, just a cosmetic change.

recipes-bsp/cmem/cmem.inc BRANCH ?= "master" · line 12

Quoted 8 lines
recipes-bsp/cmem/cmem.inc +2 -0
 LICENSE = "GPLv2"
 LIC_FILES_CHKSUM = "file://include/ti/cmem.h;beginline=1;endline=30;md5=b86138d4028fb8310b3b983024edc620"
@@ -8,3 +8,5 @@ BRANCH ?= "master"
 SRCREV = "0b68dfe9f155a1978cdb2178e052dc0d6f1e705b"
 
 SRC_URI = "git://git.ti.com/ipc/ludev.git;protocol=git;branch=${BRANCH}"
+
+S = "${WORKDIR}/git"

Consolidate S assignment in one place.

recipes-bsp/cmem/cmem_git.bb line 1

Quoted 7 lines
recipes-bsp/cmem/cmem_git.bb +1 -1
index ca3ed89..bab9238 100644
@@ -1,11 +1,9 @@
-DESCRIPTION="The cmem component supports contiguous memory allocation from userspace "
+DESCRIPTION = "The cmem component supports contiguous memory allocation from userspace"

One more cosmetic change.

recipes-bsp/cmem/cmem_git.bb line 7

Quoted 5 lines
recipes-bsp/cmem/cmem_git.bb +0 -1
 include cmem.inc
 
 RDEPENDS_${PN} = "cmem-mod"
 
-S = "${WORKDIR}/git"

Moved to cmem.inc

Quoted 6 lines
recipes-bsp/cmem/cmem_git.bb +0 -0
 PR = "r0"
 
 PACKAGES =+ "${PN}-test"
Signature · 1 line
1.8.3.2
#3 lore raw

PATCH 1/1 cmem: adding new recipe for cmem

In reply to Sam Nelson

From: Sam Nelson <[email protected]>

cmem module provides user space contiguous memory allocation

---
 recipes-bsp/cmem/cmem-mod_git.bb | 12 ++++++++++++
 recipes-bsp/cmem/cmem.inc        | 12 ++++++++++++
 recipes-bsp/cmem/cmem_git.bb     | 13 +++++++++++++
 3 files changed, 37 insertions(+)
 create mode 100644 recipes-bsp/cmem/cmem-mod_git.bb
 create mode 100644 recipes-bsp/cmem/cmem.inc
 create mode 100644 recipes-bsp/cmem/cmem_git.bb
recipes-bsp/cmem/cmem-mod_git.bb new file +12 -0
new file mode 100644
index 0000000..2bdf9c0
@@ -0,0 +1,12 @@
+DESCRIPTION = "Kernel module for contiguous memory allocation from userspace"
+
+include cmem.inc
+
+# This package builds a kernel module, use kernel PR as base and append a local
+MACHINE_KERNEL_PR_append = "a+gitr${SRCPV}"
+PR = "${MACHINE_KERNEL_PR}"
+
+inherit module
+
+EXTRA_OEMAKE += '-f lu.mak KERNEL_INSTALL_DIR="${STAGING_KERNEL_DIR}" TOOLCHAIN_PREFIX="${TOOLCHAIN_PREFIX}" EXEC_DIR="${D}/lib/modules/${KERNEL_VERSION}/extra"'
+MAKE_TARGETS = "module"
recipes-bsp/cmem/cmem.inc new file +12 -0
new file mode 100644
index 0000000..7927839
@@ -0,0 +1,12 @@
+HOMEPAGE = "http://processors.wiki.ti.com/index.php/Category:CMEM"
+
+LICENSE = "GPLv2"
+LIC_FILES_CHKSUM = "file://include/ti/cmem.h;beginline=1;endline=30;md5=b86138d4028fb8310b3b983024edc620"
+
+BRANCH ?= "master"
+# This corresponds to version 4.00.01.08
+SRCREV = "0b68dfe9f155a1978cdb2178e052dc0d6f1e705b"
+
+SRC_URI = "git://git.ti.com/ipc/ludev.git;protocol=git;branch=${BRANCH}"
+
+S = "${WORKDIR}/git"
recipes-bsp/cmem/cmem_git.bb new file +13 -0
new file mode 100644
index 0000000..bab9238
@@ -0,0 +1,13 @@
+DESCRIPTION = "The cmem component supports contiguous memory allocation from userspace"
+
+include cmem.inc
+
+RDEPENDS_${PN} = "cmem-mod"
+
+PR = "r0+gitr${SRCPV}"
+
+PACKAGES =+ "${PN}-test"
+
+FILES_${PN}-test = "${bindir}/*"
+
+inherit autotools
Signature · 1 line
1.8.3.2