public inbox for linux-tegra@vger.kernel.org
 help / color / mirror / Atom feed
* [cbootimage-configs PATCH v2] post.mk: Create dependency makefile by
@ 2017-03-31 15:01 Nikolaus Schulz
       [not found] ` <20170331150153.14606-1-nikolaus.schulz-RM9K5IK7kjKj5M59NBduVrNAH6kLmebB@public.gmane.org>
  0 siblings, 1 reply; 8+ messages in thread
From: Nikolaus Schulz @ 2017-03-31 15:01 UTC (permalink / raw)
  To: linux-tegra-u79uwXL29TY76Z2rM5mHXA

v1 of the patch didn't apply to current master, sorry about that.

Best regards,
Nikolaus

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

* [cbootimage-configs PATCH v2] post.mk: Create dependency makefile by makefile rule
       [not found] ` <20170331150153.14606-1-nikolaus.schulz-RM9K5IK7kjKj5M59NBduVrNAH6kLmebB@public.gmane.org>
@ 2017-03-31 15:01   ` Nikolaus Schulz
       [not found]     ` <20170331150153.14606-2-nikolaus.schulz-RM9K5IK7kjKj5M59NBduVrNAH6kLmebB@public.gmane.org>
  0 siblings, 1 reply; 8+ messages in thread
From: Nikolaus Schulz @ 2017-03-31 15:01 UTC (permalink / raw)
  To: linux-tegra-u79uwXL29TY76Z2rM5mHXA; +Cc: Nikolaus Schulz

Creating the emmc image requires creating the bct file and the
bootloader image first.  These dependencies are written to a makefile
snippet that is created by the gen-image-deps.sh script.  But that
script is only invoked when the rule that creates the emmc image is run,
which is too late for creating the dependencies makefile.

Add a rule to post.mk that tells make how to create the dependencies
makefile; with that in place, make automatically makes the dependency
makefile before executing any other rules.

Signed-off-by: Nikolaus Schulz <nikolaus.schulz-RM9K5IK7kjKj5M59NBduVrNAH6kLmebB@public.gmane.org>
---
 build/post.mk | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/build/post.mk b/build/post.mk
index 979d8ce..a647c81 100644
--- a/build/post.mk
+++ b/build/post.mk
@@ -21,11 +21,12 @@ bcts: $(bcts)
 images: $(images)
 
 image_deps := $(addprefix .,$(addsuffix .d,$(images)))
+$(image_deps): .%.d : %.cfg
+	../../../build/gen-image-deps.sh $< $(@:.%.d=%) $@
 -include $(image_deps)
 
 %.bct: %.bct.cfg
 	cbootimage -gbct -$(soc) $< $@
 
 %.img: %.img.cfg
-	../../../build/gen-image-deps.sh $< $@ .$@.d
 	cbootimage -$(soc) $< $@
-- 
2.11.0

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

* Re: [cbootimage-configs PATCH v2] post.mk: Create dependency makefile by makefile rule
       [not found]     ` <20170331150153.14606-2-nikolaus.schulz-RM9K5IK7kjKj5M59NBduVrNAH6kLmebB@public.gmane.org>
@ 2017-03-31 15:46       ` Stephen Warren
       [not found]         ` <8bf27012-af67-3faf-206b-ebd5cd76b276-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
  0 siblings, 1 reply; 8+ messages in thread
From: Stephen Warren @ 2017-03-31 15:46 UTC (permalink / raw)
  To: Nikolaus Schulz; +Cc: linux-tegra-u79uwXL29TY76Z2rM5mHXA

On 03/31/2017 09:01 AM, Nikolaus Schulz wrote:
> Creating the emmc image requires creating the bct file and the
> bootloader image first.  These dependencies are written to a makefile
> snippet that is created by the gen-image-deps.sh script.  But that
> script is only invoked when the rule that creates the emmc image is run,
> which is too late for creating the dependencies makefile.
>
> Add a rule to post.mk that tells make how to create the dependencies
> makefile; with that in place, make automatically makes the dependency
> makefile before executing any other rules.

I don't think this change is correct, or at least necessary.

The concept here is that:

- If an output file does not exist at all, it will be built for the 
first time, and a dependency file will be generated for the next time.

- If an output file does exist, the related dependency file is also 
expected to exist, and specify the dependencies, so that if they change, 
a rebuild will occur.

In particular, the dependency file is/should-no-be necessary in the case 
where an output file is to be generated for the first time.

If a known dependency specification is missing, we should specify it 
directly in the makefile itself. The generated dependency files are 
intended to represent unknown/unknowable dependencies.

Is it possible to fix this problem that way instead?

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

* Re: [cbootimage-configs PATCH v2] post.mk: Create dependency makefile by makefile rule
       [not found]         ` <8bf27012-af67-3faf-206b-ebd5cd76b276-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
@ 2017-04-03 12:22           ` Nikolaus Schulz
       [not found]             ` <20170403122214.cqth3myvv6tpysr4-RM9K5IK7kjJNqqvv04100KcOhU4Rzj621B7CTYaBSLdn68oJJulU0Q@public.gmane.org>
  2017-04-03 12:25           ` [cbootimage-configs PATCH 1/2] post.mk: Add dependency of emmc image on bct file Nikolaus Schulz
  1 sibling, 1 reply; 8+ messages in thread
From: Nikolaus Schulz @ 2017-04-03 12:22 UTC (permalink / raw)
  To: Stephen Warren; +Cc: linux-tegra-u79uwXL29TY76Z2rM5mHXA

On Fri, Mar 31, 2017 at 09:46:19AM -0600, Stephen Warren wrote:
> On 03/31/2017 09:01 AM, Nikolaus Schulz wrote:
> > Creating the emmc image requires creating the bct file and the
> > bootloader image first.  These dependencies are written to a makefile
> > snippet that is created by the gen-image-deps.sh script.  But that
> > script is only invoked when the rule that creates the emmc image is run,
> > which is too late for creating the dependencies makefile.
> > 
> > Add a rule to post.mk that tells make how to create the dependencies
> > makefile; with that in place, make automatically makes the dependency
> > makefile before executing any other rules.
> 
> I don't think this change is correct, or at least necessary.
> 
> The concept here is that:
> 
> - If an output file does not exist at all, it will be built for the first
> time, and a dependency file will be generated for the next time.
> 
> - If an output file does exist, the related dependency file is also expected
> to exist, and specify the dependencies, so that if they change, a rebuild
> will occur.
> 
> In particular, the dependency file is/should-no-be necessary in the case
> where an output file is to be generated for the first time.
> 
> If a known dependency specification is missing, we should specify it
> directly in the makefile itself. The generated dependency files are intended
> to represent unknown/unknowable dependencies.
> 
> Is it possible to fix this problem that way instead?

Well, the dependencies in question are hard dependencies: creating the
emmc image has the bct file and the bootloader image as prerequisites.

I just noticed though that specifying the dependency on the bct file
need not use gen-image-deps.sh at all, since the bct filename is already
known to make.  I'll send an alternate, trivial patch.

Note that the dependency on the bootloader image can be added to the
makefiles in a similar way by simply adding a variable for the filename
to the per-soc Makefiles and make that a prerequisite of the emmc image.
With that there is no need for a dynamically generated dependency file
at all, at the slight expense of some (more) duplication of filenames.

I'll send a separate patch doing that as an RFC.

Regards,
Nikolaus
-- 
Avionic Design GmbH
Nikolaus Schulz
Wragekamp 10
D-22397 Hamburg
Germany

Tel.:  +49 40 88187-163
Fax:   +49 40 88187-150
Email: nikolaus.schulz-RM9K5IK7kjKj5M59NBduVrNAH6kLmebB@public.gmane.org

Avionic Design GmbH
Amtsgericht Hamburg HRB 82598
Geschäftsführung: Cornelis Broers
Ust.-Ident-Nr.: DE813378254

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

* [cbootimage-configs PATCH 1/2] post.mk: Add dependency of emmc image on bct file
       [not found]         ` <8bf27012-af67-3faf-206b-ebd5cd76b276-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
  2017-04-03 12:22           ` Nikolaus Schulz
@ 2017-04-03 12:25           ` Nikolaus Schulz
       [not found]             ` <20170403122511.7194-1-nikolaus.schulz-RM9K5IK7kjKj5M59NBduVrNAH6kLmebB@public.gmane.org>
  1 sibling, 1 reply; 8+ messages in thread
From: Nikolaus Schulz @ 2017-04-03 12:25 UTC (permalink / raw)
  To: linux-tegra-u79uwXL29TY76Z2rM5mHXA, Stephen Warren; +Cc: Nikolaus Schulz

Creating an emmc image requires the bct file as a prerequisite.
Add the dependency to post.mk.

Signed-off-by: Nikolaus Schulz <nikolaus.schulz-RM9K5IK7kjKj5M59NBduVrNAH6kLmebB@public.gmane.org>
---
 build/post.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/build/post.mk b/build/post.mk
index 979d8ce..809fa2b 100644
--- a/build/post.mk
+++ b/build/post.mk
@@ -26,6 +26,6 @@ image_deps := $(addprefix .,$(addsuffix .d,$(images)))
 %.bct: %.bct.cfg
 	cbootimage -gbct -$(soc) $< $@
 
-%.img: %.img.cfg
+%.img: %.img.cfg $(bcts)
 	../../../build/gen-image-deps.sh $< $@ .$@.d
 	cbootimage -$(soc) $< $@
-- 
2.11.0

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

* [cbootimage-configs PATCH 2/2] Use fixed variables to track image dependencies
       [not found]             ` <20170403122511.7194-1-nikolaus.schulz-RM9K5IK7kjKj5M59NBduVrNAH6kLmebB@public.gmane.org>
@ 2017-04-03 12:25               ` Nikolaus Schulz
  2017-04-05 15:21               ` [cbootimage-configs PATCH 1/2] post.mk: Add dependency of emmc image on bct file Stephen Warren
  1 sibling, 0 replies; 8+ messages in thread
From: Nikolaus Schulz @ 2017-04-03 12:25 UTC (permalink / raw)
  To: linux-tegra-u79uwXL29TY76Z2rM5mHXA, Stephen Warren; +Cc: Nikolaus Schulz

The dependencies of the emmc image on the bootloader image and the bct
file are specified in the .img.cfg config files.  Currently a shell
script extracts these dependencies from the .img.cfg file.  But the bct
filename is already known to make, so only the bootloader image filename
is left as a somewhat dynamic component.  Add the bootloader filename to
the per-soc Makefiles, and kill the dynamic dependency file.

Signed-off-by: Nikolaus Schulz <nikolaus.schulz-RM9K5IK7kjKj5M59NBduVrNAH6kLmebB@public.gmane.org>
---
 build/gen-image-deps.sh                     | 42 -----------------------------
 build/post.mk                               |  6 +----
 tegra114/nvidia/dalmore/Makefile            |  3 +++
 tegra124/nvidia/jetson-tk1/Makefile         |  3 +++
 tegra124/nvidia/norrin/Makefile             |  3 +++
 tegra124/nvidia/venice2/Makefile            |  3 +++
 tegra20/avionic-design/medcom-wide/Makefile |  3 +++
 tegra20/avionic-design/plutux/Makefile      |  3 +++
 tegra20/avionic-design/tec/Makefile         |  3 +++
 tegra20/compulab/trimslice/Makefile         |  3 +++
 tegra20/nvidia/harmony/Makefile             |  3 +++
 tegra20/nvidia/seaboard/Makefile            |  3 +++
 tegra20/nvidia/ventana/Makefile             |  3 +++
 tegra20/nvidia/whistler/Makefile            |  3 +++
 tegra20/toradex/colibri_t20/Makefile        |  3 +++
 tegra210/nvidia/p2371-2180/Makefile         |  3 +++
 tegra30/avionic-design/tec-ng/Makefile      |  3 +++
 tegra30/nvidia/beaver/Makefile              |  3 +++
 tegra30/nvidia/cardhu/Makefile              |  3 +++
 tegra30/toradex/colibri_t30/Makefile        |  3 +++
 20 files changed, 55 insertions(+), 47 deletions(-)
 delete mode 100755 build/gen-image-deps.sh

diff --git a/build/gen-image-deps.sh b/build/gen-image-deps.sh
deleted file mode 100755
index fcbb64c..0000000
--- a/build/gen-image-deps.sh
+++ /dev/null
@@ -1,42 +0,0 @@
-#!/bin/bash
-
-# Copyright (c) 2013, NVIDIA CORPORATION.  All rights reserved.
-#
-# This software is provided 'as-is', without any express or implied
-# warranty. In no event will the authors be held liable for any damages
-# arising from the use of this software.
-#
-# Permission is granted to anyone to use this software for any purpose,
-# including commercial applications, and to alter it and redistribute it
-# freely, subject to the following restrictions:
-#
-# 1. The origin of this software must not be misrepresented; you must not
-#    claim that you wrote the original software. If you use this software
-#    in a product, an acknowledgment in the product documentation would be
-#    appreciated but is not required.
-# 2. Altered source versions must be plainly marked as such, and must not be
-#    misrepresented as being the original software.
-# 3. This notice may not be removed or altered from any source distribution.
-
-deps_script=$0
-img_cfg_file=$1
-img_file=$2
-dep_file=$3
-
-rm -f ${dep_file}
-bct=`grep -i bctfile ${img_cfg_file} | sed -e 's/^.*=\s*//' -e s'/[,;].*$//'`
-bootloader=`grep -i bootloader ${img_cfg_file} | sed -e 's/^.*=\s*//' -e s'/[,;].*$//'`
-
-cat > ${dep_file} <<ENDOFHERE
-${img_file}: \\
-	${deps_script} \\
-	${img_cfg_file} \\
-	${bct} \\
-	${bootloader}
-
-${img_cfg_file}:
-
-${bct}:
-
-${bootloader}:
-ENDOFHERE
diff --git a/build/post.mk b/build/post.mk
index 809fa2b..1c0f8cf 100644
--- a/build/post.mk
+++ b/build/post.mk
@@ -20,12 +20,8 @@ bcts: $(bcts)
 
 images: $(images)
 
-image_deps := $(addprefix .,$(addsuffix .d,$(images)))
--include $(image_deps)
-
 %.bct: %.bct.cfg
 	cbootimage -gbct -$(soc) $< $@
 
-%.img: %.img.cfg $(bcts)
-	../../../build/gen-image-deps.sh $< $@ .$@.d
+%.img: %.img.cfg $(bcts) $(bootloaders)
 	cbootimage -$(soc) $< $@
diff --git a/tegra114/nvidia/dalmore/Makefile b/tegra114/nvidia/dalmore/Makefile
index 023511b..a644b9a 100644
--- a/tegra114/nvidia/dalmore/Makefile
+++ b/tegra114/nvidia/dalmore/Makefile
@@ -25,6 +25,9 @@ bcts := \
 	E1611_Hynix_2GB_H5TC4G63AFR-RDA_792Mhz_r403_v2.bct \
 	E1611_Hynix_2GB_H5TC4G63MFR-PBA_792Mhz_r403_v05.bct
 
+bootloaders := \
+	u-boot.bin
+
 images := \
 	dalmore-t40x-1866.img \
 	dalmore-t40s-1866.img \
diff --git a/tegra124/nvidia/jetson-tk1/Makefile b/tegra124/nvidia/jetson-tk1/Makefile
index 8142ca5..a163728 100644
--- a/tegra124/nvidia/jetson-tk1/Makefile
+++ b/tegra124/nvidia/jetson-tk1/Makefile
@@ -23,6 +23,9 @@ soc := t124
 bcts := \
 	PM375_Hynix_2GB_H5TC4G63AFR_RDA_924MHz.bct
 
+bootloaders := \
+	u-boot.bin
+
 images := \
 	jetson-tk1-emmc.img
 
diff --git a/tegra124/nvidia/norrin/Makefile b/tegra124/nvidia/norrin/Makefile
index dce9668..aafcaac 100644
--- a/tegra124/nvidia/norrin/Makefile
+++ b/tegra124/nvidia/norrin/Makefile
@@ -23,6 +23,9 @@ soc := t124
 bcts := \
 	PM370_Hynix_2GB_H5TC4G63AFR_PBA_924MHz_01212014.bct
 
+bootloaders := \
+	u-boot.bin
+
 images := \
 	norrin-spi.img
 
diff --git a/tegra124/nvidia/venice2/Makefile b/tegra124/nvidia/venice2/Makefile
index 9795725..ef45981 100644
--- a/tegra124/nvidia/venice2/Makefile
+++ b/tegra124/nvidia/venice2/Makefile
@@ -23,6 +23,9 @@ soc := t124
 bcts := \
 	PM371_Hynix_2GB_H5TC4G63AFR_RDA_792MHz_0719.bct
 
+bootloaders := \
+	u-boot.bin
+
 images := \
 	venice2-spi.img
 
diff --git a/tegra20/avionic-design/medcom-wide/Makefile b/tegra20/avionic-design/medcom-wide/Makefile
index 7d37aa7..25828b4 100644
--- a/tegra20/avionic-design/medcom-wide/Makefile
+++ b/tegra20/avionic-design/medcom-wide/Makefile
@@ -24,6 +24,9 @@ soc := t20
 bcts := \
 	Tamonten_T2_512MB_MEM2G16D2D-ABG-25_366MHz.bct
 
+bootloaders := \
+	u-boot.bin
+
 images := \
 	tegra20-medcom-wide.img
 
diff --git a/tegra20/avionic-design/plutux/Makefile b/tegra20/avionic-design/plutux/Makefile
index 72ed811..3cdd480 100644
--- a/tegra20/avionic-design/plutux/Makefile
+++ b/tegra20/avionic-design/plutux/Makefile
@@ -24,6 +24,9 @@ soc := t20
 bcts := \
 	Tamonten_T2_512MB_MEM2G16D2D-ABG-25_366MHz.bct
 
+bootloaders := \
+	u-boot.bin
+
 images := \
 	tegra20-plutux.img
 
diff --git a/tegra20/avionic-design/tec/Makefile b/tegra20/avionic-design/tec/Makefile
index f5b81b6..1b5027c 100644
--- a/tegra20/avionic-design/tec/Makefile
+++ b/tegra20/avionic-design/tec/Makefile
@@ -24,6 +24,9 @@ soc := t20
 bcts := \
 	Tamonten_T2_512MB_MEM2G16D2D-ABG-25_366MHz.bct
 
+bootloaders := \
+	u-boot.bin
+
 images := \
 	tegra20-tec.img
 
diff --git a/tegra20/compulab/trimslice/Makefile b/tegra20/compulab/trimslice/Makefile
index 59d54e2..00e3e0b 100644
--- a/tegra20/compulab/trimslice/Makefile
+++ b/tegra20/compulab/trimslice/Makefile
@@ -24,6 +24,9 @@ bcts := \
 	trimslice-mmc.bct \
 	trimslice-spi.bct
 
+bootloaders := \
+	u-boot.bin
+
 images := \
 	trimslice-mmc.img \
 	trimslice-spi.img
diff --git a/tegra20/nvidia/harmony/Makefile b/tegra20/nvidia/harmony/Makefile
index 113de21..619ad9a 100644
--- a/tegra20/nvidia/harmony/Makefile
+++ b/tegra20/nvidia/harmony/Makefile
@@ -23,6 +23,9 @@ soc := t20
 bcts := \
 	harmony_a02_12Mhz_H5PS1G83EFR-S6C_333Mhz_1GB_2K8Nand_HY27UF084G2B-TP.bct
 
+bootloaders := \
+	u-boot.bin
+
 images := \
 	harmony-nand.img
 
diff --git a/tegra20/nvidia/seaboard/Makefile b/tegra20/nvidia/seaboard/Makefile
index cbe451b..b17123a 100644
--- a/tegra20/nvidia/seaboard/Makefile
+++ b/tegra20/nvidia/seaboard/Makefile
@@ -23,6 +23,9 @@ soc := t20
 bcts := \
 	PM282_Hynix_1GB_H5PS2G83AFR-S6C_380MHz_nand.bct
 
+bootloaders := \
+	u-boot.bin
+
 images := \
 	seaboard-nand.img
 
diff --git a/tegra20/nvidia/ventana/Makefile b/tegra20/nvidia/ventana/Makefile
index 2c5ca20..d831b38 100644
--- a/tegra20/nvidia/ventana/Makefile
+++ b/tegra20/nvidia/ventana/Makefile
@@ -23,6 +23,9 @@ soc := t20
 bcts := \
 	ventana_A03_12MHz_EDB8132B1PB6DF_300Mhz_1GB_emmc_THGBM1G6D4EBAI4.bct
 
+bootloaders := \
+	u-boot.bin
+
 images := \
 	ventana-emmc.img
 
diff --git a/tegra20/nvidia/whistler/Makefile b/tegra20/nvidia/whistler/Makefile
index 5d8ff04..c5705c1 100644
--- a/tegra20/nvidia/whistler/Makefile
+++ b/tegra20/nvidia/whistler/Makefile
@@ -23,6 +23,9 @@ soc := t20
 bcts := \
 	E1108_Elpida_512MB_EDB4032B2PB-6D-F_300MHz_40nm_emmc_x8.bct
 
+bootloaders := \
+	u-boot.bin
+
 images := \
 	whistler-emmc.img
 
diff --git a/tegra20/toradex/colibri_t20/Makefile b/tegra20/toradex/colibri_t20/Makefile
index 41f3c1d..e6e0800 100644
--- a/tegra20/toradex/colibri_t20/Makefile
+++ b/tegra20/toradex/colibri_t20/Makefile
@@ -29,6 +29,9 @@ bcts := \
 	colibri_t20-512-v11-nand.bct \
 	colibri_t20-512-v12-nand.bct
 
+bootloaders := \
+	u-boot.bin
+
 images := \
 	colibri_t20-256-hsmmc.img \
 	colibri_t20-512-hsmmc.img \
diff --git a/tegra210/nvidia/p2371-2180/Makefile b/tegra210/nvidia/p2371-2180/Makefile
index e8391a4..c4b6bb5 100644
--- a/tegra210/nvidia/p2371-2180/Makefile
+++ b/tegra210/nvidia/p2371-2180/Makefile
@@ -23,6 +23,9 @@ soc := t210
 bcts := \
 	P2180_A00_LP4_DSC_204Mhz.bct
 
+bootloaders := \
+	u-boot.bin
+
 images := \
 	p2371-2180-emmc.img
 
diff --git a/tegra30/avionic-design/tec-ng/Makefile b/tegra30/avionic-design/tec-ng/Makefile
index 6509e04..e1dbfb4 100644
--- a/tegra30/avionic-design/tec-ng/Makefile
+++ b/tegra30/avionic-design/tec-ng/Makefile
@@ -24,6 +24,9 @@ soc := t30
 bcts := \
 	TamontenNG_Nanya_1GB_NT5CC256M16CP-DI_750MHz_emmc.bct
 
+bootloaders := \
+	u-boot.bin
+
 images := \
 	tegra30-tec-ng.img
 
diff --git a/tegra30/nvidia/beaver/Makefile b/tegra30/nvidia/beaver/Makefile
index b27e18d..dfa276e 100644
--- a/tegra30/nvidia/beaver/Makefile
+++ b/tegra30/nvidia/beaver/Makefile
@@ -23,6 +23,9 @@ soc := t30
 bcts := \
 	Pm315_Hynix_2GB_H5TC4G83MFR-PBA_400MHz_120613_sdmmc4_x8.bct
 
+bootloaders := \
+	u-boot.bin
+
 images := \
 	beaver-emmc.img
 
diff --git a/tegra30/nvidia/cardhu/Makefile b/tegra30/nvidia/cardhu/Makefile
index 63773e9..94e4a32 100644
--- a/tegra30/nvidia/cardhu/Makefile
+++ b/tegra30/nvidia/cardhu/Makefile
@@ -25,6 +25,9 @@ bcts := \
 	E1198_Hynix_2GB_H5TC2G83BFR-PBA_667MHz_111121_317_sdmmc4_x8.bct \
 	E1198_Hynix_2GB_H5TC4G83MFR-PBA_375MHz_111122_317_sdmmc4_x8.bct
 
+bootloaders := \
+	u-boot.bin
+
 images := \
 	cardhu-a02-a04-1gb-emmc.img \
 	cardhu-a02-a04-2gb-emmc.img \
diff --git a/tegra30/toradex/colibri_t30/Makefile b/tegra30/toradex/colibri_t30/Makefile
index dffc9f0..916a087 100644
--- a/tegra30/toradex/colibri_t30/Makefile
+++ b/tegra30/toradex/colibri_t30/Makefile
@@ -24,6 +24,9 @@ soc := t30
 bcts := \
 	colibri_t30_12MHz_1GB_NT5CC256M16CP-DI_400MHz-shmoo.bct
 
+bootloaders := \
+	u-boot.bin
+
 images := \
 	colibri_t30.img
 
-- 
2.11.0

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

* Re: [cbootimage-configs PATCH 1/2] post.mk: Add dependency of emmc image on bct file
       [not found]             ` <20170403122511.7194-1-nikolaus.schulz-RM9K5IK7kjKj5M59NBduVrNAH6kLmebB@public.gmane.org>
  2017-04-03 12:25               ` [cbootimage-configs PATCH 2/2] Use fixed variables to track image dependencies Nikolaus Schulz
@ 2017-04-05 15:21               ` Stephen Warren
  1 sibling, 0 replies; 8+ messages in thread
From: Stephen Warren @ 2017-04-05 15:21 UTC (permalink / raw)
  To: Nikolaus Schulz; +Cc: linux-tegra-u79uwXL29TY76Z2rM5mHXA

On 04/03/2017 06:25 AM, Nikolaus Schulz wrote:
> Creating an emmc image requires the bct file as a prerequisite.
> Add the dependency to post.mk.

After thinking about this, I'm going to apply "post.mk: Create 
dependency makefile by makefile rule" instead of this series. I believe 
that patch has two advantages over this series (1) where multiple BCTs 
exist, changing a BCT only rebuilds the specific images that use it (2) 
there's no need to hard-code any of the bootloader filenames in the 
makefile.

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

* Re: [cbootimage-configs PATCH v2] post.mk: Create dependency makefile by makefile rule
       [not found]             ` <20170403122214.cqth3myvv6tpysr4-RM9K5IK7kjJNqqvv04100KcOhU4Rzj621B7CTYaBSLdn68oJJulU0Q@public.gmane.org>
@ 2017-04-05 15:26               ` Stephen Warren
  0 siblings, 0 replies; 8+ messages in thread
From: Stephen Warren @ 2017-04-05 15:26 UTC (permalink / raw)
  To: Nikolaus Schulz; +Cc: linux-tegra-u79uwXL29TY76Z2rM5mHXA

On 04/03/2017 06:22 AM, Nikolaus Schulz wrote:
> On Fri, Mar 31, 2017 at 09:46:19AM -0600, Stephen Warren wrote:
>> On 03/31/2017 09:01 AM, Nikolaus Schulz wrote:
>>> Creating the emmc image requires creating the bct file and the
>>> bootloader image first.  These dependencies are written to a makefile
>>> snippet that is created by the gen-image-deps.sh script.  But that
>>> script is only invoked when the rule that creates the emmc image is run,
>>> which is too late for creating the dependencies makefile.
>>>
>>> Add a rule to post.mk that tells make how to create the dependencies
>>> makefile; with that in place, make automatically makes the dependency
>>> makefile before executing any other rules.
>>
>> I don't think this change is correct, or at least necessary.
>>
>> The concept here is that:
>>
>> - If an output file does not exist at all, it will be built for the first
>> time, and a dependency file will be generated for the next time.
>>
>> - If an output file does exist, the related dependency file is also expected
>> to exist, and specify the dependencies, so that if they change, a rebuild
>> will occur.
>>
>> In particular, the dependency file is/should-no-be necessary in the case
>> where an output file is to be generated for the first time.
>>
>> If a known dependency specification is missing, we should specify it
>> directly in the makefile itself. The generated dependency files are intended
>> to represent unknown/unknowable dependencies.
>>
>> Is it possible to fix this problem that way instead?
>
> Well, the dependencies in question are hard dependencies: creating the
> emmc image has the bct file and the bootloader image as prerequisites.
>
> I just noticed though that specifying the dependency on the bct file
> need not use gen-image-deps.sh at all, since the bct filename is already
> known to make.  I'll send an alternate, trivial patch.
>
> Note that the dependency on the bootloader image can be added to the
> makefiles in a similar way by simply adding a variable for the filename
> to the per-soc Makefiles and make that a prerequisite of the emmc image.
> With that there is no need for a dynamically generated dependency file
> at all, at the slight expense of some (more) duplication of filenames.
>
> I'll send a separate patch doing that as an RFC.

As mentioned in response to the followup patches you sent, I've decided 
to apply this patch instead. It's now applied. Thanks.

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

end of thread, other threads:[~2017-04-05 15:26 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-31 15:01 [cbootimage-configs PATCH v2] post.mk: Create dependency makefile by Nikolaus Schulz
     [not found] ` <20170331150153.14606-1-nikolaus.schulz-RM9K5IK7kjKj5M59NBduVrNAH6kLmebB@public.gmane.org>
2017-03-31 15:01   ` [cbootimage-configs PATCH v2] post.mk: Create dependency makefile by makefile rule Nikolaus Schulz
     [not found]     ` <20170331150153.14606-2-nikolaus.schulz-RM9K5IK7kjKj5M59NBduVrNAH6kLmebB@public.gmane.org>
2017-03-31 15:46       ` Stephen Warren
     [not found]         ` <8bf27012-af67-3faf-206b-ebd5cd76b276-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2017-04-03 12:22           ` Nikolaus Schulz
     [not found]             ` <20170403122214.cqth3myvv6tpysr4-RM9K5IK7kjJNqqvv04100KcOhU4Rzj621B7CTYaBSLdn68oJJulU0Q@public.gmane.org>
2017-04-05 15:26               ` Stephen Warren
2017-04-03 12:25           ` [cbootimage-configs PATCH 1/2] post.mk: Add dependency of emmc image on bct file Nikolaus Schulz
     [not found]             ` <20170403122511.7194-1-nikolaus.schulz-RM9K5IK7kjKj5M59NBduVrNAH6kLmebB@public.gmane.org>
2017-04-03 12:25               ` [cbootimage-configs PATCH 2/2] Use fixed variables to track image dependencies Nikolaus Schulz
2017-04-05 15:21               ` [cbootimage-configs PATCH 1/2] post.mk: Add dependency of emmc image on bct file Stephen Warren

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