Skip to contentSkip to conversation

package/linux: fix custom dts files handling

PATCH New Rafal Susz 5 participants 12 messages Mar 12, 2018 – Mar 31, 2018

lore
Share & tools
lore

Rafal Susz

author
#0 lore raw

PATCH 1/1 package/linux: fix custom dts files handling

Custom dts files are still conditionally copied based on non existing boolean. So it is currently not possible to use custom dts file(s) at all.

List of dts files is now iterated and files are copied into dedicated kernel arch dir.

---
 linux/linux.mk | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
linux/linux.mk +2 -2
index e98b25cb72..a69cb3ee51 100644
@@ -370,8 +370,8 @@ endif
 # Compilation. We make sure the kernel gets rebuilt when the
 # configuration has changed.
 define LINUX_BUILD_CMDS
-	$(if $(BR2_LINUX_KERNEL_USE_CUSTOM_DTS),
-		cp -f $(call qstrip,$(BR2_LINUX_KERNEL_CUSTOM_DTS_PATH)) $(KERNEL_ARCH_PATH)/boot/dts/)
+	$(foreach dts, $(BR2_LINUX_KERNEL_CUSTOM_DTS_PATH),
+		cp -f $(call qstrip,$(dts)) $(KERNEL_ARCH_PATH)/boot/dts/)
 	$(LINUX_MAKE_ENV) $(MAKE) $(LINUX_MAKE_FLAGS) -C $(@D) $(LINUX_TARGET_NAME)
 	@if grep -q "CONFIG_MODULES=y" $(@D)/.config; then	\
 		$(LINUX_MAKE_ENV) $(MAKE) $(LINUX_MAKE_FLAGS) -C $(@D) modules ;	\
Signature · 1 line
2.16.1
author
#1 lore raw

PATCH 1/1 package/linux: fix custom dts files handling

Custom dts files are still conditionally copied based on non existing boolean. So it is currently not possible to use custom dts file(s) at all.

List of dts files is now iterated and files are copied into dedicated kernel arch dir.

---
 linux/linux.mk | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
linux/linux.mk +3 -2
index e98b25cb72..12f0b03dbc 100644
@@ -370,8 +370,9 @@ endif
 # Compilation. We make sure the kernel gets rebuilt when the
 # configuration has changed.
 define LINUX_BUILD_CMDS
-	$(if $(BR2_LINUX_KERNEL_USE_CUSTOM_DTS),
-		cp -f $(call qstrip,$(BR2_LINUX_KERNEL_CUSTOM_DTS_PATH)) $(KERNEL_ARCH_PATH)/boot/dts/)
+	@for dts in $(call qstrip,$(BR2_LINUX_KERNEL_CUSTOM_DTS_PATH)); do \
+		cp -f $${dts} $(KERNEL_ARCH_PATH)/boot/dts/ ;   \
+	done
 	$(LINUX_MAKE_ENV) $(MAKE) $(LINUX_MAKE_FLAGS) -C $(@D) $(LINUX_TARGET_NAME)
 	@if grep -q "CONFIG_MODULES=y" $(@D)/.config; then	\
 		$(LINUX_MAKE_ENV) $(MAKE) $(LINUX_MAKE_FLAGS) -C $(@D) modules ;	\
Signature · 1 line
2.16.1
#2 lore raw

PATCH 1/1 package/linux: fix custom dts files handling

Hi Rafal,

Quoted 15 lines · Rafal Susz

Custom dts files are still conditionally copied based on non existing boolean. So it is currently not possible to use custom dts file(s) at all.

List of dts files is now iterated and files are copied into dedicated kernel arch dir.

---
 linux/linux.mk | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
linux/linux.mk +0 -0
index e98b25cb72..12f0b03dbc 100644

linux/linux.mk endif · line 374

Quoted 5 lines
linux/linux.mk +0 -2
@@ -370,8 +370,9 @@ endif
 # Compilation. We make sure the kernel gets rebuilt when the
 # configuration has changed.
 define LINUX_BUILD_CMDS
-	$(if $(BR2_LINUX_KERNEL_USE_CUSTOM_DTS),
-		cp -f $(call qstrip,$(BR2_LINUX_KERNEL_CUSTOM_DTS_PATH)) $(KERNEL_ARCH_PATH)/boot/dts/)

Commit f142f23ecf9ee (package/linux: drop useless intermediate DTS booleans) should have removed BR2_LINUX_KERNEL_USE_CUSTOM_DTS. There is another reference to this symbol below.

linux/linux.mk endif · line 378

Quoted 6 lines
linux/linux.mk +3 -0
+	@for dts in $(call qstrip,$(BR2_LINUX_KERNEL_CUSTOM_DTS_PATH)); do \
+		cp -f $${dts} $(KERNEL_ARCH_PATH)/boot/dts/ ;   \
+	done
 	$(LINUX_MAKE_ENV) $(MAKE) $(LINUX_MAKE_FLAGS) -C $(@D) $(LINUX_TARGET_NAME)
 	@if grep -q "CONFIG_MODULES=y" $(@D)/.config; then	\
 		$(LINUX_MAKE_ENV) $(MAKE) $(LINUX_MAKE_FLAGS) -C $(@D) modules ;	\

baruch

Signature · 3 lines
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -
#3 lore raw

PATCH 1/1 package/linux: fix custom dts files handling

Hello Baruch,

could you point where is "another reference" to this bool. I grepped br and did not find any other files.
In general it was good idea to drop these booleans and basing on user-entered strings take do some action or not.

best regards,
Rafal

2018-03-13 12:49 GMT+01:00 Baruch Siach <[email protected]>:

Quoted 42 lines

Hi Rafal,

Quoted 2 lines · Rafal Susz

Custom dts files are still conditionally copied based on non existing boolean. So it is currently not possible to use custom dts file(s) at

all.

Quoted 2 lines

List of dts files is now iterated and files are copied into dedicated

kernel arch dir.

Quoted 11 lines
---
 linux/linux.mk | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
linux/linux.mk +0 -0
index e98b25cb72..12f0b03dbc 100644

linux/linux.mk endif · line 374

Quoted 5 lines
linux/linux.mk +0 -2
@@ -370,8 +370,9 @@ endif
 # Compilation. We make sure the kernel gets rebuilt when the
 # configuration has changed.
 define LINUX_BUILD_CMDS
-     $(if $(BR2_LINUX_KERNEL_USE_CUSTOM_DTS),
-             cp -f $(call qstrip,$(BR2_LINUX_KERNEL_CUSTOM_DTS_PATH))

$(KERNEL_ARCH_PATH)/boot/dts/)

Commit f142f23ecf9ee (package/linux: drop useless intermediate DTS booleans)
should have removed BR2_LINUX_KERNEL_USE_CUSTOM_DTS. There is another reference to this symbol below.

linux/linux.mk endif · line 373

Quoted 1 line
linux/linux.mk +1 -0
+     @for dts in $(call qstrip,$(BR2_LINUX_KERNEL_CUSTOM_DTS_PATH));

do \

linux/linux.mk endif

Quoted 3 lines
linux/linux.mk +2 -0
+             cp -f $${dts} $(KERNEL_ARCH_PATH)/boot/dts/ ;   \
+     done
      $(LINUX_MAKE_ENV) $(MAKE) $(LINUX_MAKE_FLAGS) -C $(@D)

$(LINUX_TARGET_NAME)

linux/linux.mk endif · line 378

Quoted 2 lines
linux/linux.mk +0 -0
      @if grep -q "CONFIG_MODULES=y" $(@D)/.config; then      \
              $(LINUX_MAKE_ENV) $(MAKE) $(LINUX_MAKE_FLAGS) -C $(@D)

modules ; \

Quoted 9 lines

baruch

--
http://baruch.siach.name/blog/ ~. .~ Tk Open
Systems =}------------------------------------------------ooO--U-- Ooo------------{=
- baruch at tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20180313/ebb09479/attachment.html>

#4 lore raw

PATCH 1/1 package/linux: fix custom dts files handling

Hi Rafa?,

Quoted 4 lines · Rafa? Susz

could you point where is "another reference" to this bool. I grepped br and did not find any other files.
In general it was good idea to drop these booleans and basing on user-entered strings take do some action or not.

Here is what I get for current git master:

$ git grep KERNEL_USE_CUSTOM_DTS origin/master 
origin/master:configs/s6lx9_microboard_defconfig:BR2_LINUX_KERNEL_USE_CUSTOM_DTS=y
origin/master:linux/linux.mk:   $(if $(BR2_LINUX_KERNEL_USE_CUSTOM_DTS),
origin/master:linux/linux.mk:BR2_LINUX_KERNEL_USE_INTREE_DTS / BR2_LINUX_KERNEL_USE_CUSTOM_DTS settings)

Your patch only removes the second reference. There a two more to be converted/removed.

baruch

Quoted 42 lines

2018-03-13 12:49 GMT+01:00 Baruch Siach <[email protected]>:

Quoted 41 lines · Rafal Susz
Quoted 2 lines

Custom dts files are still conditionally copied based on non existing boolean. So it is currently not possible to use custom dts file(s) at

all.

Quoted 2 lines

List of dts files is now iterated and files are copied into dedicated

kernel arch dir.

Quoted 11 lines
---
 linux/linux.mk | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
linux/linux.mk +0 -0
index e98b25cb72..12f0b03dbc 100644

linux/linux.mk endif · line 374

Quoted 5 lines
linux/linux.mk +0 -2
@@ -370,8 +370,9 @@ endif
 # Compilation. We make sure the kernel gets rebuilt when the
 # configuration has changed.
 define LINUX_BUILD_CMDS
-     $(if $(BR2_LINUX_KERNEL_USE_CUSTOM_DTS),
-             cp -f $(call qstrip,$(BR2_LINUX_KERNEL_CUSTOM_DTS_PATH))

$(KERNEL_ARCH_PATH)/boot/dts/)

Commit f142f23ecf9ee (package/linux: drop useless intermediate DTS booleans)
should have removed BR2_LINUX_KERNEL_USE_CUSTOM_DTS. There is another reference to this symbol below.

linux/linux.mk endif · line 373

Quoted 1 line
linux/linux.mk +1 -0
+     @for dts in $(call qstrip,$(BR2_LINUX_KERNEL_CUSTOM_DTS_PATH));

do \

linux/linux.mk endif

Quoted 3 lines
linux/linux.mk +2 -0
+             cp -f $${dts} $(KERNEL_ARCH_PATH)/boot/dts/ ;   \
+     done
      $(LINUX_MAKE_ENV) $(MAKE) $(LINUX_MAKE_FLAGS) -C $(@D)

$(LINUX_TARGET_NAME)

linux/linux.mk endif · line 378

Quoted 2 lines
linux/linux.mk +0 -0
      @if grep -q "CONFIG_MODULES=y" $(@D)/.config; then      \
              $(LINUX_MAKE_ENV) $(MAKE) $(LINUX_MAKE_FLAGS) -C $(@D)

modules ; \

baruch

Signature · 3 lines
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.52.368.4656, http://www.tkos.co.il -
author
#5 lore raw

PATCH 1/1 package/linux: fix custom dts files handling

In reply to Rafal Susz

Custom dts files are still conditionally copied based on non existing boolean. So it is currently not possible to use custom dts file(s) at all.

List of dts files is now iterated and files are copied into dedicated kernel arch dir.

---
 configs/s6lx9_microboard_defconfig | 1 -
 linux/linux.mk                     | 9 +++++----
 2 files changed, 5 insertions(+), 5 deletions(-)
configs/s6lx9_microboard_defconfig +0 -1
index f77c80ba87..97b2d3fe79 100644
@@ -10,5 +10,4 @@ BR2_LINUX_KERNEL_CUSTOM_VERSION=y
 BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.4.7"
 BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
 BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="board/avnet/s6lx9_microboard/lx9_mmu_defconfig"
-BR2_LINUX_KERNEL_USE_CUSTOM_DTS=y
 BR2_LINUX_KERNEL_CUSTOM_DTS_PATH="board/avnet/s6lx9_microboard/lx9_mmu.dts"
linux/linux.mk +5 -4
index e98b25cb72..94bfb9661a 100644
@@ -370,8 +370,9 @@ endif
 # Compilation. We make sure the kernel gets rebuilt when the
 # configuration has changed.
 define LINUX_BUILD_CMDS
-	$(if $(BR2_LINUX_KERNEL_USE_CUSTOM_DTS),
-		cp -f $(call qstrip,$(BR2_LINUX_KERNEL_CUSTOM_DTS_PATH)) $(KERNEL_ARCH_PATH)/boot/dts/)
+	@for dts in $(call qstrip,$(BR2_LINUX_KERNEL_CUSTOM_DTS_PATH)); do \
+		cp -f $${dts} $(KERNEL_ARCH_PATH)/boot/dts/ ;   \
+	done
 	$(LINUX_MAKE_ENV) $(MAKE) $(LINUX_MAKE_FLAGS) -C $(@D) $(LINUX_TARGET_NAME)
 	@if grep -q "CONFIG_MODULES=y" $(@D)/.config; then	\
 		$(LINUX_MAKE_ENV) $(MAKE) $(LINUX_MAKE_FLAGS) -C $(@D) modules ;	\
@@ -482,9 +483,9 @@ $(error No kernel configuration file specified, check your BR2_LINUX_KERNEL_CUST
 endif
 endif
 
-ifeq ($(BR2_LINUX_KERNEL_DTS_SUPPORT)$(KERNEL_DTS_NAME),y)
+ifeq ($(strip $(BR2_LINUX_KERNEL_DTS_SUPPORT)$(KERNEL_DTS_NAME)),y)
 $(error No kernel device tree source specified, check your \
-BR2_LINUX_KERNEL_USE_INTREE_DTS / BR2_LINUX_KERNEL_USE_CUSTOM_DTS settings)
+BR2_LINUX_KERNEL_INTREE_DTS_NAME / BR2_LINUX_KERNEL_CUSTOM_DTS_PATH settings)
 endif
 
 endif # BR_BUILDING
Signature · 1 line
2.16.1
#6 lore raw

PATCH 1/1 package/linux: fix custom dts files handling

Rafal, All,

On 2018-03-13 15:26 +0100, Rafal Susz spake thusly:

Quoted 16 lines

Custom dts files are still conditionally copied based on non existing boolean. So it is currently not possible to use custom dts file(s) at all.

List of dts files is now iterated and files are copied into dedicated kernel arch dir.

---
 configs/s6lx9_microboard_defconfig | 1 -
 linux/linux.mk                     | 9 +++++----
 2 files changed, 5 insertions(+), 5 deletions(-)
configs/s6lx9_microboard_defconfig +0 -0
index f77c80ba87..97b2d3fe79 100644

configs/s6lx9_microboard_defconfig BR2_LINUX_KERNEL_CUSTOM_VERSION=y · line 13

Quoted 5 lines
configs/s6lx9_microboard_defconfig +0 -1
@@ -10,5 +10,4 @@ BR2_LINUX_KERNEL_CUSTOM_VERSION=y
 BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.4.7"
 BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
 BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="board/avnet/s6lx9_microboard/lx9_mmu_defconfig"
-BR2_LINUX_KERNEL_USE_CUSTOM_DTS=y
 BR2_LINUX_KERNEL_CUSTOM_DTS_PATH="board/avnet/s6lx9_microboard/lx9_mmu.dts"

I would prefer if it were two patches:
- one to fix linux.mk
- another to fix the defconfig

Quoted 17 lines
linux/linux.mk +3 -2
index e98b25cb72..94bfb9661a 100644
@@ -370,8 +370,9 @@ endif
 # Compilation. We make sure the kernel gets rebuilt when the
 # configuration has changed.
 define LINUX_BUILD_CMDS
-	$(if $(BR2_LINUX_KERNEL_USE_CUSTOM_DTS),
-		cp -f $(call qstrip,$(BR2_LINUX_KERNEL_CUSTOM_DTS_PATH)) $(KERNEL_ARCH_PATH)/boot/dts/)
+	@for dts in $(call qstrip,$(BR2_LINUX_KERNEL_CUSTOM_DTS_PATH)); do \
+		cp -f $${dts} $(KERNEL_ARCH_PATH)/boot/dts/ ;   \
+	done
 	$(LINUX_MAKE_ENV) $(MAKE) $(LINUX_MAKE_FLAGS) -C $(@D) $(LINUX_TARGET_NAME)
 	@if grep -q "CONFIG_MODULES=y" $(@D)/.config; then	\
 		$(LINUX_MAKE_ENV) $(MAKE) $(LINUX_MAKE_FLAGS) -C $(@D) modules ;	\

linux/linux.mk $(error No kernel configuration file specified, check your BR2_LINUX_KERNEL_CUST · line 486

Quoted 5 lines
linux/linux.mk +1 -1
@@ -482,9 +483,9 @@ $(error No kernel configuration file specified, check your BR2_LINUX_KERNEL_CUST
 endif
 endif
 
-ifeq ($(BR2_LINUX_KERNEL_DTS_SUPPORT)$(KERNEL_DTS_NAME),y)
+ifeq ($(strip $(BR2_LINUX_KERNEL_DTS_SUPPORT)$(KERNEL_DTS_NAME)),y)

Only $(BR2_LINUX_KERNEL_CUSTOM_DTS_PATH) should be stripped, while the boolean $(BR2_LINUX_KERNEL_DTS_SUPPORT) needs not. Also, I'd prefer if there was a separator between the boolean and the free-form string:

    ifeq ($(BR2_LINUX_KERNEL_DTS_SUPPORT):$(strip $(KERNEL_DTS_NAME)),y:)

Regards,
Yann E. MORIN.

Quoted 6 lines
linux/linux.mk +0 -0
 endif
 
 endif # BR_BUILDING
Signature · 1 line
2.16.1
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
author
#7 lore raw

PATCH 1/2 package/linux: fix custom dts files handling

In reply to Rafal Susz

Custom dts files are still conditionally copied based on non existing boolean. So it is currently not possible to use custom dts file(s) at all.

List of dts files is now iterated and files are copied into dedicated kernel arch dir.

---
 linux/linux.mk | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
linux/linux.mk +5 -4
index e98b25cb72..cf1cae7cc0 100644
@@ -370,8 +370,9 @@ endif
 # Compilation. We make sure the kernel gets rebuilt when the
 # configuration has changed.
 define LINUX_BUILD_CMDS
-	$(if $(BR2_LINUX_KERNEL_USE_CUSTOM_DTS),
-		cp -f $(call qstrip,$(BR2_LINUX_KERNEL_CUSTOM_DTS_PATH)) $(KERNEL_ARCH_PATH)/boot/dts/)
+	@for dts in $(call qstrip,$(BR2_LINUX_KERNEL_CUSTOM_DTS_PATH)); do \
+		cp -f $${dts} $(KERNEL_ARCH_PATH)/boot/dts/ ;   \
+	done
 	$(LINUX_MAKE_ENV) $(MAKE) $(LINUX_MAKE_FLAGS) -C $(@D) $(LINUX_TARGET_NAME)
 	@if grep -q "CONFIG_MODULES=y" $(@D)/.config; then	\
 		$(LINUX_MAKE_ENV) $(MAKE) $(LINUX_MAKE_FLAGS) -C $(@D) modules ;	\
@@ -482,9 +483,9 @@ $(error No kernel configuration file specified, check your BR2_LINUX_KERNEL_CUST
 endif
 endif
 
-ifeq ($(BR2_LINUX_KERNEL_DTS_SUPPORT)$(KERNEL_DTS_NAME),y)
+ifeq ($(BR2_LINUX_KERNEL_DTS_SUPPORT):$(strip $(KERNEL_DTS_NAME)),y:)
 $(error No kernel device tree source specified, check your \
-BR2_LINUX_KERNEL_USE_INTREE_DTS / BR2_LINUX_KERNEL_USE_CUSTOM_DTS settings)
+BR2_LINUX_KERNEL_INTREE_DTS_NAME / BR2_LINUX_KERNEL_CUSTOM_DTS_PATH settings)
 endif
 
 endif # BR_BUILDING
Signature · 1 line
2.16.1
author
#8 lore raw

PATCH 2/2 configs/s6lx9_microboard_defconfig: purge custom dts boolean

Since custom dts files are unconditionally handled *KERNEL_USE_CUSTOM_DTS is no longer available/needed.

---
 configs/s6lx9_microboard_defconfig | 1 -
 1 file changed, 1 deletion(-)
configs/s6lx9_microboard_defconfig +0 -1
index f77c80ba87..97b2d3fe79 100644
@@ -10,5 +10,4 @@ BR2_LINUX_KERNEL_CUSTOM_VERSION=y
 BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="4.4.7"
 BR2_LINUX_KERNEL_USE_CUSTOM_CONFIG=y
 BR2_LINUX_KERNEL_CUSTOM_CONFIG_FILE="board/avnet/s6lx9_microboard/lx9_mmu_defconfig"
-BR2_LINUX_KERNEL_USE_CUSTOM_DTS=y
 BR2_LINUX_KERNEL_CUSTOM_DTS_PATH="board/avnet/s6lx9_microboard/lx9_mmu.dts"
Signature · 1 line
2.16.1
#9 lore raw

PATCH 2/2 configs/s6lx9_microboard_defconfig: purge custom dts boolean

Quoted 6 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Rafal" == Rafal Susz <[email protected]> writes:

Since custom dts files are unconditionally handled *KERNEL_USE_CUSTOM_DTS is no longer available/needed.

Committed, thanks.

Signature · 1 line
Bye, Peter Korsgaard
#10 lore raw

PATCH 1/2 package/linux: fix custom dts files handling

In reply to Rafal Susz
Quoted 7 lines · Rafal Susz

Custom dts files are still conditionally copied based on non existing boolean. So it is currently not possible to use custom dts file(s) at all.

List of dts files is now iterated and files are copied into dedicated kernel arch dir.

Tested on a config which uses two out-of-tree DTS files. Without this patch, the current master fails.

With kind regards,
Jan

#11 lore raw

PATCH 1/2 package/linux: fix custom dts files handling

In reply to Rafal Susz
Quoted 8 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Rafal" == Rafal Susz <[email protected]> writes:

Custom dts files are still conditionally copied based on non existing boolean. So it is currently not possible to use custom dts file(s) at all.

List of dts files is now iterated and files are copied into dedicated kernel arch dir.

Committed, thanks.

Signature · 1 line
Bye, Peter Korsgaard