Custom recipe for YOCTO

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Custom recipe for YOCTO

12,920 Views
manjunathjoshi
Contributor V

Hello All,

I want to create a recipe to compile cifs-utils and bitbake with image.

I tried following YOCTO user manual and at first it was troublesome. But now, i am able to bitbake but "cifs-utils not found in the base feeds" is the error. So the last do_install is getting failed.

My recipe looks like this,

**********************************************************************************************************************************************************

# This file is a modified example recipe to help mount cifs on linux.

#

DESCRIPTION = "Simple compile application"

SECTION = "examples"

LICENSE = "MIT"

LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"

PR = "r0"

SRC_URI = "http://ftp.de.debian.org/debian/pool/main/c/cifs-utils/cifs-utils_5.5.orig.tar.bz2"

SRC_URI[tarball.md5sum] = "b1e6309e8331e0f4e6efd311c2d97fa8"

SRC_URI[tarball.sha256sum] = "7f7d9f60b7766b852881d40b8ff91d8e39fccb0d1d913102a5c75a2dbb52332d"

S = "${WORKDIR}"

DEPENDS +="glibc"

ALLOW_EMPTY_${PN}-dev = "1"

EXTRA_OEMAKE = "'CC=${CC}' 'RANLIB=${RANLIB}' 'AR=${AR}' 'CFLAGS=${CFLAGS} -I${S}/include -DWITHOUT_XATTR' 'BUILDDIR=${S}'"

do_install () {

         oe_runmake install DESTDIR=${D} SBINDIR=${sbindir} MANDIR=${mandir} INCLUDEDIR=${includedir}

}

PARALLEL_MAKE = ""

BBCLASSEXTEND = "native"

**************************************************************************************************************************************************************

Now my question is cifs-utils gets compiled by AUTOTOOLS so at first i used inherit autotools but did not work.

oe-runmake error persisted.

But now there is no error but do_install fails right at the end. can anyone help ??

Regards,

Manju

Labels (2)
9 Replies

6,602 Views
manjunathjoshi
Contributor V

Hello Daiane,

In the first link, the recipe needs modification for enabling libcap, cifsreads etc can you suggest me the right way to modify?

I tried with,

PACKAGECONFIG[cifscreds] = "--enable-cifscreds"  ---line, but could not find the same in /usr/bin or /usr/sbin/ after build.

Even i tried with,

PACKAGECONFIG[cifscreds] = "--enable-cifscreds, ,keyutils" but could not find the same in /usr/bin or /usr/sbin/ after build.


Regards,

Manju



0 Kudos
Reply

6,602 Views
daiane_angolini
NXP Employee
NXP Employee

have you copied the recipe over your layer? Or have you included the original layer on your bblayer.conf?

I would change bblalyer.conf, create a bbappend and add the PACKAGECONFIG line you pointed.

The (my) problem is, I don't know cifs-utils enough in order to know if configure file can actually receive "--enable-cifscreds" properly or not. Have you tested that already?

0 Kudos
Reply

6,602 Views
manjunathjoshi
Contributor V

Hello Daiane,

I am using

mount -t cifs //10.20.1.123/share /home/root/smbshare -o username=blahblah,password=blahblah,rw,file_mode=0777,dir_mode=0777

to mount cifs on sabresd.

I am successful only when i have "mount.cifs" in /usr/sbin. This is a helper program to mount cifs on linux as you know.

To make this happen i have cross compiled "cifs-utils" and have copied mount.cifs after cross compilation to /usr/sbin. This was manual. This has worked for me.

Then i tried the same with a recipe to copy only mount.cifs. Even that was successful.

Now coming to what you have asked, i have copied the recipe over my layer. Added the layer to bblayers.conf, and i want to make the recipe changes.

For the second question you asked, i think cifsreds or cifsupcall may not be as important as mount.cifs file. But anyways they would be compiled to respective locations as discussed above.

Regards,

Manju

0 Kudos
Reply

6,603 Views
daiane_angolini
NXP Employee
NXP Employee

Ok, I am sorry for my misinterpretation :smileywink:

0 Kudos
Reply

6,601 Views
daiane_angolini
NXP Employee
NXP Employee

Oh, and you need

PACKAGECONFIG = cifscreds

somewhere

0 Kudos
Reply

6,602 Views
jimmychan
NXP TechSupport
NXP TechSupport

what is the fail message?

0 Kudos
Reply

6,602 Views
manjunathjoshi
Contributor V

Hello jimmychan,

This is the error,

NOTE: Preparing runqueue

NOTE: Executing SetScene Tasks

NOTE: Executing RunQueue Tasks

ERROR: Function failed: do_install (log file is located at /home/pga/projects//fsl-community-bsp/build_toolchain/tmp/work/cortexa9hf-vfp-neon-poky-linux-gnueabi/cifs-util/0.1-r0/temp/log.do_install.9801)

ERROR: Logfile of failure stored in: /home/pga/projects/fsl-community-bsp/build_toolchain/tmp/work/cortexa9hf-vfp-neon-poky-linux-gnueabi/cifs-util/0.1-r0/temp/log.do_install.9801

Log data follows:

| DEBUG: Executing shell function do_install

| NOTE: make CC=arm-poky-linux-gnueabi-gcc  -march=armv7-a -mthumb-interwork -mfloat-abi=hard -mfpu=neon -mtune=cortex-a9 --sysroot=/home/pga/projects/yocto/pga/fsl-community-bsp/build_toolchain/tmp/sysroots/imx6qsabresd RANLIB=arm-poky-linux-gnueabi-ranlib AR=arm-poky-linux-gnueabi-ar CFLAGS= -O2 -pipe -g -feliminate-unused-debug-types -I/home/pga/projects/yocto/pga/fsl-community-bsp/build_toolchain/tmp/work/cortexa9hf-vfp-neon-poky-linux-gnueabi/cifs-util/0.1-r0/include -DWITHOUT_XATTR BUILDDIR=/home/pga/pga/fsl-community-bsp/build_toolchain/tmp/work/cortexa9hf-vfp-neon-poky-linux-gnueabi/cifs-util/0.1-r0 install DESTDIR=/home/pga/projects/yocto/pga/fsl-community-bsp/build_toolchain/tmp/work/cortexa9hf-vfp-neon-poky-linux-gnueabi/cifs-util/0.1-r0/image SBINDIR=/usr/sbin MANDIR=/usr/share/man INCLUDEDIR=/usr/include

| make: *** No rule to make target `install'.  Stop.

| ERROR: oe_runmake failed

| WARNING: exit code 1 from a shell command.

| ERROR: Function failed: do_install (log file is located at /home/pga/pga/fsl-community-bsp/build_toolchain/tmp/work/cortexa9hf-vfp-neon-poky-linux-gnueabi/cifs-util/0.1-r0/temp/log.do_install.9801)

ERROR: Task 274 (/home/pga/projects/fsl-community-bsp/sources/meta-manju-custom/recipes-example/example/cifs-util_0.1.bb, do_install) failed with exit code '1'

NOTE: Tasks Summary: Attempted 3423 tasks of which 3422 didn't need to be rerun and 1 failed.

No currently running tasks (2508 of 3573)

Summary: 1 task failed:

  /home/pga/projects/fsl-community-bsp/sources/meta-manju-custom/recipes-example/example/cifs-util_0.1.bb, do_install

This is when i use "inherit autotools gettext"

I have followed another discussion with similar problem and i changed my recipe something like this,

#

# This file is a modified example recipe to help mount cifs on linux.

#

DESCRIPTION = "Simple compile application"

SECTION = "examples"

LICENSE = "MIT"

LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"

SRC_URI = "http://ftp.de.debian.org/debian/pool/main/c/cifs-utils/cifs-utils_6.4.orig.tar.bz2"

SRC_URI[md5sum] = "b7d75b67fd3987952896d27256c7293d"

SRC_URI[sha256sum] = "38fc63926af435dae4ebcf4406275580a692d9fb9ee3e32170317cf2ba68e6e3"

S = "${WORKDIR}"

PR = "r0"

INHIBIT_PACKAGE_STRIP = "1"

FILES_${PN} += "${libdir}/"

do_configure() {

echo ${libdir}

oe_runmake configure

}

do_compile() {

oe_runmake all

}

do_install () {

mkdir -p ${D}/usr/sbin

oe_runmake install SYS_ROOT=${D}

}

This gave me following error.

ERROR: Function failed: do_configure (log file is located at /home/pga/projects/fsl-community-bsp/build_toolchain/tmp/work/cortexa9hf-vfp-neon-poky-linux-gnueabi/cifs-util/0.1-r0/temp/log.do_configure.11594)

ERROR: Logfile of failure stored in: /home/pga/projects/fsl-community-bsp/build_toolchain/tmp/work/cortexa9hf-vfp-neon-poky-linux-gnueabi/cifs-util/0.1-r0/temp/log.do_configure.11594

Log data follows:

| DEBUG: Executing python function sysroot_cleansstate

| DEBUG: Python function sysroot_cleansstate finished

| DEBUG: Executing shell function do_configure

| /usr/lib

| NOTE: make -e MAKEFLAGS= configure

| make: *** No rule to make target `configure'.  Stop.

| ERROR: oe_runmake failed

| WARNING: exit code 1 from a shell command.

| ERROR: Function failed: do_configure (log file is located at /home/pga/projects/fsl-community-bsp/build_toolchain/tmp/work/cortexa9hf-vfp-neon-poky-linux-gnueabi/cifs-util/0.1-r0/temp/log.do_configure.11594)

ERROR: Task 277 (/home/pga/projects/fsl-community-bsp/sources/meta-manju-custom/recipes-example/example/cifs-util_0.1.bb, do_configure) failed with exit code '1'

NOTE: Tasks Summary: Attempted 3563 tasks of which 3558 didn't need to be rerun and 1 failed.

Waiting for 0 running tasks to finish:

It is just that i am new to python and not able to know each line of code.

My aim is to copy mount.cifs file after compilation to /usr/sbin. That would do the job.

Regards,

Manju

0 Kudos
Reply

6,602 Views
jimmychan
NXP TechSupport
NXP TechSupport