[yocto] Per image customizations

Edward Wingate edwingate8 at gmail.com
Mon Jun 6 15:06:21 PDT 2016


On Mon, Jun 6, 2016 at 2:10 PM, Oleksandr Poznyak
<oleksandr.poznyak at gmail.com> wrote:
> Hi,
> Unfortunately You can't have two *.bbappend files per one package (recipe).
>
> You can create two new recipes where You'll install what You need and plus
> add sysvinit-inittab to DEPENDS variable in those recipes. This will help to
> retain the order of packages installation. Original sysvinit -> your
> sysvinit.
>
> In this situation You will have several recipes.

I create two new recipes: image1-inittab.bb and image2-inittab.bb
The are identical except for their do_install_append() function:

[image1-inittab.bb]
LICENSE = "BSD"
LIC_FILES_CHKSUM = "file://LICENSE;md5=9bea9267288f79f074b2e000d3cf6412"
SRC_URI = "file://LICENSE"
S = "${WORKDIR}"
DEPENDS += " sysvinit-inittab"

do_install_append() {
    echo "scra:2345:respawn:/opt/script1.sh" >> ${D}${sysconfdir}/inittab
    echo "scrb:2345:respawn:/opt/script2.sh" >> ${D}${sysconfdir}/inittab
}

[image2-inittab.bb]
LICENSE = "BSD"
LIC_FILES_CHKSUM = "file://LICENSE;md5=9bea9267288f79f074b2e000d3cf6412"
SRC_URI = "file://LICENSE"
S = "${WORKDIR}"
DEPENDS += " sysvinit-inittab"

do_install_append() {
    echo "scra:2345:respawn:/opt/script3.sh" >> ${D}${sysconfdir}/inittab
    echo "scrb:2345:respawn:/opt/script4.sh" >> ${D}${sysconfdir}/inittab
}

Is this the gist of what needs to be done?

I get this error when creating either image:
| DEBUG: Executing shell function do_install
| /mnt/drive3/yocto/jethro/poky/build/tmp/work/cortexa9-vfp-neon-poky-linux-gnueabi/image1-inittab/1.0-r0/temp/run.do_install.23229:
108: /mnt/drive3/yocto/jethro/poky/build/tmp/work/cortexa9-vfp-neon-poky-linux-gnueabi/image1-inittab/1.0-r0/temp/run.do_install.23229:
cannot create /mnt/drive3/yocto/jethro/poky/build/tmp/work/cortexa9-vfp-neon-poky-linux-gnueabi/image1-inittab/1.0-r0/image/etc/inittab:
Directory nonexistent
| WARNING: exit code 2 from a shell command.

It seems I cannot just append to inittab using the echo statements
because /etc/inittab is not part of this recipe. Must I duplicate
inittab first in my imageX-inittab.bb recipes?



More information about the yocto mailing list