Skip to content

Commit

Permalink
Add support for alpine linux
Browse files Browse the repository at this point in the history
Both Alpine Linux and Gentoo use OpenRC so we share its logic

Signed-off-by: Carlo Landmeter <clandmeter@gmail.com>
Signed-off-by: Richard Yao <ryao@gentoo.org>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes openzfs#4386
  • Loading branch information
clandmeter authored and behlendorf committed Mar 8, 2016
1 parent 513168a commit c53fb01
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 6 deletions.
7 changes: 6 additions & 1 deletion config/zfs-build.m4
Expand Up @@ -266,6 +266,8 @@ AC_DEFUN([ZFS_AC_DEFAULT_PACKAGE], [
VENDOR=ubuntu ;
elif test -f /etc/debian_version ; then
VENDOR=debian ;
elif test -f /etc/alpine-release ; then
VENDOR=alpine ;
else
VENDOR= ;
fi
Expand All @@ -278,6 +280,7 @@ AC_DEFUN([ZFS_AC_DEFAULT_PACKAGE], [
redhat) DEFAULT_PACKAGE=rpm ;;
fedora) DEFAULT_PACKAGE=rpm ;;
gentoo) DEFAULT_PACKAGE=tgz ;;
alpine) DEFAULT_PACKAGE=tgz ;;
arch) DEFAULT_PACKAGE=tgz ;;
sles) DEFAULT_PACKAGE=rpm ;;
slackware) DEFAULT_PACKAGE=tgz ;;
Expand All @@ -299,7 +302,8 @@ AC_DEFUN([ZFS_AC_DEFAULT_PACKAGE], [
toss) DEFAULT_INIT_SCRIPT=redhat ;;
redhat) DEFAULT_INIT_SCRIPT=redhat ;;
fedora) DEFAULT_INIT_SCRIPT=fedora ;;
gentoo) DEFAULT_INIT_SCRIPT=gentoo ;;
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 ;;
Expand All @@ -313,6 +317,7 @@ AC_DEFUN([ZFS_AC_DEFAULT_PACKAGE], [
AC_MSG_CHECKING([default init config direectory])
case "$VENDOR" in
alpine) DEFAULT_INITCONF_DIR=/etc/conf.d ;;
gentoo) DEFAULT_INITCONF_DIR=/etc/conf.d ;;
toss) DEFAULT_INITCONF_DIR=/etc/sysconfig ;;
redhat) DEFAULT_INITCONF_DIR=/etc/sysconfig ;;
Expand Down
2 changes: 1 addition & 1 deletion etc/init.d/Makefile.am
Expand Up @@ -21,7 +21,7 @@ $(init_SCRIPTS) $(initconf_SCRIPTS) $(initcommon_SCRIPTS): $(EXTRA_DIST)
else \
NFS_SRV=nfs; \
fi; \
if [ -e /etc/gentoo-release ]; then \
if [ -e /sbin/openrc-run ]; then \
SHELL=/sbin/runscript; \
else \
SHELL=/bin/sh; \
Expand Down
2 changes: 1 addition & 1 deletion etc/init.d/zfs-import.in
Expand Up @@ -308,7 +308,7 @@ do_start()

# ----------------------------------------------------

if [ ! -e /etc/gentoo-release ]
if [ ! -e /sbin/openrc-run ]
then
case "$1" in
start)
Expand Down
2 changes: 1 addition & 1 deletion etc/init.d/zfs-mount.in
Expand Up @@ -199,7 +199,7 @@ do_stop()

# ----------------------------------------------------

if [ ! -e /etc/gentoo-release ]
if [ ! -e /sbin/openrc-run ]
then
case "$1" in
start)
Expand Down
2 changes: 1 addition & 1 deletion etc/init.d/zfs-share.in
Expand Up @@ -58,7 +58,7 @@ do_stop()

# ----------------------------------------------------

if [ ! -e /etc/gentoo-release ]; then
if [ ! -e /sbin/openrc-run ]; then
case "$1" in
start)
do_start
Expand Down
2 changes: 1 addition & 1 deletion etc/init.d/zfs-zed.in
Expand Up @@ -98,7 +98,7 @@ do_reload()

# ----------------------------------------------------

if [ ! -e /etc/gentoo-release ]; then
if [ ! -e /sbin/openrc-run ]; then
case "$1" in
start)
do_start
Expand Down

0 comments on commit c53fb01

Please sign in to comment.