Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.debian.kernel > #61600 > unrolled thread
| Started by | Ben Hutchings <ben@decadent.org.uk> |
|---|---|
| First post | 2018-07-26 12:20 +0200 |
| Last post | 2018-08-02 01:50 +0200 |
| Articles | 14 — 2 participants |
Back to article view | Back to linux.debian.kernel
[PATCH 00/12] Update architecture detection Ben Hutchings <ben@decadent.org.uk> - 2018-07-26 12:20 +0200
[PATCH 01/12] builddeb: Skip architecture detection when KBUILD_DEBARCH is set Ben Hutchings <ben@decadent.org.uk> - 2018-07-26 12:30 +0200
[PATCH 05/12] builddeb: Add automatic support for ppc64 and powerpcspe architectures Ben Hutchings <ben@decadent.org.uk> - 2018-07-26 12:30 +0200
[PATCH 04/12] builddeb: Introduce functions to simplify kconfig tests in set_debarch Ben Hutchings <ben@decadent.org.uk> - 2018-07-26 12:30 +0200
[PATCH 12/12] builddeb: Add automatic support for sh{3,4}{,eb} architectures Ben Hutchings <ben@decadent.org.uk> - 2018-07-26 12:30 +0200
[PATCH 02/12] builddeb: Change architecture detection fallback to use dpkg-architecture Ben Hutchings <ben@decadent.org.uk> - 2018-07-26 12:30 +0200
[PATCH 11/12] builddeb: Add automatic support for riscv* architectures Ben Hutchings <ben@decadent.org.uk> - 2018-07-26 12:30 +0200
[PATCH 10/12] builddeb: Add automatic support for m68k architecture Ben Hutchings <ben@decadent.org.uk> - 2018-07-26 12:30 +0200
[PATCH 06/12] builddeb: Add automatic support for mips64el architecture Ben Hutchings <ben@decadent.org.uk> - 2018-07-26 12:30 +0200
[PATCH 08/12] builddeb: Add automatic support for sparc64 architecture Ben Hutchings <ben@decadent.org.uk> - 2018-07-26 12:30 +0200
[PATCH 07/12] builddeb: Add automatic support for mips{,64}r6{,el} architectures Ben Hutchings <ben@decadent.org.uk> - 2018-07-26 12:30 +0200
[PATCH 09/12] builddeb: Add automatic support for or1k architecture Ben Hutchings <ben@decadent.org.uk> - 2018-07-26 12:30 +0200
[PATCH 03/12] builddeb: Drop check for 32-bit s390 Ben Hutchings <ben@decadent.org.uk> - 2018-07-26 12:30 +0200
Re: [PATCH 00/12] Update architecture detection Masahiro Yamada <yamada.masahiro@socionext.com> - 2018-08-02 01:50 +0200
| From | Ben Hutchings <ben@decadent.org.uk> |
|---|---|
| Date | 2018-07-26 12:20 +0200 |
| Subject | [PATCH 00/12] Update architecture detection |
| Message-ID | <wfLxg-1pq-7@gated-at.bofh.it> |
[Multipart message — attachments visible in raw view] — view raw
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(-)
[toc] | [next] | [standalone]
| From | Ben Hutchings <ben@decadent.org.uk> |
|---|---|
| Date | 2018-07-26 12:30 +0200 |
| Subject | [PATCH 01/12] builddeb: Skip architecture detection when KBUILD_DEBARCH is set |
| Message-ID | <wfLGV-1sT-1@gated-at.bofh.it> |
| In reply to | #61600 |
[Multipart message — attachments visible in raw view] — view raw
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
[toc] | [prev] | [next] | [standalone]
| From | Ben Hutchings <ben@decadent.org.uk> |
|---|---|
| Date | 2018-07-26 12:30 +0200 |
| Subject | [PATCH 05/12] builddeb: Add automatic support for ppc64 and powerpcspe architectures |
| Message-ID | <wfLGV-1sT-3@gated-at.bofh.it> |
| In reply to | #61600 |
[Multipart message — attachments visible in raw view] — view raw
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*)
[toc] | [prev] | [next] | [standalone]
| From | Ben Hutchings <ben@decadent.org.uk> |
|---|---|
| Date | 2018-07-26 12:30 +0200 |
| Subject | [PATCH 04/12] builddeb: Introduce functions to simplify kconfig tests in set_debarch |
| Message-ID | <wfLGV-1sT-5@gated-at.bofh.it> |
| In reply to | #61600 |
[Multipart message — attachments visible in raw view] — view raw
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
;;
*)
[toc] | [prev] | [next] | [standalone]
| From | Ben Hutchings <ben@decadent.org.uk> |
|---|---|
| Date | 2018-07-26 12:30 +0200 |
| Subject | [PATCH 12/12] builddeb: Add automatic support for sh{3,4}{,eb} architectures |
| Message-ID | <wfLGV-1sT-13@gated-at.bofh.it> |
| In reply to | #61600 |
[Multipart message — attachments visible in raw view] — view raw
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
[toc] | [prev] | [next] | [standalone]
| From | Ben Hutchings <ben@decadent.org.uk> |
|---|---|
| Date | 2018-07-26 12:30 +0200 |
| Subject | [PATCH 02/12] builddeb: Change architecture detection fallback to use dpkg-architecture |
| Message-ID | <wfLGV-1sT-17@gated-at.bofh.it> |
| In reply to | #61600 |
[Multipart message — attachments visible in raw view] — view raw
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
;;
[toc] | [prev] | [next] | [standalone]
| From | Ben Hutchings <ben@decadent.org.uk> |
|---|---|
| Date | 2018-07-26 12:30 +0200 |
| Subject | [PATCH 11/12] builddeb: Add automatic support for riscv* architectures |
| Message-ID | <wfLGV-1sT-19@gated-at.bofh.it> |
| In reply to | #61600 |
[Multipart message — attachments visible in raw view] — view raw
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 ;;
[toc] | [prev] | [next] | [standalone]
| From | Ben Hutchings <ben@decadent.org.uk> |
|---|---|
| Date | 2018-07-26 12:30 +0200 |
| Subject | [PATCH 10/12] builddeb: Add automatic support for m68k architecture |
| Message-ID | <wfLGW-1sT-23@gated-at.bofh.it> |
| In reply to | #61600 |
[Multipart message — attachments visible in raw view] — view raw
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 ;;
[toc] | [prev] | [next] | [standalone]
| From | Ben Hutchings <ben@decadent.org.uk> |
|---|---|
| Date | 2018-07-26 12:30 +0200 |
| Subject | [PATCH 06/12] builddeb: Add automatic support for mips64el architecture |
| Message-ID | <wfLGW-1sT-27@gated-at.bofh.it> |
| In reply to | #61600 |
[Multipart message — attachments visible in raw view] — view raw
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*)
[toc] | [prev] | [next] | [standalone]
| From | Ben Hutchings <ben@decadent.org.uk> |
|---|---|
| Date | 2018-07-26 12:30 +0200 |
| Subject | [PATCH 08/12] builddeb: Add automatic support for sparc64 architecture |
| Message-ID | <wfLGW-1sT-25@gated-at.bofh.it> |
| In reply to | #61600 |
[Multipart message — attachments visible in raw view] — view raw
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*)
[toc] | [prev] | [next] | [standalone]
| From | Ben Hutchings <ben@decadent.org.uk> |
|---|---|
| Date | 2018-07-26 12:30 +0200 |
| Subject | [PATCH 07/12] builddeb: Add automatic support for mips{,64}r6{,el} architectures |
| Message-ID | <wfLGW-1sT-29@gated-at.bofh.it> |
| In reply to | #61600 |
[Multipart message — attachments visible in raw view] — view raw
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
[toc] | [prev] | [next] | [standalone]
| From | Ben Hutchings <ben@decadent.org.uk> |
|---|---|
| Date | 2018-07-26 12:30 +0200 |
| Subject | [PATCH 09/12] builddeb: Add automatic support for or1k architecture |
| Message-ID | <wfLGW-1sT-31@gated-at.bofh.it> |
| In reply to | #61600 |
[Multipart message — attachments visible in raw view] — view raw
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
[toc] | [prev] | [next] | [standalone]
| From | Ben Hutchings <ben@decadent.org.uk> |
|---|---|
| Date | 2018-07-26 12:30 +0200 |
| Subject | [PATCH 03/12] builddeb: Drop check for 32-bit s390 |
| Message-ID | <wfLGW-1sT-33@gated-at.bofh.it> |
| In reply to | #61600 |
[Multipart message — attachments visible in raw view] — view raw
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*)
[toc] | [prev] | [next] | [standalone]
| From | Masahiro Yamada <yamada.masahiro@socionext.com> |
|---|---|
| Date | 2018-08-02 01:50 +0200 |
| Message-ID | <wi92p-85o-1@gated-at.bofh.it> |
| In reply to | #61600 |
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
[toc] | [prev] | [standalone]
Back to top | Article view | linux.debian.kernel
csiph-web