build and install .deb package

474 views
Skip to first unread message

Francesco

unread,
May 4, 2018, 8:40:50 AM5/4/18
to isar-...@googlegroups.com
Hello guys,

I still have a question regarding the management of customised packages.

I managed to create my .deb package using dpkg-raw but I would like also
to install it on the rootfs of my image. How can this be done?

Adding the package to IMAGE_INSTALL variable, does  not seem to work.
Perhaps another recipe is required?

Thanks

Frank

Alexander Smirnov

unread,
May 4, 2018, 8:49:12 AM5/4/18
to isar-...@googlegroups.com
Hello,
it depends where you've added IMAGE_INSTALL. It should be visible for
image recipe, so you have to add it to one of the following places:
1. Into you image recipe. If you use isar-image-base, then update file
'meta-isar/recipes-core/isar-image-base.bb'
2. Edit 'conf/local.conf' file in your build directory and add this line
to the end.

Alex

Francesco

unread,
May 4, 2018, 9:03:28 AM5/4/18
to isar-...@googlegroups.com
I tried to add the package name to the IMAGE_INSTALL variable inside my
image recipe. This returned an error: Unable to locate package
mypackage. I thought that I was doing something wrong, but I guess that
if this is the correct way, the problem is somewhere else.

Frank

Alexander Smirnov

unread,
May 4, 2018, 9:18:02 AM5/4/18
to Francesco, isar-...@googlegroups.com
On 05/04/2018 04:03 PM, Francesco wrote:
> I tried to add the package name to the IMAGE_INSTALL variable inside my
> image recipe. This returned an error: Unable to locate package
> mypackage. I thought that I was doing something wrong, but I guess that
> if this is the correct way, the problem is somewhere else.
>

Possibly I could also take a look on this, if you provide:

1. Name and path to your mypackage recipe, like:

meta-isar/recipes-app/libhello/libhello.bb

2. The variables from your mypackage recipe: PN, PROVIDES.

3. The content of your conf/bblayers.conf file.

4. The full line IMAGE_INSTALL you've added.

P.S. Also, am I right, that you are able to run 'bitbake mypackage'
without errors?

Alex

Francesco

unread,
May 4, 2018, 10:32:37 AM5/4/18
to Alexander Smirnov, isar-...@googlegroups.com

Here it is:

1. Name and path to your mypackage recipe:

    meta-dave/recipes-devtools/testpkg/testpkg_0.1.bb



2. The variables from your mypackage recipe: PN, PROVIDES.

    DESCRIPTION = "Sample application for ISAR"
    MAINTAINER = "Your name here <y...@domain.com>"
    DEBIAN_DEPENDS = "apt (>= 0.4.2), passwd"
    PN = "testpkg"
   
    SRC_URI = "file://README \
    file://postinst \
    file://uImage \
    file://lynx-modules.tar.gz \
    file://imx6ul-lynx-som0013-cb002f.dtb \


    "


3. The content of your conf/bblayers.conf file.
   

    # LAYER_CONF_VERSION is increased each time build/conf/bblayers.conf
    # changes incompatibly
    LCONF_VERSION = "6"
   
    BBPATH = "${TOPDIR}"
    BBFILES ?= ""
   
    BBLAYERS ?= " \
      /mnt/elbe/Isar/isar/meta \
      /mnt/elbe/Isar/isar/meta-isar \
      /mnt/elbe/Isar/isar/meta-dave \
      "
    BBLAYERS_NON_REMOVABLE ?= " \
      /mnt/elbe/Isar/isar/meta \


      "
4. The full line IMAGE_INSTALL you've added.

    IMAGE_INSTALL += "testpkg"



P.S. Also, am I right, that you are able to run 'bitbake mypackage' without errors?

 bitbake multiconfig:lynx-config:lynx-image
Parsing recipes: 100% |###########################################################################################################################################| Time: 0:00:01
Parsing of 17 .bb files complete (0 cached, 17 parsed). 187 targets, 0 skipped, 0 masked, 0 errors.
NOTE: Resolving any missing task queue dependencies
NOTE: Resolving any missing task queue dependencies
NOTE: Resolving any missing task queue dependencies
NOTE: Resolving any missing task queue dependencies
NOTE: Resolving any missing task queue dependencies
NOTE: Resolving any missing task queue dependencies
NOTE: Resolving any missing task queue dependencies
NOTE: Resolving any missing task queue dependencies
NOTE: Resolving any missing task queue dependencies
NOTE: Resolving any missing task queue dependencies
NOTE: Resolving any missing task queue dependencies
Initialising tasks: 100% |########################################################################################################################################| Time: 0:00:00
NOTE: Executing RunQueue Tasks
NOTE: Tasks Summary: Attempted 9 tasks of which 0 didn't need to be rerun and all succeeded.
 bitbake multiconfig:lynx-config:testpkg
Loading cache: 100% |#############################################################################################################################################| Time: 0:00:00
Loaded 187 entries from dependency cache.
NOTE: Resolving any missing task queue dependencies
NOTE: Resolving any missing task queue dependencies
NOTE: Resolving any missing task queue dependencies
NOTE: Resolving any missing task queue dependencies
NOTE: Resolving any missing task queue dependencies
NOTE: Resolving any missing task queue dependencies
NOTE: Resolving any missing task queue dependencies
NOTE: Resolving any missing task queue dependencies
NOTE: Resolving any missing task queue dependencies
NOTE: Resolving any missing task queue dependencies
NOTE: Resolving any missing task queue dependencies
Initialising tasks: 100% |########################################################################################################################################| Time: 0:00:00
NOTE: Executing RunQueue Tasks
NOTE: Tasks Summary: Attempted 14 tasks of which 3 didn't need to be rerun and all succeeded.

As you can see the package and the image can be built fine if the variable IMAGE_INSTALL is left empty. As soon as I add testpkg to the IMAGE_INSTALL variable I get this error:

| Fetched 12.6 MB in 10s (1,174 kB/s)
| Reading package lists...
| W: GPG error: http://security.debian.org jessie/updates InRelease: Could not execute 'gpgv' to verify signature (is gpgv installed?)
| W: GPG error: http://ftp.debian.org jessie-updates InRelease: Could not execute 'gpgv' to verify signature (is gpgv installed?)
| W: GPG error: http://ftp.debian.org jessie Release: Could not execute 'gpgv' to verify signature (is gpgv installed?)
| I: Calculating required packages.
| apt-get -y  -o Apt::Architecture=armhf -o Dir::Etc::TrustedParts=/mnt/elbe/Isar/isar/build/tmp/work/lynx-armhf/lynx-image/rootfs/etc/apt/trusted.gpg.d -o Dir::Etc::Trusted=/mn
t/elbe/Isar/isar/build/tmp/work/lynx-armhf/lynx-image/rootfs/etc/apt/trusted.gpg.d/trusted.gpg -o Apt::Get::AllowUnauthenticated=true -o Apt::Get::Download-Only=true -o Apt::Ins
tall-Recommends=false -o Dir=/mnt/elbe/Isar/isar/build/tmp/work/lynx-armhf/lynx-image/rootfs/ -o Dir::Etc=/mnt/elbe/Isar/isar/build/tmp/work/lynx-armhf/lynx-image/rootfs/etc/apt
/ -o Dir::Etc::Parts=/mnt/elbe/Isar/isar/build/tmp/work/lynx-armhf/lynx-image/rootfs/etc/apt/apt.conf.d/ -o Dir::Etc::PreferencesParts=/mnt/elbe/Isar/isar/build/tmp/work/lynx-ar
mhf/lynx-image/rootfs/etc/apt/preferences.d/ -o APT::Default-Release=* -o Dir::State=/mnt/elbe/Isar/isar/build/tmp/work/lynx-armhf/lynx-image/rootfs/var/lib/apt/ -o Dir::State::
Status=/mnt/elbe/Isar/isar/build/tmp/work/lynx-armhf/lynx-image/rootfs/var/lib/dpkg/status -o Dir::Cache=/mnt/elbe/Isar/isar/build/tmp/work/lynx-armhf/lynx-image/rootfs/var/cach
e/apt/ install  apache2 apt base-files base-passwd bash bsdutils build-essential coreutils curl dash dbus debconf debconf-i18n debianutils diffutils dpkg e2fslibs e2fsprogs find
utils gcc-4.8-base gcc-4.9-base gpgv grep gzip hostname init initscripts libacl1 libattr1 libblkid1 libc-bin libc6 libcomerr2 libgcc1 liblocale-gettext-perl liblzma5 libmount1 l
ibncurses5 libpam-modules libpam-modules-bin libpam-runtime libpam0g libpcre3 libselinux1 libsepol1 libsmartcols1 libss2 libtext-charwidth-perl libtext-iconv-perl libtext-wrapi1
8n-perl libtinfo5 libuuid1 localepurge login lsb-base mawk mount multiarch-support ncurses-base ncurses-bin nginx openssh-server passwd perl-base sed sensible-utils sqlite3 star
tpar sudo sysv-rc sysvinit-utils tar testpkg tftp tzdata util-linux vim wget zlib1g
| Reading package lists...
| Building dependency tree...
| E: Unable to locate package testpkg
| apt download failed. Exit value: 100
| WARNING: exit code 100 from a shell command.
| ERROR: Function failed: do_rootfs (log file is located at /mnt/elbe/Isar/isar/build/tmp/work/lynx-armhf/lynx-image/temp/log.do_rootfs.17385)
ERROR: Task (multiconfig:lynx-config:/mnt/elbe/Isar/isar/meta-dave/recipes-core/images/lynx-image.bb:do_rootfs) failed with exit code '1'
NOTE: Tasks Summary: Attempted 6 tasks of which 5 didn't need to be rerun and 1 failed.


My understanding is this: The testpkg.deb is generated and placed correctly inside the build/tmp/work/lynx-armhf/testpkg-0.1-r0 but then it seems that  it can't be found while the image is being built. How does bitbake know how to install the package? For other pre-compiled packages I used a dedicated recipe which inherits from dpkg class. These packages however,  were not being produced at runtime.  The situation now is a bit different. I'm trying to build the package and install it on the rootfs at runtime.
Perhaps I'm misunderstanding something, given that my experience with both yocto and isar is quite limited.
Thanks

Frank

Henning Schild

unread,
May 7, 2018, 11:54:34 AM5/7/18
to Francesco, Alexander Smirnov, isar-...@googlegroups.com
Am Fri, 4 May 2018 16:32:35 +0200
schrieb Francesco <fdp...@dave.eu>:

> Here it is:
>
> 1. Name and path to your mypackage recipe:
>
>     meta-dave/recipes-devtools/testpkg/testpkg_0.1.bb
>
> 2. The variables from your mypackage recipe: PN, PROVIDES.
>
>     DESCRIPTION = "Sample application for ISAR"

>     MAINTAINER = "Your name here <y...@domain.com>"
>     DEBIAN_DEPENDS = "apt (>= 0.4.2), passwd"
>     PN = "testpkg"

PN is already testpkg because of the filename you chose.

>     SRC_URI = "file://README \
>     file://postinst \
>     file://uImage \
>     file://lynx-modules.tar.gz \

add ";unpack=false" if you want to unpack this yourself.

>     file://imx6ul-lynx-som0013-cb002f.dtb \
>     "

you are missing some things here, try adding the following

--
inherit dpkg-raw

do_install() {
install -v -d ${D}/boot
install -v -m 644 ${WORKDIR}/uImage ${D}/boot/
install -v -m 644 ${WORKDIR}/*.dtb ${D}/boot/
tar xfvz lynx-modules.tar.gz -C ${D}/lib/modules/
}
--

When building your package you should have seen a NOTE saying "The
included, default BB base.bbclass does not define a useful default
task."

And once you you the class dpkg-raw you will have to provide an
implementation of do_install to tell Isar where your files will go in
the package.

Henning

>
> 3. The content of your conf/bblayers.conf file.
>
>     # LAYER_CONF_VERSION is increased each time
> build/conf/bblayers.conf # changes incompatibly
>     LCONF_VERSION = "6"
>
>     BBPATH = "${TOPDIR}"
>     BBFILES ?= ""
>
>     BBLAYERS ?= " \
>       /mnt/elbe/Isar/isar/meta \
>       /mnt/elbe/Isar/isar/meta-isar \
>       /mnt/elbe/Isar/isar/meta-dave \
>       "
>     BBLAYERS_NON_REMOVABLE ?= " \
>       /mnt/elbe/Isar/isar/meta \
>       "
> 4. The full line IMAGE_INSTALL you've added.
>     IMAGE_INSTALL += "testpkg"
>
> P.S. Also, am I right, that you are able to run 'bitbake mypackage'
> without errors?
> /bitbake multiconfig:lynx-config:lynx-image/
> Parsing recipes: 100%
> |###########################################################################################################################################|
> Time: 0:00:01
> Parsing of 17 .bb files complete (0 cached, 17 parsed). 187 targets,
> 0 skipped, 0 masked, 0 errors.
> NOTE: Resolving any missing task queue dependencies
> NOTE: Resolving any missing task queue dependencies
> NOTE: Resolving any missing task queue dependencies
> NOTE: Resolving any missing task queue dependencies
> NOTE: Resolving any missing task queue dependencies
> NOTE: Resolving any missing task queue dependencies
> NOTE: Resolving any missing task queue dependencies
> NOTE: Resolving any missing task queue dependencies
> NOTE: Resolving any missing task queue dependencies
> NOTE: Resolving any missing task queue dependencies
> NOTE: Resolving any missing task queue dependencies
> Initialising tasks: 100%
> |########################################################################################################################################|
> Time: 0:00:00
> NOTE: Executing RunQueue Tasks
> NOTE: Tasks Summary: Attempted 9 tasks of which 0 didn't need to be
> rerun and all succeeded.
> / bitbake multiconfig:lynx-config:testpkg/

Francesco

unread,
May 8, 2018, 2:26:23 AM5/8/18
to isar-...@googlegroups.com
Hello,
    I had done this, in fact the package could be built without
problems.  Deleting the tmp folder before restarting the building
process solved the other issue I was getting.
    Luckily I can now build and install the .deb package with no
troubles :)

    Thanks.
Reply all
Reply to author
Forward
0 new messages