You need to make the follow changes to adapt systemd to your
distribution:
- 0) Make your distribution recognized via the autoconf checks
- in configure.ac. Grep for the word "fedora" (case
- insensitively) and you should be able to find the places where
- you need to add/change things.
-
- 1) Patch src/shared/hostname-setup.c so that systemd knows
- where to read your host name from. You might also want to
- update status_welcome() in util.c.
-
- 2) Check the unit files in units/ if they match your
- distribution. Most likely you will have to make additions to
- units/*.m4 and create a copy of units/fedora/ with changes for
- your distribution.
-
- 3) Adjust Makefile.am to register the unit files you added in
- step 2. Also you might need to update the m4 invocation in
- Makefile.am. Grep for the word "fedora" (case insensitively)
- and you should be able to find the places where you need to
- add/change things.
-
- 4) Try it out. Play around with 'systemd --test --system' for
+ 1) Find the right configure parameters for:
+
+ --with-rootprefix=
+ --with-sysvinit-path=
+ --with-sysvrcd-path=
+ --with-rc-local-script-path-start=
+ --with-rc-local-script-path-stop=
+ --with-kbd-loadkeys=
+ --with-kbd-setfont=
+ --with-tty-gid=
+
+ 2) Try it out. Play around with 'systemd --test --system' for
a test run of systemd without booting. This will read the unit
files and print the initial transaction it would execute
during boot-up. This will also inform you about ordering loops
and suchlike.
CONTRIBUTING UPSTREAM:
- We are interested in merging your changes upstream, if they
- are for a big, and well-known distribution. Unfortunately we
- don't have the time and resources to maintain
- distribution-specific patches for all distributions on the
- planet, hence please do not send us patches that add systemd
- support for non-mainstream or niche distributions.
- Thank you for understanding.
-
-BE CONSIDERATE:
- We'd like to keep differences between the distributions
- minimal. This both simplifies our maintenance work, as well
- as it helps administrators to move from one distribution to
- another.
+ We are generally do no longer accept distribution specific
+ patches to systemd upstream. If you have to make changes to
+ systemd's source code to make it work on your distribution:
+ unless your code is generic enough to be generally useful we
+ are unlikely to merge it. Please always consider adopting the
+ upstream defaults. If that's not possible please maintain the
+ relevant patches downstream.
- Hence we'd like to ask you to keep your changes minimal, and
- not rename any units without a very good reason (if you need a
- particular name for compatibility reasons, consider using
- alias names via symlinks). Before you make changes that change
- semantics from upstream, please talk to us!
-
- In SysV almost every distribution uses a different
- nomenclature and different locations for the boot-up
- scripts. We'd like to avoid chaos like that with systemd right
- from the beginning. So please, be considerate!
+ Thank you for understanding.
AC_ARG_WITH(rc-local-script-path-stop,
AS_HELP_STRING([--with-rc-local-script-path-stop=PATH],
- [Path to /sbin/halt.local]),
+ [Path to /usr/sbin/halt.local]),
[RC_LOCAL_SCRIPT_PATH_STOP="$withval"],
- [RC_LOCAL_SCRIPT_PATH_STOP="/sbin/halt.local"])
+ [RC_LOCAL_SCRIPT_PATH_STOP="/usr/sbin/halt.local"])
AC_DEFINE_UNQUOTED(RC_LOCAL_SCRIPT_PATH_START, ["$RC_LOCAL_SCRIPT_PATH_START"], [Path of /etc/rc.local script])
-AC_DEFINE_UNQUOTED(RC_LOCAL_SCRIPT_PATH_STOP, ["$RC_LOCAL_SCRIPT_PATH_STOP"], [Path of /sbin/halt.local script])
+AC_DEFINE_UNQUOTED(RC_LOCAL_SCRIPT_PATH_STOP, ["$RC_LOCAL_SCRIPT_PATH_STOP"], [Path of /usr/sbin/halt.local script])
AC_SUBST(RC_LOCAL_SCRIPT_PATH_START)
AC_SUBST(RC_LOCAL_SCRIPT_PATH_STOP)
# ------------------------------------------------------------------------------
-AC_ARG_WITH(distro, AS_HELP_STRING([--with-distro=DISTRO],[Specify the distribution to target: One of fedora, suse, debian, arch, gentoo, slackware, altlinux, mandriva, mageia, angstrom or other]))
-if test "z$with_distro" = "z"; then
- if test "$cross_compiling" = yes; then
- AC_MSG_WARN([Target distribution cannot be reliably detected when cross-compiling. You should specify it with --with-distro (see $0 --help for recognized distros)])
- else
- with_distro=$($GREP '^ID=' /etc/os-release 2>/dev/null | $SED 's/ID=//');
- fi
- if test "z$with_distro" = "z"; then
- with_distro=other
- fi
-fi
-with_distro=`echo ${with_distro} | tr '[[:upper:]]' '[[:lower:]]' `
-AC_DEFINE_UNQUOTED(DISTRIBUTION, ["${with_distro}"], [Target Distribution])
-
# Location of the init scripts as mandated by LSB
SYSTEM_SYSVINIT_PATH=/etc/init.d
SYSTEM_SYSVRCND_PATH=/etc/rc.d
-
M4_DEFINES=
-case $with_distro in
- fedora)
- SYSTEM_SYSVINIT_PATH=/etc/rc.d/init.d
- AC_DEFINE(TARGET_FEDORA, [], [Target is Fedora/RHEL])
- M4_DEFINES=-DTARGET_FEDORA=1
- ;;
- opensuse|suse)
- SYSTEM_SYSVRCND_PATH=/etc/init.d
- AC_DEFINE(TARGET_SUSE, [], [Target is openSUSE/SLE])
- M4_DEFINES=-DTARGET_SUSE=1
- ;;
- debian)
- SYSTEM_SYSVRCND_PATH=/etc
- AC_DEFINE(TARGET_DEBIAN, [], [Target is Debian])
- M4_DEFINES=-DTARGET_DEBIAN=1
- ;;
- arch)
- SYSTEM_SYSVINIT_PATH=
- SYSTEM_SYSVRCND_PATH=
- AC_DEFINE(TARGET_ARCH, [], [Target is ArchLinux])
- M4_DEFINES=-DTARGET_ARCH=1
- ;;
- gentoo)
- SYSTEM_SYSVINIT_PATH=
- SYSTEM_SYSVRCND_PATH=
- AC_DEFINE(TARGET_GENTOO, [], [Target is Gentoo])
- M4_DEFINES=-DTARGET_GENTOO=1
- ;;
- slackware)
- SYSTEM_SYSVINIT_PATH=/etc/rc.d/init.d
- AC_DEFINE(TARGET_SLACKWARE, [], [Target is Slackware])
- M4_DEFINES=-DTARGET_SLACKWARE=1
- ;;
- frugalware)
- SYSTEM_SYSVINIT_PATH=/etc/rc.d
- AC_DEFINE(TARGET_FRUGALWARE, [], [Target is Frugalware])
- M4_DEFINES=-DTARGET_FRUGALWARE=1
- ;;
- altlinux)
- SYSTEM_SYSVINIT_PATH=/etc/rc.d/init.d
- AC_DEFINE(TARGET_ALTLINUX, [], [Target is ALTLinux])
- M4_DEFINES=-DTARGET_ALTLINUX=1
- ;;
- mandriva)
- SYSTEM_SYSVINIT_PATH=/etc/rc.d/init.d
- AC_DEFINE(TARGET_MANDRIVA, [], [Target is Mandriva])
- M4_DEFINES=-DTARGET_MANDRIVA=1
- ;;
- angstrom)
- SYSTEM_SYSVRCND_PATH=/etc
- AC_DEFINE(TARGET_ANGSTROM, [], [Target is Ångström])
- M4_DEFINES=-DTARGET_ANGSTROM=1
- ;;
- mageia)
- SYSTEM_SYSVINIT_PATH=/etc/rc.d/init.d
- AC_DEFINE(TARGET_MAGEIA, [], [Target is Mageia])
- M4_DEFINES=-DTARGET_MAGEIA=1
- ;;
- other)
- ;;
- *)
- AC_MSG_ERROR([Your distribution (${with_distro}) is not yet supported, SysV init scripts could not be found! (patches welcome); you can specify --with-distro=other to skip this check])
- ;;
-esac
-
AC_ARG_WITH([sysvinit-path],
[AS_HELP_STRING([--with-sysvinit-path=PATH],
- [Specify the path to where the SysV init scripts are located @<:@default=based on distro@:>@])],
+ [Specify the path to where the SysV init scripts are located])],
[SYSTEM_SYSVINIT_PATH="$withval"],
[])
AC_ARG_WITH([sysvrcd-path],
[AS_HELP_STRING([--with-sysvrcd-path=PATH],
- [Specify the path to the base directory for the SysV rcN.d directories @<:@default=based on distro@:>@])],
+ [Specify the path to the base directory for the SysV rcN.d directories])],
[SYSTEM_SYSVRCND_PATH="$withval"],
[])
-AC_SUBST(SYSTEM_SYSVINIT_PATH)
-AC_SUBST(SYSTEM_SYSVRCND_PATH)
-AC_SUBST(M4_DEFINES)
-
if test "x${SYSTEM_SYSVINIT_PATH}" != "x" -a "x${SYSTEM_SYSVRCND_PATH}" != "x"; then
AC_DEFINE(HAVE_SYSV_COMPAT, [], [SysV init scripts and rcN.d links are supported.])
SYSTEM_SYSV_COMPAT="yes"
SYSTEM_SYSV_COMPAT="no"
fi
+AC_SUBST(SYSTEM_SYSVINIT_PATH)
+AC_SUBST(SYSTEM_SYSVRCND_PATH)
+AC_SUBST(M4_DEFINES)
+
+AM_CONDITIONAL(HAVE_SYSV_COMPAT, test "$SYSTEM_SYSV_COMPAT" = "yes")
+
AC_ARG_WITH([tty-gid],
[AS_HELP_STRING([--with-tty-gid=GID],
[Specify the numeric GID of the 'tty' group])],
[AC_DEFINE_UNQUOTED(TTY_GID, [$withval], [GID of the 'tty' group])],
[])
-AM_CONDITIONAL(TARGET_FEDORA, test x"$with_distro" = xfedora)
-AM_CONDITIONAL(TARGET_SUSE, test x"$with_distro" = xsuse)
-AM_CONDITIONAL(TARGET_DEBIAN, test x"$with_distro" = xdebian)
-AM_CONDITIONAL(TARGET_ARCH, test x"$with_distro" = xarch)
-AM_CONDITIONAL(TARGET_GENTOO, test x"$with_distro" = xgentoo)
-AM_CONDITIONAL(TARGET_SLACKWARE, test x"$with_distro" = xslackware)
-AM_CONDITIONAL(TARGET_FRUGALWARE, test x"$with_distro" = xfrugalware)
-AM_CONDITIONAL(TARGET_ALTLINUX, test x"$with_distro" = xaltlinux)
-AM_CONDITIONAL(TARGET_MANDRIVA, test x"$with_distro" = xmandriva)
-AM_CONDITIONAL(TARGET_ANGSTROM, test x"$with_distro" = xangstrom)
-AM_CONDITIONAL(TARGET_MAGEIA, test x"$with_distro" = xmageia)
-
-AM_CONDITIONAL(HAVE_SYSV_COMPAT, test "$SYSTEM_SYSV_COMPAT" = "yes")
-
AC_ARG_WITH([dbuspolicydir],
AS_HELP_STRING([--with-dbuspolicydir=DIR], [D-Bus policy directory]),
[],
AC_MSG_RESULT([
$PACKAGE_NAME $VERSION
- Distribution: ${with_distro}
SysV compatibility: ${SYSTEM_SYSV_COMPAT}
SysV init scripts: ${SYSTEM_SYSVINIT_PATH}
SysV rc?.d directories: ${SYSTEM_SYSVRCND_PATH}