mirror of
https://github.com/systemd/systemd-stable.git
synced 2024-12-22 13:33:56 +03:00
build-sys: drop all distribution specfic checks
Yay, we now have a completely generic systemd. No distribution specific checks anymore!
This commit is contained in:
parent
a382332eed
commit
bc2708414b
@ -4,55 +4,31 @@ HOWTO:
|
||||
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) Find the right configure parameters for:
|
||||
|
||||
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.
|
||||
--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) 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
|
||||
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.
|
||||
|
||||
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.
|
||||
|
||||
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.
|
||||
|
||||
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!
|
||||
|
18
Makefile.am
18
Makefile.am
@ -4062,24 +4062,6 @@ if HAVE_KMOD
|
||||
$(LN_S) ../systemd-modules-load.service systemd-modules-load.service )
|
||||
endif
|
||||
|
||||
|
||||
if TARGET_FEDORA
|
||||
( cd $(DESTDIR)$(systemunitdir) && \
|
||||
rm -f display-manager.service single.service && \
|
||||
$(LN_S) rescue.service single.service )
|
||||
endif
|
||||
|
||||
if TARGET_MANDRIVA
|
||||
( cd $(DESTDIR)$(systemunitdir) && \
|
||||
rm -f display-manager.service dm.service single.service && \
|
||||
$(LN_S) rescue.service single.service )
|
||||
endif
|
||||
|
||||
if TARGET_MAGEIA
|
||||
( cd $(DESTDIR)$(systemunitdir) && \
|
||||
rm -f display-manager.service )
|
||||
endif
|
||||
|
||||
install-exec-hook: $(INSTALL_EXEC_HOOKS)
|
||||
|
||||
uninstall-hook: $(UNINSTALL_DATA_HOOKS) $(UNINSTALL_EXEC_HOOKS)
|
||||
|
115
configure.ac
115
configure.ac
@ -616,12 +616,12 @@ AC_ARG_WITH(rc-local-script-path-start,
|
||||
|
||||
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)
|
||||
@ -697,107 +697,23 @@ AM_CONDITIONAL(ENABLE_MANPAGES, [test "x$have_manpages" = "xyes"])
|
||||
|
||||
# ------------------------------------------------------------------------------
|
||||
|
||||
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"
|
||||
@ -808,26 +724,18 @@ else
|
||||
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]),
|
||||
[],
|
||||
@ -895,7 +803,6 @@ AC_OUTPUT
|
||||
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}
|
||||
|
@ -80,7 +80,6 @@ static int parse_argv(int argc, char *argv[]) {
|
||||
|
||||
case ARG_VERSION:
|
||||
puts(PACKAGE_STRING);
|
||||
puts(DISTRIBUTION);
|
||||
puts(SYSTEMD_FEATURES);
|
||||
return 0;
|
||||
|
||||
|
@ -228,7 +228,6 @@
|
||||
|
||||
#define BUS_MANAGER_INTERFACE_PROPERTIES_GENERAL \
|
||||
" <property name=\"Version\" type=\"s\" access=\"read\"/>\n" \
|
||||
" <property name=\"Distribution\" type=\"s\" access=\"read\"/>\n" \
|
||||
" <property name=\"Features\" type=\"s\" access=\"read\"/>\n" \
|
||||
" <property name=\"Tainted\" type=\"s\" access=\"read\"/>\n" \
|
||||
" <property name=\"FirmwareTimestamp\" type=\"t\" access=\"read\"/>\n" \
|
||||
@ -526,13 +525,11 @@ static int bus_manager_set_runtime_watchdog_usec(DBusMessageIter *i, const char
|
||||
|
||||
static const char systemd_property_string[] =
|
||||
PACKAGE_STRING "\0"
|
||||
DISTRIBUTION "\0"
|
||||
SYSTEMD_FEATURES;
|
||||
|
||||
static const BusProperty bus_systemd_properties[] = {
|
||||
{ "Version", bus_property_append_string, "s", 0 },
|
||||
{ "Distribution", bus_property_append_string, "s", sizeof(PACKAGE_STRING) },
|
||||
{ "Features", bus_property_append_string, "s", sizeof(PACKAGE_STRING) + sizeof(DISTRIBUTION) },
|
||||
{ "Version", bus_property_append_string, "s", 0 },
|
||||
{ "Features", bus_property_append_string, "s", sizeof(PACKAGE_STRING) },
|
||||
{ NULL, }
|
||||
};
|
||||
|
||||
|
@ -1064,7 +1064,6 @@ static int help(void) {
|
||||
|
||||
static int version(void) {
|
||||
puts(PACKAGE_STRING);
|
||||
puts(DISTRIBUTION);
|
||||
puts(SYSTEMD_FEATURES);
|
||||
|
||||
return 0;
|
||||
@ -1567,7 +1566,7 @@ int main(int argc, char *argv[]) {
|
||||
if (arg_running_as == SYSTEMD_SYSTEM) {
|
||||
const char *virtualization = NULL;
|
||||
|
||||
log_info(PACKAGE_STRING " running in system mode. (" SYSTEMD_FEATURES "; " DISTRIBUTION ")");
|
||||
log_info(PACKAGE_STRING " running in system mode. (" SYSTEMD_FEATURES ")");
|
||||
|
||||
detect_virtualization(&virtualization);
|
||||
if (virtualization)
|
||||
@ -1577,7 +1576,7 @@ int main(int argc, char *argv[]) {
|
||||
log_info("Running in initial RAM disk.");
|
||||
|
||||
} else
|
||||
log_debug(PACKAGE_STRING " running in user mode. (" SYSTEMD_FEATURES "; " DISTRIBUTION ")");
|
||||
log_debug(PACKAGE_STRING " running in user mode. (" SYSTEMD_FEATURES ")");
|
||||
|
||||
if (arg_running_as == SYSTEMD_SYSTEM && !skip_setup) {
|
||||
locale_setup();
|
||||
|
@ -362,7 +362,6 @@ static int parse_argv(int argc, char *argv[]) {
|
||||
|
||||
case ARG_VERSION:
|
||||
puts(PACKAGE_STRING);
|
||||
puts(DISTRIBUTION);
|
||||
puts(SYSTEMD_FEATURES);
|
||||
return 0;
|
||||
|
||||
|
@ -80,7 +80,6 @@ static int parse_argv(int argc, char *argv[]) {
|
||||
|
||||
case ARG_VERSION:
|
||||
puts(PACKAGE_STRING);
|
||||
puts(DISTRIBUTION);
|
||||
puts(SYSTEMD_FEATURES);
|
||||
return 0;
|
||||
|
||||
|
@ -406,7 +406,6 @@ static int parse_argv(int argc, char *argv[]) {
|
||||
|
||||
case ARG_VERSION:
|
||||
puts(PACKAGE_STRING);
|
||||
puts(DISTRIBUTION);
|
||||
puts(SYSTEMD_FEATURES);
|
||||
return 0;
|
||||
|
||||
|
@ -81,7 +81,6 @@ static int parse_argv(int argc, char *argv[]) {
|
||||
|
||||
case ARG_VERSION:
|
||||
puts(PACKAGE_STRING);
|
||||
puts(DISTRIBUTION);
|
||||
puts(SYSTEMD_FEATURES);
|
||||
return 0;
|
||||
|
||||
|
@ -170,7 +170,6 @@ static int parse_argv(int argc, char *argv[]) {
|
||||
|
||||
case ARG_VERSION:
|
||||
puts(PACKAGE_STRING);
|
||||
puts(DISTRIBUTION);
|
||||
puts(SYSTEMD_FEATURES);
|
||||
arg_action = ACTION_NONE;
|
||||
return 0;
|
||||
|
@ -202,7 +202,6 @@ static int parse_argv(int argc, char *argv[]) {
|
||||
|
||||
case ARG_VERSION:
|
||||
puts(PACKAGE_STRING);
|
||||
puts(DISTRIBUTION);
|
||||
puts(SYSTEMD_FEATURES);
|
||||
return 0;
|
||||
|
||||
|
@ -615,7 +615,6 @@ static int parse_argv(int argc, char *argv[]) {
|
||||
|
||||
case ARG_VERSION:
|
||||
puts(PACKAGE_STRING);
|
||||
puts(DISTRIBUTION);
|
||||
puts(SYSTEMD_FEATURES);
|
||||
return 0;
|
||||
|
||||
|
@ -210,7 +210,6 @@ static int parse_argv(int argc, char *argv[]) {
|
||||
|
||||
case ARG_VERSION:
|
||||
puts(PACKAGE_STRING);
|
||||
puts(DISTRIBUTION);
|
||||
puts(SYSTEMD_FEATURES);
|
||||
return 0;
|
||||
|
||||
|
@ -1394,7 +1394,6 @@ static int parse_argv(int argc, char *argv[]) {
|
||||
|
||||
case ARG_VERSION:
|
||||
puts(PACKAGE_STRING);
|
||||
puts(DISTRIBUTION);
|
||||
puts(SYSTEMD_FEATURES);
|
||||
return 0;
|
||||
|
||||
|
@ -67,7 +67,6 @@ static int parse_argv(int argc, char *argv[]) {
|
||||
|
||||
case ARG_VERSION:
|
||||
puts(PACKAGE_STRING);
|
||||
puts(DISTRIBUTION);
|
||||
puts(SYSTEMD_FEATURES);
|
||||
return 0;
|
||||
|
||||
|
@ -94,7 +94,6 @@ static int parse_argv(int argc, char *argv[]) {
|
||||
|
||||
case ARG_VERSION:
|
||||
puts(PACKAGE_STRING);
|
||||
puts(DISTRIBUTION);
|
||||
puts(SYSTEMD_FEATURES);
|
||||
return 0;
|
||||
|
||||
|
@ -4201,7 +4201,6 @@ static int systemctl_parse_argv(int argc, char *argv[]) {
|
||||
|
||||
case ARG_VERSION:
|
||||
puts(PACKAGE_STRING);
|
||||
puts(DISTRIBUTION);
|
||||
puts(SYSTEMD_FEATURES);
|
||||
return 0;
|
||||
|
||||
|
@ -551,7 +551,6 @@ static int parse_argv(int argc, char *argv[]) {
|
||||
|
||||
case ARG_VERSION:
|
||||
puts(PACKAGE_STRING);
|
||||
puts(DISTRIBUTION);
|
||||
puts(SYSTEMD_FEATURES);
|
||||
return 0;
|
||||
|
||||
|
@ -688,7 +688,6 @@ static int parse_argv(int argc, char *argv[]) {
|
||||
|
||||
case ARG_VERSION:
|
||||
puts(PACKAGE_STRING);
|
||||
puts(DISTRIBUTION);
|
||||
puts(SYSTEMD_FEATURES);
|
||||
return 0;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user