Skip to content

Commit bc27084

Browse files
committed
build-sys: drop all distribution specfic checks
Yay, we now have a completely generic systemd. No distribution specific checks anymore!
1 parent a382332 commit bc27084

File tree

20 files changed

+35
-189
lines changed

20 files changed

+35
-189
lines changed

DISTRO_PORTING

Lines changed: 20 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -4,55 +4,31 @@ HOWTO:
44
You need to make the follow changes to adapt systemd to your
55
distribution:
66

7-
0) Make your distribution recognized via the autoconf checks
8-
in configure.ac. Grep for the word "fedora" (case
9-
insensitively) and you should be able to find the places where
10-
you need to add/change things.
11-
12-
1) Patch src/shared/hostname-setup.c so that systemd knows
13-
where to read your host name from. You might also want to
14-
update status_welcome() in util.c.
15-
16-
2) Check the unit files in units/ if they match your
17-
distribution. Most likely you will have to make additions to
18-
units/*.m4 and create a copy of units/fedora/ with changes for
19-
your distribution.
20-
21-
3) Adjust Makefile.am to register the unit files you added in
22-
step 2. Also you might need to update the m4 invocation in
23-
Makefile.am. Grep for the word "fedora" (case insensitively)
24-
and you should be able to find the places where you need to
25-
add/change things.
26-
27-
4) Try it out. Play around with 'systemd --test --system' for
7+
1) Find the right configure parameters for:
8+
9+
--with-rootprefix=
10+
--with-sysvinit-path=
11+
--with-sysvrcd-path=
12+
--with-rc-local-script-path-start=
13+
--with-rc-local-script-path-stop=
14+
--with-kbd-loadkeys=
15+
--with-kbd-setfont=
16+
--with-tty-gid=
17+
18+
2) Try it out. Play around with 'systemd --test --system' for
2819
a test run of systemd without booting. This will read the unit
2920
files and print the initial transaction it would execute
3021
during boot-up. This will also inform you about ordering loops
3122
and suchlike.
3223

3324
CONTRIBUTING UPSTREAM:
34-
We are interested in merging your changes upstream, if they
35-
are for a big, and well-known distribution. Unfortunately we
36-
don't have the time and resources to maintain
37-
distribution-specific patches for all distributions on the
38-
planet, hence please do not send us patches that add systemd
39-
support for non-mainstream or niche distributions.
4025

41-
Thank you for understanding.
42-
43-
BE CONSIDERATE:
44-
We'd like to keep differences between the distributions
45-
minimal. This both simplifies our maintenance work, as well
46-
as it helps administrators to move from one distribution to
47-
another.
26+
We are generally do no longer accept distribution specific
27+
patches to systemd upstream. If you have to make changes to
28+
systemd's source code to make it work on your distribution:
29+
unless your code is generic enough to be generally useful we
30+
are unlikely to merge it. Please always consider adopting the
31+
upstream defaults. If that's not possible please maintain the
32+
relevant patches downstream.
4833

49-
Hence we'd like to ask you to keep your changes minimal, and
50-
not rename any units without a very good reason (if you need a
51-
particular name for compatibility reasons, consider using
52-
alias names via symlinks). Before you make changes that change
53-
semantics from upstream, please talk to us!
54-
55-
In SysV almost every distribution uses a different
56-
nomenclature and different locations for the boot-up
57-
scripts. We'd like to avoid chaos like that with systemd right
58-
from the beginning. So please, be considerate!
34+
Thank you for understanding.

Makefile.am

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4062,24 +4062,6 @@ if HAVE_KMOD
40624062
$(LN_S) ../systemd-modules-load.service systemd-modules-load.service )
40634063
endif
40644064

4065-
4066-
if TARGET_FEDORA
4067-
( cd $(DESTDIR)$(systemunitdir) && \
4068-
rm -f display-manager.service single.service && \
4069-
$(LN_S) rescue.service single.service )
4070-
endif
4071-
4072-
if TARGET_MANDRIVA
4073-
( cd $(DESTDIR)$(systemunitdir) && \
4074-
rm -f display-manager.service dm.service single.service && \
4075-
$(LN_S) rescue.service single.service )
4076-
endif
4077-
4078-
if TARGET_MAGEIA
4079-
( cd $(DESTDIR)$(systemunitdir) && \
4080-
rm -f display-manager.service )
4081-
endif
4082-
40834065
install-exec-hook: $(INSTALL_EXEC_HOOKS)
40844066

40854067
uninstall-hook: $(UNINSTALL_DATA_HOOKS) $(UNINSTALL_EXEC_HOOKS)

configure.ac

Lines changed: 11 additions & 104 deletions
Original file line numberDiff line numberDiff line change
@@ -616,12 +616,12 @@ AC_ARG_WITH(rc-local-script-path-start,
616616

617617
AC_ARG_WITH(rc-local-script-path-stop,
618618
AS_HELP_STRING([--with-rc-local-script-path-stop=PATH],
619-
[Path to /sbin/halt.local]),
619+
[Path to /usr/sbin/halt.local]),
620620
[RC_LOCAL_SCRIPT_PATH_STOP="$withval"],
621-
[RC_LOCAL_SCRIPT_PATH_STOP="/sbin/halt.local"])
621+
[RC_LOCAL_SCRIPT_PATH_STOP="/usr/sbin/halt.local"])
622622

623623
AC_DEFINE_UNQUOTED(RC_LOCAL_SCRIPT_PATH_START, ["$RC_LOCAL_SCRIPT_PATH_START"], [Path of /etc/rc.local script])
624-
AC_DEFINE_UNQUOTED(RC_LOCAL_SCRIPT_PATH_STOP, ["$RC_LOCAL_SCRIPT_PATH_STOP"], [Path of /sbin/halt.local script])
624+
AC_DEFINE_UNQUOTED(RC_LOCAL_SCRIPT_PATH_STOP, ["$RC_LOCAL_SCRIPT_PATH_STOP"], [Path of /usr/sbin/halt.local script])
625625

626626
AC_SUBST(RC_LOCAL_SCRIPT_PATH_START)
627627
AC_SUBST(RC_LOCAL_SCRIPT_PATH_STOP)
@@ -697,107 +697,23 @@ AM_CONDITIONAL(ENABLE_MANPAGES, [test "x$have_manpages" = "xyes"])
697697

698698
# ------------------------------------------------------------------------------
699699

700-
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]))
701-
if test "z$with_distro" = "z"; then
702-
if test "$cross_compiling" = yes; then
703-
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)])
704-
else
705-
with_distro=$($GREP '^ID=' /etc/os-release 2>/dev/null | $SED 's/ID=//');
706-
fi
707-
if test "z$with_distro" = "z"; then
708-
with_distro=other
709-
fi
710-
fi
711-
with_distro=`echo ${with_distro} | tr '[[:upper:]]' '[[:lower:]]' `
712-
AC_DEFINE_UNQUOTED(DISTRIBUTION, ["${with_distro}"], [Target Distribution])
713-
714700
# Location of the init scripts as mandated by LSB
715701
SYSTEM_SYSVINIT_PATH=/etc/init.d
716702
SYSTEM_SYSVRCND_PATH=/etc/rc.d
717-
718703
M4_DEFINES=
719704

720-
case $with_distro in
721-
fedora)
722-
SYSTEM_SYSVINIT_PATH=/etc/rc.d/init.d
723-
AC_DEFINE(TARGET_FEDORA, [], [Target is Fedora/RHEL])
724-
M4_DEFINES=-DTARGET_FEDORA=1
725-
;;
726-
opensuse|suse)
727-
SYSTEM_SYSVRCND_PATH=/etc/init.d
728-
AC_DEFINE(TARGET_SUSE, [], [Target is openSUSE/SLE])
729-
M4_DEFINES=-DTARGET_SUSE=1
730-
;;
731-
debian)
732-
SYSTEM_SYSVRCND_PATH=/etc
733-
AC_DEFINE(TARGET_DEBIAN, [], [Target is Debian])
734-
M4_DEFINES=-DTARGET_DEBIAN=1
735-
;;
736-
arch)
737-
SYSTEM_SYSVINIT_PATH=
738-
SYSTEM_SYSVRCND_PATH=
739-
AC_DEFINE(TARGET_ARCH, [], [Target is ArchLinux])
740-
M4_DEFINES=-DTARGET_ARCH=1
741-
;;
742-
gentoo)
743-
SYSTEM_SYSVINIT_PATH=
744-
SYSTEM_SYSVRCND_PATH=
745-
AC_DEFINE(TARGET_GENTOO, [], [Target is Gentoo])
746-
M4_DEFINES=-DTARGET_GENTOO=1
747-
;;
748-
slackware)
749-
SYSTEM_SYSVINIT_PATH=/etc/rc.d/init.d
750-
AC_DEFINE(TARGET_SLACKWARE, [], [Target is Slackware])
751-
M4_DEFINES=-DTARGET_SLACKWARE=1
752-
;;
753-
frugalware)
754-
SYSTEM_SYSVINIT_PATH=/etc/rc.d
755-
AC_DEFINE(TARGET_FRUGALWARE, [], [Target is Frugalware])
756-
M4_DEFINES=-DTARGET_FRUGALWARE=1
757-
;;
758-
altlinux)
759-
SYSTEM_SYSVINIT_PATH=/etc/rc.d/init.d
760-
AC_DEFINE(TARGET_ALTLINUX, [], [Target is ALTLinux])
761-
M4_DEFINES=-DTARGET_ALTLINUX=1
762-
;;
763-
mandriva)
764-
SYSTEM_SYSVINIT_PATH=/etc/rc.d/init.d
765-
AC_DEFINE(TARGET_MANDRIVA, [], [Target is Mandriva])
766-
M4_DEFINES=-DTARGET_MANDRIVA=1
767-
;;
768-
angstrom)
769-
SYSTEM_SYSVRCND_PATH=/etc
770-
AC_DEFINE(TARGET_ANGSTROM, [], [Target is Ångström])
771-
M4_DEFINES=-DTARGET_ANGSTROM=1
772-
;;
773-
mageia)
774-
SYSTEM_SYSVINIT_PATH=/etc/rc.d/init.d
775-
AC_DEFINE(TARGET_MAGEIA, [], [Target is Mageia])
776-
M4_DEFINES=-DTARGET_MAGEIA=1
777-
;;
778-
other)
779-
;;
780-
*)
781-
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])
782-
;;
783-
esac
784-
785705
AC_ARG_WITH([sysvinit-path],
786706
[AS_HELP_STRING([--with-sysvinit-path=PATH],
787-
[Specify the path to where the SysV init scripts are located @<:@default=based on distro@:>@])],
707+
[Specify the path to where the SysV init scripts are located])],
788708
[SYSTEM_SYSVINIT_PATH="$withval"],
789709
[])
790710

791711
AC_ARG_WITH([sysvrcd-path],
792712
[AS_HELP_STRING([--with-sysvrcd-path=PATH],
793-
[Specify the path to the base directory for the SysV rcN.d directories @<:@default=based on distro@:>@])],
713+
[Specify the path to the base directory for the SysV rcN.d directories])],
794714
[SYSTEM_SYSVRCND_PATH="$withval"],
795715
[])
796716

797-
AC_SUBST(SYSTEM_SYSVINIT_PATH)
798-
AC_SUBST(SYSTEM_SYSVRCND_PATH)
799-
AC_SUBST(M4_DEFINES)
800-
801717
if test "x${SYSTEM_SYSVINIT_PATH}" != "x" -a "x${SYSTEM_SYSVRCND_PATH}" != "x"; then
802718
AC_DEFINE(HAVE_SYSV_COMPAT, [], [SysV init scripts and rcN.d links are supported.])
803719
SYSTEM_SYSV_COMPAT="yes"
@@ -808,26 +724,18 @@ else
808724
SYSTEM_SYSV_COMPAT="no"
809725
fi
810726

727+
AC_SUBST(SYSTEM_SYSVINIT_PATH)
728+
AC_SUBST(SYSTEM_SYSVRCND_PATH)
729+
AC_SUBST(M4_DEFINES)
730+
731+
AM_CONDITIONAL(HAVE_SYSV_COMPAT, test "$SYSTEM_SYSV_COMPAT" = "yes")
732+
811733
AC_ARG_WITH([tty-gid],
812734
[AS_HELP_STRING([--with-tty-gid=GID],
813735
[Specify the numeric GID of the 'tty' group])],
814736
[AC_DEFINE_UNQUOTED(TTY_GID, [$withval], [GID of the 'tty' group])],
815737
[])
816738

817-
AM_CONDITIONAL(TARGET_FEDORA, test x"$with_distro" = xfedora)
818-
AM_CONDITIONAL(TARGET_SUSE, test x"$with_distro" = xsuse)
819-
AM_CONDITIONAL(TARGET_DEBIAN, test x"$with_distro" = xdebian)
820-
AM_CONDITIONAL(TARGET_ARCH, test x"$with_distro" = xarch)
821-
AM_CONDITIONAL(TARGET_GENTOO, test x"$with_distro" = xgentoo)
822-
AM_CONDITIONAL(TARGET_SLACKWARE, test x"$with_distro" = xslackware)
823-
AM_CONDITIONAL(TARGET_FRUGALWARE, test x"$with_distro" = xfrugalware)
824-
AM_CONDITIONAL(TARGET_ALTLINUX, test x"$with_distro" = xaltlinux)
825-
AM_CONDITIONAL(TARGET_MANDRIVA, test x"$with_distro" = xmandriva)
826-
AM_CONDITIONAL(TARGET_ANGSTROM, test x"$with_distro" = xangstrom)
827-
AM_CONDITIONAL(TARGET_MAGEIA, test x"$with_distro" = xmageia)
828-
829-
AM_CONDITIONAL(HAVE_SYSV_COMPAT, test "$SYSTEM_SYSV_COMPAT" = "yes")
830-
831739
AC_ARG_WITH([dbuspolicydir],
832740
AS_HELP_STRING([--with-dbuspolicydir=DIR], [D-Bus policy directory]),
833741
[],
@@ -895,7 +803,6 @@ AC_OUTPUT
895803
AC_MSG_RESULT([
896804
$PACKAGE_NAME $VERSION
897805
898-
Distribution: ${with_distro}
899806
SysV compatibility: ${SYSTEM_SYSV_COMPAT}
900807
SysV init scripts: ${SYSTEM_SYSVINIT_PATH}
901808
SysV rc?.d directories: ${SYSTEM_SYSVRCND_PATH}

src/cgls/cgls.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ static int parse_argv(int argc, char *argv[]) {
8080

8181
case ARG_VERSION:
8282
puts(PACKAGE_STRING);
83-
puts(DISTRIBUTION);
8483
puts(SYSTEMD_FEATURES);
8584
return 0;
8685

src/core/dbus-manager.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,6 @@
228228

229229
#define BUS_MANAGER_INTERFACE_PROPERTIES_GENERAL \
230230
" <property name=\"Version\" type=\"s\" access=\"read\"/>\n" \
231-
" <property name=\"Distribution\" type=\"s\" access=\"read\"/>\n" \
232231
" <property name=\"Features\" type=\"s\" access=\"read\"/>\n" \
233232
" <property name=\"Tainted\" type=\"s\" access=\"read\"/>\n" \
234233
" <property name=\"FirmwareTimestamp\" type=\"t\" access=\"read\"/>\n" \
@@ -526,13 +525,11 @@ static int bus_manager_set_runtime_watchdog_usec(DBusMessageIter *i, const char
526525

527526
static const char systemd_property_string[] =
528527
PACKAGE_STRING "\0"
529-
DISTRIBUTION "\0"
530528
SYSTEMD_FEATURES;
531529

532530
static const BusProperty bus_systemd_properties[] = {
533-
{ "Version", bus_property_append_string, "s", 0 },
534-
{ "Distribution", bus_property_append_string, "s", sizeof(PACKAGE_STRING) },
535-
{ "Features", bus_property_append_string, "s", sizeof(PACKAGE_STRING) + sizeof(DISTRIBUTION) },
531+
{ "Version", bus_property_append_string, "s", 0 },
532+
{ "Features", bus_property_append_string, "s", sizeof(PACKAGE_STRING) },
536533
{ NULL, }
537534
};
538535

src/core/main.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1064,7 +1064,6 @@ static int help(void) {
10641064

10651065
static int version(void) {
10661066
puts(PACKAGE_STRING);
1067-
puts(DISTRIBUTION);
10681067
puts(SYSTEMD_FEATURES);
10691068

10701069
return 0;
@@ -1567,7 +1566,7 @@ int main(int argc, char *argv[]) {
15671566
if (arg_running_as == SYSTEMD_SYSTEM) {
15681567
const char *virtualization = NULL;
15691568

1570-
log_info(PACKAGE_STRING " running in system mode. (" SYSTEMD_FEATURES "; " DISTRIBUTION ")");
1569+
log_info(PACKAGE_STRING " running in system mode. (" SYSTEMD_FEATURES ")");
15711570

15721571
detect_virtualization(&virtualization);
15731572
if (virtualization)
@@ -1577,7 +1576,7 @@ int main(int argc, char *argv[]) {
15771576
log_info("Running in initial RAM disk.");
15781577

15791578
} else
1580-
log_debug(PACKAGE_STRING " running in user mode. (" SYSTEMD_FEATURES "; " DISTRIBUTION ")");
1579+
log_debug(PACKAGE_STRING " running in user mode. (" SYSTEMD_FEATURES ")");
15811580

15821581
if (arg_running_as == SYSTEMD_SYSTEM && !skip_setup) {
15831582
locale_setup();

src/delta/delta.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,6 @@ static int parse_argv(int argc, char *argv[]) {
362362

363363
case ARG_VERSION:
364364
puts(PACKAGE_STRING);
365-
puts(DISTRIBUTION);
366365
puts(SYSTEMD_FEATURES);
367366
return 0;
368367

src/detect-virt/detect-virt.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ static int parse_argv(int argc, char *argv[]) {
8080

8181
case ARG_VERSION:
8282
puts(PACKAGE_STRING);
83-
puts(DISTRIBUTION);
8483
puts(SYSTEMD_FEATURES);
8584
return 0;
8685

src/hostname/hostnamectl.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,6 @@ static int parse_argv(int argc, char *argv[]) {
406406

407407
case ARG_VERSION:
408408
puts(PACKAGE_STRING);
409-
puts(DISTRIBUTION);
410409
puts(SYSTEMD_FEATURES);
411410
return 0;
412411

src/journal/cat.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ static int parse_argv(int argc, char *argv[]) {
8181

8282
case ARG_VERSION:
8383
puts(PACKAGE_STRING);
84-
puts(DISTRIBUTION);
8584
puts(SYSTEMD_FEATURES);
8685
return 0;
8786

0 commit comments

Comments
 (0)