Skip to contentSkip to conversation

recipe removing (some)contents of /etc

DISCUSSION Oliver 5 participants 10 messages May 14, 2015 – May 15, 2015

lore
Share & tools
lore

Oliver

author
#0 lore raw

Hello
I have the below's simple recipe(starting a script in sysV runlevel 2), but when I add it to the image with IMAGE_INSTALL += "canlogger"in my local.conf, most of the contents of /etc gets removed/overwritten making the system unbootable.

Does someone sees something wrong?

#####
DESCRIPTION = "Start CAN services logging"
SECTION = "examples"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" PR = "r0"

SRC_URI += "file://canlogger"

INITSCRIPT_NAME = "canlogger"
INITSCRIPT_PARAMS = "start 98 2 ."

do_install() {
    install -d ${D}${sysconfdir}/init.d/
    install -m 0755 ${WORKDIR}/canlogger ${D}${sysconfdir}/init.d/canlogger }

inherit update-rc.d
#####

#1 lore raw
Quoted 5 lines · Oliver

Hello

I have the below's simple recipe(starting a script in sysV runlevel 2), but when I add it to the image with IMAGE_INSTALL += "canlogger"
in my local.conf, most of the contents of /etc gets removed/overwritten making the system unbootable.

What image are you building?

You should probably use this line instead
CORE_IMAGE_EXTRA_INSTALL = "canlogger"

Quoted 25 lines

Does someone sees something wrong?

#####
DESCRIPTION = "Start CAN services logging"
SECTION = "examples"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" PR = "r0"

SRC_URI += "file://canlogger"

INITSCRIPT_NAME = "canlogger"
INITSCRIPT_PARAMS = "start 98 2 ."

do_install() {
     install -d ${D}${sysconfdir}/init.d/
     install -m 0755 ${WORKDIR}/canlogger ${D}${sysconfdir}/init.d/canlogger
}

inherit update-rc.d
#####

Signature · 4 lines
------------------------------------------------------------
Gary Thomas                 |  Consulting for the
MLB Associates              |    Embedded world
------------------------------------------------------------
#2 lore raw
In reply to Oliver

This seems to bite a lot of people (myself included). Change
IMAGE_INSTALL += “canlogger”
to
IMAGE_INSTALL_append = “ canlogger”
or possibly better
EXTRA_IMAGE_INSTALL_append = “ canlogger”

+= is evaluated immediately during parsing just like = and therefore behaves just like = if the variable did not yet exist. This then defeats the ?= assignment of IMAGE_INSTALL in your distro/.conf, image recipe, or core-image.bbclass.

The “override syntax” _append gets appended POST parsing and so does not preempt the ?= default assignment.

From: [email protected] [mailto:[email protected]] On Behalf Of Oliver
Sent: Thursday, May 14, 2015 10:27 AM
To: [email protected]
Subject: [yocto] recipe removing (some)contents of /etc

Hello

I have the below's simple recipe(starting a script in sysV runlevel 2), but when I add it to the image with IMAGE_INSTALL += "canlogger"
in my local.conf, most of the contents of /etc gets removed/overwritten making the system unbootable.

Does someone sees something wrong?

#####
DESCRIPTION = "Start CAN services logging"
SECTION = "examples"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302<file:///\\$%7bCOMMON_LICENSE_DIR%7d\MIT;md5=0835ade698e0bcf8506ecda2f7b4f302>" PR = "r0"

SRC_URI += "file://canlogger<file:///\\canlogger>"

INITSCRIPT_NAME = "canlogger"
INITSCRIPT_PARAMS = "start 98 2 ."

do_install() {
    install -d ${D}${sysconfdir}/init.d/
    install -m 0755 ${WORKDIR}/canlogger ${D}${sysconfdir}/init.d/canlogger
}

inherit update-rc.d
#####

________________________________

Notice to recipient: This email is meant for only the intended recipient of the transmission, and may be a communication privileged by law, subject to export control restrictions or that otherwise contains proprietary information. If you receive this email by mistake, please notify us immediately by replying to this message and then destroy it and do not review, disclose, copy or distribute it. Thank you in advance for your cooperation.

#3 lore raw
Quoted 7 lines · Virgil

This seems to bite a lot of people (myself included).

Change

IMAGE_INSTALL += “canlogger”

Quoted 7 lines

to

IMAGE_INSTALL_append = “ canlogger”

or possibly better

EXTRA_IMAGE_INSTALL_append = “ canlogger”

if you're putting this in local.conf, i'm pretty sure the preferred
syntax is just:

EXTRA_IMAGE_INSTALL = "canlogger"

no?

rday

Signature · 7 lines
========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                        http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================
#4 lore raw
Quoted 9 lines
Quoted 6 lines

Change
IMAGE_INSTALL += “canlogger”
to
IMAGE_INSTALL_append = “ canlogger”
or possibly better
EXTRA_IMAGE_INSTALL_append = “ canlogger”

if you're putting this in local.conf, i'm pretty sure the preferred syntax is just:
EXTRA_IMAGE_INSTALL = "canlogger"

Yes, I think rday is correct and the intended purpose of EXTRA_IMAGE_INSTALL is to be used entirely from local.conf and thereby avoid the += vs ?= vs _append issues I mentioned. At least EXTRA_IMAGE_FEATURES is listed this way in the Yocto manual.

To force an analogy, rday told you what side of the street is safe to walk on (use EXTRA_IMAGE_FEATURES) and I pointed out what dog bit you and how to pull his teeth (use _append). However, depending on your situation, I may not have gotten all of those teeth (there are other issues with machine/other overrides potentially influencing variable values).

________________________________

Notice to recipient: This email is meant for only the intended recipient of the transmission, and may be a communication privileged by law, subject to export control restrictions or that otherwise contains proprietary information. If you receive this email by mistake, please notify us immediately by replying to this message and then destroy it and do not review, disclose, copy or distribute it. Thank you in advance for your cooperation.

#5 lore raw
Quoted 11 lines · Virgil
Quoted 11 lines
Quoted 6 lines

Change
IMAGE_INSTALL += “canlogger”
to
IMAGE_INSTALL_append = “ canlogger”
or possibly better
EXTRA_IMAGE_INSTALL_append = “ canlogger”

if you're putting this in local.conf, i'm pretty sure the preferred syntax is just:

Quoted 7 lines

EXTRA_IMAGE_INSTALL = "canlogger"

Yes, I think rday is correct and the intended purpose of EXTRA_IMAGE_INSTALL is to be used entirely from local.conf and thereby avoid the += vs ?= vs _append issues I mentioned. At least EXTRA_IMAGE_FEATURES is listed this way in the Yocto manual.

There's no such thing as EXTRA_IMAGE_INSTALL, not in the core system anyway. There is CORE_IMAGE_EXTRA_INSTALL though which you can add to with += (since there aren't any default items in it, unlike IMAGE_INSTALL).

Cheers,
Paul

Signature · 2 lines
Paul Eggleton
Intel Open Source Technology Centre
#6 lore raw
Quoted 15 lines · Paul Eggleton
Quoted 14 lines · Virgil
Quoted 11 lines
Quoted 6 lines

Change
IMAGE_INSTALL += “canlogger”
to
IMAGE_INSTALL_append = “ canlogger”
or possibly better
EXTRA_IMAGE_INSTALL_append = “ canlogger”

if you're putting this in local.conf, i'm pretty sure the preferred syntax is just:

EXTRA_IMAGE_INSTALL = "canlogger"

Quoted 8 lines
Quoted 4 lines

Yes, I think rday is correct and the intended purpose of EXTRA_IMAGE_INSTALL is to be used entirely from local.conf and thereby avoid the += vs ?= vs _append issues I mentioned. At least EXTRA_IMAGE_FEATURES is listed this way in the Yocto manual.

There's no such thing as EXTRA_IMAGE_INSTALL, not in the core system anyway. There is CORE_IMAGE_EXTRA_INSTALL though which you can add to with += (since there aren't any default items in it, unlike IMAGE_INSTALL).

ack, you're right, i was thinking of EXTRA_IMAGE_FEATURES, i think.

rday

Signature · 7 lines
========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                        http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================
author
#7 lore raw
In reply to Paul Eggleton
Quoted 3 lines

What image are you building?

it is a Freescale iMX6 target, the image name is exactly a fsl-image-qt5 with a playground layer

Quoted 5 lines
Quoted 5 lines

You should probably use this line instead
CORE_IMAGE_EXTRA_INSTALL = "canlogger"

There is CORE_IMAGE_EXTRA_INSTALL though which you can add to with += (since there aren't any default items in it, unlike IMAGE_INSTALL).

My understanding these are the preferred options

Quoted 1 line
Quoted 1 line
Quoted 1 line

IMAGE_INSTALL_append = “ canlogger”

But would this still do? (just for my self-learning)

I have other recipes(not *.bbappend) which end up in the image without adding any explicit statement, just the fact of being part of the layer includes them, is there any explanation?

I am still missing something to get the whole picture...

Thanks a lot for the detailed explanations
best Regards
Oliver

#8 lore raw
Quoted 13 lines · Oliver
Quoted 3 lines

What image are you building?

it is a Freescale iMX6 target, the image name is exactly a fsl-image-qt5 with a playground layer

Quoted 5 lines
Quoted 5 lines

You should probably use this line instead
CORE_IMAGE_EXTRA_INSTALL = "canlogger"

There is CORE_IMAGE_EXTRA_INSTALL though which you can add to with += (since there aren't any default items in it, unlike IMAGE_INSTALL).

Quoted 5 lines

My understanding these are the preferred options

Quoted 1 line
Quoted 1 line
Quoted 1 line

IMAGE_INSTALL_append = “ canlogger”

But would this still do? (just for my self-learning)

The recommended way is to use CORE_IMAGE_EXTRA_INSTALL. Why would you want to use some other method which might not work?

Quoted 2 lines

I have other recipes(not *.bbappend) which end up in the image without adding any explicit statement, just the fact of being part of the layer includes them, is there any explanation?

Something must cause them to be included, either explicitly or implicitly.

What package(s) in particular are you asking about?

You can find out why recipes are included, etc, by looking at the output from bitbake. Try this:
% bitbake fsl-image-qt5 -g -u depexp

This will bring up a "dependency explorer" where you can see what depends on what (directly at build time or implicitly at runtime).

Quoted 7 lines

I am still missing something to get the whole picture...

Thanks a lot for the detailed explanations
best Regards
Oliver

Signature · 4 lines
------------------------------------------------------------
Gary Thomas                 |  Consulting for the
MLB Associates              |    Embedded world
------------------------------------------------------------
author
#9 lore raw
Quoted 3 lines

The recommended way is to use CORE_IMAGE_EXTRA_INSTALL.

Ok, this one worked! thanks

Quoted 2 lines
Quoted 1 line

I have other recipes(not *.bbappend) which end up in the image without adding any explicit statement, just the fact of being part of the layer includes them, is there any explanation?

Something must cause them to be included, either explicitly or implicitly.

Therefore if it is included implicitly involves dependencies or requirements by other recipes.

Quoted 1 line

What package(s) in particular are you asking about?

Both components were simple recipes created by my own.

I have discovered the root of my confusion, I had a "Hello World" recipe in my layer, which was in the image, hence I thought It was included implicitly.

But I was wrong, /usr/bin/hello was already in the default image, some other layer/recipe adds it.

Whats the experts' way to find out the origin of a deployed file?

Hopefully there is a faster way than searching whole $BUILD/tmp/work

Thanks again

Signature · 10 lines
------------------------------------------------------------
Gary Thomas                 |  Consulting for the
MLB Associates              |    Embedded world

------------------------------------------------------------
-- 
_______________________________________________
yocto mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/yocto