mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
* [ptxdist] [PATCH 0/5] FIT images with U-Boot and barebox on recent DistroKit
@ 2024-02-02 15:12 Alexander Dahl
  2024-02-02 15:12 ` [ptxdist] [PATCH 1/5] kernel-fit: Review help text Alexander Dahl
                   ` (4 more replies)
  0 siblings, 5 replies; 12+ messages in thread
From: Alexander Dahl @ 2024-02-02 15:12 UTC (permalink / raw)
  To: ptxdist; +Cc: AVazquez, Enrico Jorns, Roland Hieber, Bastian Krause

Hei hei,

I'm working on something I need FIT images for in a BSP which is an
upper layer on top of DistroKit.  That task is not complete and will
have to wait until after my holidays, but I want to share things I found
on the way nonetheless.

Please review carefully.

Patch 1 is updating help text of kernel-fit rule Kconfig menu.

Patch 2 adapts the kernel-fit rule to generate a FIT image with a
generic kernel which can be booted by U-Boot.

Patch 3 fixes the default path in blspec-entry once all the .dtb are not
in /boot anymore but included in the FIT image.

Patch 4 fixes a minor annoyance in U-Boot rule when calling oldconfig
very often while using the non-kconfig legacy config mode (e.g. for a
defconfig).

Patch 5 fixes a field passed to the env used in the image-rauc package …
I wonder how this could ever work in DistroKit before?

So it's stuff all around the tree, and I have more fixes here, which I
could not prepare for sending, will do that later.

Greets
Alex

Alexander Dahl (5):
  kernel-fit: Review help text
  kernel-fit: Allow using 'kernel_noload' as sub-image type
  blspec-entry: Fix kernel entry for FIT image
  u-boot: Avoid hooking oldconfig if kconfig is not selected
  image-rauc: Fix quotation marks / whitespace handling

 platforms/kernel-fit.in            | 26 ++++++++++++++++++++++----
 rules/blspec-entry.make            |  2 +-
 rules/image-rauc.make              |  2 +-
 rules/u-boot.make                  |  2 ++
 scripts/lib/ptxd_make_fit_image.sh | 20 +++++++++++++++-----
 scripts/migrate/migrate_platform   |  2 +-
 6 files changed, 42 insertions(+), 12 deletions(-)


base-commit: 69a17d3e7d14510f4aff738f8efd6c47c76c0d0c
-- 
2.39.2




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

* [ptxdist] [PATCH 1/5] kernel-fit: Review help text
  2024-02-02 15:12 [ptxdist] [PATCH 0/5] FIT images with U-Boot and barebox on recent DistroKit Alexander Dahl
@ 2024-02-02 15:12 ` Alexander Dahl
  2024-02-08 16:03   ` [ptxdist] [APPLIED] " Michael Olbrich
  2024-02-02 15:12 ` [ptxdist] [PATCH 2/5] kernel-fit: Allow using 'kernel_noload' as sub-image type Alexander Dahl
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 12+ messages in thread
From: Alexander Dahl @ 2024-02-02 15:12 UTC (permalink / raw)
  To: ptxdist; +Cc: AVazquez, Enrico Jorns, Roland Hieber, Bastian Krause

Fixed typos, mismatched case, and the variable name changed with commit
f50cd1449e93 ("rework device-tree handling").  The double underscore in
the migrate script help text was probably just a typo in the change back
then.

Signed-off-by: Alexander Dahl <ada@thorsis.com>
---
 platforms/kernel-fit.in          | 9 +++++----
 scripts/migrate/migrate_platform | 2 +-
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/platforms/kernel-fit.in b/platforms/kernel-fit.in
index b5f878354..0e82889b9 100644
--- a/platforms/kernel-fit.in
+++ b/platforms/kernel-fit.in
@@ -9,10 +9,11 @@ menuconfig KERNEL_FIT
 	select IMAGE_ROOT_CPIO	if KERNEL_FIT_INITRAMFS
 	prompt "Generate images/linuximage.fit"
 	help
-	  Generate a FIT image from the kernel image. This will contain
-	  the Kernel image and all device trees in PTXCONF_DTC_OFTREE_DTS.
-	  Configurations are provided for each device tree together witt
-	  the Kernel image.
+	  Generate a FIT image from the kernel image.
+	  This will contain the kernel image and all device trees in
+	  PTXCONF_KERNEL_DTS.
+	  Configurations are provided for each device tree together with
+	  the kernel image.
 
 if KERNEL_FIT
 
diff --git a/scripts/migrate/migrate_platform b/scripts/migrate/migrate_platform
index c75705f3a..f7432bc1c 100755
--- a/scripts/migrate/migrate_platform
+++ b/scripts/migrate/migrate_platform
@@ -46,7 +46,7 @@ s/^\(\(# \)\?PTXCONF_TF_A_PLATFORM\>\)\(.*$\)/\1S\3/
 # from   : ptxdist-2020.07.0
 # to     : ptxdist-2020.08.0
 # symbol : PTXCONF_DTC -> PTXCONF_KERNEL_DTB
-# symbol : PTXCONF_DTC_OFTREE_DTS{,_PATH} -> PTXCONF_KERNEL__DTS{,_PATH}
+# symbol : PTXCONF_DTC_OFTREE_DTS{,_PATH} -> PTXCONF_KERNEL_DTS{,_PATH}
 # reason : dtc package removed. Devicetrees are built and installed with the kernel
 #
 s/^\(\(# \)\?PTXCONF\)_DTC\>\(.*$\)/\1_KERNEL_DTB\3/
-- 
2.39.2




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

* [ptxdist] [PATCH 2/5] kernel-fit: Allow using 'kernel_noload' as sub-image type
  2024-02-02 15:12 [ptxdist] [PATCH 0/5] FIT images with U-Boot and barebox on recent DistroKit Alexander Dahl
  2024-02-02 15:12 ` [ptxdist] [PATCH 1/5] kernel-fit: Review help text Alexander Dahl
@ 2024-02-02 15:12 ` Alexander Dahl
  2024-02-08 16:03   ` [ptxdist] [APPLIED] " Michael Olbrich
  2024-02-02 15:12 ` [ptxdist] [PATCH 3/5] blspec-entry: Fix kernel entry for FIT image Alexander Dahl
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 12+ messages in thread
From: Alexander Dahl @ 2024-02-02 15:12 UTC (permalink / raw)
  To: ptxdist; +Cc: AVazquez, Enrico Jorns, Roland Hieber, Bastian Krause

Multi platform kernels built by the kernel-fit rule before are not
usable in U-Boot, which adheres more strictly to the Flat Image Tree
(FIT) spec than barebox does.  For image sub-type 'kernel' U-Boot
expects valid 'load' and 'entry' addresses.  Setting those addresses to
a generic value is impossible however for generic kernels, e.g. the
DistroKit v7a kernel needs different addresses on at91 SAMA5 than
on i.MX6.  barebox circumvents this by ignoring missing 'load' and
'entry' addresses and finding a suitable address by itself.  For using
generic kernels in U-Boot you need sub-image type 'kernel_noload' and
dummy addresses, which is also supported in barebox from v2024.01.0
release onwards.

Link: https://github.com/open-source-firmware/flat-image-tree/releases/download/v0.8/fit-specification-v0.8.pdf
Link: https://lore.barebox.org/barebox/20231129203106.2417486-1-a.fatoum@pengutronix.de/
Signed-off-by: Alexander Dahl <ada@thorsis.com>
---
 platforms/kernel-fit.in            | 17 +++++++++++++++++
 scripts/lib/ptxd_make_fit_image.sh | 20 +++++++++++++++-----
 2 files changed, 32 insertions(+), 5 deletions(-)

diff --git a/platforms/kernel-fit.in b/platforms/kernel-fit.in
index 0e82889b9..5b160c57d 100644
--- a/platforms/kernel-fit.in
+++ b/platforms/kernel-fit.in
@@ -17,14 +17,31 @@ menuconfig KERNEL_FIT
 
 if KERNEL_FIT
 
+config KERNEL_FIT_NOLOAD
+	bool
+	prompt "Sub-image type 'kernel_noload'"
+	help
+	  Use 'kernel_noload' as sub-image type for the kernel, setting
+	  the load address and entry address to dummy values as required
+	  by the FIT image specification.
+	  Useful for booting kernels supporting multiple boards with
+	  U-Boot, e.g. the platform-v7a kernel of DistroKit.
+	  U-Boot supports this since release v2011.12.
+
+	  Note: barebox added support with release v2024.01.0.
+	  You can leave this option disabled if you only use barebox.
+	  You should not enable this if you use older barebox versions.
+
 config KERNEL_FIT_LOAD
 	string
+	depends on !KERNEL_FIT_NOLOAD
 	prompt "Kernel load address (optional)"
 	help
 	  Required by most bootloaders. Optional for Barebox.
 
 config KERNEL_FIT_ENTRY
 	string
+	depends on !KERNEL_FIT_NOLOAD
 	prompt "Kernel entry address (optional)"
 	help
 	  Required by most bootloaders. Optional for Barebox.
diff --git a/scripts/lib/ptxd_make_fit_image.sh b/scripts/lib/ptxd_make_fit_image.sh
index dd0f63b7b..4b99e6fbf 100644
--- a/scripts/lib/ptxd_make_fit_image.sh
+++ b/scripts/lib/ptxd_make_fit_image.sh
@@ -19,20 +19,30 @@ ptxd_make_image_fit_its() {
 		kernel {
 			description = "kernel";
 			data = /incbin/("${image_kernel}");
-			type = "kernel";
 			arch = "$(ptxd_get_ptxconf PTXCONF_ARCH_STRING)";
 			os = "linux";
 			compression = "none";
 EOF
-    if [ -n "$(ptxd_get_ptxconf PTXCONF_KERNEL_FIT_LOAD)" ]; then
+    if [ -n "$(ptxd_get_ptxconf PTXCONF_KERNEL_FIT_NOLOAD)" ]; then
         cat << EOF
+			type = "kernel_noload";
+			load = <0x00000000>;
+			entry = <0x00000000>;
+EOF
+    else
+        cat << EOF
+			type = "kernel";
+EOF
+        if [ -n "$(ptxd_get_ptxconf PTXCONF_KERNEL_FIT_LOAD)" ]; then
+            cat << EOF
 			load = <$(ptxd_get_ptxconf PTXCONF_KERNEL_FIT_LOAD)>;
 EOF
-    fi
-    if [ -n "$(ptxd_get_ptxconf PTXCONF_KERNEL_FIT_ENTRY)" ]; then
-        cat << EOF
+        fi
+        if [ -n "$(ptxd_get_ptxconf PTXCONF_KERNEL_FIT_ENTRY)" ]; then
+            cat << EOF
 			entry = <$(ptxd_get_ptxconf PTXCONF_KERNEL_FIT_ENTRY)>;
 EOF
+        fi
     fi
     cat << EOF
 			hash-1 {
-- 
2.39.2




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

* [ptxdist] [PATCH 3/5] blspec-entry: Fix kernel entry for FIT image
  2024-02-02 15:12 [ptxdist] [PATCH 0/5] FIT images with U-Boot and barebox on recent DistroKit Alexander Dahl
  2024-02-02 15:12 ` [ptxdist] [PATCH 1/5] kernel-fit: Review help text Alexander Dahl
  2024-02-02 15:12 ` [ptxdist] [PATCH 2/5] kernel-fit: Allow using 'kernel_noload' as sub-image type Alexander Dahl
@ 2024-02-02 15:12 ` Alexander Dahl
  2024-02-08 16:03   ` [ptxdist] [APPLIED] " Michael Olbrich
  2024-02-02 15:12 ` [ptxdist] [PATCH 4/5] u-boot: Avoid hooking oldconfig if kconfig is not selected Alexander Dahl
  2024-02-02 15:12 ` [ptxdist] [PATCH 5/5] image-rauc: Fix quotation marks / whitespace handling Alexander Dahl
  4 siblings, 1 reply; 12+ messages in thread
From: Alexander Dahl @ 2024-02-02 15:12 UTC (permalink / raw)
  To: ptxdist; +Cc: AVazquez, Enrico Jorns, Roland Hieber, Bastian Krause

The path prefix '/boot' should be added either when assigning
BLSPEC_KERNEL_IMAGE or when replacing @KERNEL@, but not in both cases.
Results in wrong paths like this otherwise:

    linux           /boot//boot/linux.fit

Fixes: 0cfba65d15e6 ("image-kernel-fit: Add package")
Signed-off-by: Alexander Dahl <ada@thorsis.com>
---
 rules/blspec-entry.make | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/rules/blspec-entry.make b/rules/blspec-entry.make
index 7523009f6..442159401 100644
--- a/rules/blspec-entry.make
+++ b/rules/blspec-entry.make
@@ -30,7 +30,7 @@ endif
 BLSPEC_ENTRY_LICENSE	= ignore
 
 ifdef PTXCONF_KERNEL_FIT
-BLSPEC_KERNEL_IMAGE	= /boot/linux.fit
+BLSPEC_KERNEL_IMAGE	= linux.fit
 else
 BLSPEC_KERNEL_IMAGE	= $(KERNEL_IMAGE)
 endif
-- 
2.39.2




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

* [ptxdist] [PATCH 4/5] u-boot: Avoid hooking oldconfig if kconfig is not selected
  2024-02-02 15:12 [ptxdist] [PATCH 0/5] FIT images with U-Boot and barebox on recent DistroKit Alexander Dahl
                   ` (2 preceding siblings ...)
  2024-02-02 15:12 ` [ptxdist] [PATCH 3/5] blspec-entry: Fix kernel entry for FIT image Alexander Dahl
@ 2024-02-02 15:12 ` Alexander Dahl
  2024-02-08 16:03   ` [ptxdist] [APPLIED] " Michael Olbrich
  2024-02-02 15:12 ` [ptxdist] [PATCH 5/5] image-rauc: Fix quotation marks / whitespace handling Alexander Dahl
  4 siblings, 1 reply; 12+ messages in thread
From: Alexander Dahl @ 2024-02-02 15:12 UTC (permalink / raw)
  To: ptxdist; +Cc: AVazquez, Enrico Jorns, Roland Hieber, Bastian Krause

Calling `ptxdist oldconfig u-boot` (or `ptxdist oldconfig all`) makes
only sense if the package actually uses Kconfig.  If it does not, you
probably got an at best annoying error message of a missing u-boot
.config in your BSP.

Fixes: 44e565de9b2d ("u-boot: Add option to use Kconfig based configuration")
Signed-off-by: Alexander Dahl <ada@thorsis.com>
---
 rules/u-boot.make | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/rules/u-boot.make b/rules/u-boot.make
index cadca4a6b..4bc7f3f78 100644
--- a/rules/u-boot.make
+++ b/rules/u-boot.make
@@ -214,7 +214,9 @@ $(STATEDIR)/u-boot.clean:
 # oldconfig / menuconfig
 # ----------------------------------------------------------------------------
 
+ifdef PTXCONF_U_BOOT_CONFIGSYSTEM_KCONFIG
 u-boot_oldconfig u-boot_menuconfig u-boot_nconfig: $(STATEDIR)/u-boot.extract
 	@$(call world/kconfig, U_BOOT, $(subst u-boot_,,$@))
+endif
 
 # vim: syntax=make
-- 
2.39.2




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

* [ptxdist] [PATCH 5/5] image-rauc: Fix quotation marks / whitespace handling
  2024-02-02 15:12 [ptxdist] [PATCH 0/5] FIT images with U-Boot and barebox on recent DistroKit Alexander Dahl
                   ` (3 preceding siblings ...)
  2024-02-02 15:12 ` [ptxdist] [PATCH 4/5] u-boot: Avoid hooking oldconfig if kconfig is not selected Alexander Dahl
@ 2024-02-02 15:12 ` Alexander Dahl
  2024-02-06 11:41   ` Roland Hieber
  2024-02-08 16:03   ` [ptxdist] [APPLIED] " Michael Olbrich
  4 siblings, 2 replies; 12+ messages in thread
From: Alexander Dahl @ 2024-02-02 15:12 UTC (permalink / raw)
  To: ptxdist; +Cc: AVazquez, Enrico Jorns, Roland Hieber, Bastian Krause

If you had set
PTXCONF_IMAGE_RAUC_DESCRIPTION="${PTXCONF_PROJECT_VENDOR} ${PTXCONF_PROJECT}"
like DistroKit-2023.12.0 does, target update.raucb failed with
'command not found' because of wrong quoting and interpreting parts of
PTXCONF_IMAGE_RAUC_DESCRIPTION as command.

Signed-off-by: Alexander Dahl <ada@thorsis.com>
---
 rules/image-rauc.make | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/rules/image-rauc.make b/rules/image-rauc.make
index e267e78c6..def2ade1e 100644
--- a/rules/image-rauc.make
+++ b/rules/image-rauc.make
@@ -56,7 +56,7 @@ IMAGE_RAUC_ENV	= \
 	RAUC_BUNDLE_FORMAT=$(IMAGE_RAUC_BUNDLE_FORMAT) \
 	RAUC_BUNDLE_VERSION="$(call remove_quotes, $(PTXCONF_RAUC_BUNDLE_VERSION))" \
 	RAUC_BUNDLE_BUILD=$(call ptx/sh, date +%FT%T%z) \
-	RAUC_BUNDLE_DESCRIPTION=$(PTXCONF_IMAGE_RAUC_DESCRIPTION) \
+	RAUC_BUNDLE_DESCRIPTION="$(call remove_quotes, $(PTXCONF_IMAGE_RAUC_DESCRIPTION))" \
 	$(IMAGE_RAUC_ENV_HOOK) \
 	RAUC_KEY="$(shell cs_get_uri update)" \
 	RAUC_CERT="$(shell cs_get_uri update)" \
-- 
2.39.2




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

* Re: [ptxdist] [PATCH 5/5] image-rauc: Fix quotation marks / whitespace handling
  2024-02-02 15:12 ` [ptxdist] [PATCH 5/5] image-rauc: Fix quotation marks / whitespace handling Alexander Dahl
@ 2024-02-06 11:41   ` Roland Hieber
  2024-02-08 16:03   ` [ptxdist] [APPLIED] " Michael Olbrich
  1 sibling, 0 replies; 12+ messages in thread
From: Roland Hieber @ 2024-02-06 11:41 UTC (permalink / raw)
  To: Alexander Dahl; +Cc: Enrico Jorns, AVazquez, ptxdist, Bastian Krause

On Fri, Feb 02, 2024 at 04:12:09PM +0100, Alexander Dahl wrote:
> If you had set
> PTXCONF_IMAGE_RAUC_DESCRIPTION="${PTXCONF_PROJECT_VENDOR} ${PTXCONF_PROJECT}"
> like DistroKit-2023.12.0 does, target update.raucb failed with
> 'command not found' because of wrong quoting and interpreting parts of
> PTXCONF_IMAGE_RAUC_DESCRIPTION as command.
> 
> Signed-off-by: Alexander Dahl <ada@thorsis.com>

Huh. Strange, I never got such an error all the times I built the
DistroKit update.raucb. I guess the bundle description in DistroKit is
unfortunate enough; this is in the output of 'ptxdist -v image
update.raucb':

    RAUC_BUNDLE_DESCRIPTION=""Pengutronix" "DistroKit""

… and bash interprets that as an empty string, a plain word, a quoted
space, another plain word, and another empty string, and concatenates
that into RAUC_BUNDLE_DESCRIPTION as expected. I guess if your bundle
description contains any special chars like '(' or '$', bash starts
interpreting those as bash syntax instead of plain words, which could
lead to the error you see.

Anyway, your patch gives me the correct results.

Reviewed-by: Roland Hieber <rhi@pengutronix.de>
> ---
>  rules/image-rauc.make | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/rules/image-rauc.make b/rules/image-rauc.make
> index e267e78c6..def2ade1e 100644
> --- a/rules/image-rauc.make
> +++ b/rules/image-rauc.make
> @@ -56,7 +56,7 @@ IMAGE_RAUC_ENV	= \
>  	RAUC_BUNDLE_FORMAT=$(IMAGE_RAUC_BUNDLE_FORMAT) \
>  	RAUC_BUNDLE_VERSION="$(call remove_quotes, $(PTXCONF_RAUC_BUNDLE_VERSION))" \
>  	RAUC_BUNDLE_BUILD=$(call ptx/sh, date +%FT%T%z) \
> -	RAUC_BUNDLE_DESCRIPTION=$(PTXCONF_IMAGE_RAUC_DESCRIPTION) \
> +	RAUC_BUNDLE_DESCRIPTION="$(call remove_quotes, $(PTXCONF_IMAGE_RAUC_DESCRIPTION))" \
>  	$(IMAGE_RAUC_ENV_HOOK) \
>  	RAUC_KEY="$(shell cs_get_uri update)" \
>  	RAUC_CERT="$(shell cs_get_uri update)" \
> -- 
> 2.39.2
> 
> 

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



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

* Re: [ptxdist] [APPLIED] kernel-fit: Review help text
  2024-02-02 15:12 ` [ptxdist] [PATCH 1/5] kernel-fit: Review help text Alexander Dahl
@ 2024-02-08 16:03   ` Michael Olbrich
  0 siblings, 0 replies; 12+ messages in thread
From: Michael Olbrich @ 2024-02-08 16:03 UTC (permalink / raw)
  To: ptxdist; +Cc: Alexander Dahl

Thanks, applied as 12cafdf4df8fbf127757805f7d4c65faa861bb98.

Michael

[sent from post-receive hook]

On Thu, 08 Feb 2024 17:03:33 +0100, Alexander Dahl <ada@thorsis.com> wrote:
> Fixed typos, mismatched case, and the variable name changed with commit
> f50cd1449e93 ("rework device-tree handling").  The double underscore in
> the migrate script help text was probably just a typo in the change back
> then.
> 
> Signed-off-by: Alexander Dahl <ada@thorsis.com>
> Message-Id: <20240202151209.2535721-2-ada@thorsis.com>
> Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
> 
> diff --git a/platforms/kernel-fit.in b/platforms/kernel-fit.in
> index b5f8783540c3..0e82889b9ede 100644
> --- a/platforms/kernel-fit.in
> +++ b/platforms/kernel-fit.in
> @@ -9,10 +9,11 @@ menuconfig KERNEL_FIT
>  	select IMAGE_ROOT_CPIO	if KERNEL_FIT_INITRAMFS
>  	prompt "Generate images/linuximage.fit"
>  	help
> -	  Generate a FIT image from the kernel image. This will contain
> -	  the Kernel image and all device trees in PTXCONF_DTC_OFTREE_DTS.
> -	  Configurations are provided for each device tree together witt
> -	  the Kernel image.
> +	  Generate a FIT image from the kernel image.
> +	  This will contain the kernel image and all device trees in
> +	  PTXCONF_KERNEL_DTS.
> +	  Configurations are provided for each device tree together with
> +	  the kernel image.
>  
>  if KERNEL_FIT
>  
> diff --git a/scripts/migrate/migrate_platform b/scripts/migrate/migrate_platform
> index c75705f3a1cb..f7432bc1cfb4 100755
> --- a/scripts/migrate/migrate_platform
> +++ b/scripts/migrate/migrate_platform
> @@ -46,7 +46,7 @@ s/^\(\(# \)\?PTXCONF_TF_A_PLATFORM\>\)\(.*$\)/\1S\3/
>  # from   : ptxdist-2020.07.0
>  # to     : ptxdist-2020.08.0
>  # symbol : PTXCONF_DTC -> PTXCONF_KERNEL_DTB
> -# symbol : PTXCONF_DTC_OFTREE_DTS{,_PATH} -> PTXCONF_KERNEL__DTS{,_PATH}
> +# symbol : PTXCONF_DTC_OFTREE_DTS{,_PATH} -> PTXCONF_KERNEL_DTS{,_PATH}
>  # reason : dtc package removed. Devicetrees are built and installed with the kernel
>  #
>  s/^\(\(# \)\?PTXCONF\)_DTC\>\(.*$\)/\1_KERNEL_DTB\3/



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

* Re: [ptxdist] [APPLIED] kernel-fit: Allow using 'kernel_noload' as sub-image type
  2024-02-02 15:12 ` [ptxdist] [PATCH 2/5] kernel-fit: Allow using 'kernel_noload' as sub-image type Alexander Dahl
@ 2024-02-08 16:03   ` Michael Olbrich
  0 siblings, 0 replies; 12+ messages in thread
From: Michael Olbrich @ 2024-02-08 16:03 UTC (permalink / raw)
  To: ptxdist; +Cc: Alexander Dahl

Thanks, applied as d2be5e8d92708ef2c0fdcfa86c9d351556379537.

Michael

[sent from post-receive hook]

On Thu, 08 Feb 2024 17:03:34 +0100, Alexander Dahl <ada@thorsis.com> wrote:
> Multi platform kernels built by the kernel-fit rule before are not
> usable in U-Boot, which adheres more strictly to the Flat Image Tree
> (FIT) spec than barebox does.  For image sub-type 'kernel' U-Boot
> expects valid 'load' and 'entry' addresses.  Setting those addresses to
> a generic value is impossible however for generic kernels, e.g. the
> DistroKit v7a kernel needs different addresses on at91 SAMA5 than
> on i.MX6.  barebox circumvents this by ignoring missing 'load' and
> 'entry' addresses and finding a suitable address by itself.  For using
> generic kernels in U-Boot you need sub-image type 'kernel_noload' and
> dummy addresses, which is also supported in barebox from v2024.01.0
> release onwards.
> 
> Link: https://github.com/open-source-firmware/flat-image-tree/releases/download/v0.8/fit-specification-v0.8.pdf
> Link: https://lore.barebox.org/barebox/20231129203106.2417486-1-a.fatoum@pengutronix.de/
> Signed-off-by: Alexander Dahl <ada@thorsis.com>
> Message-Id: <20240202151209.2535721-3-ada@thorsis.com>
> Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
> 
> diff --git a/platforms/kernel-fit.in b/platforms/kernel-fit.in
> index 0e82889b9ede..5b160c57ddf6 100644
> --- a/platforms/kernel-fit.in
> +++ b/platforms/kernel-fit.in
> @@ -17,14 +17,31 @@ menuconfig KERNEL_FIT
>  
>  if KERNEL_FIT
>  
> +config KERNEL_FIT_NOLOAD
> +	bool
> +	prompt "Sub-image type 'kernel_noload'"
> +	help
> +	  Use 'kernel_noload' as sub-image type for the kernel, setting
> +	  the load address and entry address to dummy values as required
> +	  by the FIT image specification.
> +	  Useful for booting kernels supporting multiple boards with
> +	  U-Boot, e.g. the platform-v7a kernel of DistroKit.
> +	  U-Boot supports this since release v2011.12.
> +
> +	  Note: barebox added support with release v2024.01.0.
> +	  You can leave this option disabled if you only use barebox.
> +	  You should not enable this if you use older barebox versions.
> +
>  config KERNEL_FIT_LOAD
>  	string
> +	depends on !KERNEL_FIT_NOLOAD
>  	prompt "Kernel load address (optional)"
>  	help
>  	  Required by most bootloaders. Optional for Barebox.
>  
>  config KERNEL_FIT_ENTRY
>  	string
> +	depends on !KERNEL_FIT_NOLOAD
>  	prompt "Kernel entry address (optional)"
>  	help
>  	  Required by most bootloaders. Optional for Barebox.
> diff --git a/scripts/lib/ptxd_make_fit_image.sh b/scripts/lib/ptxd_make_fit_image.sh
> index dd0f63b7b72d..4b99e6fbfec3 100644
> --- a/scripts/lib/ptxd_make_fit_image.sh
> +++ b/scripts/lib/ptxd_make_fit_image.sh
> @@ -19,20 +19,30 @@ ptxd_make_image_fit_its() {
>  		kernel {
>  			description = "kernel";
>  			data = /incbin/("${image_kernel}");
> -			type = "kernel";
>  			arch = "$(ptxd_get_ptxconf PTXCONF_ARCH_STRING)";
>  			os = "linux";
>  			compression = "none";
>  EOF
> -    if [ -n "$(ptxd_get_ptxconf PTXCONF_KERNEL_FIT_LOAD)" ]; then
> +    if [ -n "$(ptxd_get_ptxconf PTXCONF_KERNEL_FIT_NOLOAD)" ]; then
>          cat << EOF
> -			load = <$(ptxd_get_ptxconf PTXCONF_KERNEL_FIT_LOAD)>;
> +			type = "kernel_noload";
> +			load = <0x00000000>;
> +			entry = <0x00000000>;
>  EOF
> -    fi
> -    if [ -n "$(ptxd_get_ptxconf PTXCONF_KERNEL_FIT_ENTRY)" ]; then
> +    else
>          cat << EOF
> +			type = "kernel";
> +EOF
> +        if [ -n "$(ptxd_get_ptxconf PTXCONF_KERNEL_FIT_LOAD)" ]; then
> +            cat << EOF
> +			load = <$(ptxd_get_ptxconf PTXCONF_KERNEL_FIT_LOAD)>;
> +EOF
> +        fi
> +        if [ -n "$(ptxd_get_ptxconf PTXCONF_KERNEL_FIT_ENTRY)" ]; then
> +            cat << EOF
>  			entry = <$(ptxd_get_ptxconf PTXCONF_KERNEL_FIT_ENTRY)>;
>  EOF
> +        fi
>      fi
>      cat << EOF
>  			hash-1 {



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

* Re: [ptxdist] [APPLIED] blspec-entry: Fix kernel entry for FIT image
  2024-02-02 15:12 ` [ptxdist] [PATCH 3/5] blspec-entry: Fix kernel entry for FIT image Alexander Dahl
@ 2024-02-08 16:03   ` Michael Olbrich
  0 siblings, 0 replies; 12+ messages in thread
From: Michael Olbrich @ 2024-02-08 16:03 UTC (permalink / raw)
  To: ptxdist; +Cc: Alexander Dahl

Thanks, applied as 0d360df876bc26f709cf527d03981ab0055c632c.

Michael

[sent from post-receive hook]

On Thu, 08 Feb 2024 17:03:35 +0100, Alexander Dahl <ada@thorsis.com> wrote:
> The path prefix '/boot' should be added either when assigning
> BLSPEC_KERNEL_IMAGE or when replacing @KERNEL@, but not in both cases.
> Results in wrong paths like this otherwise:
> 
>     linux           /boot//boot/linux.fit
> 
> Fixes: 0cfba65d15e6 ("image-kernel-fit: Add package")
> Signed-off-by: Alexander Dahl <ada@thorsis.com>
> Message-Id: <20240202151209.2535721-4-ada@thorsis.com>
> Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
> 
> diff --git a/rules/blspec-entry.make b/rules/blspec-entry.make
> index 7523009f6197..4421594016e1 100644
> --- a/rules/blspec-entry.make
> +++ b/rules/blspec-entry.make
> @@ -30,7 +30,7 @@ endif
>  BLSPEC_ENTRY_LICENSE	= ignore
>  
>  ifdef PTXCONF_KERNEL_FIT
> -BLSPEC_KERNEL_IMAGE	= /boot/linux.fit
> +BLSPEC_KERNEL_IMAGE	= linux.fit
>  else
>  BLSPEC_KERNEL_IMAGE	= $(KERNEL_IMAGE)
>  endif



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

* Re: [ptxdist] [APPLIED] u-boot: Avoid hooking oldconfig if kconfig is not selected
  2024-02-02 15:12 ` [ptxdist] [PATCH 4/5] u-boot: Avoid hooking oldconfig if kconfig is not selected Alexander Dahl
@ 2024-02-08 16:03   ` Michael Olbrich
  0 siblings, 0 replies; 12+ messages in thread
From: Michael Olbrich @ 2024-02-08 16:03 UTC (permalink / raw)
  To: ptxdist; +Cc: Alexander Dahl

Thanks, applied as 611215d2df98c1fd3a0a78557320088b8b85ba95.

Michael

[sent from post-receive hook]

On Thu, 08 Feb 2024 17:03:35 +0100, Alexander Dahl <ada@thorsis.com> wrote:
> Calling `ptxdist oldconfig u-boot` (or `ptxdist oldconfig all`) makes
> only sense if the package actually uses Kconfig.  If it does not, you
> probably got an at best annoying error message of a missing u-boot
> .config in your BSP.
> 
> Fixes: 44e565de9b2d ("u-boot: Add option to use Kconfig based configuration")
> Signed-off-by: Alexander Dahl <ada@thorsis.com>
> Message-Id: <20240202151209.2535721-5-ada@thorsis.com>
> Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
> 
> diff --git a/rules/u-boot.make b/rules/u-boot.make
> index cadca4a6bc92..4bc7f3f781fc 100644
> --- a/rules/u-boot.make
> +++ b/rules/u-boot.make
> @@ -214,7 +214,9 @@ $(STATEDIR)/u-boot.clean:
>  # oldconfig / menuconfig
>  # ----------------------------------------------------------------------------
>  
> +ifdef PTXCONF_U_BOOT_CONFIGSYSTEM_KCONFIG
>  u-boot_oldconfig u-boot_menuconfig u-boot_nconfig: $(STATEDIR)/u-boot.extract
>  	@$(call world/kconfig, U_BOOT, $(subst u-boot_,,$@))
> +endif
>  
>  # vim: syntax=make



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

* Re: [ptxdist] [APPLIED] image-rauc: Fix quotation marks / whitespace handling
  2024-02-02 15:12 ` [ptxdist] [PATCH 5/5] image-rauc: Fix quotation marks / whitespace handling Alexander Dahl
  2024-02-06 11:41   ` Roland Hieber
@ 2024-02-08 16:03   ` Michael Olbrich
  1 sibling, 0 replies; 12+ messages in thread
From: Michael Olbrich @ 2024-02-08 16:03 UTC (permalink / raw)
  To: ptxdist; +Cc: Alexander Dahl

Thanks, applied as f216869a760d69d54ebbe4a0ebd08265f54be3ca.

Michael

[sent from post-receive hook]

On Thu, 08 Feb 2024 17:03:36 +0100, Alexander Dahl <ada@thorsis.com> wrote:
> If you had set
> PTXCONF_IMAGE_RAUC_DESCRIPTION="${PTXCONF_PROJECT_VENDOR} ${PTXCONF_PROJECT}"
> like DistroKit-2023.12.0 does, target update.raucb failed with
> 'command not found' because of wrong quoting and interpreting parts of
> PTXCONF_IMAGE_RAUC_DESCRIPTION as command.
> 
> Signed-off-by: Alexander Dahl <ada@thorsis.com>
> Message-Id: <20240202151209.2535721-6-ada@thorsis.com>
> Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
> 
> diff --git a/rules/image-rauc.make b/rules/image-rauc.make
> index e267e78c68f2..def2ade1e237 100644
> --- a/rules/image-rauc.make
> +++ b/rules/image-rauc.make
> @@ -56,7 +56,7 @@ IMAGE_RAUC_ENV	= \
>  	RAUC_BUNDLE_FORMAT=$(IMAGE_RAUC_BUNDLE_FORMAT) \
>  	RAUC_BUNDLE_VERSION="$(call remove_quotes, $(PTXCONF_RAUC_BUNDLE_VERSION))" \
>  	RAUC_BUNDLE_BUILD=$(call ptx/sh, date +%FT%T%z) \
> -	RAUC_BUNDLE_DESCRIPTION=$(PTXCONF_IMAGE_RAUC_DESCRIPTION) \
> +	RAUC_BUNDLE_DESCRIPTION="$(call remove_quotes, $(PTXCONF_IMAGE_RAUC_DESCRIPTION))" \
>  	$(IMAGE_RAUC_ENV_HOOK) \
>  	RAUC_KEY="$(shell cs_get_uri update)" \
>  	RAUC_CERT="$(shell cs_get_uri update)" \



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

end of thread, other threads:[~2024-02-08 16:09 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-02 15:12 [ptxdist] [PATCH 0/5] FIT images with U-Boot and barebox on recent DistroKit Alexander Dahl
2024-02-02 15:12 ` [ptxdist] [PATCH 1/5] kernel-fit: Review help text Alexander Dahl
2024-02-08 16:03   ` [ptxdist] [APPLIED] " Michael Olbrich
2024-02-02 15:12 ` [ptxdist] [PATCH 2/5] kernel-fit: Allow using 'kernel_noload' as sub-image type Alexander Dahl
2024-02-08 16:03   ` [ptxdist] [APPLIED] " Michael Olbrich
2024-02-02 15:12 ` [ptxdist] [PATCH 3/5] blspec-entry: Fix kernel entry for FIT image Alexander Dahl
2024-02-08 16:03   ` [ptxdist] [APPLIED] " Michael Olbrich
2024-02-02 15:12 ` [ptxdist] [PATCH 4/5] u-boot: Avoid hooking oldconfig if kconfig is not selected Alexander Dahl
2024-02-08 16:03   ` [ptxdist] [APPLIED] " Michael Olbrich
2024-02-02 15:12 ` [ptxdist] [PATCH 5/5] image-rauc: Fix quotation marks / whitespace handling Alexander Dahl
2024-02-06 11:41   ` Roland Hieber
2024-02-08 16:03   ` [ptxdist] [APPLIED] " Michael Olbrich

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