diff options
-rw-r--r-- | Makefile.am | 1 | ||||
-rw-r--r-- | configure.ac | 21 | ||||
-rw-r--r-- | src/basic/util.c | 27 | ||||
-rw-r--r-- | src/test/test-execute.c | 8 | ||||
-rw-r--r-- | test/exec-personality-s390.service | 7 |
5 files changed, 56 insertions, 8 deletions
diff --git a/Makefile.am b/Makefile.am index 41bfdfbeac..e9ad72333b 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1502,6 +1502,7 @@ EXTRA_DIST += \ test/exec-ignoresigpipe-yes.service \ test/exec-personality-x86-64.service \ test/exec-personality-x86.service \ + test/exec-personality-s390.service \ test/exec-privatedevices-no.service \ test/exec-privatedevices-yes.service \ test/exec-privatetmp-no.service \ diff --git a/configure.ac b/configure.ac index ef03fb082c..d75a02623b 100644 --- a/configure.ac +++ b/configure.ac @@ -701,12 +701,21 @@ AC_ARG_ENABLE([gcrypt], [have_gcrypt=auto]) if test "x${have_gcrypt}" != xno ; then - AM_PATH_LIBGCRYPT( - [1.4.5], - [have_gcrypt=yes], - [if test "x$have_gcrypt" = xyes ; then - AC_MSG_ERROR([*** GCRYPT headers not found.]) - fi]) + m4_define([AM_PATH_LIBGCRYPT_FAIL], + [{ test "x$have_gcrypt" != xyes || AC_MSG_ERROR([*** GCRYPT headers not found.]); }] + ) + m4_ifdef([AM_PATH_LIBGCRYPT], [AM_PATH_LIBGCRYPT( + [1.4.5], + [have_gcrypt=yes], + dnl If we have the gcrypt m4 macros, but don't have + dnl gcrypt, throw an error if gcrypt is explicitly + dnl requested. + [AM_PATH_LIBGCRYPT_FAIL] + )], + dnl If we don't have the gcrypt m4 macros, but build with + dnl gcrypt explicitly requested, throw an error. + [AM_PATH_LIBGCRYPT_FAIL] + ) if test "x$have_gcrypt" = xyes ; then GCRYPT_LIBS="$LIBGCRYPT_LIBS" diff --git a/src/basic/util.c b/src/basic/util.c index 18be0bfd5a..40a4b8fbec 100644 --- a/src/basic/util.c +++ b/src/basic/util.c @@ -5261,6 +5261,19 @@ unsigned long personality_from_string(const char *p) { if (streq(p, "x86")) return PER_LINUX; + +#elif defined(__s390x__) + + if (streq(p, "s390")) + return PER_LINUX32; + + if (streq(p, "s390x")) + return PER_LINUX; + +#elif defined(__s390__) + + if (streq(p, "s390")) + return PER_LINUX; #endif return PERSONALITY_INVALID; @@ -5280,6 +5293,20 @@ const char* personality_to_string(unsigned long p) { if (p == PER_LINUX) return "x86"; + +#elif defined(__s390x__) + + if (p == PER_LINUX) + return "s390x"; + + if (p == PER_LINUX32) + return "s390"; + +#elif defined(__s390__) + + if (p == PER_LINUX) + return "s390"; + #endif return NULL; diff --git a/src/test/test-execute.c b/src/test/test-execute.c index dd8ab7dcb8..fa6336f1fb 100644 --- a/src/test/test-execute.c +++ b/src/test/test-execute.c @@ -77,10 +77,14 @@ static void test_exec_workingdirectory(Manager *m) { } static void test_exec_personality(Manager *m) { - test(m, "exec-personality-x86.service", 0, CLD_EXITED); - #if defined(__x86_64__) test(m, "exec-personality-x86-64.service", 0, CLD_EXITED); + +#elif defined(__s390__) + test(m, "exec-personality-s390.service", 0, CLD_EXITED); + +#else + test(m, "exec-personality-x86.service", 0, CLD_EXITED); #endif } diff --git a/test/exec-personality-s390.service b/test/exec-personality-s390.service new file mode 100644 index 0000000000..f3c3b03e3d --- /dev/null +++ b/test/exec-personality-s390.service @@ -0,0 +1,7 @@ +[Unit] +Description=Test for Personality=s390 + +[Service] +ExecStart=/bin/sh -c 'echo $(uname -m); exit $(test $(uname -m) = "s390")' +Type=oneshot +Personality=s390 |