All of lore.kernel.org
 help / color / mirror / Atom feed
* Keeping and modifying Source code in Yocto
@ 2018-07-06 15:20 Simon Chamlian
  2018-07-06 15:25 ` Rudolf J Streif
                   ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: Simon Chamlian @ 2018-07-06 15:20 UTC (permalink / raw)
  To: yocto

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

Hi,

Is there a way to keep the source code of a package to be able to modify it
and then compile?

For example, with LTIB ( Linux Target Image Builder ), it was possible with
a command to extract the source code from a package, make modifications and
then re-compile?

Thanks,
S

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

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

* Re: Keeping and modifying Source code in Yocto
  2018-07-06 15:20 Keeping and modifying Source code in Yocto Simon Chamlian
@ 2018-07-06 15:25 ` Rudolf J Streif
  2018-07-06 15:27 ` Tim Hammer
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 11+ messages in thread
From: Rudolf J Streif @ 2018-07-06 15:25 UTC (permalink / raw)
  To: Simon Chamlian, yocto


[-- Attachment #1.1.1: Type: text/plain, Size: 729 bytes --]

Hi Simon,

> Is there a way to keep the source code of a package to be able to
modify it and then compile?

Yes, there is. devtool greatly simplifies this type of workflow. Please
refer to
https://www.yoctoproject.org/docs/2.5/mega-manual/mega-manual.html#using-devtool-in-your-sdk-workflow
for details.

:rjs


On 07/06/2018 08:20 AM, Simon Chamlian wrote:
> Hi,
>
> Is there a way to keep the source code of a package to be able to
> modify it and then compile?
>
> For example, with LTIB ( Linux Target Image Builder ), it was possible
> with a command to extract the source code from a package, make
> modifications and then re-compile?
>
> Thanks,
> S
>
>
>
>
>
>
>

-- 
Rudolf J Streif


[-- Attachment #1.1.2: Type: text/html, Size: 1856 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 499 bytes --]

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

* Re: Keeping and modifying Source code in Yocto
  2018-07-06 15:20 Keeping and modifying Source code in Yocto Simon Chamlian
  2018-07-06 15:25 ` Rudolf J Streif
@ 2018-07-06 15:27 ` Tim Hammer
  2018-07-06 19:11   ` Ulf Samuelsson
  2018-07-10  1:32 ` ChenQi
  2018-07-10  1:44 ` Khem Raj
  3 siblings, 1 reply; 11+ messages in thread
From: Tim Hammer @ 2018-07-06 15:27 UTC (permalink / raw)
  To: Simon Chamlian; +Cc: yocto

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

On Fri, Jul 6, 2018 at 11:20 AM, Simon Chamlian <simon.chamlian@mpbc.ca>
wrote:

> Hi,
>
> Is there a way to keep the source code of a package to be able to modify
> it and then compile?
>
> For example, with LTIB ( Linux Target Image Builder ), it was possible
> with a command to extract the source code from a package, make
> modifications and then re-compile?
>
>
I suggest you take a look at the devtool:
     https://www.yoctoproject.org/software-item/devtool/

https://wiki.yoctoproject.org/wiki/TipsAndTricks/Patching_the_source_for_a_recipe



> Thanks,
> S
>
>
>
>
>
>
> --
> _______________________________________________
> yocto mailing list
> yocto@yoctoproject.org
> https://lists.yoctoproject.org/listinfo/yocto
>
>


-- 

.Tim

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

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

* Re: Keeping and modifying Source code in Yocto
  2018-07-06 15:27 ` Tim Hammer
@ 2018-07-06 19:11   ` Ulf Samuelsson
  2018-07-09 12:43     ` Marcelo E. Magallon
  0 siblings, 1 reply; 11+ messages in thread
From: Ulf Samuelsson @ 2018-07-06 19:11 UTC (permalink / raw)
  To: Tim Hammer; +Cc: yocto

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

externalsrc.bbclass?

In my current project we have a simplified version in a ”component.bbclass”.
It relies on a variable COMPONENT_DIR defined in our local.conf.

A recipe located in ”recipe-xxxx/<package>/<package>_$PV.bb” doing

inherit component

will find its source code in $COMPONENT_DIR/<package>, making the recipe simpler than that of the externalsrc bbclass. No need for SRC_URI statements.

We check out meta layers and the components using repo so the components are always located in $COMPONENTS_DIR.

Been thinking of upstreaming this, but I am unsure about the interest.


Best Regards,
Ulf Samuelsson

> 6 juli 2018 kl. 17:27 skrev Tim Hammer <tdhammer99@gmail.com>:
> 
> 
>> On Fri, Jul 6, 2018 at 11:20 AM, Simon Chamlian <simon.chamlian@mpbc.ca> wrote:
> 
>> Hi,
>> 
>> Is there a way to keep the source code of a package to be able to modify it and then compile?
>> 
>> For example, with LTIB ( Linux Target Image Builder ), it was possible with a command to extract the source code from a package, make modifications and then re-compile?
>> 
> 
> I suggest you take a look at the devtool:
>      https://www.yoctoproject.org/software-item/devtool/
>      https://wiki.yoctoproject.org/wiki/TipsAndTricks/Patching_the_source_for_a_recipe
> 
>  
>> Thanks,
>> S
>> 
>> 
>> 
>> 
>> 
>> 
>> -- 
>> _______________________________________________
>> yocto mailing list
>> yocto@yoctoproject.org
>> https://lists.yoctoproject.org/listinfo/yocto
>> 
> 
> 
> 
> -- 
> 
> .Tim
> -- 
> _______________________________________________
> yocto mailing list
> yocto@yoctoproject.org
> https://lists.yoctoproject.org/listinfo/yocto

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

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

* Re: Keeping and modifying Source code in Yocto
  2018-07-06 19:11   ` Ulf Samuelsson
@ 2018-07-09 12:43     ` Marcelo E. Magallon
  0 siblings, 0 replies; 11+ messages in thread
From: Marcelo E. Magallon @ 2018-07-09 12:43 UTC (permalink / raw)
  To: Ulf Samuelsson; +Cc: yocto

On Fri, Jul 06, 2018 at 09:11:35PM +0200, Ulf Samuelsson wrote:

>In my current project we have a simplified version in a 
>”component.bbclass”. It relies on a variable COMPONENT_DIR 
>defined in our local.conf.
>
>A recipe located in ”recipe-xxxx/<package>/<package>_$PV.bb” doing
>
>inherit component
>
>will find its source code in $COMPONENT_DIR/<package>, making 
>the recipe simpler than that of the externalsrc bbclass. No need 
>for SRC_URI statements.

You mean you set S to $COMPONENT_DIR/<package>?

If there's no SRC_URI, does fetch run? If not, how does it detect 
that the source code changed?

Marcelo


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

* Re: Keeping and modifying Source code in Yocto
  2018-07-06 15:20 Keeping and modifying Source code in Yocto Simon Chamlian
  2018-07-06 15:25 ` Rudolf J Streif
  2018-07-06 15:27 ` Tim Hammer
@ 2018-07-10  1:32 ` ChenQi
  2018-07-10  6:18   ` Paul Eggleton
  2018-07-10  1:44 ` Khem Raj
  3 siblings, 1 reply; 11+ messages in thread
From: ChenQi @ 2018-07-10  1:32 UTC (permalink / raw)
  To: Simon Chamlian, yocto

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

Hi Simon,

I usually use the following steps when I need to modify source for some 
purpose.

1. bitbake A (or at least bitbake A -c configure)
*2. cd tmp/work/xxxxx/A/<source dir>**
**3. make the modification*
4. bitbake A -c compile -f
5. bitbake A

If you find the modification useful, make a patch from it.

Best Regards,
Chen Qi

On 07/06/2018 11:20 PM, Simon Chamlian wrote:
> Hi,
>
> Is there a way to keep the source code of a package to be able to 
> modify it and then compile?
>
> For example, with LTIB ( Linux Target Image Builder ), it was possible 
> with a command to extract the source code from a package, make 
> modifications and then re-compile?
>
> Thanks,
> S
>
>
>
>
>
>
>


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

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

* Re: Keeping and modifying Source code in Yocto
  2018-07-06 15:20 Keeping and modifying Source code in Yocto Simon Chamlian
                   ` (2 preceding siblings ...)
  2018-07-10  1:32 ` ChenQi
@ 2018-07-10  1:44 ` Khem Raj
  3 siblings, 0 replies; 11+ messages in thread
From: Khem Raj @ 2018-07-10  1:44 UTC (permalink / raw)
  To: simon.chamlian; +Cc: Yocto Project

On Fri, Jul 6, 2018 at 8:20 AM Simon Chamlian <simon.chamlian@mpbc.ca> wrote:
>
> Hi,
>
> Is there a way to keep the source code of a package to be able to modify it and then compile?
>
> For example, with LTIB ( Linux Target Image Builder ), it was possible with a command to extract the source code from a package, make modifications and then re-compile?
>

Please use devtool which is aimed at exactly what you want to get done here.

https://www.yoctoproject.org/docs/2.6/sdk-manual/sdk-manual.html#sdk-a-closer-look-at-devtool-add

> Thanks,
> S
>
>
>
>
>
> --
> _______________________________________________
> yocto mailing list
> yocto@yoctoproject.org
> https://lists.yoctoproject.org/listinfo/yocto


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

* Re: Keeping and modifying Source code in Yocto
  2018-07-10  1:32 ` ChenQi
@ 2018-07-10  6:18   ` Paul Eggleton
  2018-07-10  8:27     ` ChenQi
  0 siblings, 1 reply; 11+ messages in thread
From: Paul Eggleton @ 2018-07-10  6:18 UTC (permalink / raw)
  To: yocto

On Tuesday, 10 July 2018 3:32:56 AM CEST ChenQi wrote:
> I usually use the following steps when I need to modify source for some 
> purpose.
> 
> 1. bitbake A (or at least bitbake A -c configure)
> *2. cd tmp/work/xxxxx/A/<source dir>**
> **3. make the modification*
> 4. bitbake A -c compile -f
> 5. bitbake A
> 
> If you find the modification useful, make a patch from it.

This is the old way of doing it which can under some circumstances result in 
you losing your changes to the source tree, since the sources under tmp/work/ 
are only ever intended to be there temporarily. Devtool (as recommend by 
others on this thread) is designed to enable this workflow in a much safer 
manner.

Cheers,
Paul

-- 

Paul Eggleton
Intel Open Source Technology Centre




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

* Re: Keeping and modifying Source code in Yocto
  2018-07-10  6:18   ` Paul Eggleton
@ 2018-07-10  8:27     ` ChenQi
  2018-07-11 15:27       ` Simon Chamlian
  0 siblings, 1 reply; 11+ messages in thread
From: ChenQi @ 2018-07-10  8:27 UTC (permalink / raw)
  To: Paul Eggleton, yocto

On 07/10/2018 02:18 PM, Paul Eggleton wrote:
> On Tuesday, 10 July 2018 3:32:56 AM CEST ChenQi wrote:
>> I usually use the following steps when I need to modify source for some
>> purpose.
>>
>> 1. bitbake A (or at least bitbake A -c configure)
>> *2. cd tmp/work/xxxxx/A/<source dir>**
>> **3. make the modification*
>> 4. bitbake A -c compile -f
>> 5. bitbake A
>>
>> If you find the modification useful, make a patch from it.
> This is the old way of doing it which can under some circumstances result in
> you losing your changes to the source tree, since the sources under tmp/work/
> are only ever intended to be there temporarily. Devtool (as recommend by
> others on this thread) is designed to enable this workflow in a much safer
> manner.
>
> Cheers,
> Paul
>
Thanks Paul. I'll turn to use devtool.

Best Regards,

Chen Qi



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

* Re: Keeping and modifying Source code in Yocto
  2018-07-10  8:27     ` ChenQi
@ 2018-07-11 15:27       ` Simon Chamlian
  2018-07-11 20:46         ` Khem Raj
  0 siblings, 1 reply; 11+ messages in thread
From: Simon Chamlian @ 2018-07-11 15:27 UTC (permalink / raw)
  To: ChenQi; +Cc: Paul Eggleton, yocto

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

I am getting the following error using devtool:

$ devtool add help
ERROR: Layer directory '/home/jay/sources/poky/meta' does not exist! Please
check BBLAYERS in /home/jay/build/conf/bblayers.conf

$ whereis devtool
devtool: /opt/PHYTEC_BSPs/yocto_imx7/sources/poky/scripts/devtool

The paths are completely wrong.

Any hints?

Thanks,
S






On Tue, Jul 10, 2018 at 4:27 AM, ChenQi <Qi.Chen@windriver.com> wrote:

> On 07/10/2018 02:18 PM, Paul Eggleton wrote:
>
>> On Tuesday, 10 July 2018 3:32:56 AM CEST ChenQi wrote:
>>
>>> I usually use the following steps when I need to modify source for some
>>> purpose.
>>>
>>> 1. bitbake A (or at least bitbake A -c configure)
>>> *2. cd tmp/work/xxxxx/A/<source dir>**
>>> **3. make the modification*
>>> 4. bitbake A -c compile -f
>>> 5. bitbake A
>>>
>>> If you find the modification useful, make a patch from it.
>>>
>> This is the old way of doing it which can under some circumstances result
>> in
>> you losing your changes to the source tree, since the sources under
>> tmp/work/
>> are only ever intended to be there temporarily. Devtool (as recommend by
>> others on this thread) is designed to enable this workflow in a much safer
>> manner.
>>
>> Cheers,
>> Paul
>>
>> Thanks Paul. I'll turn to use devtool.
>
> Best Regards,
>
> Chen Qi
>
>

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

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

* Re: Keeping and modifying Source code in Yocto
  2018-07-11 15:27       ` Simon Chamlian
@ 2018-07-11 20:46         ` Khem Raj
  0 siblings, 0 replies; 11+ messages in thread
From: Khem Raj @ 2018-07-11 20:46 UTC (permalink / raw)
  To: simon.chamlian; +Cc: Paul Eggleton, Yocto Project

On Wed, Jul 11, 2018 at 9:28 AM Simon Chamlian <simon.chamlian@mpbc.ca> wrote:
>
> I am getting the following error using devtool:
>
> $ devtool add help
> ERROR: Layer directory '/home/jay/sources/poky/meta' does not exist! Please check BBLAYERS in /home/jay/build/conf/bblayers.conf
>
> $ whereis devtool
> devtool: /opt/PHYTEC_BSPs/yocto_imx7/sources/poky/scripts/devtool
>
> The paths are completely wrong.
>
> Any hints?

may be there are two different workspaces being mixed here. Probably
you should start a fresh shell and setup
environment to run bitbake and then be able to run devtool in that
shell as well.

>
> Thanks,
> S
>
>
>
>
>
>
> On Tue, Jul 10, 2018 at 4:27 AM, ChenQi <Qi.Chen@windriver.com> wrote:
>>
>> On 07/10/2018 02:18 PM, Paul Eggleton wrote:
>>>
>>> On Tuesday, 10 July 2018 3:32:56 AM CEST ChenQi wrote:
>>>>
>>>> I usually use the following steps when I need to modify source for some
>>>> purpose.
>>>>
>>>> 1. bitbake A (or at least bitbake A -c configure)
>>>> *2. cd tmp/work/xxxxx/A/<source dir>**
>>>> **3. make the modification*
>>>> 4. bitbake A -c compile -f
>>>> 5. bitbake A
>>>>
>>>> If you find the modification useful, make a patch from it.
>>>
>>> This is the old way of doing it which can under some circumstances result in
>>> you losing your changes to the source tree, since the sources under tmp/work/
>>> are only ever intended to be there temporarily. Devtool (as recommend by
>>> others on this thread) is designed to enable this workflow in a much safer
>>> manner.
>>>
>>> Cheers,
>>> Paul
>>>
>> Thanks Paul. I'll turn to use devtool.
>>
>> Best Regards,
>>
>> Chen Qi
>>
>
> --
> _______________________________________________
> yocto mailing list
> yocto@yoctoproject.org
> https://lists.yoctoproject.org/listinfo/yocto


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

end of thread, other threads:[~2018-07-11 20:46 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-06 15:20 Keeping and modifying Source code in Yocto Simon Chamlian
2018-07-06 15:25 ` Rudolf J Streif
2018-07-06 15:27 ` Tim Hammer
2018-07-06 19:11   ` Ulf Samuelsson
2018-07-09 12:43     ` Marcelo E. Magallon
2018-07-10  1:32 ` ChenQi
2018-07-10  6:18   ` Paul Eggleton
2018-07-10  8:27     ` ChenQi
2018-07-11 15:27       ` Simon Chamlian
2018-07-11 20:46         ` Khem Raj
2018-07-10  1:44 ` Khem Raj

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.