All of lore.kernel.org
 help / color / mirror / Atom feed
* recipe to clean up files from rootfs
@ 2017-12-11 14:18 Sherif Omran
  2017-12-11 14:57 ` Alexander Kanavin
  2017-12-12 12:58 ` Mike Looijmans
  0 siblings, 2 replies; 13+ messages in thread
From: Sherif Omran @ 2017-12-11 14:18 UTC (permalink / raw)
  To: Yocto discussion list

[-- Attachment #1: Type: text/plain, Size: 182 bytes --]

i want to create a recipe to clean some files from the rootfile system, but
i don't know how to let this recipe run the last one before building the
rootfile system.

any idea?

[-- Attachment #2: Type: text/html, Size: 224 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: recipe to clean up files from rootfs
  2017-12-11 14:18 recipe to clean up files from rootfs Sherif Omran
@ 2017-12-11 14:57 ` Alexander Kanavin
  2017-12-12 12:58 ` Mike Looijmans
  1 sibling, 0 replies; 13+ messages in thread
From: Alexander Kanavin @ 2017-12-11 14:57 UTC (permalink / raw)
  To: Sherif Omran, Yocto discussion list

On 12/11/2017 04:18 PM, Sherif Omran wrote:
> i want to create a recipe to clean some files from the rootfile system, 
> but i don't know how to let this recipe run the last one before building 
> the rootfile system.

Have a look at ROOTFS_POSTPROCESS_COMMAND.

Alex


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: recipe to clean up files from rootfs
  2017-12-11 14:18 recipe to clean up files from rootfs Sherif Omran
  2017-12-11 14:57 ` Alexander Kanavin
@ 2017-12-12 12:58 ` Mike Looijmans
  2017-12-13  6:14   ` Sherif Omran
  1 sibling, 1 reply; 13+ messages in thread
From: Mike Looijmans @ 2017-12-12 12:58 UTC (permalink / raw)
  To: yocto

On 11-12-17 15:18, Sherif Omran wrote:
> i want to create a recipe to clean some files from the rootfile system, but i 
> don't know how to let this recipe run the last one before building the 
> rootfile system.

You can use ROOTFS_POSTPROCESS_COMMAND in your image recipe to do some 
last-minute filesystem cleanup.

However, in most cases it's much better to determine what recipe puts the 
files there and modify the recipe or remove the package. It would help a lot 
if you would reveal what files you want to remove and why.


Kind regards,

Mike Looijmans
System Expert

TOPIC Products
Materiaalweg 4, NL-5681 RJ Best
Postbus 440, NL-5680 AK Best
Telefoon: +31 (0) 499 33 69 79
E-mail: mike.looijmans@topicproducts.com
Website: www.topicproducts.com

Please consider the environment before printing this e-mail





^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: recipe to clean up files from rootfs
  2017-12-12 12:58 ` Mike Looijmans
@ 2017-12-13  6:14   ` Sherif Omran
  2017-12-13  6:22     ` Mike Looijmans
  0 siblings, 1 reply; 13+ messages in thread
From: Sherif Omran @ 2017-12-13  6:14 UTC (permalink / raw)
  To: Mike Looijmans; +Cc: Yocto discussion list

[-- Attachment #1: Type: text/plain, Size: 1296 bytes --]

hi Mike,
i could not get it to work, if you have a recipe that works, please share
it. ROOTFS_POSTPROCESS_COMMAND seems to be buggy.

thank you

>
>
On Tue, Dec 12, 2017 at 1:58 PM, Mike Looijmans <mike.looijmans@topic.nl>
wrote:

> On 11-12-17 15:18, Sherif Omran wrote:
>
>> i want to create a recipe to clean some files from the rootfile system,
>> but i don't know how to let this recipe run the last one before building
>> the rootfile system.
>>
>
> You can use ROOTFS_POSTPROCESS_COMMAND in your image recipe to do some
> last-minute filesystem cleanup.
>
> However, in most cases it's much better to determine what recipe puts the
> files there and modify the recipe or remove the package. It would help a
> lot if you would reveal what files you want to remove and why.
>
>
> Kind regards,
>
> Mike Looijmans
> System Expert
>
> TOPIC Products
> Materiaalweg 4, NL-5681 RJ Best
> Postbus 440, NL-5680 AK Best
> Telefoon: +31 (0) 499 33 69 79
> E-mail: mike.looijmans@topicproducts.com
> Website: www.topicproducts.com
>
> Please consider the environment before printing this e-mail
>
>
>
> --
> _______________________________________________
> yocto mailing list
> yocto@yoctoproject.org
> https://lists.yoctoproject.org/listinfo/yocto
>

[-- Attachment #2: Type: text/html, Size: 2416 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: recipe to clean up files from rootfs
  2017-12-13  6:14   ` Sherif Omran
@ 2017-12-13  6:22     ` Mike Looijmans
  2017-12-13  8:10       ` Sherif Omran
  0 siblings, 1 reply; 13+ messages in thread
From: Mike Looijmans @ 2017-12-13  6:22 UTC (permalink / raw)
  To: Sherif Omran; +Cc: Yocto discussion list

Well, start by sharing yours first.

Be careful when naming your shell routine, sometimes OE considers parts behind 
the underscore as overrides and then it cannot find it.


On 13-12-17 07:14, Sherif Omran wrote:
> hi Mike,
> i could not get it to work, if you have a recipe that works, please share it. 
> ROOTFS_POSTPROCESS_COMMAND seems to be buggy.
> 
> thank you
> 
> 
> 
> On Tue, Dec 12, 2017 at 1:58 PM, Mike Looijmans <mike.looijmans@topic.nl 
> <mailto:mike.looijmans@topic.nl>> wrote:
> 
>     On 11-12-17 15:18, Sherif Omran wrote:
> 
>         i want to create a recipe to clean some files from the rootfile
>         system, but i don't know how to let this recipe run the last one
>         before building the rootfile system.
> 
> 
>     You can use ROOTFS_POSTPROCESS_COMMAND in your image recipe to do some
>     last-minute filesystem cleanup.
> 
>     However, in most cases it's much better to determine what recipe puts the
>     files there and modify the recipe or remove the package. It would help a
>     lot if you would reveal what files you want to remove and why.
> 
> 
>     Kind regards,
> 
>     Mike Looijmans
>     System Expert
> 
>     TOPIC Products
>     Materiaalweg 4, NL-5681 RJ Best
>     Postbus 440, NL-5680 AK Best
>     Telefoon: +31 (0) 499 33 69 79 <tel:%2B31%20%280%29%20499%2033%2069%2079>
>     E-mail: mike.looijmans@topicproducts.com
>     <mailto:mike.looijmans@topicproducts.com>
>     Website: www.topicproducts.com <http://www.topicproducts.com>
> 
>     Please consider the environment before printing this e-mail
> 
> 
> 
>     -- 
>     

Kind regards,

Mike Looijmans
System Expert

TOPIC Products
Materiaalweg 4, NL-5681 RJ Best
Postbus 440, NL-5680 AK Best
Telefoon: +31 (0) 499 33 69 79
E-mail: mike.looijmans@topicproducts.com
Website: www.topicproducts.com

Please consider the environment before printing this e-mail



_______________________________________________
>     yocto mailing list
>     yocto@yoctoproject.org <mailto:yocto@yoctoproject.org>
>     https://lists.yoctoproject.org/listinfo/yocto
>     <https://lists.yoctoproject.org/listinfo/yocto>
> 
> 



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: recipe to clean up files from rootfs
  2017-12-13  6:22     ` Mike Looijmans
@ 2017-12-13  8:10       ` Sherif Omran
  2017-12-13 13:03         ` Mike Looijmans
  0 siblings, 1 reply; 13+ messages in thread
From: Sherif Omran @ 2017-12-13  8:10 UTC (permalink / raw)
  To: Mike Looijmans; +Cc: Yocto discussion list

[-- Attachment #1: Type: text/plain, Size: 3229 bytes --]

here is my recipe, the aim was to remove some files from the init.d folder
and tweek before creating the image

#
# This file was derived from the 'Hello World!' example recipe in the
# Yocto Project Development Manual.
#

SUMMARY = "This recipe removes any missing files from the filesystem before
finalinzing it"
SECTION = "base"
LICENSE = "MIT"
LIC_FILES_CHKSUM =
"file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"

#SRC_URI = "file://*"

S = "${WORKDIR}"
BB_STRICT_CHECKSUM ="0"
ALLOW_EMPTY_${PN}="1"


#IMAGE_INSTALL = "packagegroup-core-boot packagegroup-base-extended
${CORE_IMAGE_EXTRA_INSTALL}"
#IMAGE_INSTALL = "${CORE_IMAGE}"

#inherit core-image

my_postprocess_function() {
 rm -r ${D}${bindir}/init.d/psplash.sh
}

ROOTFS_POSTPROCESS_COMMAND += "my_postprocess_function; "

On Wed, Dec 13, 2017 at 7:22 AM, Mike Looijmans <mike.looijmans@topic.nl>
wrote:

> Well, start by sharing yours first.
>
> Be careful when naming your shell routine, sometimes OE considers parts
> behind the underscore as overrides and then it cannot find it.
>
>
> On 13-12-17 07:14, Sherif Omran wrote:
>
>> hi Mike,
>> i could not get it to work, if you have a recipe that works, please share
>> it. ROOTFS_POSTPROCESS_COMMAND seems to be buggy.
>>
>> thank you
>>
>>
>>
>> On Tue, Dec 12, 2017 at 1:58 PM, Mike Looijmans <mike.looijmans@topic.nl
>> <mailto:mike.looijmans@topic.nl>> wrote:
>>
>>     On 11-12-17 15:18, Sherif Omran wrote:
>>
>>         i want to create a recipe to clean some files from the rootfile
>>         system, but i don't know how to let this recipe run the last one
>>         before building the rootfile system.
>>
>>
>>     You can use ROOTFS_POSTPROCESS_COMMAND in your image recipe to do some
>>     last-minute filesystem cleanup.
>>
>>     However, in most cases it's much better to determine what recipe puts
>> the
>>     files there and modify the recipe or remove the package. It would
>> help a
>>     lot if you would reveal what files you want to remove and why.
>>
>>
>>     Kind regards,
>>
>>     Mike Looijmans
>>     System Expert
>>
>>     TOPIC Products
>>     Materiaalweg 4, NL-5681 RJ Best
>>     Postbus 440, NL-5680 AK Best
>>     Telefoon: +31 (0) 499 33 69 79 <tel:%2B31%20%280%29%20499%203
>> 3%2069%2079>
>>     E-mail: mike.looijmans@topicproducts.com
>>     <mailto:mike.looijmans@topicproducts.com>
>>     Website: www.topicproducts.com <http://www.topicproducts.com>
>>
>>     Please consider the environment before printing this e-mail
>>
>>
>>
>>     --
>>
>
> Kind regards,
>
> Mike Looijmans
> System Expert
>
> TOPIC Products
> Materiaalweg 4, NL-5681 RJ Best
> Postbus 440, NL-5680 AK Best
> Telefoon: +31 (0) 499 33 69 79
> E-mail: mike.looijmans@topicproducts.com
> Website: www.topicproducts.com
>
> Please consider the environment before printing this e-mail
>
>
>
> _______________________________________________
>
>>     yocto mailing list
>>     yocto@yoctoproject.org <mailto:yocto@yoctoproject.org>
>>     https://lists.yoctoproject.org/listinfo/yocto
>>     <https://lists.yoctoproject.org/listinfo/yocto>
>>
>>
>>
>

[-- Attachment #2: Type: text/html, Size: 5344 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: recipe to clean up files from rootfs
  2017-12-13  8:10       ` Sherif Omran
@ 2017-12-13 13:03         ` Mike Looijmans
  2017-12-14  7:06           ` Sherif Omran
  0 siblings, 1 reply; 13+ messages in thread
From: Mike Looijmans @ 2017-12-13 13:03 UTC (permalink / raw)
  To: Sherif Omran; +Cc: Yocto discussion list

${D} won't work here, grep on ROOTFS_POSTPROCESS_COMMAND for recipes that get 
it right.

And, much much much better would be to just not install psplash into your image!

On 13-12-17 09:10, Sherif Omran wrote:
> here is my recipe, the aim was to remove some files from the init.d folder and 
> tweek before creating the image
> 
> #
> # This file was derived from the 'Hello World!' example recipe in the
> # Yocto Project Development Manual.
> #
> 
> SUMMARY = "This recipe removes any missing files from the filesystem before 
> finalinzing it"
> SECTION = "base"
> LICENSE = "MIT"
> LIC_FILES_CHKSUM = 
> "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
> 
> #SRC_URI = "file://*"
> 
> S = "${WORKDIR}"
> BB_STRICT_CHECKSUM ="0"
> ALLOW_EMPTY_${PN}="1"
> 
> 
> #IMAGE_INSTALL = "packagegroup-core-boot packagegroup-base-extended 
> ${CORE_IMAGE_EXTRA_INSTALL}"
> #IMAGE_INSTALL = "${CORE_IMAGE}"
> 
> #inherit core-image
> 
> my_postprocess_function() {
>   rm -r ${D}${bindir}/init.d/psplash.sh
> }
> 
> ROOTFS_POSTPROCESS_COMMAND += "my_postprocess_function; "
> 
> On Wed, Dec 13, 2017 at 7:22 AM, Mike Looijmans <mike.looijmans@topic.nl 
> <mailto:mike.looijmans@topic.nl>> wrote:
> 
>     Well, start by sharing yours first.
> 
>     Be careful when naming your shell routine, sometimes OE considers parts
>     behind the underscore as overrides and then it cannot find it.
> 
> 
>     On 13-12-17 07:14, Sherif Omran wrote:
> 
>         hi Mike,
>         i could not get it to work, if you have a recipe that works, please
>         share it. ROOTFS_POSTPROCESS_COMMAND seems to be buggy.
> 
>         thank you
> 
> 
> 
>         On Tue, Dec 12, 2017 at 1:58 PM, Mike Looijmans
>         <mike.looijmans@topic.nl <mailto:mike.looijmans@topic.nl>
>         <mailto:mike.looijmans@topic.nl <mailto:mike.looijmans@topic.nl>>> wrote:
> 
>              On 11-12-17 15:18, Sherif Omran wrote:
> 
>                  i want to create a recipe to clean some files from the rootfile
>                  system, but i don't know how to let this recipe run the last one
>                  before building the rootfile system.
> 
> 
>              You can use ROOTFS_POSTPROCESS_COMMAND in your image recipe to do
>         some
>              last-minute filesystem cleanup.
> 
>              However, in most cases it's much better to determine what recipe
>         puts the
>              files there and modify the recipe or remove the package. It would
>         help a
>              lot if you would reveal what files you want to remove and why.
> 
> 
>              Kind regards,
> 
>              Mike Looijmans
>              System Expert
> 
>              TOPIC Products
>              Materiaalweg 4, NL-5681 RJ Best
>              Postbus 440, NL-5680 AK Best
>              Telefoon: +31 (0) 499 33 69 79
>         <tel:%2B31%20%280%29%20499%2033%2069%2079>
>         <tel:%2B31%20%280%29%20499%2033%2069%2079>
>              E-mail: mike.looijmans@topicproducts.com
>         <mailto:mike.looijmans@topicproducts.com>
>              <mailto:mike.looijmans@topicproducts.com
>         <mailto:mike.looijmans@topicproducts.com>>
>              Website: www.topicproducts.com <http://www.topicproducts.com>
>         <http://www.topicproducts.com>
> 
>              Please consider the environment before printing this e-mail
> 
> 
> 
>              --
> 
> 
>     Kind regards,
> 
>     Mike Looijmans
>     System Expert
> 
>     TOPIC Products
>     Materiaalweg 4, NL-5681 RJ Best
>     Postbus 440, NL-5680 AK Best
>     Telefoon: +31 (0) 499 33 69 79 <tel:%2B31%20%280%29%20499%2033%2069%2079>
>     E-mail: mike.looijmans@topicproducts.com
>     <mailto:mike.looijmans@topicproducts.com>
>     Website: www.topicproducts.com <http://www.topicproducts.com>
> 
>     Please consider the environment before printing this e-mail
> 
> 
> 
>     

Kind regards,

Mike Looijmans
System Expert

TOPIC Products
Materiaalweg 4, NL-5681 RJ Best
Postbus 440, NL-5680 AK Best
Telefoon: +31 (0) 499 33 69 79
E-mail: mike.looijmans@topicproducts.com
Website: www.topicproducts.com

Please consider the environment before printing this e-mail



_______________________________________________
> 
>              yocto mailing list
>         yocto@yoctoproject.org <mailto:yocto@yoctoproject.org>
>         <mailto:yocto@yoctoproject.org <mailto:yocto@yoctoproject.org>>
>         https://lists.yoctoproject.org/listinfo/yocto
>         <https://lists.yoctoproject.org/listinfo/yocto>
>              <https://lists.yoctoproject.org/listinfo/yocto
>         <https://lists.yoctoproject.org/listinfo/yocto>>
> 
> 
> 
> 



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: recipe to clean up files from rootfs
  2017-12-13 13:03         ` Mike Looijmans
@ 2017-12-14  7:06           ` Sherif Omran
  2017-12-14  7:17             ` Martin Hundebøll
  2017-12-14  7:57             ` Andre McCurdy
  0 siblings, 2 replies; 13+ messages in thread
From: Sherif Omran @ 2017-12-14  7:06 UTC (permalink / raw)
  To: Mike Looijmans; +Cc: Yocto discussion list

[-- Attachment #1: Type: text/plain, Size: 5310 bytes --]

Here is my recipe, it runs suceeds but does not delete the files

mypostprocesfunction() {
rm -r ${IMAGE_ROOTFS}/etc/init.d/psplash.sh
rm -r ${IMAGE_ROOTFS}/usr/bin/psplash*
}

ROOTFS_POSTPROCESS_COMMAND += "mypostprocessfunction; "

On Wed, Dec 13, 2017 at 2:03 PM, Mike Looijmans <mike.looijmans@topic.nl>
wrote:

> ${D} won't work here, grep on ROOTFS_POSTPROCESS_COMMAND for recipes that
> get it right.
>
> And, much much much better would be to just not install psplash into your
> image!
>
> On 13-12-17 09:10, Sherif Omran wrote:
>
>> here is my recipe, the aim was to remove some files from the init.d
>> folder and tweek before creating the image
>>
>> #
>> # This file was derived from the 'Hello World!' example recipe in the
>> # Yocto Project Development Manual.
>> #
>>
>> SUMMARY = "This recipe removes any missing files from the filesystem
>> before finalinzing it"
>> SECTION = "base"
>> LICENSE = "MIT"
>> LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/
>> MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
>>
>> #SRC_URI = "file://*"
>>
>> S = "${WORKDIR}"
>> BB_STRICT_CHECKSUM ="0"
>> ALLOW_EMPTY_${PN}="1"
>>
>>
>> #IMAGE_INSTALL = "packagegroup-core-boot packagegroup-base-extended
>> ${CORE_IMAGE_EXTRA_INSTALL}"
>> #IMAGE_INSTALL = "${CORE_IMAGE}"
>>
>> #inherit core-image
>>
>> my_postprocess_function() {
>>   rm -r ${D}${bindir}/init.d/psplash.sh
>> }
>>
>> ROOTFS_POSTPROCESS_COMMAND += "my_postprocess_function; "
>>
>> On Wed, Dec 13, 2017 at 7:22 AM, Mike Looijmans <mike.looijmans@topic.nl
>> <mailto:mike.looijmans@topic.nl>> wrote:
>>
>>     Well, start by sharing yours first.
>>
>>     Be careful when naming your shell routine, sometimes OE considers
>> parts
>>     behind the underscore as overrides and then it cannot find it.
>>
>>
>>     On 13-12-17 07:14, Sherif Omran wrote:
>>
>>         hi Mike,
>>         i could not get it to work, if you have a recipe that works,
>> please
>>         share it. ROOTFS_POSTPROCESS_COMMAND seems to be buggy.
>>
>>         thank you
>>
>>
>>
>>         On Tue, Dec 12, 2017 at 1:58 PM, Mike Looijmans
>>         <mike.looijmans@topic.nl <mailto:mike.looijmans@topic.nl>
>>         <mailto:mike.looijmans@topic.nl <mailto:mike.looijmans@topic.nl>>>
>> wrote:
>>
>>              On 11-12-17 15:18, Sherif Omran wrote:
>>
>>                  i want to create a recipe to clean some files from the
>> rootfile
>>                  system, but i don't know how to let this recipe run the
>> last one
>>                  before building the rootfile system.
>>
>>
>>              You can use ROOTFS_POSTPROCESS_COMMAND in your image recipe
>> to do
>>         some
>>              last-minute filesystem cleanup.
>>
>>              However, in most cases it's much better to determine what
>> recipe
>>         puts the
>>              files there and modify the recipe or remove the package. It
>> would
>>         help a
>>              lot if you would reveal what files you want to remove and
>> why.
>>
>>
>>              Kind regards,
>>
>>              Mike Looijmans
>>              System Expert
>>
>>              TOPIC Products
>>              Materiaalweg 4, NL-5681 RJ Best
>>              Postbus 440, NL-5680 AK Best
>>              Telefoon: +31 (0) 499 33 69 79
>>         <tel:%2B31%20%280%29%20499%2033%2069%2079>
>>         <tel:%2B31%20%280%29%20499%2033%2069%2079>
>>              E-mail: mike.looijmans@topicproducts.com
>>         <mailto:mike.looijmans@topicproducts.com>
>>              <mailto:mike.looijmans@topicproducts.com
>>
>>         <mailto:mike.looijmans@topicproducts.com>>
>>              Website: www.topicproducts.com <http://www.topicproducts.com
>> >
>>         <http://www.topicproducts.com>
>>
>>              Please consider the environment before printing this e-mail
>>
>>
>>
>>              --
>>
>>
>>     Kind regards,
>>
>>     Mike Looijmans
>>     System Expert
>>
>>     TOPIC Products
>>     Materiaalweg 4, NL-5681 RJ Best
>>     Postbus 440, NL-5680 AK Best
>>     Telefoon: +31 (0) 499 33 69 79 <tel:%2B31%20%280%29%20499%203
>> 3%2069%2079>
>>     E-mail: mike.looijmans@topicproducts.com
>>     <mailto:mike.looijmans@topicproducts.com>
>>     Website: www.topicproducts.com <http://www.topicproducts.com>
>>
>>     Please consider the environment before printing this e-mail
>>
>>
>>
>>
>>
>
> Kind regards,
>
> Mike Looijmans
> System Expert
>
> TOPIC Products
> Materiaalweg 4, NL-5681 RJ Best
> Postbus 440, NL-5680 AK Best
> Telefoon: +31 (0) 499 33 69 79
> E-mail: mike.looijmans@topicproducts.com
> Website: www.topicproducts.com
>
> Please consider the environment before printing this e-mail
>
>
>
> _______________________________________________
>
>>
>>              yocto mailing list
>>         yocto@yoctoproject.org <mailto:yocto@yoctoproject.org>
>>         <mailto:yocto@yoctoproject.org <mailto:yocto@yoctoproject.org>>
>>         https://lists.yoctoproject.org/listinfo/yocto
>>         <https://lists.yoctoproject.org/listinfo/yocto>
>>              <https://lists.yoctoproject.org/listinfo/yocto
>>         <https://lists.yoctoproject.org/listinfo/yocto>>
>>
>>
>>
>>
>>
>

[-- Attachment #2: Type: text/html, Size: 9061 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: recipe to clean up files from rootfs
  2017-12-14  7:06           ` Sherif Omran
@ 2017-12-14  7:17             ` Martin Hundebøll
  2017-12-14  8:11               ` Sherif Omran
  2017-12-14  7:57             ` Andre McCurdy
  1 sibling, 1 reply; 13+ messages in thread
From: Martin Hundebøll @ 2017-12-14  7:17 UTC (permalink / raw)
  To: Sherif Omran, Mike Looijmans; +Cc: Yocto discussion list

Hi Sherif,

On 2017-12-14 08:06, Sherif Omran wrote:
> Here is my recipe, it runs suceeds but does not delete the files
> 
> mypostprocesfunction() {
> rm -r ${IMAGE_ROOTFS}/etc/init.d/psplash.sh
> rm -r ${IMAGE_ROOTFS}/usr/bin/psplash*
> }
> 
> ROOTFS_POSTPROCESS_COMMAND += "mypostprocessfunction; "

Unless you did a copy-paste error, there's a typo in the function name:
mypostprocesfunction
mypostprocessfunction

// Martin

> 
> On Wed, Dec 13, 2017 at 2:03 PM, Mike Looijmans <mike.looijmans@topic.nl 
> <mailto:mike.looijmans@topic.nl>> wrote:
> 
>     ${D} won't work here, grep on ROOTFS_POSTPROCESS_COMMAND for recipes
>     that get it right.
> 
>     And, much much much better would be to just not install psplash into
>     your image!
> 
>     On 13-12-17 09:10, Sherif Omran wrote:
> 
>         here is my recipe, the aim was to remove some files from the
>         init.d folder and tweek before creating the image
> 
>         #
>         # This file was derived from the 'Hello World!' example recipe
>         in the
>         # Yocto Project Development Manual.
>         #
> 
>         SUMMARY = "This recipe removes any missing files from the
>         filesystem before finalinzing it"
>         SECTION = "base"
>         LICENSE = "MIT"
>         LIC_FILES_CHKSUM =
>         "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
> 
>         #SRC_URI = "file://*"
> 
>         S = "${WORKDIR}"
>         BB_STRICT_CHECKSUM ="0"
>         ALLOW_EMPTY_${PN}="1"
> 
> 
>         #IMAGE_INSTALL = "packagegroup-core-boot
>         packagegroup-base-extended ${CORE_IMAGE_EXTRA_INSTALL}"
>         #IMAGE_INSTALL = "${CORE_IMAGE}"
> 
>         #inherit core-image
> 
>         my_postprocess_function() {
>            rm -r ${D}${bindir}/init.d/psplash.sh
>         }
> 
>         ROOTFS_POSTPROCESS_COMMAND += "my_postprocess_function; "
> 
>         On Wed, Dec 13, 2017 at 7:22 AM, Mike Looijmans
>         <mike.looijmans@topic.nl <mailto:mike.looijmans@topic.nl>
>         <mailto:mike.looijmans@topic.nl
>         <mailto:mike.looijmans@topic.nl>>> wrote:
> 
>              Well, start by sharing yours first.
> 
>              Be careful when naming your shell routine, sometimes OE
>         considers parts
>              behind the underscore as overrides and then it cannot find it.
> 
> 
>              On 13-12-17 07:14, Sherif Omran wrote:
> 
>                  hi Mike,
>                  i could not get it to work, if you have a recipe that
>         works, please
>                  share it. ROOTFS_POSTPROCESS_COMMAND seems to be buggy.
> 
>                  thank you
> 
> 
> 
>                  On Tue, Dec 12, 2017 at 1:58 PM, Mike Looijmans
>                  <mike.looijmans@topic.nl
>         <mailto:mike.looijmans@topic.nl> <mailto:mike.looijmans@topic.nl
>         <mailto:mike.looijmans@topic.nl>>
>                  <mailto:mike.looijmans@topic.nl
>         <mailto:mike.looijmans@topic.nl> <mailto:mike.looijmans@topic.nl
>         <mailto:mike.looijmans@topic.nl>>>> wrote:
> 
>                       On 11-12-17 15:18, Sherif Omran wrote:
> 
>                           i want to create a recipe to clean some files
>         from the rootfile
>                           system, but i don't know how to let this
>         recipe run the last one
>                           before building the rootfile system.
> 
> 
>                       You can use ROOTFS_POSTPROCESS_COMMAND in your
>         image recipe to do
>                  some
>                       last-minute filesystem cleanup.
> 
>                       However, in most cases it's much better to
>         determine what recipe
>                  puts the
>                       files there and modify the recipe or remove the
>         package. It would
>                  help a
>                       lot if you would reveal what files you want to
>         remove and why.
> 
> 
>                       Kind regards,
> 
>                       Mike Looijmans
>                       System Expert
> 
>                       TOPIC Products
>                       Materiaalweg 4, NL-5681 RJ Best
>                       Postbus 440, NL-5680 AK Best
>                       Telefoon: +31 (0) 499 33 69 79
>         <tel:%2B31%20%280%29%20499%2033%2069%2079>
>                  <tel:%2B31%20%280%29%20499%2033%2069%2079>
>                  <tel:%2B31%20%280%29%20499%2033%2069%2079>
>                       E-mail: mike.looijmans@topicproducts.com
>         <mailto:mike.looijmans@topicproducts.com>
>                  <mailto:mike.looijmans@topicproducts.com
>         <mailto:mike.looijmans@topicproducts.com>>
>                       <mailto:mike.looijmans@topicproducts.com
>         <mailto:mike.looijmans@topicproducts.com>
> 
>                  <mailto:mike.looijmans@topicproducts.com
>         <mailto:mike.looijmans@topicproducts.com>>>
>                       Website: www.topicproducts.com
>         <http://www.topicproducts.com> <http://www.topicproducts.com>
>                  <http://www.topicproducts.com>
> 
>                       Please consider the environment before printing
>         this e-mail
> 
> 
> 
>                       --
> 
> 
>              Kind regards,
> 
>              Mike Looijmans
>              System Expert
> 
>              TOPIC Products
>              Materiaalweg 4, NL-5681 RJ Best
>              Postbus 440, NL-5680 AK Best
>              Telefoon: +31 (0) 499 33 69 79
>         <tel:%2B31%20%280%29%20499%2033%2069%2079>
>         <tel:%2B31%20%280%29%20499%2033%2069%2079>
>              E-mail: mike.looijmans@topicproducts.com
>         <mailto:mike.looijmans@topicproducts.com>
>              <mailto:mike.looijmans@topicproducts.com
>         <mailto:mike.looijmans@topicproducts.com>>
>              Website: www.topicproducts.com
>         <http://www.topicproducts.com> <http://www.topicproducts.com>
> 
>              Please consider the environment before printing this e-mail
> 
> 
> 
> 
> 
>     Kind regards,
> 
>     Mike Looijmans
>     System Expert
> 
>     TOPIC Products
>     Materiaalweg 4, NL-5681 RJ Best
>     Postbus 440, NL-5680 AK Best
>     Telefoon: +31 (0) 499 33 69 79
>     <tel:%2B31%20%280%29%20499%2033%2069%2079>
>     E-mail: mike.looijmans@topicproducts.com
>     <mailto:mike.looijmans@topicproducts.com>
>     Website: www.topicproducts.com <http://www.topicproducts.com>
> 
>     Please consider the environment before printing this e-mail
> 
> 
> 
>     _______________________________________________
> 
> 
>                       yocto mailing list
>         yocto@yoctoproject.org <mailto:yocto@yoctoproject.org>
>         <mailto:yocto@yoctoproject.org <mailto:yocto@yoctoproject.org>>
>                  <mailto:yocto@yoctoproject.org
>         <mailto:yocto@yoctoproject.org> <mailto:yocto@yoctoproject.org
>         <mailto:yocto@yoctoproject.org>>>
>         https://lists.yoctoproject.org/listinfo/yocto
>         <https://lists.yoctoproject.org/listinfo/yocto>
>                  <https://lists.yoctoproject.org/listinfo/yocto
>         <https://lists.yoctoproject.org/listinfo/yocto>>
>                       <https://lists.yoctoproject.org/listinfo/yocto
>         <https://lists.yoctoproject.org/listinfo/yocto>
>                  <https://lists.yoctoproject.org/listinfo/yocto
>         <https://lists.yoctoproject.org/listinfo/yocto>>>
> 
> 
> 
> 
> 
> 
> 
> 

-- 
MARTIN HUNDEBØLL, Prevas A/S
Software Developer

Hedeager 3, DK-8200 Aarhus N
Phone +45 87438070
Mobile +45 25562438
Martin.Hundeboll@prevas.dk
www.prevas.com


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: recipe to clean up files from rootfs
  2017-12-14  7:06           ` Sherif Omran
  2017-12-14  7:17             ` Martin Hundebøll
@ 2017-12-14  7:57             ` Andre McCurdy
  1 sibling, 0 replies; 13+ messages in thread
From: Andre McCurdy @ 2017-12-14  7:57 UTC (permalink / raw)
  To: Sherif Omran; +Cc: Yocto discussion list

On Wed, Dec 13, 2017 at 11:06 PM, Sherif Omran
<sherifomran2000@gmail.com> wrote:
> Here is my recipe, it runs suceeds but does not delete the files
>
> mypostprocesfunction() {
> rm -r ${IMAGE_ROOTFS}/etc/init.d/psplash.sh
> rm -r ${IMAGE_ROOTFS}/usr/bin/psplash*
> }
>
> ROOTFS_POSTPROCESS_COMMAND += "mypostprocessfunction; "
>

I think you are fundamentally misunderstanding how recipes work. At a
very high level, recipes are used to compile sources into installable
packages (e.g. ipk or rpm files) and then (as a separate step) an
image recipe creates the rootfs by unpacking a set of installable
packages.

One recipe can depend on the output of another (e.g. an image recipe
depends on the installable packages created by other recipes) but each
recipe has it's own execution environment. You can't expect to write a
recipe which changes the behaviour of another recipe, so writing a new
recipe to remove some files from the rootfs created by the image
recipe is fundamentally wrong. It's never going to work, even if you
fix every typo.

As suggested already, the normal and recommended way to remove files
from the rootfs is:

  1) Remove the package which provides the file(s) from the image you
are building (ie don't install the files in the rootfs at all).

If the file(s) you want to remove don't match the granularity of the
installable packages (ie you want to keep some files provided by a
package but remove others) then you have two basic options:

  2) Spilt the installable package into multiple smaller installable
packages (ie modify the packaging rules in the recipe which creates
the installable package).

  3) Postprocess the rootfs. For that to work, you need to add the
postprocessing function ** TO THE IMAGE RECIPE **.


^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: recipe to clean up files from rootfs
  2017-12-14  7:17             ` Martin Hundebøll
@ 2017-12-14  8:11               ` Sherif Omran
  2017-12-14  8:14                 ` Sherif Omran
  0 siblings, 1 reply; 13+ messages in thread
From: Sherif Omran @ 2017-12-14  8:11 UTC (permalink / raw)
  To: Martin Hundebøll, Yocto discussion list

[-- Attachment #1: Type: text/plain, Size: 8178 bytes --]

hi Martin,

thank you for help .. well done .. it should now work..

On Thu, Dec 14, 2017 at 8:17 AM, Martin Hundebøll <
Martin.Hundeboll@prevas.dk> wrote:

> Hi Sherif,
>
> On 2017-12-14 08:06, Sherif Omran wrote:
>
>> Here is my recipe, it runs suceeds but does not delete the files
>>
>> mypostprocesfunction() {
>> rm -r ${IMAGE_ROOTFS}/etc/init.d/psplash.sh
>> rm -r ${IMAGE_ROOTFS}/usr/bin/psplash*
>> }
>>
>> ROOTFS_POSTPROCESS_COMMAND += "mypostprocessfunction; "
>>
>
> Unless you did a copy-paste error, there's a typo in the function name:
> mypostprocesfunction
> mypostprocessfunction
>
> // Martin
>
>
>> On Wed, Dec 13, 2017 at 2:03 PM, Mike Looijmans <mike.looijmans@topic.nl
>> <mailto:mike.looijmans@topic.nl>> wrote:
>>
>>     ${D} won't work here, grep on ROOTFS_POSTPROCESS_COMMAND for recipes
>>     that get it right.
>>
>>     And, much much much better would be to just not install psplash into
>>     your image!
>>
>>     On 13-12-17 09:10, Sherif Omran wrote:
>>
>>         here is my recipe, the aim was to remove some files from the
>>         init.d folder and tweek before creating the image
>>
>>         #
>>         # This file was derived from the 'Hello World!' example recipe
>>         in the
>>         # Yocto Project Development Manual.
>>         #
>>
>>         SUMMARY = "This recipe removes any missing files from the
>>         filesystem before finalinzing it"
>>         SECTION = "base"
>>         LICENSE = "MIT"
>>         LIC_FILES_CHKSUM =
>>         "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecd
>> a2f7b4f302"
>>
>>         #SRC_URI = "file://*"
>>
>>         S = "${WORKDIR}"
>>         BB_STRICT_CHECKSUM ="0"
>>         ALLOW_EMPTY_${PN}="1"
>>
>>
>>         #IMAGE_INSTALL = "packagegroup-core-boot
>>         packagegroup-base-extended ${CORE_IMAGE_EXTRA_INSTALL}"
>>         #IMAGE_INSTALL = "${CORE_IMAGE}"
>>
>>         #inherit core-image
>>
>>         my_postprocess_function() {
>>            rm -r ${D}${bindir}/init.d/psplash.sh
>>         }
>>
>>         ROOTFS_POSTPROCESS_COMMAND += "my_postprocess_function; "
>>
>>         On Wed, Dec 13, 2017 at 7:22 AM, Mike Looijmans
>>         <mike.looijmans@topic.nl <mailto:mike.looijmans@topic.nl>
>>         <mailto:mike.looijmans@topic.nl
>>         <mailto:mike.looijmans@topic.nl>>> wrote:
>>
>>              Well, start by sharing yours first.
>>
>>              Be careful when naming your shell routine, sometimes OE
>>         considers parts
>>              behind the underscore as overrides and then it cannot find
>> it.
>>
>>
>>              On 13-12-17 07:14, Sherif Omran wrote:
>>
>>                  hi Mike,
>>                  i could not get it to work, if you have a recipe that
>>         works, please
>>                  share it. ROOTFS_POSTPROCESS_COMMAND seems to be buggy.
>>
>>                  thank you
>>
>>
>>
>>                  On Tue, Dec 12, 2017 at 1:58 PM, Mike Looijmans
>>                  <mike.looijmans@topic.nl
>>         <mailto:mike.looijmans@topic.nl> <mailto:mike.looijmans@topic.nl
>>         <mailto:mike.looijmans@topic.nl>>
>>                  <mailto:mike.looijmans@topic.nl
>>         <mailto:mike.looijmans@topic.nl> <mailto:mike.looijmans@topic.nl
>>         <mailto:mike.looijmans@topic.nl>>>> wrote:
>>
>>                       On 11-12-17 15:18, Sherif Omran wrote:
>>
>>                           i want to create a recipe to clean some files
>>         from the rootfile
>>                           system, but i don't know how to let this
>>         recipe run the last one
>>                           before building the rootfile system.
>>
>>
>>                       You can use ROOTFS_POSTPROCESS_COMMAND in your
>>         image recipe to do
>>                  some
>>                       last-minute filesystem cleanup.
>>
>>                       However, in most cases it's much better to
>>         determine what recipe
>>                  puts the
>>                       files there and modify the recipe or remove the
>>         package. It would
>>                  help a
>>                       lot if you would reveal what files you want to
>>         remove and why.
>>
>>
>>                       Kind regards,
>>
>>                       Mike Looijmans
>>                       System Expert
>>
>>                       TOPIC Products
>>                       Materiaalweg 4, NL-5681 RJ Best
>>                       Postbus 440, NL-5680 AK Best
>>                       Telefoon: +31 (0) 499 33 69 79
>>         <tel:%2B31%20%280%29%20499%2033%2069%2079>
>>                  <tel:%2B31%20%280%29%20499%2033%2069%2079>
>>                  <tel:%2B31%20%280%29%20499%2033%2069%2079>
>>                       E-mail: mike.looijmans@topicproducts.com
>>         <mailto:mike.looijmans@topicproducts.com>
>>                  <mailto:mike.looijmans@topicproducts.com
>>         <mailto:mike.looijmans@topicproducts.com>>
>>                       <mailto:mike.looijmans@topicproducts.com
>>         <mailto:mike.looijmans@topicproducts.com>
>>
>>                  <mailto:mike.looijmans@topicproducts.com
>>         <mailto:mike.looijmans@topicproducts.com>>>
>>                       Website: www.topicproducts.com
>>         <http://www.topicproducts.com> <http://www.topicproducts.com>
>>                  <http://www.topicproducts.com>
>>
>>                       Please consider the environment before printing
>>         this e-mail
>>
>>
>>
>>                       --
>>
>>
>>              Kind regards,
>>
>>              Mike Looijmans
>>              System Expert
>>
>>              TOPIC Products
>>              Materiaalweg 4, NL-5681 RJ Best
>>              Postbus 440, NL-5680 AK Best
>>              Telefoon: +31 (0) 499 33 69 79
>>         <tel:%2B31%20%280%29%20499%2033%2069%2079>
>>         <tel:%2B31%20%280%29%20499%2033%2069%2079>
>>              E-mail: mike.looijmans@topicproducts.com
>>         <mailto:mike.looijmans@topicproducts.com>
>>              <mailto:mike.looijmans@topicproducts.com
>>         <mailto:mike.looijmans@topicproducts.com>>
>>              Website: www.topicproducts.com
>>         <http://www.topicproducts.com> <http://www.topicproducts.com>
>>
>>              Please consider the environment before printing this e-mail
>>
>>
>>
>>
>>
>>     Kind regards,
>>
>>     Mike Looijmans
>>     System Expert
>>
>>     TOPIC Products
>>     Materiaalweg 4, NL-5681 RJ Best
>>     Postbus 440, NL-5680 AK Best
>>     Telefoon: +31 (0) 499 33 69 79
>>     <tel:%2B31%20%280%29%20499%2033%2069%2079>
>>     E-mail: mike.looijmans@topicproducts.com
>>     <mailto:mike.looijmans@topicproducts.com>
>>     Website: www.topicproducts.com <http://www.topicproducts.com>
>>
>>     Please consider the environment before printing this e-mail
>>
>>
>>
>>     _______________________________________________
>>
>>
>>                       yocto mailing list
>>         yocto@yoctoproject.org <mailto:yocto@yoctoproject.org>
>>         <mailto:yocto@yoctoproject.org <mailto:yocto@yoctoproject.org>>
>>                  <mailto:yocto@yoctoproject.org
>>         <mailto:yocto@yoctoproject.org> <mailto:yocto@yoctoproject.org
>>         <mailto:yocto@yoctoproject.org>>>
>>         https://lists.yoctoproject.org/listinfo/yocto
>>         <https://lists.yoctoproject.org/listinfo/yocto>
>>                  <https://lists.yoctoproject.org/listinfo/yocto
>>         <https://lists.yoctoproject.org/listinfo/yocto>>
>>                       <https://lists.yoctoproject.org/listinfo/yocto
>>         <https://lists.yoctoproject.org/listinfo/yocto>
>>                  <https://lists.yoctoproject.org/listinfo/yocto
>>         <https://lists.yoctoproject.org/listinfo/yocto>>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
> --
> MARTIN HUNDEBØLL, Prevas A/S
> Software Developer
>
> Hedeager 3, DK-8200 Aarhus N
> Phone +45 87438070
> Mobile +45 25562438
> Martin.Hundeboll@prevas.dk
> www.prevas.com
>

[-- Attachment #2: Type: text/html, Size: 15020 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: recipe to clean up files from rootfs
  2017-12-14  8:11               ` Sherif Omran
@ 2017-12-14  8:14                 ` Sherif Omran
  2017-12-14 17:39                   ` Chris Simmonds
  0 siblings, 1 reply; 13+ messages in thread
From: Sherif Omran @ 2017-12-14  8:14 UTC (permalink / raw)
  To: Yocto discussion list

[-- Attachment #1: Type: text/plain, Size: 8662 bytes --]

hi Andre
thank you for your mail. I tried to remove this package but i don't know
where it is installed from, i can not find it and got lost.

On Thu, Dec 14, 2017 at 9:11 AM, Sherif Omran <sherifomran2000@gmail.com>
wrote:

> hi Martin,
>
> thank you for help .. well done .. it should now work..
>
> On Thu, Dec 14, 2017 at 8:17 AM, Martin Hundebøll <
> Martin.Hundeboll@prevas.dk> wrote:
>
>> Hi Sherif,
>>
>> On 2017-12-14 08:06, Sherif Omran wrote:
>>
>>> Here is my recipe, it runs suceeds but does not delete the files
>>>
>>> mypostprocesfunction() {
>>> rm -r ${IMAGE_ROOTFS}/etc/init.d/psplash.sh
>>> rm -r ${IMAGE_ROOTFS}/usr/bin/psplash*
>>> }
>>>
>>> ROOTFS_POSTPROCESS_COMMAND += "mypostprocessfunction; "
>>>
>>
>> Unless you did a copy-paste error, there's a typo in the function name:
>> mypostprocesfunction
>> mypostprocessfunction
>>
>> // Martin
>>
>>
>>> On Wed, Dec 13, 2017 at 2:03 PM, Mike Looijmans <mike.looijmans@topic.nl
>>> <mailto:mike.looijmans@topic.nl>> wrote:
>>>
>>>     ${D} won't work here, grep on ROOTFS_POSTPROCESS_COMMAND for recipes
>>>     that get it right.
>>>
>>>     And, much much much better would be to just not install psplash into
>>>     your image!
>>>
>>>     On 13-12-17 09:10, Sherif Omran wrote:
>>>
>>>         here is my recipe, the aim was to remove some files from the
>>>         init.d folder and tweek before creating the image
>>>
>>>         #
>>>         # This file was derived from the 'Hello World!' example recipe
>>>         in the
>>>         # Yocto Project Development Manual.
>>>         #
>>>
>>>         SUMMARY = "This recipe removes any missing files from the
>>>         filesystem before finalinzing it"
>>>         SECTION = "base"
>>>         LICENSE = "MIT"
>>>         LIC_FILES_CHKSUM =
>>>         "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecd
>>> a2f7b4f302"
>>>
>>>         #SRC_URI = "file://*"
>>>
>>>         S = "${WORKDIR}"
>>>         BB_STRICT_CHECKSUM ="0"
>>>         ALLOW_EMPTY_${PN}="1"
>>>
>>>
>>>         #IMAGE_INSTALL = "packagegroup-core-boot
>>>         packagegroup-base-extended ${CORE_IMAGE_EXTRA_INSTALL}"
>>>         #IMAGE_INSTALL = "${CORE_IMAGE}"
>>>
>>>         #inherit core-image
>>>
>>>         my_postprocess_function() {
>>>            rm -r ${D}${bindir}/init.d/psplash.sh
>>>         }
>>>
>>>         ROOTFS_POSTPROCESS_COMMAND += "my_postprocess_function; "
>>>
>>>         On Wed, Dec 13, 2017 at 7:22 AM, Mike Looijmans
>>>         <mike.looijmans@topic.nl <mailto:mike.looijmans@topic.nl>
>>>         <mailto:mike.looijmans@topic.nl
>>>         <mailto:mike.looijmans@topic.nl>>> wrote:
>>>
>>>              Well, start by sharing yours first.
>>>
>>>              Be careful when naming your shell routine, sometimes OE
>>>         considers parts
>>>              behind the underscore as overrides and then it cannot find
>>> it.
>>>
>>>
>>>              On 13-12-17 07:14, Sherif Omran wrote:
>>>
>>>                  hi Mike,
>>>                  i could not get it to work, if you have a recipe that
>>>         works, please
>>>                  share it. ROOTFS_POSTPROCESS_COMMAND seems to be buggy.
>>>
>>>                  thank you
>>>
>>>
>>>
>>>                  On Tue, Dec 12, 2017 at 1:58 PM, Mike Looijmans
>>>                  <mike.looijmans@topic.nl
>>>         <mailto:mike.looijmans@topic.nl> <mailto:mike.looijmans@topic.nl
>>>         <mailto:mike.looijmans@topic.nl>>
>>>                  <mailto:mike.looijmans@topic.nl
>>>         <mailto:mike.looijmans@topic.nl> <mailto:mike.looijmans@topic.nl
>>>         <mailto:mike.looijmans@topic.nl>>>> wrote:
>>>
>>>                       On 11-12-17 15:18, Sherif Omran wrote:
>>>
>>>                           i want to create a recipe to clean some files
>>>         from the rootfile
>>>                           system, but i don't know how to let this
>>>         recipe run the last one
>>>                           before building the rootfile system.
>>>
>>>
>>>                       You can use ROOTFS_POSTPROCESS_COMMAND in your
>>>         image recipe to do
>>>                  some
>>>                       last-minute filesystem cleanup.
>>>
>>>                       However, in most cases it's much better to
>>>         determine what recipe
>>>                  puts the
>>>                       files there and modify the recipe or remove the
>>>         package. It would
>>>                  help a
>>>                       lot if you would reveal what files you want to
>>>         remove and why.
>>>
>>>
>>>                       Kind regards,
>>>
>>>                       Mike Looijmans
>>>                       System Expert
>>>
>>>                       TOPIC Products
>>>                       Materiaalweg 4, NL-5681 RJ Best
>>>                       Postbus 440, NL-5680 AK Best
>>>                       Telefoon: +31 (0) 499 33 69 79
>>>         <tel:%2B31%20%280%29%20499%2033%2069%2079>
>>>                  <tel:%2B31%20%280%29%20499%2033%2069%2079>
>>>                  <tel:%2B31%20%280%29%20499%2033%2069%2079>
>>>                       E-mail: mike.looijmans@topicproducts.com
>>>         <mailto:mike.looijmans@topicproducts.com>
>>>                  <mailto:mike.looijmans@topicproducts.com
>>>         <mailto:mike.looijmans@topicproducts.com>>
>>>                       <mailto:mike.looijmans@topicproducts.com
>>>         <mailto:mike.looijmans@topicproducts.com>
>>>
>>>                  <mailto:mike.looijmans@topicproducts.com
>>>         <mailto:mike.looijmans@topicproducts.com>>>
>>>                       Website: www.topicproducts.com
>>>         <http://www.topicproducts.com> <http://www.topicproducts.com>
>>>                  <http://www.topicproducts.com>
>>>
>>>                       Please consider the environment before printing
>>>         this e-mail
>>>
>>>
>>>
>>>                       --
>>>
>>>
>>>              Kind regards,
>>>
>>>              Mike Looijmans
>>>              System Expert
>>>
>>>              TOPIC Products
>>>              Materiaalweg 4, NL-5681 RJ Best
>>>              Postbus 440, NL-5680 AK Best
>>>              Telefoon: +31 (0) 499 33 69 79
>>>         <tel:%2B31%20%280%29%20499%2033%2069%2079>
>>>         <tel:%2B31%20%280%29%20499%2033%2069%2079>
>>>              E-mail: mike.looijmans@topicproducts.com
>>>         <mailto:mike.looijmans@topicproducts.com>
>>>              <mailto:mike.looijmans@topicproducts.com
>>>         <mailto:mike.looijmans@topicproducts.com>>
>>>              Website: www.topicproducts.com
>>>         <http://www.topicproducts.com> <http://www.topicproducts.com>
>>>
>>>              Please consider the environment before printing this e-mail
>>>
>>>
>>>
>>>
>>>
>>>     Kind regards,
>>>
>>>     Mike Looijmans
>>>     System Expert
>>>
>>>     TOPIC Products
>>>     Materiaalweg 4, NL-5681 RJ Best
>>>     Postbus 440, NL-5680 AK Best
>>>     Telefoon: +31 (0) 499 33 69 79
>>>     <tel:%2B31%20%280%29%20499%2033%2069%2079>
>>>     E-mail: mike.looijmans@topicproducts.com
>>>     <mailto:mike.looijmans@topicproducts.com>
>>>     Website: www.topicproducts.com <http://www.topicproducts.com>
>>>
>>>     Please consider the environment before printing this e-mail
>>>
>>>
>>>
>>>     _______________________________________________
>>>
>>>
>>>                       yocto mailing list
>>>         yocto@yoctoproject.org <mailto:yocto@yoctoproject.org>
>>>         <mailto:yocto@yoctoproject.org <mailto:yocto@yoctoproject.org>>
>>>                  <mailto:yocto@yoctoproject.org
>>>         <mailto:yocto@yoctoproject.org> <mailto:yocto@yoctoproject.org
>>>         <mailto:yocto@yoctoproject.org>>>
>>>         https://lists.yoctoproject.org/listinfo/yocto
>>>         <https://lists.yoctoproject.org/listinfo/yocto>
>>>                  <https://lists.yoctoproject.org/listinfo/yocto
>>>         <https://lists.yoctoproject.org/listinfo/yocto>>
>>>                       <https://lists.yoctoproject.org/listinfo/yocto
>>>         <https://lists.yoctoproject.org/listinfo/yocto>
>>>                  <https://lists.yoctoproject.org/listinfo/yocto
>>>         <https://lists.yoctoproject.org/listinfo/yocto>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>> --
>> MARTIN HUNDEBØLL, Prevas A/S
>> Software Developer
>>
>> Hedeager 3, DK-8200 Aarhus N
>> Phone +45 87438070
>> Mobile +45 25562438
>> Martin.Hundeboll@prevas.dk
>> www.prevas.com
>>
>
>

[-- Attachment #2: Type: text/html, Size: 15663 bytes --]

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: recipe to clean up files from rootfs
  2017-12-14  8:14                 ` Sherif Omran
@ 2017-12-14 17:39                   ` Chris Simmonds
  0 siblings, 0 replies; 13+ messages in thread
From: Chris Simmonds @ 2017-12-14 17:39 UTC (permalink / raw)
  To: yocto

Hi Sherif,

Maybe this is a little late, but as been said already, the best solution
is to remove psplash from your image altogether. You can to this quite
simply by adding to your conf/local.conf

IMAGE_FEATURES_remove = "splash"




Rationale: the dependency on the psplash program is (usually) set in the
image recipe. For example, in
meta/recipes-core/images/core-image-base.bb, you see

IMAGE_FEATURES += "splash"

The image class (meta/classes/image.bbclass) matches the list of
features in IMAGE_FEATURES with package names in FEATURE_PACKAGES_*. So,
in meta/classes/image.bbclass, you find

SPLASH ?= "psplash"
FEATURE_PACKAGES_splash = "${SPLASH}"

This causes "psplash" to be added to the image if IMAGE_FEATURES
contains the string "splash".

By using IMAGE_FEATURES_remove, you remove the string "splash" from the
list of features and so psplash will not be included in your image.

HTH,
Chris Simmonds.


On 14/12/17 08:14, Sherif Omran wrote:
> hi Andre
> thank you for your mail. I tried to remove this package but i don't know
> where it is installed from, i can not find it and got lost.
> 
> On Thu, Dec 14, 2017 at 9:11 AM, Sherif Omran <sherifomran2000@gmail.com
> <mailto:sherifomran2000@gmail.com>> wrote:
> 
>     hi Martin,
> 
>     thank you for help .. well done .. it should now work..
> 
>     On Thu, Dec 14, 2017 at 8:17 AM, Martin Hundebøll
>     <Martin.Hundeboll@prevas.dk <mailto:Martin.Hundeboll@prevas.dk>> wrote:
> 
>         Hi Sherif,
> 
>         On 2017-12-14 08:06, Sherif Omran wrote:
> 
>             Here is my recipe, it runs suceeds but does not delete the files
> 
>             mypostprocesfunction() {
>             rm -r ${IMAGE_ROOTFS}/etc/init.d/psplash.sh
>             rm -r ${IMAGE_ROOTFS}/usr/bin/psplash*
>             }
> 
>             ROOTFS_POSTPROCESS_COMMAND += "mypostprocessfunction; "
> 
> 
>         Unless you did a copy-paste error, there's a typo in the
>         function name:
>         mypostprocesfunction
>         mypostprocessfunction
> 
>         // Martin
> 
> 
>             On Wed, Dec 13, 2017 at 2:03 PM, Mike Looijmans
>             <mike.looijmans@topic.nl <mailto:mike.looijmans@topic.nl>
>             <mailto:mike.looijmans@topic.nl
>             <mailto:mike.looijmans@topic.nl>>> wrote:
> 
>                 ${D} won't work here, grep on ROOTFS_POSTPROCESS_COMMAND
>             for recipes
>                 that get it right.
> 
>                 And, much much much better would be to just not install
>             psplash into
>                 your image!
> 
>                 On 13-12-17 09:10, Sherif Omran wrote:
> 
>                     here is my recipe, the aim was to remove some files
>             from the
>                     init.d folder and tweek before creating the image
> 
>                     #
>                     # This file was derived from the 'Hello World!'
>             example recipe
>                     in the
>                     # Yocto Project Development Manual.
>                     #
> 
>                     SUMMARY = "This recipe removes any missing files
>             from the
>                     filesystem before finalinzing it"
>                     SECTION = "base"
>                     LICENSE = "MIT"
>                     LIC_FILES_CHKSUM =
>                    
>             "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
> 
>                     #SRC_URI = "file://*"
> 
>                     S = "${WORKDIR}"
>                     BB_STRICT_CHECKSUM ="0"
>                     ALLOW_EMPTY_${PN}="1"
> 
> 
>                     #IMAGE_INSTALL = "packagegroup-core-boot
>                     packagegroup-base-extended ${CORE_IMAGE_EXTRA_INSTALL}"
>                     #IMAGE_INSTALL = "${CORE_IMAGE}"
> 
>                     #inherit core-image
> 
>                     my_postprocess_function() {
>                        rm -r ${D}${bindir}/init.d/psplash.sh
>                     }
> 
>                     ROOTFS_POSTPROCESS_COMMAND +=
>             "my_postprocess_function; "
> 
>                     On Wed, Dec 13, 2017 at 7:22 AM, Mike Looijmans
>                     <mike.looijmans@topic.nl
>             <mailto:mike.looijmans@topic.nl>
>             <mailto:mike.looijmans@topic.nl
>             <mailto:mike.looijmans@topic.nl>>
>                     <mailto:mike.looijmans@topic.nl
>             <mailto:mike.looijmans@topic.nl>
>                     <mailto:mike.looijmans@topic.nl
>             <mailto:mike.looijmans@topic.nl>>>> wrote:
> 
>                          Well, start by sharing yours first.
> 
>                          Be careful when naming your shell routine,
>             sometimes OE
>                     considers parts
>                          behind the underscore as overrides and then it
>             cannot find it.
> 
> 
>                          On 13-12-17 07:14, Sherif Omran wrote:
> 
>                              hi Mike,
>                              i could not get it to work, if you have a
>             recipe that
>                     works, please
>                              share it. ROOTFS_POSTPROCESS_COMMAND seems
>             to be buggy.
> 
>                              thank you
> 
> 
> 
>                              On Tue, Dec 12, 2017 at 1:58 PM, Mike Looijmans
>                              <mike.looijmans@topic.nl
>             <mailto:mike.looijmans@topic.nl>
>                     <mailto:mike.looijmans@topic.nl
>             <mailto:mike.looijmans@topic.nl>>
>             <mailto:mike.looijmans@topic.nl <mailto:mike.looijmans@topic.nl>
>                     <mailto:mike.looijmans@topic.nl
>             <mailto:mike.looijmans@topic.nl>>>
>                              <mailto:mike.looijmans@topic.nl
>             <mailto:mike.looijmans@topic.nl>
>                     <mailto:mike.looijmans@topic.nl
>             <mailto:mike.looijmans@topic.nl>>
>             <mailto:mike.looijmans@topic.nl <mailto:mike.looijmans@topic.nl>
>                     <mailto:mike.looijmans@topic.nl
>             <mailto:mike.looijmans@topic.nl>>>>> wrote:
> 
>                                   On 11-12-17 15:18, Sherif Omran wrote:
> 
>                                       i want to create a recipe to clean
>             some files
>                     from the rootfile
>                                       system, but i don't know how to
>             let this
>                     recipe run the last one
>                                       before building the rootfile system.
> 
> 
>                                   You can use ROOTFS_POSTPROCESS_COMMAND
>             in your
>                     image recipe to do
>                              some
>                                   last-minute filesystem cleanup.
> 
>                                   However, in most cases it's much better to
>                     determine what recipe
>                              puts the
>                                   files there and modify the recipe or
>             remove the
>                     package. It would
>                              help a
>                                   lot if you would reveal what files you
>             want to
>                     remove and why.
> 
> 
>                                   Kind regards,
> 
>                                   Mike Looijmans
>                                   System Expert
> 
>                                   TOPIC Products
>                                   Materiaalweg 4, NL-5681 RJ Best
>                                   Postbus 440, NL-5680 AK Best
>                                   Telefoon: +31 (0) 499 33 69 79
>             <tel:%2B31%20%280%29%20499%2033%2069%2079>
>                     <tel:%2B31%20%280%29%20499%2033%2069%2079>
>                              <tel:%2B31%20%280%29%20499%2033%2069%2079>
>                              <tel:%2B31%20%280%29%20499%2033%2069%2079>
>                                   E-mail:
>             mike.looijmans@topicproducts.com
>             <mailto:mike.looijmans@topicproducts.com>
>                     <mailto:mike.looijmans@topicproducts.com
>             <mailto:mike.looijmans@topicproducts.com>>
>                              <mailto:mike.looijmans@topicproducts.com
>             <mailto:mike.looijmans@topicproducts.com>
>                     <mailto:mike.looijmans@topicproducts.com
>             <mailto:mike.looijmans@topicproducts.com>>>
>                                  
>             <mailto:mike.looijmans@topicproducts.com
>             <mailto:mike.looijmans@topicproducts.com>
>                     <mailto:mike.looijmans@topicproducts.com
>             <mailto:mike.looijmans@topicproducts.com>>
> 
>                              <mailto:mike.looijmans@topicproducts.com
>             <mailto:mike.looijmans@topicproducts.com>
>                     <mailto:mike.looijmans@topicproducts.com
>             <mailto:mike.looijmans@topicproducts.com>>>>
>                                   Website: www.topicproducts.com
>             <http://www.topicproducts.com>
>                     <http://www.topicproducts.com>
>             <http://www.topicproducts.com>
>                              <http://www.topicproducts.com>
> 
>                                   Please consider the environment before
>             printing
>                     this e-mail
> 
> 
> 
>                                   --
> 
> 
>                          Kind regards,
> 
>                          Mike Looijmans
>                          System Expert
> 
>                          TOPIC Products
>                          Materiaalweg 4, NL-5681 RJ Best
>                          Postbus 440, NL-5680 AK Best
>                          Telefoon: +31 (0) 499 33 69 79
>             <tel:%2B31%20%280%29%20499%2033%2069%2079>
>                     <tel:%2B31%20%280%29%20499%2033%2069%2079>
>                     <tel:%2B31%20%280%29%20499%2033%2069%2079>
>                          E-mail: mike.looijmans@topicproducts.com
>             <mailto:mike.looijmans@topicproducts.com>
>                     <mailto:mike.looijmans@topicproducts.com
>             <mailto:mike.looijmans@topicproducts.com>>
>                          <mailto:mike.looijmans@topicproducts.com
>             <mailto:mike.looijmans@topicproducts.com>
>                     <mailto:mike.looijmans@topicproducts.com
>             <mailto:mike.looijmans@topicproducts.com>>>
>                          Website: www.topicproducts.com
>             <http://www.topicproducts.com>
>                     <http://www.topicproducts.com>
>             <http://www.topicproducts.com>
> 
>                          Please consider the environment before printing
>             this e-mail
> 
> 
> 
> 
> 
>                 Kind regards,
> 
>                 Mike Looijmans
>                 System Expert
> 
>                 TOPIC Products
>                 Materiaalweg 4, NL-5681 RJ Best
>                 Postbus 440, NL-5680 AK Best
>                 Telefoon: +31 (0) 499 33 69 79
>             <tel:%2B31%20%280%29%20499%2033%2069%2079>
>                 <tel:%2B31%20%280%29%20499%2033%2069%2079>
>                 E-mail: mike.looijmans@topicproducts.com
>             <mailto:mike.looijmans@topicproducts.com>
>                 <mailto:mike.looijmans@topicproducts.com
>             <mailto:mike.looijmans@topicproducts.com>>
>                 Website: www.topicproducts.com
>             <http://www.topicproducts.com> <http://www.topicproducts.com>
> 
>                 Please consider the environment before printing this e-mail
> 
> 
> 
>                 _______________________________________________
> 
> 
>                                   yocto mailing list
>                     yocto@yoctoproject.org
>             <mailto:yocto@yoctoproject.org>
>             <mailto:yocto@yoctoproject.org <mailto:yocto@yoctoproject.org>>
>                     <mailto:yocto@yoctoproject.org
>             <mailto:yocto@yoctoproject.org>
>             <mailto:yocto@yoctoproject.org <mailto:yocto@yoctoproject.org>>>
>                              <mailto:yocto@yoctoproject.org
>             <mailto:yocto@yoctoproject.org>
>                     <mailto:yocto@yoctoproject.org
>             <mailto:yocto@yoctoproject.org>>
>             <mailto:yocto@yoctoproject.org <mailto:yocto@yoctoproject.org>
>                     <mailto:yocto@yoctoproject.org
>             <mailto:yocto@yoctoproject.org>>>>
>                     https://lists.yoctoproject.org/listinfo/yocto
>             <https://lists.yoctoproject.org/listinfo/yocto>
>                     <https://lists.yoctoproject.org/listinfo/yocto
>             <https://lists.yoctoproject.org/listinfo/yocto>>
>                             
>             <https://lists.yoctoproject.org/listinfo/yocto
>             <https://lists.yoctoproject.org/listinfo/yocto>
>                     <https://lists.yoctoproject.org/listinfo/yocto
>             <https://lists.yoctoproject.org/listinfo/yocto>>>
>                                  
>             <https://lists.yoctoproject.org/listinfo/yocto
>             <https://lists.yoctoproject.org/listinfo/yocto>
>                     <https://lists.yoctoproject.org/listinfo/yocto
>             <https://lists.yoctoproject.org/listinfo/yocto>>
>                             
>             <https://lists.yoctoproject.org/listinfo/yocto
>             <https://lists.yoctoproject.org/listinfo/yocto>
>                     <https://lists.yoctoproject.org/listinfo/yocto
>             <https://lists.yoctoproject.org/listinfo/yocto>>>>
> 
> 
> 
> 
> 
> 
> 
> 
> 
>         -- 
>         MARTIN HUNDEBØLL, Prevas A/S
>         Software Developer
> 
>         Hedeager 3, DK-8200 Aarhus N
>         Phone +45 87438070 <tel:%2B45%2087438070>
>         Mobile +45 25562438 <tel:%2B45%2025562438>
>         Martin.Hundeboll@prevas.dk <mailto:Martin.Hundeboll@prevas.dk>
>         www.prevas.com <http://www.prevas.com>
> 
> 
> 
> 
> 


-- 
Chris Simmonds, Consultant, 2net Ltd
http://www.2net.co.uk
+44 (0)1962 869003


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2017-12-14 17:39 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-11 14:18 recipe to clean up files from rootfs Sherif Omran
2017-12-11 14:57 ` Alexander Kanavin
2017-12-12 12:58 ` Mike Looijmans
2017-12-13  6:14   ` Sherif Omran
2017-12-13  6:22     ` Mike Looijmans
2017-12-13  8:10       ` Sherif Omran
2017-12-13 13:03         ` Mike Looijmans
2017-12-14  7:06           ` Sherif Omran
2017-12-14  7:17             ` Martin Hundebøll
2017-12-14  8:11               ` Sherif Omran
2017-12-14  8:14                 ` Sherif Omran
2017-12-14 17:39                   ` Chris Simmonds
2017-12-14  7:57             ` Andre McCurdy

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.