Util-Linux Archive on lore.kernel.org
 help / color / Atom feed
From: Alexey Gladkov <gladkov.alexey@gmail.com>
To: util-linux@vger.kernel.org
Cc: Karel Zak <kzak@redhat.com>, "Dmitry V. Levin" <ldv@altlinux.org>,
	Gleb Fotengauer-Malinovskiy <glebfm@altlinux.org>
Subject: [PATCH 2/2] setarch: add arm and aarch64 architectures to transition rules
Date: Tue, 23 Jun 2020 16:56:20 +0200
Message-ID: <20200623145620.2669920-3-gladkov.alexey@gmail.com> (raw)
In-Reply-To: <20200623145620.2669920-1-gladkov.alexey@gmail.com>

Since aarch64 kernel can be configured with compat 32-bit support
enabled, extend translation rules in a way similar to x86/x86_64.

Suggested-by: "Dmitry V. Levin" <ldv@altlinux.org>
Signed-off-by: Alexey Gladkov <gladkov.alexey@gmail.com>
---
 sys-utils/setarch.c | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/sys-utils/setarch.c b/sys-utils/setarch.c
index b057b4df8..6914d791b 100644
--- a/sys-utils/setarch.c
+++ b/sys-utils/setarch.c
@@ -206,6 +206,19 @@ static struct arch_domain *init_arch_domains(void)
 		{PER_LINUX,	"e2k12c",	"e2k"},
 		{PER_LINUX,	"e2k16c",	"e2k"},
 		{PER_LINUX,	"e2k2c3",	"e2k"},
+#endif
+#if defined(__arm__) || defined(__aarch64__)
+# ifdef __BIG_ENDIAN__
+		{PER_LINUX32,	"armv7b",	"arm"},
+		{PER_LINUX32,	"armv8b",	"arm"},
+# else
+		{PER_LINUX32,	"armv7l",	"arm"},
+		{PER_LINUX32,	"armv8l",	"arm"},
+# endif
+		{PER_LINUX32,	"armh",		"arm"},
+		{PER_LINUX32,	"arm",		"arm"},
+		{PER_LINUX,	"arm64",	"aarch64"},
+		{PER_LINUX,	"aarch64",	"aarch64"},
 #endif
 		/* place holder, will be filled up at runtime */
 		{-1,		NULL,		NULL},
@@ -266,7 +279,8 @@ static void verify_arch_domain(struct arch_domain *doms, struct arch_domain *tar
 	if (!strcmp(un.machine, target->result_arch))
 		return;
 
-	if (!strcmp(target->result_arch, "i386")) {
+	if (!strcmp(target->result_arch, "i386") ||
+	    !strcmp(target->result_arch, "arm")) {
 		struct arch_domain *dom;
 		for (dom = doms; dom->target_arch != NULL; dom++) {
 			if (!dom->result_arch || strcmp(dom->result_arch, target->result_arch))
-- 
2.25.4


  parent reply index

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-23 14:56 [PATCH 0/2] setarch: add arm and aarch64 architectures to transition Alexey Gladkov
2020-06-23 14:56 ` [PATCH 1/2] setarch: make verify_arch_domain extendable Alexey Gladkov
2020-06-23 14:56 ` Alexey Gladkov [this message]
2020-06-24 13:09 ` [PATCH 0/2] setarch: add arm and aarch64 architectures to transition Karel Zak

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200623145620.2669920-3-gladkov.alexey@gmail.com \
    --to=gladkov.alexey@gmail.com \
    --cc=glebfm@altlinux.org \
    --cc=kzak@redhat.com \
    --cc=ldv@altlinux.org \
    --cc=util-linux@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Util-Linux Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/util-linux/0 util-linux/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 util-linux util-linux/ https://lore.kernel.org/util-linux \
		util-linux@vger.kernel.org
	public-inbox-index util-linux

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.util-linux


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git