mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
* [ptxdist] [PATCH] image-hdimg.make: Add PROJECT and PROJECT_VERSION variables.
@ 2022-01-14 11:56 Christian Melki
  2022-01-21  8:19 ` Michael Olbrich
  0 siblings, 1 reply; 5+ messages in thread
From: Christian Melki @ 2022-01-14 11:56 UTC (permalink / raw)
  To: ptxdist

Ideally, I'd like this to be in the generic genimage env.
I need this to be able to name images according to the project.

Signed-off-by: Christian Melki <christian.melki@t2data.com>
---
 rules/image-hdimg.make | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/rules/image-hdimg.make b/rules/image-hdimg.make
index b470c0fb6..6f0012a85 100644
--- a/rules/image-hdimg.make
+++ b/rules/image-hdimg.make
@@ -57,6 +57,8 @@ IMAGE_HDIMG_ENV = \
 	PARTITION_TABLE_TYPE=$(call ptx/ifdef, PTXCONF_IMAGE_HDIMG_GPT,gpt,mbr) \
 	PARTITION_TYPE_SUFFIX=$(call ptx/ifdef, PTXCONF_IMAGE_HDIMG_GPT,-uuid) \
 	ROOT_PARTITION_TYPE=$(call ptx/ifdef, PTXCONF_IMAGE_HDIMG_GPT,L,0x83) \
+	PROJECT=$(PTXCONF_PROJECT) \
+	PROJECT_VERSION=$(PTXCONF_PROJECT_VERSION) \
 	$(IMAGE_HDIMG_BOOTLOADER_ENV)
 
 $(IMAGE_HDIMG_IMAGE):
-- 
2.30.2


_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de
To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de


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

* Re: [ptxdist] [PATCH] image-hdimg.make: Add PROJECT and PROJECT_VERSION variables.
  2022-01-14 11:56 [ptxdist] [PATCH] image-hdimg.make: Add PROJECT and PROJECT_VERSION variables Christian Melki
@ 2022-01-21  8:19 ` Michael Olbrich
  2022-01-21  8:44   ` Christian Melki
  2022-02-04 13:13   ` Christian Melki
  0 siblings, 2 replies; 5+ messages in thread
From: Michael Olbrich @ 2022-01-21  8:19 UTC (permalink / raw)
  To: Christian Melki; +Cc: ptxdist

On Fri, Jan 14, 2022 at 12:56:47PM +0100, Christian Melki wrote:
> Ideally, I'd like this to be in the generic genimage env.
> I need this to be able to name images according to the project.

I don't really like adding random stuff here. And it's easy to expand this
locally:

IMAGE_HDIMG_ENV += \
	PROJECT=$(PTXCONF_PROJECT) \
	PROJECT_VERSION=$(PTXCONF_PROJECT_VERSION)

In rules/image-hdimg.<something>.make in your BSP since ptxdist-2021.12.0 or in
rules/post/<something>.make before that.
So you don't need to overwrite the upstream rule entirely and it's easy to
maintain.

Michael

> Signed-off-by: Christian Melki <christian.melki@t2data.com>
> ---
>  rules/image-hdimg.make | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/rules/image-hdimg.make b/rules/image-hdimg.make
> index b470c0fb6..6f0012a85 100644
> --- a/rules/image-hdimg.make
> +++ b/rules/image-hdimg.make
> @@ -57,6 +57,8 @@ IMAGE_HDIMG_ENV = \
>  	PARTITION_TABLE_TYPE=$(call ptx/ifdef, PTXCONF_IMAGE_HDIMG_GPT,gpt,mbr) \
>  	PARTITION_TYPE_SUFFIX=$(call ptx/ifdef, PTXCONF_IMAGE_HDIMG_GPT,-uuid) \
>  	ROOT_PARTITION_TYPE=$(call ptx/ifdef, PTXCONF_IMAGE_HDIMG_GPT,L,0x83) \
> +	PROJECT=$(PTXCONF_PROJECT) \
> +	PROJECT_VERSION=$(PTXCONF_PROJECT_VERSION) \
>  	$(IMAGE_HDIMG_BOOTLOADER_ENV)
>  
>  $(IMAGE_HDIMG_IMAGE):
> -- 
> 2.30.2
> 
> 
> _______________________________________________
> ptxdist mailing list
> ptxdist@pengutronix.de
> To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de
To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de


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

* Re: [ptxdist] [PATCH] image-hdimg.make: Add PROJECT and PROJECT_VERSION variables.
  2022-01-21  8:19 ` Michael Olbrich
@ 2022-01-21  8:44   ` Christian Melki
  2022-02-04 13:13   ` Christian Melki
  1 sibling, 0 replies; 5+ messages in thread
From: Christian Melki @ 2022-01-21  8:44 UTC (permalink / raw)
  To: ptxdist



On 1/21/22 9:19 AM, Michael Olbrich wrote:
> On Fri, Jan 14, 2022 at 12:56:47PM +0100, Christian Melki wrote:
>> Ideally, I'd like this to be in the generic genimage env.
>> I need this to be able to name images according to the project.
> 
> I don't really like adding random stuff here. And it's easy to expand this
> locally:
> 
> IMAGE_HDIMG_ENV += \
> 	PROJECT=$(PTXCONF_PROJECT) \
> 	PROJECT_VERSION=$(PTXCONF_PROJECT_VERSION)
> 
> In rules/image-hdimg.<something>.make in your BSP since ptxdist-2021.12.0 or in
> rules/post/<something>.make before that.
> So you don't need to overwrite the upstream rule entirely and it's easy to
> maintain.
> 
> Michael
> 

Mmm.

I do agree that this is pretty random, but it's not random wanting to 
name your images according to some project/project-version naming scheme.

I was thinking more like adding project and project_version to the 
calling image env. But I was unsure how to do that. Maybe this was 
totally unnecessary because the variables already existed in the image 
env in some form?

>> Signed-off-by: Christian Melki <christian.melki@t2data.com>
>> ---
>>   rules/image-hdimg.make | 2 ++
>>   1 file changed, 2 insertions(+)
>>
>> diff --git a/rules/image-hdimg.make b/rules/image-hdimg.make
>> index b470c0fb6..6f0012a85 100644
>> --- a/rules/image-hdimg.make
>> +++ b/rules/image-hdimg.make
>> @@ -57,6 +57,8 @@ IMAGE_HDIMG_ENV = \
>>   	PARTITION_TABLE_TYPE=$(call ptx/ifdef, PTXCONF_IMAGE_HDIMG_GPT,gpt,mbr) \
>>   	PARTITION_TYPE_SUFFIX=$(call ptx/ifdef, PTXCONF_IMAGE_HDIMG_GPT,-uuid) \
>>   	ROOT_PARTITION_TYPE=$(call ptx/ifdef, PTXCONF_IMAGE_HDIMG_GPT,L,0x83) \
>> +	PROJECT=$(PTXCONF_PROJECT) \
>> +	PROJECT_VERSION=$(PTXCONF_PROJECT_VERSION) \
>>   	$(IMAGE_HDIMG_BOOTLOADER_ENV)
>>   
>>   $(IMAGE_HDIMG_IMAGE):
>> -- 
>> 2.30.2
>>
>>
>> _______________________________________________
>> ptxdist mailing list
>> ptxdist@pengutronix.de
>> To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de
>>
> 

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de
To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de


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

* Re: [ptxdist] [PATCH] image-hdimg.make: Add PROJECT and PROJECT_VERSION variables.
  2022-01-21  8:19 ` Michael Olbrich
  2022-01-21  8:44   ` Christian Melki
@ 2022-02-04 13:13   ` Christian Melki
  2022-02-04 14:47     ` Michael Olbrich
  1 sibling, 1 reply; 5+ messages in thread
From: Christian Melki @ 2022-02-04 13:13 UTC (permalink / raw)
  To: m.olbrich; +Cc: ptxdist

On 1/21/22 9:19 AM, Michael Olbrich wrote:
> On Fri, Jan 14, 2022 at 12:56:47PM +0100, Christian Melki wrote:
>> Ideally, I'd like this to be in the generic genimage env.
>> I need this to be able to name images according to the project.
> 
> I don't really like adding random stuff here. And it's easy to expand this
> locally:
> 
> IMAGE_HDIMG_ENV += \
> 	PROJECT=$(PTXCONF_PROJECT) \
> 	PROJECT_VERSION=$(PTXCONF_PROJECT_VERSION)
> 
> In rules/image-hdimg.<something>.make in your BSP since ptxdist-2021.12.0 or in
> rules/post/<something>.make before that.
> So you don't need to overwrite the upstream rule entirely and it's easy to
> maintain.
> 
> Michael
> 

Is there some form of documentation on this somewhere?
An example? Say I want to add a file to the weston targetinstall?
Can that be used for such things?
Is the weston.something.make a copy of the original? What needs to be in 
this file?
Does it override the entire target? For example targetinstall?

So many questions. :)

>> Signed-off-by: Christian Melki <christian.melki@t2data.com>
>> ---
>>   rules/image-hdimg.make | 2 ++
>>   1 file changed, 2 insertions(+)
>>
>> diff --git a/rules/image-hdimg.make b/rules/image-hdimg.make
>> index b470c0fb6..6f0012a85 100644
>> --- a/rules/image-hdimg.make
>> +++ b/rules/image-hdimg.make
>> @@ -57,6 +57,8 @@ IMAGE_HDIMG_ENV = \
>>   	PARTITION_TABLE_TYPE=$(call ptx/ifdef, PTXCONF_IMAGE_HDIMG_GPT,gpt,mbr) \
>>   	PARTITION_TYPE_SUFFIX=$(call ptx/ifdef, PTXCONF_IMAGE_HDIMG_GPT,-uuid) \
>>   	ROOT_PARTITION_TYPE=$(call ptx/ifdef, PTXCONF_IMAGE_HDIMG_GPT,L,0x83) \
>> +	PROJECT=$(PTXCONF_PROJECT) \
>> +	PROJECT_VERSION=$(PTXCONF_PROJECT_VERSION) \
>>   	$(IMAGE_HDIMG_BOOTLOADER_ENV)
>>   
>>   $(IMAGE_HDIMG_IMAGE):
>> -- 
>> 2.30.2
>>
>>
>> _______________________________________________
>> ptxdist mailing list
>> ptxdist@pengutronix.de
>> To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de
>>
> 

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de
To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de


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

* Re: [ptxdist] [PATCH] image-hdimg.make: Add PROJECT and PROJECT_VERSION variables.
  2022-02-04 13:13   ` Christian Melki
@ 2022-02-04 14:47     ` Michael Olbrich
  0 siblings, 0 replies; 5+ messages in thread
From: Michael Olbrich @ 2022-02-04 14:47 UTC (permalink / raw)
  To: Christian Melki; +Cc: ptxdist

On Fri, Feb 04, 2022 at 02:13:53PM +0100, Christian Melki wrote:
> On 1/21/22 9:19 AM, Michael Olbrich wrote:
> > On Fri, Jan 14, 2022 at 12:56:47PM +0100, Christian Melki wrote:
> > > Ideally, I'd like this to be in the generic genimage env.
> > > I need this to be able to name images according to the project.
> > 
> > I don't really like adding random stuff here. And it's easy to expand this
> > locally:
> > 
> > IMAGE_HDIMG_ENV += \
> > 	PROJECT=$(PTXCONF_PROJECT) \
> > 	PROJECT_VERSION=$(PTXCONF_PROJECT_VERSION)
> > 
> > In rules/image-hdimg.<something>.make in your BSP since ptxdist-2021.12.0 or in
> > rules/post/<something>.make before that.
> > So you don't need to overwrite the upstream rule entirely and it's easy to
> > maintain.
> > 
> > Michael
> > 
> 
> Is there some form of documentation on this somewhere?

Unfortunately not yet.

> An example? Say I want to add a file to the weston targetinstall?
> Can that be used for such things?
> Is the weston.something.make a copy of the original? What needs to be in
> this file?
> Does it override the entire target? For example targetinstall?

It does not override anything. The <pkg>.<something>.make has two
features:
1. It is always included directly after <pkg>.make. This means that
   any variable defined in <pkg>.make is already defined when
   <pkg>.<something>.make. This helps for anything where the parse order in
   make is relevant.
2. As an individual file, it has the same override mechanism as <pkg>.make.

The rest is just make syntax. 'targetinstall' is a make target. Redefining
a make target results in a warning from make and the new definition
replaces the old one. So there is no way to expand it.

To change 'targetinstall' like that you need a full copy of <pkg>.make in
your BSP. PTXdist will then use that one instead.

What you can du in <pkg>.<something>.make is change variables. This works
because the variables used in a make target are expanded when the target is
executed. At that point all files are parsed and the variables have
whatever value was assigned last.

Michael

> 
> So many questions. :)
> 
> > > Signed-off-by: Christian Melki <christian.melki@t2data.com>
> > > ---
> > >   rules/image-hdimg.make | 2 ++
> > >   1 file changed, 2 insertions(+)
> > > 
> > > diff --git a/rules/image-hdimg.make b/rules/image-hdimg.make
> > > index b470c0fb6..6f0012a85 100644
> > > --- a/rules/image-hdimg.make
> > > +++ b/rules/image-hdimg.make
> > > @@ -57,6 +57,8 @@ IMAGE_HDIMG_ENV = \
> > >   	PARTITION_TABLE_TYPE=$(call ptx/ifdef, PTXCONF_IMAGE_HDIMG_GPT,gpt,mbr) \
> > >   	PARTITION_TYPE_SUFFIX=$(call ptx/ifdef, PTXCONF_IMAGE_HDIMG_GPT,-uuid) \
> > >   	ROOT_PARTITION_TYPE=$(call ptx/ifdef, PTXCONF_IMAGE_HDIMG_GPT,L,0x83) \
> > > +	PROJECT=$(PTXCONF_PROJECT) \
> > > +	PROJECT_VERSION=$(PTXCONF_PROJECT_VERSION) \
> > >   	$(IMAGE_HDIMG_BOOTLOADER_ENV)
> > >   $(IMAGE_HDIMG_IMAGE):
> > > -- 
> > > 2.30.2
> > > 
> > > 
> > > _______________________________________________
> > > ptxdist mailing list
> > > ptxdist@pengutronix.de
> > > To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de
> > > 
> > 
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de
To unsubscribe, send a mail with subject "unsubscribe" to ptxdist-request@pengutronix.de


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

end of thread, other threads:[~2022-02-04 14:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-14 11:56 [ptxdist] [PATCH] image-hdimg.make: Add PROJECT and PROJECT_VERSION variables Christian Melki
2022-01-21  8:19 ` Michael Olbrich
2022-01-21  8:44   ` Christian Melki
2022-02-04 13:13   ` Christian Melki
2022-02-04 14:47     ` Michael Olbrich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox