mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
* [ptxdist] [PATCH v2 1/2] dtc: Seperate path and filename of dts
@ 2014-05-15  9:10 Teresa Gámez
  2014-05-15  9:10 ` [ptxdist] [PATCH v2 2/2] barebox_mlo: use images/barebox-*-mlo.img as images Teresa Gámez
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Teresa Gámez @ 2014-05-15  9:10 UTC (permalink / raw)
  To: ptxdist

Creating multiple device trees result in a quite
long DTC_OFTREE_DTS variable. Splitting it into a
path variable and file variable makes it more handy.

Signed-off-by: Teresa Gámez <t.gamez@phytec.de>
---
Changed v2:
- Add default for DTC_OFFTREE_DTS_PATH

 platforms/dtc.in    |    8 +++++++-
 rules/post/dts.make |    8 ++++++--
 2 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/platforms/dtc.in b/platforms/dtc.in
index a39af97..dbf3c55 100644
--- a/platforms/dtc.in
+++ b/platforms/dtc.in
@@ -19,9 +19,15 @@ config DTC_INSTALL_OFTREE
 	  Creates an package to install the 'oftree' file to /boot
 	  of your target system.
 
+config DTC_OFTREE_DTS_PATH
+	string "path to source dts file"
+	default "${KERNEL_DIR}/arch/${PTXCONF_KERNEL_ARCH_STRING}/boot/dts/"
+	help
+	  Define path to the dts source file.
+
 config DTC_OFTREE_DTS
 	string "source dts file"
-	default "${KERNEL_DIR}/arch/${PTXCONF_KERNEL_ARCH_STRING}/boot/dts/<yourboard>.dts"
+	default "<yourboard>.dts"
 	help
 	  Select the dts file to use for the device tree binary
 	  blob generation. Default is to use the one shipped with
diff --git a/rules/post/dts.make b/rules/post/dts.make
index 8d2b7fe..b39a4f0 100644
--- a/rules/post/dts.make
+++ b/rules/post/dts.make
@@ -12,10 +12,14 @@
 # defined in post/ to make sure PTXCONF_DTC_OFTREE_DTS is fully defined
 # .dtb depends on the .dts and dtc.install for all other dependencies
 #
+
+DTS_PATH = $(call remove_quotes,$(PTXCONF_DTC_OFTREE_DTS_PATH))
+
 $(foreach dts, $(call remove_quotes,$(PTXCONF_DTC_OFTREE_DTS)), \
-	$(eval $(IMAGEDIR)/$(call ptx/dtb, $(dts)): $(dts)  $(STATEDIR)/dtc.install))
+	$(eval $(IMAGEDIR)/$(call ptx/dtb, $(DTS_PATH)/$(dts)): \
+	$(DTS_PATH)/$(dts)  $(STATEDIR)/dtc.install))
 
 $(foreach dts, $(call remove_quotes,$(PTXCONF_DTC_OFTREE_DTS)), \
-	$(eval $(dts):  $(STATEDIR)/kernel.extract.post))
+	$(eval $(DTS_PATH)/$(dts):  $(STATEDIR)/kernel.extract.post))
 
 # vim: syntax=make
-- 
1.7.0.4


-- 
ptxdist mailing list
ptxdist@pengutronix.de

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

* [ptxdist] [PATCH v2 2/2] barebox_mlo: use images/barebox-*-mlo.img as images
  2014-05-15  9:10 [ptxdist] [PATCH v2 1/2] dtc: Seperate path and filename of dts Teresa Gámez
@ 2014-05-15  9:10 ` Teresa Gámez
  2014-06-11  6:30   ` Michael Olbrich
  2014-05-15  9:38 ` [ptxdist] [PATCH v2 1/2] dtc: Seperate path and filename of dts Alexander Aring
  2014-05-16  6:45 ` Alexander Aring
  2 siblings, 1 reply; 7+ messages in thread
From: Teresa Gámez @ 2014-05-15  9:10 UTC (permalink / raw)
  To: ptxdist

New barebox versions may create multiple MLO images.
Adapted barebox_mlo rule to handle this.

Signed-off-by: Teresa Gámez <t.gamez@phytec.de>
---
Changes in v2:
- Reworked second if statement
- Added tick marks

 rules/barebox_mlo.make |   15 ++++++++++++---
 1 files changed, 12 insertions(+), 3 deletions(-)

diff --git a/rules/barebox_mlo.make b/rules/barebox_mlo.make
index 3c53575..f90955c 100644
--- a/rules/barebox_mlo.make
+++ b/rules/barebox_mlo.make
@@ -76,9 +76,18 @@ $(STATEDIR)/barebox_mlo.install:
 $(STATEDIR)/barebox_mlo.targetinstall:
 	@$(call targetinfo)
 #	#barebox renamed barebox.bin.ift to MLO, so fall back to barebox.bin.ift
-	@ptxd_get_path "$(BAREBOX_MLO_DIR)/MLO" \
-		"$(BAREBOX_MLO_DIR)/barebox.bin.ift" && \
-	install -D -m644 "$${ptxd_reply}" "$(IMAGEDIR)/MLO"
+	@rm -f $(IMAGEDIR)/MLO
+	@for image in `ls $(BAREBOX_MLO_DIR)/images/barebox-*-mlo.img`; do \
+		install -D -m644 $$image $(IMAGEDIR)/`basename $$image`; \
+		if [ ! -e "$(IMAGEDIR)/MLO" ]; then \
+			ln -sf `basename $$image` $(IMAGEDIR)/MLO; \
+		fi; \
+	done
+	@if [ ! -e "$(IMAGEDIR)/MLO" ]; then \
+		ptxd_get_path "$(BAREBOX_MLO_DIR)/MLO" \
+			"$(BAREBOX_MLO_DIR)/barebox.bin.ift" && \
+		install -D -m644 "$${ptxd_reply}" "$(IMAGEDIR)/MLO"; \
+	fi
 
 	@$(call touch)
 
-- 
1.7.0.4


-- 
ptxdist mailing list
ptxdist@pengutronix.de

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

* Re: [ptxdist] [PATCH v2 1/2] dtc: Seperate path and filename of dts
  2014-05-15  9:10 [ptxdist] [PATCH v2 1/2] dtc: Seperate path and filename of dts Teresa Gámez
  2014-05-15  9:10 ` [ptxdist] [PATCH v2 2/2] barebox_mlo: use images/barebox-*-mlo.img as images Teresa Gámez
@ 2014-05-15  9:38 ` Alexander Aring
  2014-05-16  6:45 ` Alexander Aring
  2 siblings, 0 replies; 7+ messages in thread
From: Alexander Aring @ 2014-05-15  9:38 UTC (permalink / raw)
  To: ptxdist

On Thu, May 15, 2014 at 11:10:08AM +0200, Teresa Gámez wrote:
> Creating multiple device trees result in a quite
> long DTC_OFTREE_DTS variable. Splitting it into a
> path variable and file variable makes it more handy.
> 
> Signed-off-by: Teresa Gámez <t.gamez@phytec.de>
> ---
> Changed v2:
> - Add default for DTC_OFFTREE_DTS_PATH
> 
>  platforms/dtc.in    |    8 +++++++-
>  rules/post/dts.make |    8 ++++++--
>  2 files changed, 13 insertions(+), 3 deletions(-)
> 
> diff --git a/platforms/dtc.in b/platforms/dtc.in
> index a39af97..dbf3c55 100644
> --- a/platforms/dtc.in
> +++ b/platforms/dtc.in
> @@ -19,9 +19,15 @@ config DTC_INSTALL_OFTREE
>  	  Creates an package to install the 'oftree' file to /boot
>  	  of your target system.
>  
> +config DTC_OFTREE_DTS_PATH
> +	string "path to source dts file"
> +	default "${KERNEL_DIR}/arch/${PTXCONF_KERNEL_ARCH_STRING}/boot/dts/"

little nitpick here. This produce an output of "/foo/bar/boot/dts//bar.foo".
								 ^^
					this will not generate a nice output

Sorry, I said in my previous mail
"${KERNEL_DIR}/arch/${PTXCONF_KERNEL_ARCH_STRING}/boot/dts/"... but I
was a little bit too fast and did not remove the '/'. :-(

- Alex

-- 
ptxdist mailing list
ptxdist@pengutronix.de

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

* Re: [ptxdist] [PATCH v2 1/2] dtc: Seperate path and filename of dts
  2014-05-15  9:10 [ptxdist] [PATCH v2 1/2] dtc: Seperate path and filename of dts Teresa Gámez
  2014-05-15  9:10 ` [ptxdist] [PATCH v2 2/2] barebox_mlo: use images/barebox-*-mlo.img as images Teresa Gámez
  2014-05-15  9:38 ` [ptxdist] [PATCH v2 1/2] dtc: Seperate path and filename of dts Alexander Aring
@ 2014-05-16  6:45 ` Alexander Aring
  2014-06-11  6:29   ` Michael Olbrich
  2 siblings, 1 reply; 7+ messages in thread
From: Alexander Aring @ 2014-05-16  6:45 UTC (permalink / raw)
  To: ptxdist

I detected a new issue with this patch.


First:

Before it was possible to have something like:

PTXCONF_DTC_OFTREE_DTS="/bar/foo/foobar.dts /foo/bar/barfoo.dts"

These files have a different basename. With your patch the basename must
be one unique basename. I mean okay, we could drop this and force the
ptxdist users that all dts files need to be under one location.

or

we make a for-each to search all directories of DTS_PATH, then we could
configure something like that:

DTC_OFTREE_DTS_PATHS="/bar/foo /foo/bar"
DTC_OFTREE_DTS="foobar.dts barfoo.dts"



Second:

We should write some migrate sed pattern for
"scripts/migrate/migrate_ptx". I think this becomes a little bit
complicated, if you like I can try to help you there. ;)

- Alex

-- 
ptxdist mailing list
ptxdist@pengutronix.de

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

* Re: [ptxdist] [PATCH v2 1/2] dtc: Seperate path and filename of dts
  2014-05-16  6:45 ` Alexander Aring
@ 2014-06-11  6:29   ` Michael Olbrich
  2014-06-20  7:23     ` Alexander Aring
  0 siblings, 1 reply; 7+ messages in thread
From: Michael Olbrich @ 2014-06-11  6:29 UTC (permalink / raw)
  To: ptxdist

Hi,

I've rewritten the patch taking these issues into account.
I'll merge it after the release.

On Fri, May 16, 2014 at 08:45:19AM +0200, Alexander Aring wrote:
> I detected a new issue with this patch.
> 
> 
> First:
> 
> Before it was possible to have something like:
> 
> PTXCONF_DTC_OFTREE_DTS="/bar/foo/foobar.dts /foo/bar/barfoo.dts"
> 
> These files have a different basename. With your patch the basename must
> be one unique basename. I mean okay, we could drop this and force the
> ptxdist users that all dts files need to be under one location.
> 
> or
> 
> we make a for-each to search all directories of DTS_PATH, then we could
> configure something like that:
> 
> DTC_OFTREE_DTS_PATHS="/bar/foo /foo/bar"
> DTC_OFTREE_DTS="foobar.dts barfoo.dts"

I've used ':' as a separater for the path.

> Second:
> 
> We should write some migrate sed pattern for
> "scripts/migrate/migrate_ptx". I think this becomes a little bit
> complicated, if you like I can try to help you there. ;)

Doing this correctly in sed seems rather complex:
- don't do anything if DTC_OFTREE_DTS_PATHS is already set
- move all directories to DTC_OFTREE_DTS_PATHS
- make them unique

Instead I've done this backwards compatible: Don't add DTC_OFTREE_DTS_PATHS
if the filename starts with '/'.

Michael

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

-- 
ptxdist mailing list
ptxdist@pengutronix.de

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

* Re: [ptxdist] [PATCH v2 2/2] barebox_mlo: use images/barebox-*-mlo.img as images
  2014-05-15  9:10 ` [ptxdist] [PATCH v2 2/2] barebox_mlo: use images/barebox-*-mlo.img as images Teresa Gámez
@ 2014-06-11  6:30   ` Michael Olbrich
  0 siblings, 0 replies; 7+ messages in thread
From: Michael Olbrich @ 2014-06-11  6:30 UTC (permalink / raw)
  To: ptxdist

On Thu, May 15, 2014 at 11:10:09AM +0200, Teresa Gámez wrote:
> New barebox versions may create multiple MLO images.
> Adapted barebox_mlo rule to handle this.
> 
> Signed-off-by: Teresa Gámez <t.gamez@phytec.de>

Thanks, applied.

Michael

> ---
> Changes in v2:
> - Reworked second if statement
> - Added tick marks
> 
>  rules/barebox_mlo.make |   15 ++++++++++++---
>  1 files changed, 12 insertions(+), 3 deletions(-)
> 
> diff --git a/rules/barebox_mlo.make b/rules/barebox_mlo.make
> index 3c53575..f90955c 100644
> --- a/rules/barebox_mlo.make
> +++ b/rules/barebox_mlo.make
> @@ -76,9 +76,18 @@ $(STATEDIR)/barebox_mlo.install:
>  $(STATEDIR)/barebox_mlo.targetinstall:
>  	@$(call targetinfo)
>  #	#barebox renamed barebox.bin.ift to MLO, so fall back to barebox.bin.ift
> -	@ptxd_get_path "$(BAREBOX_MLO_DIR)/MLO" \
> -		"$(BAREBOX_MLO_DIR)/barebox.bin.ift" && \
> -	install -D -m644 "$${ptxd_reply}" "$(IMAGEDIR)/MLO"
> +	@rm -f $(IMAGEDIR)/MLO
> +	@for image in `ls $(BAREBOX_MLO_DIR)/images/barebox-*-mlo.img`; do \
> +		install -D -m644 $$image $(IMAGEDIR)/`basename $$image`; \
> +		if [ ! -e "$(IMAGEDIR)/MLO" ]; then \
> +			ln -sf `basename $$image` $(IMAGEDIR)/MLO; \
> +		fi; \
> +	done
> +	@if [ ! -e "$(IMAGEDIR)/MLO" ]; then \
> +		ptxd_get_path "$(BAREBOX_MLO_DIR)/MLO" \
> +			"$(BAREBOX_MLO_DIR)/barebox.bin.ift" && \
> +		install -D -m644 "$${ptxd_reply}" "$(IMAGEDIR)/MLO"; \
> +	fi
>  
>  	@$(call touch)
>  
> -- 
> 1.7.0.4
> 
> 
> -- 
> ptxdist mailing list
> ptxdist@pengutronix.de

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

-- 
ptxdist mailing list
ptxdist@pengutronix.de

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

* Re: [ptxdist] [PATCH v2 1/2] dtc: Seperate path and filename of dts
  2014-06-11  6:29   ` Michael Olbrich
@ 2014-06-20  7:23     ` Alexander Aring
  0 siblings, 0 replies; 7+ messages in thread
From: Alexander Aring @ 2014-06-20  7:23 UTC (permalink / raw)
  To: ptxdist

Hi,

On Wed, Jun 11, 2014 at 08:29:55AM +0200, Michael Olbrich wrote:
> Hi,
> 
> I've rewritten the patch taking these issues into account.
> I'll merge it after the release.
> 
> On Fri, May 16, 2014 at 08:45:19AM +0200, Alexander Aring wrote:
> > I detected a new issue with this patch.
> > 
> > 
> > First:
> > 
> > Before it was possible to have something like:
> > 
> > PTXCONF_DTC_OFTREE_DTS="/bar/foo/foobar.dts /foo/bar/barfoo.dts"
> > 
> > These files have a different basename. With your patch the basename must
> > be one unique basename. I mean okay, we could drop this and force the
> > ptxdist users that all dts files need to be under one location.
> > 
> > or
> > 
> > we make a for-each to search all directories of DTS_PATH, then we could
> > configure something like that:
> > 
> > DTC_OFTREE_DTS_PATHS="/bar/foo /foo/bar"
> > DTC_OFTREE_DTS="foobar.dts barfoo.dts"
> 
> I've used ':' as a separater for the path.
> 

just to clarify, what's the priority in this list?

Should we do that like PATH? Then I would prefer

${KERNEL_DIR}/arch/${PTXCONF_KERNEL_ARCH_STRING}/boot/dts:${PTXDIST_PLATFORMCONFIGDIR}/dts

instead

${PTXDIST_PLATFORMCONFIGDIR}/dts:${KERNEL_DIR}/arch/${PTXCONF_KERNEL_ARCH_STRING}/boot/dts

as default value. Then I can just copy the mainline dts file to ${PTXDIST_PLATFORMCONFIGDIR}/dts
without renaming and make some platform changes.

- Alex

-- 
ptxdist mailing list
ptxdist@pengutronix.de

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

end of thread, other threads:[~2014-06-20  7:23 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-15  9:10 [ptxdist] [PATCH v2 1/2] dtc: Seperate path and filename of dts Teresa Gámez
2014-05-15  9:10 ` [ptxdist] [PATCH v2 2/2] barebox_mlo: use images/barebox-*-mlo.img as images Teresa Gámez
2014-06-11  6:30   ` Michael Olbrich
2014-05-15  9:38 ` [ptxdist] [PATCH v2 1/2] dtc: Seperate path and filename of dts Alexander Aring
2014-05-16  6:45 ` Alexander Aring
2014-06-11  6:29   ` Michael Olbrich
2014-06-20  7:23     ` Alexander Aring

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