From db6ba8d7443a234e497264a1da3d197d5ca32777 Mon Sep 17 00:00:00 2001 From: Xinliang Liu Date: Sat, 3 Dec 2022 09:39:48 +0800 Subject: [PATCH] autoconf: add support for openEuler Add config support for openEuler, so that it set the right sysconfig dir for openEuler. And DEFAULT_INIT_SCRIPT is no longer needed since commit "2a34db1bd Base init scripts for SYSV systems". Reviewed-by: George Melikov Reviewed-by: Richard Yao Reviewed-by: Brian Behlendorf Signed-off-by: Xinliang Liu Closes #14241 --- config/zfs-build.m4 | 25 ++++++------------------- 1 file changed, 6 insertions(+), 19 deletions(-) diff --git a/config/zfs-build.m4 b/config/zfs-build.m4 index 6355952487..bb3c81a647 100644 --- a/config/zfs-build.m4 +++ b/config/zfs-build.m4 @@ -532,6 +532,8 @@ AC_DEFUN([ZFS_AC_DEFAULT_PACKAGE], [ VENDOR=alpine ; elif test -f /bin/freebsd-version ; then VENDOR=freebsd ; + elif test -f /etc/openEuler-release ; then + VENDOR=openeuler ; else VENDOR= ; fi], @@ -556,6 +558,7 @@ AC_DEFUN([ZFS_AC_DEFAULT_PACKAGE], [ ubuntu) DEFAULT_PACKAGE=deb ;; debian) DEFAULT_PACKAGE=deb ;; freebsd) DEFAULT_PACKAGE=pkg ;; + openeuler) DEFAULT_PACKAGE=rpm ;; *) DEFAULT_PACKAGE=rpm ;; esac AC_MSG_RESULT([$DEFAULT_PACKAGE]) @@ -569,31 +572,14 @@ AC_DEFUN([ZFS_AC_DEFAULT_PACKAGE], [ AC_MSG_RESULT([$initdir]) AC_SUBST(initdir) - AC_MSG_CHECKING([default init script type and shell]) - case "$VENDOR" in - toss) DEFAULT_INIT_SCRIPT=redhat ;; - redhat) DEFAULT_INIT_SCRIPT=redhat ;; - fedora) DEFAULT_INIT_SCRIPT=fedora ;; - gentoo) DEFAULT_INIT_SCRIPT=openrc ;; - alpine) DEFAULT_INIT_SCRIPT=openrc ;; - arch) DEFAULT_INIT_SCRIPT=lsb ;; - sles) DEFAULT_INIT_SCRIPT=lsb ;; - slackware) DEFAULT_INIT_SCRIPT=lsb ;; - lunar) DEFAULT_INIT_SCRIPT=lunar ;; - ubuntu) DEFAULT_INIT_SCRIPT=lsb ;; - debian) DEFAULT_INIT_SCRIPT=lsb ;; - freebsd) DEFAULT_INIT_SCRIPT=freebsd;; - *) DEFAULT_INIT_SCRIPT=lsb ;; - esac - + AC_MSG_CHECKING([default shell]) case "$VENDOR" in gentoo) DEFAULT_INIT_SHELL="/sbin/openrc-run";; alpine) DEFAULT_INIT_SHELL="/sbin/openrc-run";; *) DEFAULT_INIT_SHELL="/bin/sh" ;; esac - AC_MSG_RESULT([$DEFAULT_INIT_SCRIPT:$DEFAULT_INIT_SHELL]) - AC_SUBST(DEFAULT_INIT_SCRIPT) + AC_MSG_RESULT([$DEFAULT_INIT_SHELL]) AC_SUBST(DEFAULT_INIT_SHELL) AC_MSG_CHECKING([default nfs server init script]) @@ -612,6 +598,7 @@ AC_DEFUN([ZFS_AC_DEFAULT_PACKAGE], [ redhat) initconfdir=/etc/sysconfig ;; fedora) initconfdir=/etc/sysconfig ;; sles) initconfdir=/etc/sysconfig ;; + openeuler) initconfdir=/etc/sysconfig ;; ubuntu) initconfdir=/etc/default ;; debian) initconfdir=/etc/default ;; freebsd) initconfdir=$sysconfdir/rc.conf.d;;