setarch: add arm and aarch64 architectures to transition rules

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>
This commit is contained in:
Alexey Gladkov 2020-06-23 16:56:20 +02:00 committed by Karel Zak
parent 7f48cfb0e4
commit 9fd01b10d0
1 changed files with 15 additions and 1 deletions

View File

@ -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))