All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/12] Update architecture detection
@ 2018-07-26 10:19 Ben Hutchings
  2018-07-26 10:20 ` [PATCH 01/12] builddeb: Skip architecture detection when KBUILD_DEBARCH is set Ben Hutchings
                   ` (12 more replies)
  0 siblings, 13 replies; 14+ messages in thread
From: Ben Hutchings @ 2018-07-26 10:19 UTC (permalink / raw)
  To: linux-kbuild; +Cc: debian-kernel

[-- Attachment #1: Type: text/plain, Size: 1045 bytes --]

This series cleans up the set_debarch function in
scripts/package/mkdebian and adds support for several additional
Debian architectures.

Ben.

Ben Hutchings (12):
  builddeb: Skip architecture detection when KBUILD_DEBARCH is set
  builddeb: Change architecture detection fallback to use
    dpkg-architecture
  builddeb: Drop check for 32-bit s390
  builddeb: Introduce functions to simplify kconfig tests in set_debarch
  builddeb: Add automatic support for ppc64 and powerpcspe architectures
  builddeb: Add automatic support for mips64el architecture
  builddeb: Add automatic support for mips46{,64}{,el} architectures
  builddeb: Add automatic support for sparc64 architecture
  builddeb: Add automatic support for or1k architecture
  builddeb: Add automatic support for m68k architecture
  builddeb: Add automatic support for riscv* architectures
  builddeb: Add automatic support for sh{3,4}{,eb} architectures

 scripts/package/mkdebian | 68 +++++++++++++++++++++++++++++-----------
 1 file changed, 50 insertions(+), 18 deletions(-)


[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 811 bytes --]

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

* [PATCH 01/12] builddeb: Skip architecture detection when KBUILD_DEBARCH is set
  2018-07-26 10:19 [PATCH 00/12] Update architecture detection Ben Hutchings
@ 2018-07-26 10:20 ` Ben Hutchings
  2018-07-26 10:20 ` [PATCH 02/12] builddeb: Change architecture detection fallback to use dpkg-architecture Ben Hutchings
                   ` (11 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Ben Hutchings @ 2018-07-26 10:20 UTC (permalink / raw)
  To: linux-kbuild; +Cc: debian-kernel

[-- Attachment #1: Type: text/plain, Size: 1082 bytes --]

If KBUILD_DEBARCH is set then we will not use the result of
architecture detection, and we may also warn unnecessarily.
Move the check for KBUILD_DEBARCH further up to avoid this.

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 scripts/package/mkdebian | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/scripts/package/mkdebian b/scripts/package/mkdebian
index 985d72d1ab34..434f0b4d5231 100755
--- a/scripts/package/mkdebian
+++ b/scripts/package/mkdebian
@@ -7,6 +7,11 @@
 set -e
 
 set_debarch() {
+	if [ -n "$KBUILD_DEBARCH" ] ; then
+		debarch="$KBUILD_DEBARCH"
+		return
+	fi
+
 	# Attempt to find the correct Debian architecture
 	case "$UTS_MACHINE" in
 	i386|ia64|alpha)
@@ -46,10 +51,8 @@ set_debarch() {
 		echo "Falling back to using your current userspace instead!" >&2
 		echo "Please add support for $UTS_MACHINE to ${0} ..." >&2
 		echo "" >&2
+		;;
 	esac
-	if [ -n "$KBUILD_DEBARCH" ] ; then
-		debarch="$KBUILD_DEBARCH"
-	fi
 }
 
 # Some variables and settings used throughout the script


[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 811 bytes --]

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

* [PATCH 02/12] builddeb: Change architecture detection fallback to use dpkg-architecture
  2018-07-26 10:19 [PATCH 00/12] Update architecture detection Ben Hutchings
  2018-07-26 10:20 ` [PATCH 01/12] builddeb: Skip architecture detection when KBUILD_DEBARCH is set Ben Hutchings
@ 2018-07-26 10:20 ` Ben Hutchings
  2018-07-26 10:20 ` [PATCH 03/12] builddeb: Drop check for 32-bit s390 Ben Hutchings
                   ` (10 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Ben Hutchings @ 2018-07-26 10:20 UTC (permalink / raw)
  To: linux-kbuild; +Cc: debian-kernel

[-- Attachment #1: Type: text/plain, Size: 1238 bytes --]

We currently use dpkg --print-architecture, which reports the
architecture of the build machine.  We can make a better guess
than this by asking dpkg-architecture what the host architecture,
i.e. the default architecture for building packages, is.  This is
sensitive to environment variables such as CC and DEB_HOST_ARCH,
which should already be set in a cross-build environment.

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 scripts/package/mkdebian | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/scripts/package/mkdebian b/scripts/package/mkdebian
index 434f0b4d5231..389bf983879d 100755
--- a/scripts/package/mkdebian
+++ b/scripts/package/mkdebian
@@ -42,13 +42,13 @@ set_debarch() {
 		fi
 		;;
 	*)
-		debarch=$(dpkg --print-architecture)
+		debarch=$(dpkg-architecture -qDEB_HOST_ARCH)
 		echo "" >&2
 		echo "** ** **  WARNING  ** ** **" >&2
 		echo "" >&2
 		echo "Your architecture doesn't have its equivalent" >&2
 		echo "Debian userspace architecture defined!" >&2
-		echo "Falling back to using your current userspace instead!" >&2
+		echo "Falling back to the current host architecture ($debarch)." >&2
 		echo "Please add support for $UTS_MACHINE to ${0} ..." >&2
 		echo "" >&2
 		;;


[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 811 bytes --]

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

* [PATCH 03/12] builddeb: Drop check for 32-bit s390
  2018-07-26 10:19 [PATCH 00/12] Update architecture detection Ben Hutchings
  2018-07-26 10:20 ` [PATCH 01/12] builddeb: Skip architecture detection when KBUILD_DEBARCH is set Ben Hutchings
  2018-07-26 10:20 ` [PATCH 02/12] builddeb: Change architecture detection fallback to use dpkg-architecture Ben Hutchings
@ 2018-07-26 10:20 ` Ben Hutchings
  2018-07-26 10:21 ` [PATCH 04/12] builddeb: Introduce functions to simplify kconfig tests in set_debarch Ben Hutchings
                   ` (9 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Ben Hutchings @ 2018-07-26 10:20 UTC (permalink / raw)
  To: linux-kbuild; +Cc: debian-kernel

[-- Attachment #1: Type: text/plain, Size: 634 bytes --]

s390 now only supports 64-bit configurations.

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 scripts/package/mkdebian | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/package/mkdebian b/scripts/package/mkdebian
index 389bf983879d..f4449b575379 100755
--- a/scripts/package/mkdebian
+++ b/scripts/package/mkdebian
@@ -21,7 +21,7 @@ set_debarch() {
 	sparc*)
 		debarch=sparc ;;
 	s390*)
-		debarch=s390$(grep -q CONFIG_64BIT=y $KCONFIG_CONFIG && echo x || true) ;;
+		debarch=s390x ;;
 	ppc*)
 		debarch=$(grep -q CPU_LITTLE_ENDIAN=y $KCONFIG_CONFIG && echo ppc64el || echo powerpc) ;;
 	parisc*)


[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 811 bytes --]

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

* [PATCH 04/12] builddeb: Introduce functions to simplify kconfig tests in set_debarch
  2018-07-26 10:19 [PATCH 00/12] Update architecture detection Ben Hutchings
                   ` (2 preceding siblings ...)
  2018-07-26 10:20 ` [PATCH 03/12] builddeb: Drop check for 32-bit s390 Ben Hutchings
@ 2018-07-26 10:21 ` Ben Hutchings
  2018-07-26 10:21 ` [PATCH 05/12] builddeb: Add automatic support for ppc64 and powerpcspe architectures Ben Hutchings
                   ` (8 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Ben Hutchings @ 2018-07-26 10:21 UTC (permalink / raw)
  To: linux-kbuild; +Cc: debian-kernel

[-- Attachment #1: Type: text/plain, Size: 1526 bytes --]

We now have many repetitive greps over the kernel config.  Refactor
them into functions.

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 scripts/package/mkdebian | 26 +++++++++++++++++---------
 1 file changed, 17 insertions(+), 9 deletions(-)

diff --git a/scripts/package/mkdebian b/scripts/package/mkdebian
index f4449b575379..ada3c73d1493 100755
--- a/scripts/package/mkdebian
+++ b/scripts/package/mkdebian
@@ -6,6 +6,18 @@
 
 set -e
 
+is_enabled() {
+	grep -q "^CONFIG_$1=y" $KCONFIG_CONFIG
+}
+
+if_enabled_echo() {
+	if is_enabled "$1"; then
+		echo -n "$2"
+	elif [ $# -ge 3 ]; then
+		echo -n "$3"
+	fi
+}
+
 set_debarch() {
 	if [ -n "$KBUILD_DEBARCH" ] ; then
 		debarch="$KBUILD_DEBARCH"
@@ -23,22 +35,18 @@ set_debarch() {
 	s390*)
 		debarch=s390x ;;
 	ppc*)
-		debarch=$(grep -q CPU_LITTLE_ENDIAN=y $KCONFIG_CONFIG && echo ppc64el || echo powerpc) ;;
+		debarch=$(if_enabled_echo CPU_LITTLE_ENDIAN ppc64el powerpc) ;;
 	parisc*)
 		debarch=hppa ;;
 	mips*)
-		debarch=mips$(grep -q CPU_LITTLE_ENDIAN=y $KCONFIG_CONFIG && echo el || true) ;;
+		debarch=mips$(if_enabled_echo CPU_LITTLE_ENDIAN el) ;;
 	aarch64|arm64)
 		debarch=arm64 ;;
 	arm*)
-		if grep -q CONFIG_AEABI=y $KCONFIG_CONFIG; then
-		    if grep -q CONFIG_VFP=y $KCONFIG_CONFIG; then
-			debarch=armhf
-		    else
-			debarch=armel
-		    fi
+		if is_enabled AEABI; then
+			debarch=arm$(if_enabled_echo VFP hf el)
 		else
-		    debarch=arm
+			debarch=arm
 		fi
 		;;
 	*)


[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 811 bytes --]

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

* [PATCH 05/12] builddeb: Add automatic support for ppc64 and powerpcspe architectures
  2018-07-26 10:19 [PATCH 00/12] Update architecture detection Ben Hutchings
                   ` (3 preceding siblings ...)
  2018-07-26 10:21 ` [PATCH 04/12] builddeb: Introduce functions to simplify kconfig tests in set_debarch Ben Hutchings
@ 2018-07-26 10:21 ` Ben Hutchings
  2018-07-26 10:21 ` [PATCH 06/12] builddeb: Add automatic support for mips64el architecture Ben Hutchings
                   ` (7 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Ben Hutchings @ 2018-07-26 10:21 UTC (permalink / raw)
  To: linux-kbuild; +Cc: debian-kernel

[-- Attachment #1: Type: text/plain, Size: 993 bytes --]

We currently label 64-bit big-endian kernel packages as
powerpc (32-bit), mostly because it was officially supported while
ppc64 (64-bit big-endian) was not.  Now neither is officially
supported, so label these packages as ppc64.

Debian also has a powerpcspe (32-bit with SPE) architecture.
Label packages with a suitable configuration as powerpcspe.

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 scripts/package/mkdebian | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/scripts/package/mkdebian b/scripts/package/mkdebian
index ada3c73d1493..0891974f499b 100755
--- a/scripts/package/mkdebian
+++ b/scripts/package/mkdebian
@@ -35,7 +35,12 @@ set_debarch() {
 	s390*)
 		debarch=s390x ;;
 	ppc*)
-		debarch=$(if_enabled_echo CPU_LITTLE_ENDIAN ppc64el powerpc) ;;
+		if is_enabled 64BIT; then
+			debarch=ppc64$(if_enabled_echo CPU_LITTLE_ENDIAN el)
+		else
+			debarch=powerpc$(if_enabled_echo SPE spe)
+		fi
+		;;
 	parisc*)
 		debarch=hppa ;;
 	mips*)


[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 811 bytes --]

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

* [PATCH 06/12] builddeb: Add automatic support for mips64el architecture
  2018-07-26 10:19 [PATCH 00/12] Update architecture detection Ben Hutchings
                   ` (4 preceding siblings ...)
  2018-07-26 10:21 ` [PATCH 05/12] builddeb: Add automatic support for ppc64 and powerpcspe architectures Ben Hutchings
@ 2018-07-26 10:21 ` Ben Hutchings
  2018-07-26 10:22 ` [PATCH 07/12] builddeb: Add automatic support for mips{,64}r6{,el} architectures Ben Hutchings
                   ` (6 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Ben Hutchings @ 2018-07-26 10:21 UTC (permalink / raw)
  To: linux-kbuild; +Cc: debian-kernel

[-- Attachment #1: Type: text/plain, Size: 857 bytes --]

We currently label 64-bit little-endian kernel packages as
mipsel (32-bit little-endian), mostly it was officially supported
while mips64el (64-bit little-endian) was not.  Now both are
officially supported, so label these packages as mips64el.

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 scripts/package/mkdebian | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/scripts/package/mkdebian b/scripts/package/mkdebian
index 0891974f499b..350724cdc5af 100755
--- a/scripts/package/mkdebian
+++ b/scripts/package/mkdebian
@@ -44,7 +44,12 @@ set_debarch() {
 	parisc*)
 		debarch=hppa ;;
 	mips*)
-		debarch=mips$(if_enabled_echo CPU_LITTLE_ENDIAN el) ;;
+		if is_enabled CPU_LITTLE_ENDIAN; then
+			debarch=mips$(if_enabled_echo 64BIT 64)el
+		else
+			debarch=mips
+		fi
+		;;
 	aarch64|arm64)
 		debarch=arm64 ;;
 	arm*)


[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 811 bytes --]

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

* [PATCH 07/12] builddeb: Add automatic support for mips{,64}r6{,el} architectures
  2018-07-26 10:19 [PATCH 00/12] Update architecture detection Ben Hutchings
                   ` (5 preceding siblings ...)
  2018-07-26 10:21 ` [PATCH 06/12] builddeb: Add automatic support for mips64el architecture Ben Hutchings
@ 2018-07-26 10:22 ` Ben Hutchings
  2018-07-26 10:22 ` [PATCH 08/12] builddeb: Add automatic support for sparc64 architecture Ben Hutchings
                   ` (5 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Ben Hutchings @ 2018-07-26 10:22 UTC (permalink / raw)
  To: linux-kbuild; +Cc: debian-kernel

[-- Attachment #1: Type: text/plain, Size: 795 bytes --]

MIPS R6 is not fully backward-compatible, so Debian has separate
architecture names for userland built for R6.  Label kernel
packages accordingly.

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 scripts/package/mkdebian | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/scripts/package/mkdebian b/scripts/package/mkdebian
index 350724cdc5af..595482923844 100755
--- a/scripts/package/mkdebian
+++ b/scripts/package/mkdebian
@@ -45,7 +45,9 @@ set_debarch() {
 		debarch=hppa ;;
 	mips*)
 		if is_enabled CPU_LITTLE_ENDIAN; then
-			debarch=mips$(if_enabled_echo 64BIT 64)el
+			debarch=mips$(if_enabled_echo 64BIT 64)$(if_enabled_echo CPU_MIPSR6 r6)el
+		elif is_enabled CPU_MIPSR6; then
+			debarch=mips$(if_enabled_echo 64BIT 64)r6
 		else
 			debarch=mips
 		fi


[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 811 bytes --]

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

* [PATCH 08/12] builddeb: Add automatic support for sparc64 architecture
  2018-07-26 10:19 [PATCH 00/12] Update architecture detection Ben Hutchings
                   ` (6 preceding siblings ...)
  2018-07-26 10:22 ` [PATCH 07/12] builddeb: Add automatic support for mips{,64}r6{,el} architectures Ben Hutchings
@ 2018-07-26 10:22 ` Ben Hutchings
  2018-07-26 10:22 ` [PATCH 09/12] builddeb: Add automatic support for or1k architecture Ben Hutchings
                   ` (4 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Ben Hutchings @ 2018-07-26 10:22 UTC (permalink / raw)
  To: linux-kbuild; +Cc: debian-kernel

[-- Attachment #1: Type: text/plain, Size: 684 bytes --]

We currently label 64-bit kernel packages as sparc (32-bit), mostly
because it was officially supported while sparc64 was not.  Now
neither is officially supported, so label these packages as sparc64.

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 scripts/package/mkdebian | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/package/mkdebian b/scripts/package/mkdebian
index 595482923844..83179a4c6fda 100755
--- a/scripts/package/mkdebian
+++ b/scripts/package/mkdebian
@@ -31,7 +31,7 @@ set_debarch() {
 	x86_64)
 		debarch=amd64 ;;
 	sparc*)
-		debarch=sparc ;;
+		debarch=sparc$(if_enabled_echo 64BIT 64) ;;
 	s390*)
 		debarch=s390x ;;
 	ppc*)


[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 811 bytes --]

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

* [PATCH 09/12] builddeb: Add automatic support for or1k architecture
  2018-07-26 10:19 [PATCH 00/12] Update architecture detection Ben Hutchings
                   ` (7 preceding siblings ...)
  2018-07-26 10:22 ` [PATCH 08/12] builddeb: Add automatic support for sparc64 architecture Ben Hutchings
@ 2018-07-26 10:22 ` Ben Hutchings
  2018-07-26 10:22 ` [PATCH 10/12] builddeb: Add automatic support for m68k architecture Ben Hutchings
                   ` (3 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Ben Hutchings @ 2018-07-26 10:22 UTC (permalink / raw)
  To: linux-kbuild; +Cc: debian-kernel

[-- Attachment #1: Type: text/plain, Size: 451 bytes --]

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 scripts/package/mkdebian | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/scripts/package/mkdebian b/scripts/package/mkdebian
index 83179a4c6fda..fb0d3056f3e2 100755
--- a/scripts/package/mkdebian
+++ b/scripts/package/mkdebian
@@ -61,6 +61,8 @@ set_debarch() {
 			debarch=arm
 		fi
 		;;
+	openrisc)
+		debarch=or1k ;;
 	*)
 		debarch=$(dpkg-architecture -qDEB_HOST_ARCH)
 		echo "" >&2


[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 811 bytes --]

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

* [PATCH 10/12] builddeb: Add automatic support for m68k architecture
  2018-07-26 10:19 [PATCH 00/12] Update architecture detection Ben Hutchings
                   ` (8 preceding siblings ...)
  2018-07-26 10:22 ` [PATCH 09/12] builddeb: Add automatic support for or1k architecture Ben Hutchings
@ 2018-07-26 10:22 ` Ben Hutchings
  2018-07-26 10:22 ` [PATCH 11/12] builddeb: Add automatic support for riscv* architectures Ben Hutchings
                   ` (2 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Ben Hutchings @ 2018-07-26 10:22 UTC (permalink / raw)
  To: linux-kbuild; +Cc: debian-kernel

[-- Attachment #1: Type: text/plain, Size: 538 bytes --]

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 scripts/package/mkdebian | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/package/mkdebian b/scripts/package/mkdebian
index fb0d3056f3e2..470899fa3a8c 100755
--- a/scripts/package/mkdebian
+++ b/scripts/package/mkdebian
@@ -26,7 +26,7 @@ set_debarch() {
 
 	# Attempt to find the correct Debian architecture
 	case "$UTS_MACHINE" in
-	i386|ia64|alpha)
+	i386|ia64|alpha|m68k)
 		debarch="$UTS_MACHINE" ;;
 	x86_64)
 		debarch=amd64 ;;


[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 811 bytes --]

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

* [PATCH 11/12] builddeb: Add automatic support for riscv* architectures
  2018-07-26 10:19 [PATCH 00/12] Update architecture detection Ben Hutchings
                   ` (9 preceding siblings ...)
  2018-07-26 10:22 ` [PATCH 10/12] builddeb: Add automatic support for m68k architecture Ben Hutchings
@ 2018-07-26 10:22 ` Ben Hutchings
  2018-07-26 10:22 ` [PATCH 12/12] builddeb: Add automatic support for sh{3,4}{,eb} architectures Ben Hutchings
  2018-08-01 23:10 ` [PATCH 00/12] Update architecture detection Masahiro Yamada
  12 siblings, 0 replies; 14+ messages in thread
From: Ben Hutchings @ 2018-07-26 10:22 UTC (permalink / raw)
  To: linux-kbuild; +Cc: debian-kernel

[-- Attachment #1: Type: text/plain, Size: 703 bytes --]

Debian currently only defines "riscv64", but it seems safe to assume
that any 32-bit port will now be called "riscv32", also matching
$UTS_MACHINE.

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 scripts/package/mkdebian | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/package/mkdebian b/scripts/package/mkdebian
index 470899fa3a8c..3ef2fd0c5086 100755
--- a/scripts/package/mkdebian
+++ b/scripts/package/mkdebian
@@ -26,7 +26,7 @@ set_debarch() {
 
 	# Attempt to find the correct Debian architecture
 	case "$UTS_MACHINE" in
-	i386|ia64|alpha|m68k)
+	i386|ia64|alpha|m68k|riscv*)
 		debarch="$UTS_MACHINE" ;;
 	x86_64)
 		debarch=amd64 ;;


[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 811 bytes --]

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

* [PATCH 12/12] builddeb: Add automatic support for sh{3,4}{,eb} architectures
  2018-07-26 10:19 [PATCH 00/12] Update architecture detection Ben Hutchings
                   ` (10 preceding siblings ...)
  2018-07-26 10:22 ` [PATCH 11/12] builddeb: Add automatic support for riscv* architectures Ben Hutchings
@ 2018-07-26 10:22 ` Ben Hutchings
  2018-08-01 23:10 ` [PATCH 00/12] Update architecture detection Masahiro Yamada
  12 siblings, 0 replies; 14+ messages in thread
From: Ben Hutchings @ 2018-07-26 10:22 UTC (permalink / raw)
  To: linux-kbuild; +Cc: debian-kernel

[-- Attachment #1: Type: text/plain, Size: 1304 bytes --]

Different generations of the SH architecture are not very compatible,
so there are/were separate Debian ports for SH3 and SH4.

Move the fallback out of the "case" statement, so that it will also be
used in case we find some SH architecture version without a known
mapping.

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 scripts/package/mkdebian | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/scripts/package/mkdebian b/scripts/package/mkdebian
index 3ef2fd0c5086..663a7f343b42 100755
--- a/scripts/package/mkdebian
+++ b/scripts/package/mkdebian
@@ -63,7 +63,15 @@ set_debarch() {
 		;;
 	openrisc)
 		debarch=or1k ;;
-	*)
+	sh)
+		if is_enabled CPU_SH3; then
+			debarch=sh3$(if_enabled_echo CPU_BIG_ENDIAN eb)
+		elif is_enabled CPU_SH4; then
+			debarch=sh4$(if_enabled_echo CPU_BIG_ENDIAN eb)
+		fi
+		;;
+	esac
+	if [ -z "$debarch" ]; then
 		debarch=$(dpkg-architecture -qDEB_HOST_ARCH)
 		echo "" >&2
 		echo "** ** **  WARNING  ** ** **" >&2
@@ -73,8 +81,7 @@ set_debarch() {
 		echo "Falling back to the current host architecture ($debarch)." >&2
 		echo "Please add support for $UTS_MACHINE to ${0} ..." >&2
 		echo "" >&2
-		;;
-	esac
+	fi
 }
 
 # Some variables and settings used throughout the script

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 811 bytes --]

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

* Re: [PATCH 00/12] Update architecture detection
  2018-07-26 10:19 [PATCH 00/12] Update architecture detection Ben Hutchings
                   ` (11 preceding siblings ...)
  2018-07-26 10:22 ` [PATCH 12/12] builddeb: Add automatic support for sh{3,4}{,eb} architectures Ben Hutchings
@ 2018-08-01 23:10 ` Masahiro Yamada
  12 siblings, 0 replies; 14+ messages in thread
From: Masahiro Yamada @ 2018-08-01 23:10 UTC (permalink / raw)
  To: Ben Hutchings; +Cc: Linux Kbuild mailing list, debian-kernel

2018-07-26 19:19 GMT+09:00 Ben Hutchings <ben@decadent.org.uk>:
> This series cleans up the set_debarch function in
> scripts/package/mkdebian and adds support for several additional
> Debian architectures.
>
> Ben.
>
> Ben Hutchings (12):
>   builddeb: Skip architecture detection when KBUILD_DEBARCH is set
>   builddeb: Change architecture detection fallback to use
>     dpkg-architecture
>   builddeb: Drop check for 32-bit s390
>   builddeb: Introduce functions to simplify kconfig tests in set_debarch
>   builddeb: Add automatic support for ppc64 and powerpcspe architectures
>   builddeb: Add automatic support for mips64el architecture
>   builddeb: Add automatic support for mips46{,64}{,el} architectures
>   builddeb: Add automatic support for sparc64 architecture
>   builddeb: Add automatic support for or1k architecture
>   builddeb: Add automatic support for m68k architecture
>   builddeb: Add automatic support for riscv* architectures
>   builddeb: Add automatic support for sh{3,4}{,eb} architectures
>
>  scripts/package/mkdebian | 68 +++++++++++++++++++++++++++++-----------
>  1 file changed, 50 insertions(+), 18 deletions(-)
>

Applied.  Thanks!


-- 
Best Regards
Masahiro Yamada

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

end of thread, other threads:[~2018-08-02  0:59 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-26 10:19 [PATCH 00/12] Update architecture detection Ben Hutchings
2018-07-26 10:20 ` [PATCH 01/12] builddeb: Skip architecture detection when KBUILD_DEBARCH is set Ben Hutchings
2018-07-26 10:20 ` [PATCH 02/12] builddeb: Change architecture detection fallback to use dpkg-architecture Ben Hutchings
2018-07-26 10:20 ` [PATCH 03/12] builddeb: Drop check for 32-bit s390 Ben Hutchings
2018-07-26 10:21 ` [PATCH 04/12] builddeb: Introduce functions to simplify kconfig tests in set_debarch Ben Hutchings
2018-07-26 10:21 ` [PATCH 05/12] builddeb: Add automatic support for ppc64 and powerpcspe architectures Ben Hutchings
2018-07-26 10:21 ` [PATCH 06/12] builddeb: Add automatic support for mips64el architecture Ben Hutchings
2018-07-26 10:22 ` [PATCH 07/12] builddeb: Add automatic support for mips{,64}r6{,el} architectures Ben Hutchings
2018-07-26 10:22 ` [PATCH 08/12] builddeb: Add automatic support for sparc64 architecture Ben Hutchings
2018-07-26 10:22 ` [PATCH 09/12] builddeb: Add automatic support for or1k architecture Ben Hutchings
2018-07-26 10:22 ` [PATCH 10/12] builddeb: Add automatic support for m68k architecture Ben Hutchings
2018-07-26 10:22 ` [PATCH 11/12] builddeb: Add automatic support for riscv* architectures Ben Hutchings
2018-07-26 10:22 ` [PATCH 12/12] builddeb: Add automatic support for sh{3,4}{,eb} architectures Ben Hutchings
2018-08-01 23:10 ` [PATCH 00/12] Update architecture detection Masahiro Yamada

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.