Skip to contentSkip to conversation

board/zynqmp/post-image.sh: Don't insist on a xilinx/ prefix for .dts files.

PATCH Applied Graeme Smecher 2 participants 6 messages Feb 1, 2023 – Feb 5, 2023 Arm/Zynq architecture

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 board/zynqmp/post-image.sh: Don't insist on a xilinx/ prefix for .dts files.

If using BR2_LINUX_KERNEL_CUSTOM_DTS_PATH to copy .dts files from buildroot into the linux tree, these .dts files are copied to arch/arm64/boot. Unfortunately, the post-image.sh script expects to find them in arch/arm64/boot/xilinx.

This patch does not require the xilinx/ prefix to be present when symlinking the device-tree to system.dtb where u-boot expects to find it.

---
 board/zynqmp/post-image.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
board/zynqmp/post-image.sh +1 -1
index ed6dbe188c..c5de2db820 100755
@@ -5,7 +5,7 @@
 # devicetree listed in the config.
 
 FIRST_DT=$(sed -nr \
-               -e 's|^BR2_LINUX_KERNEL_INTREE_DTS_NAME="xilinx/([-_/[:alnum:]\\.]*).*"$|\1|p' \
+               -e 's|^BR2_LINUX_KERNEL_INTREE_DTS_NAME="(xilinx/)?([-_/[:alnum:]\\.]*).*"$|\2|p' \
                ${BR2_CONFIG})
 
 [ -z "${FIRST_DT}" ] || ln -fs ${FIRST_DT}.dtb ${BINARIES_DIR}/system.dtb
Signature · 6 lines
2.35.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw

Hi Graeme,

Quoted 19 lines · On Wed, 1 Feb 2023 11:59:56 -0800 Graeme Smecher…

If using BR2_LINUX_KERNEL_CUSTOM_DTS_PATH to copy .dts files from buildroot into the linux tree, these .dts files are copied to arch/arm64/boot. Unfortunately, the post-image.sh script expects to find them in arch/arm64/boot/xilinx.

This patch does not require the xilinx/ prefix to be present when symlinking the device-tree to system.dtb where u-boot expects to find it.

---
 board/zynqmp/post-image.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
board/zynqmp/post-image.sh +0 -0
index ed6dbe188c..c5de2db820 100755

board/zynqmp/post-image.sh line 8

Quoted 5 lines
board/zynqmp/post-image.sh +1 -1
@@ -5,7 +5,7 @@
 # devicetree listed in the config.
 
 FIRST_DT=$(sed -nr \
-               -e 's|^BR2_LINUX_KERNEL_INTREE_DTS_NAME="xilinx/([-_/[:alnum:]\\.]*).*"$|\1|p' \
+               -e 's|^BR2_LINUX_KERNEL_INTREE_DTS_NAME="(xilinx/)?([-_/[:alnum:]\\.]*).*"$|\2|p' \

I think the following simpler change would also work. Can you check that please?

-               -e 's|^BR2_LINUX_KERNEL_INTREE_DTS_NAME="xilinx/([-_/[:alnum:]\\.]*).*"$|\1|p' \
+               -e 's|^BR2_LINUX_KERNEL_INTREE_DTS_NAME="([-_/[:alnum:]\\.]*).*"$|\2|p' \
Signature · 7 lines
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#2 lore raw

Hi Luca,

Quoted 33 lines · Luca Ceresoli

Hi Graeme,

Quoted 19 lines · On Wed, 1 Feb 2023 11:59:56 -0800 Graeme Smecher…

If using BR2_LINUX_KERNEL_CUSTOM_DTS_PATH to copy .dts files from buildroot into the linux tree, these .dts files are copied to arch/arm64/boot. Unfortunately, the post-image.sh script expects to find them in arch/arm64/boot/xilinx.

This patch does not require the xilinx/ prefix to be present when symlinking the device-tree to system.dtb where u-boot expects to find it.

---
  board/zynqmp/post-image.sh | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
board/zynqmp/post-image.sh +0 -0
index ed6dbe188c..c5de2db820 100755

board/zynqmp/post-image.sh line 8

Quoted 5 lines
board/zynqmp/post-image.sh +1 -1
@@ -5,7 +5,7 @@
  # devicetree listed in the config.
 
  FIRST_DT=$(sed -nr \
-               -e 's|^BR2_LINUX_KERNEL_INTREE_DTS_NAME="xilinx/([-_/[:alnum:]\\.]*).*"$|\1|p' \
+               -e 's|^BR2_LINUX_KERNEL_INTREE_DTS_NAME="(xilinx/)?([-_/[:alnum:]\\.]*).*"$|\2|p' \

I think the following simpler change would also work. Can you check that please?

Review

Quoted 2 lines
(quoted diff) +1 -1
-               -e 's|^BR2_LINUX_KERNEL_INTREE_DTS_NAME="xilinx/([-_/[:alnum:]\\.]*).*"$|\1|p' \
+               -e 's|^BR2_LINUX_KERNEL_INTREE_DTS_NAME="([-_/[:alnum:]\\.]*).*"$|\2|p' \

Assuming you intended \1, not \2 here - this suggestion breaks behaviour for a couple of defconfigs in the tree. If I run the ZCU106 defconfig through this regexp, I get:

	$ cat configs/zynqmp_zcu106_defconfig | sed -nr -e 's|^BR2_LINUX_KERNEL_INTREE_DTS_NAME="([-_/[:alnum:]\\.]*).*"$|\1|p'
	xilinx/zynqmp-zcu106-revA

...this creates a dangling symlink in output/images (system.dtb -> xilinx/zynqmp-zcu106-revA.dtb).

The right behaviour is to strip any prefixes that exist, without requiring any. Something like:

-               -e 's|^BR2_LINUX_KERNEL_INTREE_DTS_NAME="xilinx/([-_/[:alnum:]\\.]*).*"$|\1|p' \
+               -e 's|^BR2_LINUX_KERNEL_INTREE_DTS_NAME="(.*/)?([-_/[:alnum:]\\.]*).*"$|\2|p' \

This is less Xilinx-specific, although it seems a tad greedy.

best,
Graeme
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

Reviewed-by Luca Ceresoli
#3 lore raw

Hi Graeme,

Quoted 39 lines · On Wed, 1 Feb 2023 14:16:47 -0800 Graeme Smecher…

Hi Luca,

Quoted 33 lines · Luca Ceresoli

Hi Graeme,

Quoted 19 lines · On Wed, 1 Feb 2023 11:59:56 -0800 Graeme Smecher…

If using BR2_LINUX_KERNEL_CUSTOM_DTS_PATH to copy .dts files from buildroot into the linux tree, these .dts files are copied to arch/arm64/boot. Unfortunately, the post-image.sh script expects to find them in arch/arm64/boot/xilinx.

This patch does not require the xilinx/ prefix to be present when symlinking the device-tree to system.dtb where u-boot expects to find it.

---
  board/zynqmp/post-image.sh | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
board/zynqmp/post-image.sh +0 -0
index ed6dbe188c..c5de2db820 100755

board/zynqmp/post-image.sh line 8

Quoted 5 lines
board/zynqmp/post-image.sh +1 -1
@@ -5,7 +5,7 @@
  # devicetree listed in the config.
 
  FIRST_DT=$(sed -nr \
-               -e 's|^BR2_LINUX_KERNEL_INTREE_DTS_NAME="xilinx/([-_/[:alnum:]\\.]*).*"$|\1|p' \
+               -e 's|^BR2_LINUX_KERNEL_INTREE_DTS_NAME="(xilinx/)?([-_/[:alnum:]\\.]*).*"$|\2|p' \  

I think the following simpler change would also work. Can you check that please?

Review

Quoted 2 lines
(quoted diff) +1 -1
-               -e 's|^BR2_LINUX_KERNEL_INTREE_DTS_NAME="xilinx/([-_/[:alnum:]\\.]*).*"$|\1|p' \
+               -e 's|^BR2_LINUX_KERNEL_INTREE_DTS_NAME="([-_/[:alnum:]\\.]*).*"$|\2|p' \  
Quoted 6 lines

Assuming you intended \1, not \2 here - this suggestion breaks behaviour for a couple of defconfigs in the tree. If I run the ZCU106 defconfig through this regexp, I get:

	$ cat configs/zynqmp_zcu106_defconfig | sed -nr -e 's|^BR2_LINUX_KERNEL_INTREE_DTS_NAME="([-_/[:alnum:]\\.]*).*"$|\1|p'
	xilinx/zynqmp-zcu106-revA

...this creates a dangling symlink in output/images (system.dtb -> xilinx/zynqmp-zcu106-revA.dtb).

Right.

Quoted 6 lines

The right behaviour is to strip any prefixes that exist, without requiring any. Something like:

(quoted diff) +1 -1
-               -e 's|^BR2_LINUX_KERNEL_INTREE_DTS_NAME="xilinx/([-_/[:alnum:]\\.]*).*"$|\1|p' \
+               -e 's|^BR2_LINUX_KERNEL_INTREE_DTS_NAME="(.*/)?([-_/[:alnum:]\\.]*).*"$|\2|p' \

This is less Xilinx-specific, although it seems a tad greedy.

Yes, better keeping the xilinx prefix as this is a xilinx-specific script anyway.

Signature · 7 lines
Luca Ceresoli, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
Reviewed-by Neal Frager
#4 lore raw

Hi Graeme,

Quoted 59 lines

Hi Luca,

Quoted 35 lines · Luca Ceresoli

Hi Graeme,

Quoted 19 lines · On Wed, 1 Feb 2023 11:59:56 -0800 Graeme Smecher…

If using BR2_LINUX_KERNEL_CUSTOM_DTS_PATH to copy .dts files from buildroot into the linux tree, these .dts files are copied to arch/arm64/boot. Unfortunately, the post-image.sh script expects to find them in arch/arm64/boot/xilinx.

This patch does not require the xilinx/ prefix to be present when symlinking the device-tree to system.dtb where u-boot expects to find it.

---
  board/zynqmp/post-image.sh | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
(quoted diff) +0 -0

b/board/zynqmp/post-image.sh index ed6dbe188c..c5de2db820 100755

board/zynqmp/post-image.sh line 10

Quoted 7 lines
board/zynqmp/post-image.sh +3 -1
@@ -5,7 +5,7 @@
  # devicetree listed in the config.
 
  FIRST_DT=$(sed -nr \
-               -e 's|^BR2_LINUX_KERNEL_INTREE_DTS_NAME="xilinx/([-_/[:alnum:]\\.]*).*"$|\1|p' \
+               -e 
+ 's|^BR2_LINUX_KERNEL_INTREE_DTS_NAME="(xilinx/)?([-_/[:alnum:]\\.
+ ]*).*"$|\2|p' \

I think the following simpler change would also work. Can you check that please?

Review

Quoted 4 lines
(quoted diff) +3 -1
-               -e 's|^BR2_LINUX_KERNEL_INTREE_DTS_NAME="xilinx/([-_/[:alnum:]\\.]*).*"$|\1|p' \
+               -e 
+ 's|^BR2_LINUX_KERNEL_INTREE_DTS_NAME="([-_/[:alnum:]\\.]*).*"$|\2|
+ p' \

Assuming you intended \1, not \2 here - this suggestion breaks behaviour for a couple of defconfigs in the tree. If I run the ZCU106 defconfig through this regexp, I get:

	$ cat configs/zynqmp_zcu106_defconfig | sed -nr -e 's|^BR2_LINUX_KERNEL_INTREE_DTS_NAME="([-_/[:alnum:]\\.]*).*"$|\1|p'
	xilinx/zynqmp-zcu106-revA

...this creates a dangling symlink in output/images (system.dtb -> xilinx/zynqmp-zcu106-revA.dtb).

Right.

The right behaviour is to strip any prefixes that exist, without requiring any. Something like:

(quoted diff) +3 -1
-               -e 's|^BR2_LINUX_KERNEL_INTREE_DTS_NAME="xilinx/([-_/[:alnum:]\\.]*).*"$|\1|p' \
+               -e 
+ 's|^BR2_LINUX_KERNEL_INTREE_DTS_NAME="(.*/)?([-_/[:alnum:]\\.]*).*"$
+ |\2|p' \
Quoted 5 lines

This is less Xilinx-specific, although it seems a tad greedy.

Yes, better keeping the xilinx prefix as this is a xilinx-specific script anyway.

Thank you for your patch.

Best regards,
Neal Frager
AMD
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#5 lore raw
In reply to Graeme Smecher
Quoted 5 lines · On Wed, 1 Feb 2023 11:59:56 -0800 Graeme Smecher…

If using BR2_LINUX_KERNEL_CUSTOM_DTS_PATH to copy .dts files from buildroot into the linux tree, these .dts files are copied to arch/arm64/boot. Unfortunately, the post-image.sh script expects to find them in arch/arm64/boot/xilinx.

Quoted 8 lines

This patch does not require the xilinx/ prefix to be present when symlinking the device-tree to system.dtb where u-boot expects to find it.

---
 board/zynqmp/post-image.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Applied to master, thanks.

Thomas

Signature · 7 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot