* [PATCH] Makefile: Ensure initrd parameters in /chosen are up-to-date
@ 2025-05-12 15:09 Dave Martin
2025-05-12 15:51 ` Mark Rutland
0 siblings, 1 reply; 3+ messages in thread
From: Dave Martin @ 2025-05-12 15:09 UTC (permalink / raw)
To: linux-arm-kernel; +Cc: Mark Rutland
The initrd parameters in the FDT /chosen node are fixed when the device
tree blob is generated, so it is important to regenerate the device
tree if the initrd image has been updated.
Currently this does not happen, so the parameters can be stale.
In particular, if the initrd image is bigger than it was when the
device tree was first generated then the value of the linux,initrd-end
parameter is too small, leading to truncation of the initrd image on
boot even though the whole image is present in linux-system.axf.
Make $(FILESYSTEM) a dependency of fdt.dtb so that the parameters are
refreshed properly based on the current initrd image (if any).
Without --with-initrd, FILESYSTEM is the empty string and the
dependency evaporates, which is just fine.
Signed-off-by: Dave Martin <Dave.Martin@arm.com>
---
Makefile.am | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile.am b/Makefile.am
index a8d5c1b..0178e5d 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -185,7 +185,7 @@ model.lds: $(LD_SCRIPT) Makefile
DTC_NOWARN = $(call test-dtc-option,-Wno-clocks_property)
DTC_NOWARN += $(call test-dtc-option,-Wno-gpios_property)
-fdt.dtb: $(KERNEL_DTB) Makefile
+fdt.dtb: $(KERNEL_DTB) Makefile $(FILESYSTEM)
( $(DTC) -O dts -I dtb $(KERNEL_DTB) ; echo "/ { $(CHOSEN_NODE) $(PSCI_NODE) }; $(CPU_NODES)" ) | $(DTC) -O dtb -o $@ $(DTC_NOWARN) -
# The filesystem archive might not exist if INITRD is not being used
--
2.34.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] Makefile: Ensure initrd parameters in /chosen are up-to-date
2025-05-12 15:09 [PATCH] Makefile: Ensure initrd parameters in /chosen are up-to-date Dave Martin
@ 2025-05-12 15:51 ` Mark Rutland
2025-05-13 13:45 ` Dave Martin
0 siblings, 1 reply; 3+ messages in thread
From: Mark Rutland @ 2025-05-12 15:51 UTC (permalink / raw)
To: Dave Martin; +Cc: linux-arm-kernel
On Mon, May 12, 2025 at 04:09:44PM +0100, Dave Martin wrote:
> The initrd parameters in the FDT /chosen node are fixed when the device
> tree blob is generated, so it is important to regenerate the device
> tree if the initrd image has been updated.
>
> Currently this does not happen, so the parameters can be stale.
> In particular, if the initrd image is bigger than it was when the
> device tree was first generated then the value of the linux,initrd-end
> parameter is too small, leading to truncation of the initrd image on
> boot even though the whole image is present in linux-system.axf.
>
> Make $(FILESYSTEM) a dependency of fdt.dtb so that the parameters are
> refreshed properly based on the current initrd image (if any).
>
> Without --with-initrd, FILESYSTEM is the empty string and the
> dependency evaporates, which is just fine.
>
> Signed-off-by: Dave Martin <Dave.Martin@arm.com>
Applied.
Mark.
> ---
> Makefile.am | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/Makefile.am b/Makefile.am
> index a8d5c1b..0178e5d 100644
> --- a/Makefile.am
> +++ b/Makefile.am
> @@ -185,7 +185,7 @@ model.lds: $(LD_SCRIPT) Makefile
> DTC_NOWARN = $(call test-dtc-option,-Wno-clocks_property)
> DTC_NOWARN += $(call test-dtc-option,-Wno-gpios_property)
>
> -fdt.dtb: $(KERNEL_DTB) Makefile
> +fdt.dtb: $(KERNEL_DTB) Makefile $(FILESYSTEM)
> ( $(DTC) -O dts -I dtb $(KERNEL_DTB) ; echo "/ { $(CHOSEN_NODE) $(PSCI_NODE) }; $(CPU_NODES)" ) | $(DTC) -O dtb -o $@ $(DTC_NOWARN) -
>
> # The filesystem archive might not exist if INITRD is not being used
> --
> 2.34.1
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Makefile: Ensure initrd parameters in /chosen are up-to-date
2025-05-12 15:51 ` Mark Rutland
@ 2025-05-13 13:45 ` Dave Martin
0 siblings, 0 replies; 3+ messages in thread
From: Dave Martin @ 2025-05-13 13:45 UTC (permalink / raw)
To: Mark Rutland; +Cc: linux-arm-kernel
Hi,
On Mon, May 12, 2025 at 04:51:25PM +0100, Mark Rutland wrote:
> On Mon, May 12, 2025 at 04:09:44PM +0100, Dave Martin wrote:
> > The initrd parameters in the FDT /chosen node are fixed when the device
> > tree blob is generated, so it is important to regenerate the device
> > tree if the initrd image has been updated.
> >
> > Currently this does not happen, so the parameters can be stale.
> > In particular, if the initrd image is bigger than it was when the
> > device tree was first generated then the value of the linux,initrd-end
> > parameter is too small, leading to truncation of the initrd image on
> > boot even though the whole image is present in linux-system.axf.
> >
> > Make $(FILESYSTEM) a dependency of fdt.dtb so that the parameters are
> > refreshed properly based on the current initrd image (if any).
> >
> > Without --with-initrd, FILESYSTEM is the empty string and the
> > dependency evaporates, which is just fine.
> >
> > Signed-off-by: Dave Martin <Dave.Martin@arm.com>
>
> Applied.
>
> Mark.
Thanks!
---Dave
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-05-13 13:57 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-12 15:09 [PATCH] Makefile: Ensure initrd parameters in /chosen are up-to-date Dave Martin
2025-05-12 15:51 ` Mark Rutland
2025-05-13 13:45 ` Dave Martin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox