From ee7401c58eb0bbf058382574ad7a2386ffd737e8 Mon Sep 17 00:00:00 2001 From: Dennis Gilmore Date: Tue, 21 Aug 2007 09:55:28 +0200 Subject: [PATCH] setarch: add sparc32bash alias to keep compatibility with sparc32 Signed-off-by: Dennis Gilmore Signed-off-by: Karel Zak --- sys-utils/setarch.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/sys-utils/setarch.c b/sys-utils/setarch.c index e812c279..153a8283 100644 --- a/sys-utils/setarch.c +++ b/sys-utils/setarch.c @@ -114,6 +114,7 @@ int set_arch(const char *pers, unsigned long options) #endif #if defined(__sparc64__) || defined(__sparc__) {PER_LINUX32, "sparc", "sparc"}, + {PER_LINUX32, "sparc32bash", "sparc"}, {PER_LINUX32, "sparc32", "sparc"}, {PER_LINUX, "sparc64", "sparc64"}, #endif @@ -175,6 +176,14 @@ int main(int argc, char *argv[]) if (!strcmp(p, "-h") || !strcmp(p, "--help")) show_help(); } + #if defined(__sparc64__) || defined(__sparc__) + if (!strcmp(p, "sparc32bash")) { + if (set_arch(p, NULL)) + error(EXIT_FAILURE, errno, "Failed to set personality to %s", p); + execl("/bin/bash", NULL); + error(EXIT_FAILURE, errno, "/bin/bash"); + } + #endif for (argv++, argc--; argc && argv[0][0] == '-'; argv++, argc--) { int n, unknown = 1; const char *arg = argv[0]; -- 2.39.5