Skip to contentSkip to conversation

kbuild: buildtar: add arm64 dtbs support

PATCH Superseded Domenico Andreoli 2 participants 7 messages Jun 25, 2020 – Jun 28, 2020 Kbuild

v2 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 kbuild: buildtar: add arm64 dtbs support

From: Domenico Andreoli <[email protected]>

Make 'make tar-pkg' install dtbs on arm64.

v2:
- Destination path includes the kernel version, as expected

---
 scripts/package/buildtar |    9 +++++++++
 1 file changed, 9 insertions(+)
scripts/package/buildtar +9 -0
Index: b/scripts/package/buildtar
===================================================================
@@ -125,6 +125,15 @@ case "${ARCH}" in
 		;;
 esac
 
+#
+# Install dtbs
+#
+case "${ARCH}" in
+	arm64)
+		make ARCH="${ARCH}" -f ${srctree}/Makefile INSTALL_DTBS_PATH="${tmpdir}/boot/dtbs/${KERNELRELEASE}" dtbs_install
+		;;
+esac
+
 if [ "${1}" = dir-pkg ]; then
 	echo "Kernel tree successfully created in $tmpdir"
 	exit 0
Signature · 2 lines
rsa4096: 3B10 0CA1 8674 ACBA B4FE  FCD2 CE5B CF17 9960 DE13
ed25519: FFB4 0CC3 7F2E 091D F7DA  356E CC79 2832 ED38 CB05
#1 lore raw
Quoted 19 lines · Domenico Andreoli

From: Domenico Andreoli <[email protected]>

Make 'make tar-pkg' install dtbs on arm64.

v2:
- Destination path includes the kernel version, as expected

---
 scripts/package/buildtar |    9 +++++++++
 1 file changed, 9 insertions(+)

Index: b/scripts/package/buildtar
===================================================================

scripts/package/buildtar case "${ARCH}" in · line 131

Quoted 7 lines
scripts/package/buildtar +4 -0
@@ -125,6 +125,15 @@ case "${ARCH}" in
                ;;
 esac
 
+#
+# Install dtbs
+#
+case "${ARCH}" in

Instead of checking ${ARCH},
can you you do

if grep -q '^CONFIG_OF_EARLY_FLATTREE=y' include/config/auto.conf; then

?

This is what the deb package build does:
https://github.com/masahir0y/linux/blob/v5.7/scripts/package/builddeb#L145

scripts/package/buildtar case "${ARCH}" in · line 136

Quoted 5 lines
scripts/package/buildtar +5 -0
+       arm64)
+               make ARCH="${ARCH}" -f ${srctree}/Makefile INSTALL_DTBS_PATH="${tmpdir}/boot/dtbs/${KERNELRELEASE}" dtbs_install
+               ;;
+esac
+

Or, you can use INSTALL_PATH="${tmpdir}/boot"
to make it shorter.

--
Best Regards
Masahiro Yamada

#2 lore raw
Quoted 32 lines · Masahiro Yamada
Quoted 19 lines · Domenico Andreoli

From: Domenico Andreoli <[email protected]>

Make 'make tar-pkg' install dtbs on arm64.

v2:
- Destination path includes the kernel version, as expected

---
 scripts/package/buildtar |    9 +++++++++
 1 file changed, 9 insertions(+)

Index: b/scripts/package/buildtar
===================================================================

scripts/package/buildtar case "${ARCH}" in · line 131

Quoted 7 lines
scripts/package/buildtar +4 -0
@@ -125,6 +125,15 @@ case "${ARCH}" in
                ;;
 esac
 
+#
+# Install dtbs
+#
+case "${ARCH}" in

Instead of checking ${ARCH},
can you you do

Quoted 3 lines

if grep -q '^CONFIG_OF_EARLY_FLATTREE=y' include/config/auto.conf; then

?

Done in v3.

Quoted 5 lines

This is what the deb package build does:
https://github.com/masahir0y/linux/blob/v5.7/scripts/package/builddeb#L145

Quoted 9 lines

scripts/package/buildtar case "${ARCH}" in · line 136

Quoted 5 lines
scripts/package/buildtar +5 -0
+       arm64)
+               make ARCH="${ARCH}" -f ${srctree}/Makefile INSTALL_DTBS_PATH="${tmpdir}/boot/dtbs/${KERNELRELEASE}" dtbs_install
+               ;;
+esac
+

Or, you can use INSTALL_PATH="${tmpdir}/boot"
to make it shorter.

This does not work, INSTALL_DTBS_PATH gets somehow defined along the twisted path to buildtar and therefore needs to be explicitly specified for the new destination.

Quoted 3 lines

--
Best Regards
Masahiro Yamada

Thank you for the review.

Regards,
Domenico

Signature · 2 lines
rsa4096: 3B10 0CA1 8674 ACBA B4FE  FCD2 CE5B CF17 9960 DE13
ed25519: FFB4 0CC3 7F2E 091D F7DA  356E CC79 2832 ED38 CB05
#3 lore raw
Quoted 55 lines · Domenico Andreoli
Quoted 32 lines · Masahiro Yamada
Quoted 19 lines · Domenico Andreoli

From: Domenico Andreoli <[email protected]>

Make 'make tar-pkg' install dtbs on arm64.

v2:
- Destination path includes the kernel version, as expected

---
 scripts/package/buildtar |    9 +++++++++
 1 file changed, 9 insertions(+)

Index: b/scripts/package/buildtar
===================================================================

scripts/package/buildtar case "${ARCH}" in · line 131

Quoted 7 lines
scripts/package/buildtar +4 -0
@@ -125,6 +125,15 @@ case "${ARCH}" in
                ;;
 esac
 
+#
+# Install dtbs
+#
+case "${ARCH}" in

Instead of checking ${ARCH},
can you you do

Quoted 3 lines

if grep -q '^CONFIG_OF_EARLY_FLATTREE=y' include/config/auto.conf; then

?

Done in v3.

Quoted 5 lines

This is what the deb package build does:
https://github.com/masahir0y/linux/blob/v5.7/scripts/package/builddeb#L145

Quoted 9 lines

scripts/package/buildtar case "${ARCH}" in · line 136

Quoted 5 lines
scripts/package/buildtar +5 -0
+       arm64)
+               make ARCH="${ARCH}" -f ${srctree}/Makefile INSTALL_DTBS_PATH="${tmpdir}/boot/dtbs/${KERNELRELEASE}" dtbs_install
+               ;;
+esac
+

Or, you can use INSTALL_PATH="${tmpdir}/boot"
to make it shorter.

Quoted 3 lines

This does not work, INSTALL_DTBS_PATH gets somehow defined along the twisted path to buildtar and therefore needs to be explicitly specified for the new destination.

It works.

See line 1002 of the top Makefile

export INSTALL_DTBS_PATH ?= $(INSTALL_PATH)/dtbs/$(KERNELRELEASE)

Quoted 12 lines
Quoted 3 lines

--
Best Regards
Masahiro Yamada

Thank you for the review.

Regards,
Domenico

--
rsa4096: 3B10 0CA1 8674 ACBA B4FE FCD2 CE5B CF17 9960 DE13
ed25519: FFB4 0CC3 7F2E 091D F7DA 356E CC79 2832 ED38 CB05

Signature · 2 lines
Best Regards
Masahiro Yamada
#4 lore raw
Quoted 3 lines · Masahiro Yamada
Quoted 2 lines · Domenico Andreoli
Quoted 1 line · Masahiro Yamada

On Fri, Jun 26, 2020 at 5:51 AM Domenico Andreoli <[email protected]> wrote:

[...]

Quoted 15 lines
Quoted 11 lines
Quoted 10 lines

scripts/package/buildtar case "${ARCH}" in · line 136

Quoted 6 lines
scripts/package/buildtar +5 -0
+       arm64)
+               make ARCH="${ARCH}" -f ${srctree}/Makefile INSTALL_DTBS_PATH="${tmpdir}/boot/dtbs/${KERNELRELEASE}" dtbs_install
+               ;;
+esac
+

Or, you can use INSTALL_PATH="${tmpdir}/boot"
to make it shorter.

Quoted 3 lines

This does not work, INSTALL_DTBS_PATH gets somehow defined along the twisted path to buildtar and therefore needs to be explicitly specified for the new destination.

Quoted 5 lines

It works.

See line 1002 of the top Makefile

export INSTALL_DTBS_PATH ?= $(INSTALL_PATH)/dtbs/$(KERNELRELEASE)

Exactly. INSTALL_DTBS_PATH is _exported_ in the top Makefile.

This is what it seems to happen, in the order:

1. outer 'make dir-pkg'
INSTALL_DTBS_PATH is exported with some content

2. control arrives to buildtar INSTALL_DTBS_PATH is there as environment variable

3. inner 'make INSTALL_PATH=${tmpdir}/boot dtbs_install' INSTALL_DTBS_PATH is already set, therefore it is not modified

To make the inner invocation work, I see these two options:

1. 'make INSTALL_DTBS_PATH= INSTALL_PATH=${tmpdir}/boot dtb_install' (untested)

2. 'make INSTALL_DTBS_PATH=${tmpdir}/boot/dtbs/${KERNELRELEASE} dtbs_install'

I chose 2 but I can switch to 1, if you prefer. No problem.

Regards,
Domenico

Signature · 2 lines
rsa4096: 3B10 0CA1 8674 ACBA B4FE  FCD2 CE5B CF17 9960 DE13
ed25519: FFB4 0CC3 7F2E 091D F7DA  356E CC79 2832 ED38 CB05
#5 lore raw
Quoted 34 lines · Domenico Andreoli
Quoted 3 lines · Masahiro Yamada
Quoted 2 lines · Domenico Andreoli
Quoted 1 line · Masahiro Yamada

On Fri, Jun 26, 2020 at 5:51 AM Domenico Andreoli <[email protected]> wrote:

[...]

Quoted 15 lines
Quoted 11 lines
Quoted 10 lines

scripts/package/buildtar case "${ARCH}" in · line 136

Quoted 6 lines
scripts/package/buildtar +5 -0
+       arm64)
+               make ARCH="${ARCH}" -f ${srctree}/Makefile INSTALL_DTBS_PATH="${tmpdir}/boot/dtbs/${KERNELRELEASE}" dtbs_install
+               ;;
+esac
+

Or, you can use INSTALL_PATH="${tmpdir}/boot"
to make it shorter.

Quoted 3 lines

This does not work, INSTALL_DTBS_PATH gets somehow defined along the twisted path to buildtar and therefore needs to be explicitly specified for the new destination.

Quoted 5 lines

It works.

See line 1002 of the top Makefile

export INSTALL_DTBS_PATH ?= $(INSTALL_PATH)/dtbs/$(KERNELRELEASE)

Exactly. INSTALL_DTBS_PATH is _exported_ in the top Makefile.

This is what it seems to happen, in the order:

Quoted 8 lines

1. outer 'make dir-pkg'
INSTALL_DTBS_PATH is exported with some content

2. control arrives to buildtar INSTALL_DTBS_PATH is there as environment variable

3. inner 'make INSTALL_PATH=${tmpdir}/boot dtbs_install' INSTALL_DTBS_PATH is already set, therefore it is not modified

Sorry, I was wrong.
Your analysis is definitely right.

I will apply v4.

Thanks.

Quoted 16 lines

To make the inner invocation work, I see these two options:

1. 'make INSTALL_DTBS_PATH= INSTALL_PATH=${tmpdir}/boot dtb_install' (untested)

2. 'make INSTALL_DTBS_PATH=${tmpdir}/boot/dtbs/${KERNELRELEASE} dtbs_install'

I chose 2 but I can switch to 1, if you prefer. No problem.

Regards,
Domenico

--
rsa4096: 3B10 0CA1 8674 ACBA B4FE FCD2 CE5B CF17 9960 DE13
ed25519: FFB4 0CC3 7F2E 091D F7DA 356E CC79 2832 ED38 CB05

Signature · 2 lines
Best Regards
Masahiro Yamada
#6 lore raw
Quoted 45 lines · Masahiro Yamada
Quoted 34 lines · Domenico Andreoli
Quoted 3 lines · Masahiro Yamada
Quoted 2 lines · Domenico Andreoli
Quoted 1 line · Masahiro Yamada

On Fri, Jun 26, 2020 at 5:51 AM Domenico Andreoli <[email protected]> wrote:

[...]

Quoted 15 lines
Quoted 11 lines
Quoted 10 lines

scripts/package/buildtar case "${ARCH}" in · line 136

Quoted 6 lines
scripts/package/buildtar +5 -0
+       arm64)
+               make ARCH="${ARCH}" -f ${srctree}/Makefile INSTALL_DTBS_PATH="${tmpdir}/boot/dtbs/${KERNELRELEASE}" dtbs_install
+               ;;
+esac
+

Or, you can use INSTALL_PATH="${tmpdir}/boot"
to make it shorter.

Quoted 3 lines

This does not work, INSTALL_DTBS_PATH gets somehow defined along the twisted path to buildtar and therefore needs to be explicitly specified for the new destination.

Quoted 5 lines

It works.

See line 1002 of the top Makefile

export INSTALL_DTBS_PATH ?= $(INSTALL_PATH)/dtbs/$(KERNELRELEASE)

Exactly. INSTALL_DTBS_PATH is _exported_ in the top Makefile.

This is what it seems to happen, in the order:

Quoted 8 lines

1. outer 'make dir-pkg'
INSTALL_DTBS_PATH is exported with some content

2. control arrives to buildtar INSTALL_DTBS_PATH is there as environment variable

3. inner 'make INSTALL_PATH=${tmpdir}/boot dtbs_install' INSTALL_DTBS_PATH is already set, therefore it is not modified

Quoted 8 lines

Sorry, I was wrong.
Your analysis is definitely right.

I will apply v4.

Thanks.

Thanks to you!

Domenico

Signature · 2 lines
rsa4096: 3B10 0CA1 8674 ACBA B4FE  FCD2 CE5B CF17 9960 DE13
ed25519: FFB4 0CC3 7F2E 091D F7DA  356E CC79 2832 ED38 CB05