Community
cancel
Showing results for 
Search instead for 
Did you mean: 
ZIDONG_J_Intel
Employee
1,653 Views

How to put some files (libs) into the edison image while building

Hi

I am creating a custom edison yocto image.

I knew I can put the standard yocto packages into image like `IMAGE_INSTALL += `libx11``

while I already have some files/libs on my hand, and I want to put those files in the yocto's /usr/lib. What should i do? (Those files are from my ubuntu 32bit, and they can work well on edison, such like libsmime3.so)

6 Replies
Pedro_M_Intel
Employee
68 Views

Hello jzd,

Let me see if I got it right, you had no issues installing the extra packages, right? What you are trying to do is to only change the location where the libs are stored, right? Please correct me if I'm wrong.

Peter.

ZIDONG_J_Intel
Employee
68 Views

hi Peter

Merry Xmas~

 

I already have some lib files in the host machine (ubuntu), and I want to put those files into Edison's /usr/lib

Yes, I want to change the location, but the source file is not from network, but in the local disk already.

Thanks

Zidong

ZIDONG_J_Intel
Employee
68 Views

hi peter

I narrow down the question.

1, now i create a recipe `hope` in /edison-src/out/linux64/poky/meta-intel-iot-middleware/recipes-devtools

2, I put the existing files into hope/files

jzd@jzd:~/edison-src/out/linux64/poky/meta-intel-iot-middleware/recipes-devtools/hope$ tree

.

├── files

│ └── hope_lib

│ ├── jzd1

│ ├── jzd2

│ └── LICENSE

└── hope_1.0.0.bb

3, edit the hope_1.0.0.bb as follows. the main purpose is copy those files into ${libdir}

LICENSE = "hope"

LIC_FILES_CHKSUM = "file://hope_lib/LICENSE;md5=d41d8cd98f00b204e9800998ecf8427e"

S="${WORKDIR}"

SRC_URI="file://hope_lib"

INSANE_SKIP_${PN} = "installed-vs-shipped "

do_install(){

install -d ${D}${libdir}

install -c ${S}/hope_lib/jzd1 ${D}${libdir}

}

4, add IMAGE_INSTALL += "hope" in /edison-src/meta-intel-edison/meta-intel-edison-distro/recipes-core/images/edison-image.bb

5, make image

While it shows do_rootfs failed

...

Installing libcurl-dev (7.35.0-r0) to root...

Downloading file:/home/jzd/edison-src/out/linux64/build/tmp/deploy/ipk/core2-32/libcurl-dev_7.35.0-r0_core2-32.ipk.

Unknown package 'hope'.

Package python-misc (2.7.3-r0.3) installed in root is up to date.

Installing ethtool (3.13-r0) to root...

Downloading file:/home/jzd/edison-src/out/linux64/build/tmp/deploy/ipk/core2-32/ethtool_3.13-r0_core2-32.ipk.

Package libx11-6 (1:1.6.2-r0) installed in root is up to date.

...

Collected errors:

* opkg_install_cmd: Cannot install package hope.

DEBUG: Python function do_rootfs finished

ERROR: Function failed: do_rootfs

...

I found other packages all have the ipk files, while `hope` doesn't.

Why the hope is unkown and What should i do to resolve this problem?

Thanks

Zidong

Pedro_M_Intel
Employee
68 Views

Could you please show us the output of the commands bitbake-layers show-recipes and bitbake-layers show-layers?

bitbake-layers show-recipes shows where all recipes come from and bitbake-layers show-layers shows all active layers in the image.

Is hope shown when you enter the command bitbake-layers show-recipes? If it isn't, it might mean that it is not recognized under the image's layers that could mean that it is inappropriately included.

Peter.

ZIDONG_J_Intel
Employee
68 Views

Hi peter

1, I use the make setup and make image, instead of the bitbake.

2, I find the solution:

the wrong one:

in edison-imahge.bb

IMAGE_INSTALL += "hope"

in hope_1.0.0.bb

LICENSE = "hope"

 

LIC_FILES_CHKSUM = "file://hope_lib/LICENSE;md5=d41d8cd98f00b204e9800998ecf8427e"

 

S="${WORKDIR}"

 

SRC_URI="file://hope_lib" all related files are in the edison-src/out/linux64/poky/meta-intel-iot-middleware/recipes-devtools/hope/files/hope_lib. i need to put those files into edison's /usr/lib

 

INSANE_SKIP_${PN} += "already-stripped"

 

do_install(){

 

install -d ${D}${libdir}

 

install -d ${D}${libdir}/nss

 

install -c ${S}/hope_lib/*.so ${D}${libdir}

 

install -c ${S}/hope_lib/nss/* ${D}${libdir}/nss

 

}

the correct one:

in edison-imahge.bb

IMAGE_INSTALL += "libhope"

in hope_1.0.0.bb

LICENSE = "hope"

 

LIC_FILES_CHKSUM = "file://hope_lib/LICENSE;md5=d41d8cd98f00b204e9800998ecf8427e"

 

S="${WORKDIR}"

 

SRC_URI="file://hope_lib"

 

INSANE_SKIP_${PN} += "already-stripped"

 

do_install(){

 

install -d ${D}${libdir}

 

install -d ${D}${libdir}/nss

 

install -c ${S}/hope_lib/*.so ${D}${libdir}

 

install -c ${S}/hope_lib/nss/* ${D}${libdir}/nss

 

}

PACKAGES =+ "libhope" the two lines solves the problem!!!

 

FILES_libhope = "${libdir}/* ${libdir}/nss/*"

But i don't know why? other receipes can use the default package name and dob't need to specified the FILES.

Thanks

Zidong

Pedro_M_Intel
Employee
68 Views

I'm glad to hear that you managed to solve your issue. I believe the reason why it is different for this package is because you are not fetching it from anywhere, instead you already have its source store in your PC's storage.

Peter.