All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Allow disabling the build of all of systemd, leaving just udev
@ 2012-06-02  6:56 Bryan Kadzban
  2012-06-02 20:49 ` William Hubbs
                   ` (17 more replies)
  0 siblings, 18 replies; 19+ messages in thread
From: Bryan Kadzban @ 2012-06-02  6:56 UTC (permalink / raw)
  To: linux-hotplug

[-- Attachment #1: Type: text/plain, Size: 2098 bytes --]

Add a new ./configure arg (--disable-systemd) that causes the build
system to build, test, and install only udev.

Allows udev to be built on a system with many fewer of the build-time
dependencies present.

Signed-Off-By: Bryan Kadzban <bryan@kadzban.is-a-geek.net>

----

Possible points of discussion:

Should this flag be called --disable-systemd, as I did?  (That follows
the autoconf docs, which say --disable-* should only ever turn stuff
off, and --enable-* should only ever turn stuff on.)  Or are the
autoconf docs irrelevant, and this should be called --enable-udev-only
or something, instead?  The flag name isn't terribly important to me.

(Note that the flag is set to *enable* systemd by default.  Disabling it
is probably not to be done lightly, and a bunch of other stuff needs to
be turned off as well for this to actually build.)

Also, a few notes on usage.  First, to fully avoid installing systemd
stuff, a bunch of directories need to be set to the empty string at
"make install" time, or they'll be created and left empty.
("pkgdatadir= polkitpolicydir= bashcompletiondir= pkgsysconfdir=
userunitdir= tmpfilesdir= sysctldir= systemunitdir= pkgincludedir=
systemgeneratordir=" is the full list.)

Second, "make check" fails in the po/ directory if systemd was not
enabled at configure time, because intltool was skipped.  The udev tests
all succeed though, so "make SUBDIRS=. check" works.

Third, "make distdir" also require systemd to be enabled, otherwise some
of the .policy.in files don't make it into the directory (and so
"dist-xz" won't put them into the generated tarball).  But that's not
likely to be an issue, considering who does the releases.

Last, on the changes to configure.ac.  The intltool and m4 path checks
are not needed anymore if only udev is being built.  Neither is gperf,
so skip the "no gperf found" error message in that case.  No need to
check pkg-config for dbus-1.  cap_init and sys/capability.h are no
longer required either, so skip them as well.  Finally, none of the
--with-{dbus,pam}*dir args need a default value for a udev-only build.

[-- Attachment #2: systemd-make-systemd-optional.patch --]
[-- Type: text/plain, Size: 9621 bytes --]

diff --git a/Makefile.am b/Makefile.am
index 597711e..4712c11 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -202,6 +202,13 @@ endif
 endif
 
 # ------------------------------------------------------------------------------
+if !ENABLE_SYSTEMD
+# stubs
+bin_PROGRAMS =
+rootlibexec_PROGRAMS =
+endif
+
+if ENABLE_SYSTEMD
 rootbin_PROGRAMS = \
 	systemctl \
 	systemd-notify \
@@ -442,6 +449,8 @@ EXTRA_DIST += \
 	units/systemd-ask-password-plymouth.service.in
 endif
 
+endif  # ENABLE_SYSTEMD
+
 dist_doc_DATA = \
 	README \
 	NEWS \
@@ -453,6 +462,7 @@ dist_doc_DATA = \
 @INTLTOOL_POLICY_RULE@
 
 # ------------------------------------------------------------------------------
+if ENABLE_SYSTEMD
 MANPAGES = \
 	man/systemd.1 \
 	man/systemctl.1 \
@@ -510,13 +520,19 @@ MANPAGES_ALIAS = \
 	man/systemd-modules-load.8 \
 	man/systemd-sysctl.8 \
 	man/systemd-journald.8
+else
+MANPAGES =
+MANPAGES_ALIAS =
+endif
 
+if ENABLE_SYSTEMD
 man/reboot.8: man/halt.8
 man/poweroff.8: man/halt.8
 man/init.1: man/systemd.1
 man/systemd-modules-load.8: man/systemd-modules-load.service.8
 man/systemd-sysctl.8: man/systemd-sysctl.service.8
 man/systemd-journald.8: man/systemd-journald.service.8
+endif
 
 XML_FILES = \
 	${patsubst %.1,%.xml,${patsubst %.3,%.xml,${patsubst %.5,%.xml,${patsubst %.7,%.xml,${patsubst %.8,%.xml,$(MANPAGES)}}}}}
@@ -595,6 +611,7 @@ libsystemd_shared_la_SOURCES = \
 	src/shared/hwclock.c \
 	src/shared/hwclock.h
 
+if ENABLE_SYSTEMD
 #-------------------------------------------------------------------------------
 noinst_LTLIBRARIES += \
 	libsystemd-dbus.la
@@ -627,6 +644,7 @@ libsystemd_units_la_SOURCES = \
 libsystemd_units_la_CFLAGS = \
 	$(AM_CFLAGS) \
 	$(DBUS_CFLAGS)
+endif
 
 # ------------------------------------------------------------------------------
 noinst_LTLIBRARIES += \
@@ -651,6 +669,7 @@ libsystemd_label_la_CFLAGS = \
 libsystemd_label_la_LIBADD = \
 	$(SELINUX_LIBS)
 
+if ENABLE_SYSTEMD
 # ------------------------------------------------------------------------------
 noinst_LTLIBRARIES += \
 	libsystemd-logs.la
@@ -692,6 +711,8 @@ libsystemd_audit_la_SOURCES = \
 libsystemd_audit_la_LIBADD = \
 	libsystemd-capability.la
 
+endif # ENABLE_SYSTEMD
+
 # ------------------------------------------------------------------------------
 if HAVE_ACL
 noinst_LTLIBRARIES += \
@@ -709,6 +730,7 @@ libsystemd_acl_la_LIBADD = \
 	$(ACL_LIBS)
 endif
 
+if ENABLE_SYSTEMD
 # ------------------------------------------------------------------------------
 noinst_LTLIBRARIES += \
 	libsystemd-core.la
@@ -1355,6 +1377,8 @@ EXTRA_DIST += \
 	src/libsystemd-daemon/libsystemd-daemon.pc.in \
 	src/libsystemd-daemon/libsystemd-daemon.sym
 
+endif # ENABLE_SYSTEMD
+
 # ------------------------------------------------------------------------------
 if ENABLE_GTK_DOC
 SUBDIRS += \
@@ -1443,8 +1467,12 @@ udev-confdirs:
 
 INSTALL_DATA_HOOKS += udev-confdirs
 
+if ENABLE_SYSTEMD
+SYSTEMD_UDEV_RULES = rules/99-systemd.rules
+endif
+
 dist_udevrules_DATA += \
-	rules/99-systemd.rules \
+	$(SYSTEMD_UDEV_RULES) \
 	rules/42-usb-hid-pm.rules \
 	rules/50-udev-default.rules \
 	rules/60-persistent-storage-tape.rules \
@@ -1471,9 +1499,10 @@ EXTRA_DIST += \
 	src/udev/udev.pc.in
 
 CLEANFILES += \
-	rules/99-systemd.rules \
+	$(SYSTEMD_UDEV_RULES) \
 	src/udev/udev.pc
 
+if ENABLE_SYSTEMD
 EXTRA_DIST += \
 	units/systemd-udev.service.in \
 	units/systemd-udev-trigger.service.in \
@@ -1493,6 +1522,7 @@ systemd-install-hook:
 	ln -sf ../systemd-udev-trigger.service $(DESTDIR)$(systemunitdir)/sysinit.target.wants/systemd-udev-trigger.service
 
 INSTALL_DATA_HOOKS += systemd-install-hook
+endif
 
 bin_PROGRAMS += \
 	udevadm
@@ -2017,6 +2047,7 @@ dist_udevrules_DATA += \
 udevlibexec_PROGRAMS += \
 	mtd_probe
 
+if ENABLE_SYSTEMD
 # ------------------------------------------------------------------------------
 libsystemd_id128_la_SOURCES = \
 	src/libsystemd-id128/sd-id128.c
@@ -2984,6 +3015,8 @@ CLEANFILES += \
 	src/login/71-seat.rules \
 	src/login/73-seat-late.rules
 endif
+
+endif # ENABLE_SYSTEMD
 # ------------------------------------------------------------------------------
 
 SED_PROCESS = \
@@ -3113,6 +3146,8 @@ DBUS_PREPROCESS = $(CPP) -P $(DBUS_CFLAGS) -imacros dbus/dbus-protocol.h
 CLEANFILES += \
 	$(dbusinterface_DATA)
 
+if ENABLE_SYSTEMD
+
 systemd-install-data-hook:
 	$(MKDIR_P) -m 0755 \
 		$(DESTDIR)$(tmpfilesdir) \
@@ -3321,11 +3356,17 @@ if TARGET_MAGEIA
 		$(LN_S) $(systemunitdir)/display-manager.service display-manager.service )
 endif
 
+endif # ENABLE_SYSTEMD
+
 install-exec-hook: $(INSTALL_EXEC_HOOKS)
 
 uninstall-hook: $(UNINSTALL_EXEC_HOOKS)
 
-install-data-hook: systemd-install-data-hook $(INSTALL_DATA_HOOKS)
+if ENABLE_SYSTEMD
+SYSTEMD_INSTALL_DATA_HOOK = systemd-install-data-hook
+endif
+
+install-data-hook: $(SYSTEMD_INSTALL_DATA_HOOK) $(INSTALL_DATA_HOOKS)
 
 distclean-local: $(DISTCLEAN_LOCAL_HOOKS)
 
diff --git a/configure.ac b/configure.ac
index a4f9fea..bf825bd 100644
--- a/configure.ac
+++ b/configure.ac
@@ -44,8 +44,23 @@ AS_IF([test "x$host_cpu" = "xmips" || test "x$host_cpu" = "xmipsel" ||
 LT_PREREQ(2.2)
 LT_INIT
 
+dnl Figure out if we want a udev-only build early.  Inverted logic to match
+dnl autoconf expectations (passing --enable-foo should only ever turn something
+dnl on, never turn something off).
+AC_ARG_ENABLE([systemd],
+              [AS_HELP_STRING([--disable-systemd],
+                              [build udevd only, not systemd @<:@default: systemd enabled@:>@])],
+              [enable_systemd=$enableval], [enable_systemd=yes])
+
+dnl Anything other than --disable-systemd means "yes, build systemd as well"
+AS_IF([test "x$enable_systemd" != "xno"], [enable_systemd=yes])
+
+AM_CONDITIONAL([ENABLE_SYSTEMD], [test "x$enable_systemd" = "xyes"])
+
 # i18n stuff for the PolicyKit policy files
+AS_IF([test "x$enable_systemd" = "xyes"], [
 IT_PROG_INTLTOOL([0.40.0])
+])
 
 GETTEXT_PACKAGE=systemd
 AC_SUBST(GETTEXT_PACKAGE)
@@ -61,7 +76,9 @@ AC_PROG_CC_C99
 AM_PROG_CC_C_O
 AC_PROG_GCC_TRADITIONAL
 
+AS_IF([test "x$enable_systemd" = "xyes"], [
 AC_PATH_PROG([M4], [m4])
+])
 
 # gtkdocize greps for '^GTK_DOC_CHECK', so it needs to be on its own line
 m4_ifdef([GTK_DOC_CHECK], [
@@ -75,7 +92,7 @@ GOBJECT_INTROSPECTION_CHECK([1.31.1])
 AC_CHECK_TOOL(OBJCOPY, objcopy)
 AC_CHECK_TOOL(STRINGS, strings)
 AC_CHECK_TOOL(GPERF, gperf)
-if test -z "$GPERF" ; then
+if test -z "$GPERF" && test "x$enable_systemd" = "xyes" ; then
         AC_MSG_ERROR([*** gperf not found])
 fi
 
@@ -132,6 +149,7 @@ AC_SUBST([GCLDFLAGS], $with_ldflags)
 AC_SEARCH_LIBS([clock_gettime], [rt], [], [AC_MSG_ERROR([*** POSIX RT library not found])])
 AC_SEARCH_LIBS([dlsym], [dl], [], [AC_MSG_ERROR([*** Dynamic linking loader library not found])])
 
+AS_IF([test "x$enable_systemd" = "xyes"], [
 save_LIBS="$LIBS"
 LIBS=
 AC_SEARCH_LIBS([cap_init], [cap], [], [AC_MSG_ERROR([*** POSIX caps library not found])])
@@ -139,11 +157,14 @@ AC_CHECK_HEADERS([sys/capability.h], [], [AC_MSG_ERROR([*** POSIX caps headers n
 CAP_LIBS="$LIBS"
 LIBS="$save_LIBS"
 AC_SUBST(CAP_LIBS)
+])
 
 # This makes sure pkg.m4 is available.
 m4_pattern_forbid([^_?PKG_[A-Z_]+$],[*** pkg.m4 missing, please install pkg-config])
 
+AS_IF([test "x$enable_systemd" = "xyes"], [
 PKG_CHECK_MODULES(DBUS, [dbus-1 >= 1.3.2])
+])
 PKG_CHECK_MODULES(KMOD, [libkmod >= 5])
 PKG_CHECK_MODULES(BLKID,[blkid >= 2.20])
 
@@ -655,22 +676,22 @@ AM_CONDITIONAL(HAVE_SYSV_COMPAT, test "$SYSTEM_SYSV_COMPAT" = "yes")
 AC_ARG_WITH([dbuspolicydir],
         AS_HELP_STRING([--with-dbuspolicydir=DIR], [D-Bus policy directory]),
         [],
-        [with_dbuspolicydir=`pkg-config --variable=sysconfdir dbus-1`/dbus-1/system.d])
+        [AS_IF([test "x$enable_systemd" = "xyes"], [with_dbuspolicydir=`pkg-config --variable=sysconfdir dbus-1`/dbus-1/system.d])])
 
 AC_ARG_WITH([dbussessionservicedir],
         AS_HELP_STRING([--with-dbussessionservicedir=DIR], [D-Bus session service directory]),
         [],
-        [with_dbussessionservicedir=`pkg-config --variable=session_bus_services_dir dbus-1`])
+        [AS_IF([test "x$enable_systemd" = "xyes"], [with_dbussessionservicedir=`pkg-config --variable=session_bus_services_dir dbus-1`])])
 
 AC_ARG_WITH([dbussystemservicedir],
         AS_HELP_STRING([--with-dbussystemservicedir=DIR], [D-Bus system service directory]),
         [],
-        [with_dbussystemservicedir=`pkg-config --variable=session_bus_services_dir dbus-1`/../system-services])
+        [AS_IF([test "x$enable_systemd" = "xyes"], [with_dbussystemservicedir=`pkg-config --variable=session_bus_services_dir dbus-1`/../system-services])])
 
 AC_ARG_WITH([dbusinterfacedir],
         AS_HELP_STRING([--with-dbusinterfacedir=DIR], [D-Bus interface directory]),
         [],
-        [with_dbusinterfacedir=`pkg-config --variable=session_bus_services_dir dbus-1`/../interfaces])
+        [AS_IF([test "x$enable_systemd" = "xyes"], [with_dbusinterfacedir=`pkg-config --variable=session_bus_services_dir dbus-1`/../interfaces])])
 
 AC_ARG_WITH([rootprefix],
         AS_HELP_STRING([--with-rootprefix=DIR], [rootfs directory prefix for config files and kernel modules]),
@@ -684,7 +705,7 @@ AC_ARG_WITH([rootlibdir],
 AC_ARG_WITH([pamlibdir],
         AS_HELP_STRING([--with-pamlibdir=DIR], [Directory for PAM modules]),
         [],
-        [with_pamlibdir=${with_rootlibdir}/security])
+        [AS_IF([test "x$enable_systemd" = "xyes"], [with_pamlibdir=${with_rootlibdir}/security])])
 
 AC_ARG_ENABLE([split-usr],
         AS_HELP_STRING([--enable-split-usr], [Assume that /bin, /sbin aren\'t symlinks into /usr]),

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* Re: [PATCH] Allow disabling the build of all of systemd, leaving just udev
  2012-06-02  6:56 [PATCH] Allow disabling the build of all of systemd, leaving just udev Bryan Kadzban
@ 2012-06-02 20:49 ` William Hubbs
  2012-06-03 16:55 ` Bryan Kadzban
                   ` (16 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: William Hubbs @ 2012-06-02 20:49 UTC (permalink / raw)
  To: linux-hotplug

[-- Attachment #1: Type: text/plain, Size: 203 bytes --]

Hi Bryan,

this looks good to me, but there are still pieces being installed which
should not be installed for a udev-only build afaik.

You might want to look at removing those also.

Thanks,

William


[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH] Allow disabling the build of all of systemd, leaving just udev
  2012-06-02  6:56 [PATCH] Allow disabling the build of all of systemd, leaving just udev Bryan Kadzban
  2012-06-02 20:49 ` William Hubbs
@ 2012-06-03 16:55 ` Bryan Kadzban
  2012-06-03 21:21 ` Bryan Kadzban
                   ` (15 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: Bryan Kadzban @ 2012-06-03 16:55 UTC (permalink / raw)
  To: linux-hotplug

William Hubbs wrote:
> this looks good to me, but there are still pieces being installed
> which should not be installed for a udev-only build afaik.
> 
> You might want to look at removing those also.

Which pieces?

The only things that get installed in my case are the rules, udev.conf,
systemd-udevd, udevadm, the helper binaries, the manpages, libudev, the
udev and libudev pkg-config files, and stuff in /usr/share/doc.  Though
I do use a lot of the existing ./configure knobs to turn other systemd
things off; maybe that's related.

Unless you mean the directories that are getting created, as in the
previous message -- but I don't see a way to stop automake from doing
that.  Well, other than setting them to nothing in the Makefile.am if
!ENABLE_SYSTEMD; duh, I should have done that.  But that still seems a
bit cosmetic to me.

(One thing I need to do today is fix this so that "make distdir" works
even with --disable-systemd.  Should be able to pull the EXTRA_DIST
stuff out of the conditionals to do that.  So I'll probably look into
setting these directories to nothing in that case as well.)

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH] Allow disabling the build of all of systemd, leaving just udev
  2012-06-02  6:56 [PATCH] Allow disabling the build of all of systemd, leaving just udev Bryan Kadzban
  2012-06-02 20:49 ` William Hubbs
  2012-06-03 16:55 ` Bryan Kadzban
@ 2012-06-03 21:21 ` Bryan Kadzban
  2012-06-03 21:22 ` William Hubbs
                   ` (14 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: Bryan Kadzban @ 2012-06-03 21:21 UTC (permalink / raw)
  To: linux-hotplug

[-- Attachment #1: Type: text/plain, Size: 1069 bytes --]

Bryan Kadzban wrote:
> Unless you mean the directories that are getting created, as in the 
> previous message -- but I don't see a way to stop automake from doing
> that.

Digging a bit (the initial attempt at setting directories to "" resulted
in several warnings from automake about conditionally changing pkg*dir
variables), recent versions of automake no longer create empty
directories.  Upgrading my system to 1.12.1 (most recent) and rerunning
"autoreconf --force" removed almost all of the requirements to set these
directories to the empty string.

I still need to set "pkgincludedir= pkgsysconfdir=", and that looks like
a too-simple check for no files (it doesn't work if there's only
whitespace).  But I don't think it's a huge deal either.

> (One thing I need to do today is fix this so that "make distdir"
> works even with --disable-systemd.)

This is now done, just without the directory changes, since a newer
automake fixes that.  v2 patch (including header) attached.

Still wondering which bits of systemd got installed in your setup
though.  :-)

[-- Attachment #2: systemd-make-systemd-optional.patch --]
[-- Type: text/plain, Size: 20213 bytes --]

Add a new ./configure arg (--disable-systemd) that causes the build
system to build, test, and install only udev.

Allows udev to be built on a system with many fewer of the build-time
dependencies present.

v2: Handle EXTRA_DIST correctly; always distribute everything.  This
also fixes several cases where using e.g. --disable-gudev on the
distributor's system causes "make dist" to not distribute some of the
gudev source files.  Also handle polkitpolicy* files: always include
the filenames in the $(*_files) variables, since EXTRA_DIST is built
from those variables, but skip the installation rules unless
ENABLE_SYSTEMD is on.

Signed-Off-By: Bryan Kadzban <bryan@kadzban.is-a-geek.net>

diff --git a/Makefile.am b/Makefile.am
index 597711e..12baedd 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -202,6 +202,13 @@ endif
 endif
 
 # ------------------------------------------------------------------------------
+if !ENABLE_SYSTEMD
+# stubs
+bin_PROGRAMS =
+rootlibexec_PROGRAMS =
+endif
+
+if ENABLE_SYSTEMD
 rootbin_PROGRAMS = \
 	systemctl \
 	systemd-notify \
@@ -349,6 +356,8 @@ dist_userunit_DATA = \
 nodist_userunit_DATA = \
 	units/user/exit.service
 
+endif # ENABLE_SYSTEMD
+
 EXTRA_DIST += \
 	units/getty@.service.m4 \
 	units/serial-getty@.service.m4 \
@@ -383,6 +392,8 @@ EXTRA_DIST += \
 	introspect.awk \
 	man/custom-html.xsl
 
+if ENABLE_SYSTEMD
+
 if TARGET_FEDORA
 dist_systemunit_DATA += \
 	units/fedora/prefdm.service \
@@ -437,10 +448,12 @@ dist_systemunit_DATA += \
 
 nodist_systemunit_DATA += \
 	units/systemd-ask-password-plymouth.service
+
+endif
+endif # ENABLE_SYSTEMD
 
 EXTRA_DIST += \
 	units/systemd-ask-password-plymouth.service.in
-endif
 
 dist_doc_DATA = \
 	README \
@@ -453,6 +466,7 @@ dist_doc_DATA = \
 @INTLTOOL_POLICY_RULE@
 
 # ------------------------------------------------------------------------------
+if ENABLE_SYSTEMD
 MANPAGES = \
 	man/systemd.1 \
 	man/systemctl.1 \
@@ -510,13 +524,19 @@ MANPAGES_ALIAS = \
 	man/systemd-modules-load.8 \
 	man/systemd-sysctl.8 \
 	man/systemd-journald.8
+else
+MANPAGES =
+MANPAGES_ALIAS =
+endif
 
+if ENABLE_SYSTEMD
 man/reboot.8: man/halt.8
 man/poweroff.8: man/halt.8
 man/init.1: man/systemd.1
 man/systemd-modules-load.8: man/systemd-modules-load.service.8
 man/systemd-sysctl.8: man/systemd-sysctl.service.8
 man/systemd-journald.8: man/systemd-journald.service.8
+endif
 
 XML_FILES = \
 	${patsubst %.1,%.xml,${patsubst %.3,%.xml,${patsubst %.5,%.xml,${patsubst %.7,%.xml,${patsubst %.8,%.xml,$(MANPAGES)}}}}}
@@ -595,6 +615,7 @@ libsystemd_shared_la_SOURCES = \
 	src/shared/hwclock.c \
 	src/shared/hwclock.h
 
+if ENABLE_SYSTEMD
 #-------------------------------------------------------------------------------
 noinst_LTLIBRARIES += \
 	libsystemd-dbus.la
@@ -627,6 +648,7 @@ libsystemd_units_la_SOURCES = \
 libsystemd_units_la_CFLAGS = \
 	$(AM_CFLAGS) \
 	$(DBUS_CFLAGS)
+endif
 
 # ------------------------------------------------------------------------------
 noinst_LTLIBRARIES += \
@@ -651,6 +673,7 @@ libsystemd_label_la_CFLAGS = \
 libsystemd_label_la_LIBADD = \
 	$(SELINUX_LIBS)
 
+if ENABLE_SYSTEMD
 # ------------------------------------------------------------------------------
 noinst_LTLIBRARIES += \
 	libsystemd-logs.la
@@ -692,6 +715,8 @@ libsystemd_audit_la_SOURCES = \
 libsystemd_audit_la_LIBADD = \
 	libsystemd-capability.la
 
+endif # ENABLE_SYSTEMD
+
 # ------------------------------------------------------------------------------
 if HAVE_ACL
 noinst_LTLIBRARIES += \
@@ -709,6 +734,7 @@ libsystemd_acl_la_LIBADD = \
 	$(ACL_LIBS)
 endif
 
+if ENABLE_SYSTEMD
 # ------------------------------------------------------------------------------
 noinst_LTLIBRARIES += \
 	libsystemd-core.la
@@ -844,9 +870,13 @@ src/core/load-fragment-gperf-nulstr.c: src/core/load-fragment-gperf.gperf
 	$(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
 	$(AWK) 'BEGIN{ keywords=0 ; FS="," ; print "extern const char load_fragment_gperf_nulstr[];" ; print "const char load_fragment_gperf_nulstr[] ="} ; keyword==1 { print "\"" $$1 "\\0\"" } ; /%%/ { keyword=1} ; END { print ";" }' < $< > $@ || rm $@
 
+endif # ENABLE_SYSTEMD
+
 EXTRA_DIST += \
 	src/core/load-fragment-gperf.gperf.m4
 
+if ENABLE_SYSTEMD
+
 CLEANFILES += \
 	src/core/load-fragment-gperf.gperf \
 	src/core/load-fragment-gperf.c \
@@ -891,9 +921,6 @@ dbusinterface_DATA += \
 	org.freedesktop.systemd1.Swap.xml \
 	org.freedesktop.systemd1.Path.xml
 
-polkitpolicy_in_in_files = \
-	src/core/org.freedesktop.systemd1.policy.in.in
-
 org.freedesktop.systemd1.%.xml: systemd
 	$(AM_V_GEN)$(LIBTOOL) --mode=execute $(OBJCOPY) -O binary -j introspect.$* $< $@.tmp && \
 		$(STRINGS) $@.tmp | $(AWK) -f $(srcdir)/introspect.awk | \
@@ -902,9 +929,16 @@ org.freedesktop.systemd1.%.xml: systemd
 pkgconfigdata_DATA = \
 	src/core/systemd.pc
 
+endif # ENABLE_SYSTEMD
+
+polkitpolicy_in_in_files = \
+	src/core/org.freedesktop.systemd1.policy.in.in
+
 EXTRA_DIST += \
 	src/core/systemd.pc.in
 
+if ENABLE_SYSTEMD
+
 # ------------------------------------------------------------------------------
 noinst_PROGRAMS += \
 	test-engine \
@@ -1351,6 +1385,8 @@ man/sd_is_socket_inet.3: man/sd_is_fifo.3
 man/sd_is_mq.3: man/sd_is_fifo.3
 man/sd_notifyf.3: man/sd_notify.3
 
+endif # ENABLE_SYSTEMD
+
 EXTRA_DIST += \
 	src/libsystemd-daemon/libsystemd-daemon.pc.in \
 	src/libsystemd-daemon/libsystemd-daemon.sym
@@ -1443,8 +1479,12 @@ udev-confdirs:
 
 INSTALL_DATA_HOOKS += udev-confdirs
 
+if ENABLE_SYSTEMD
+SYSTEMD_UDEV_RULES = rules/99-systemd.rules
+endif
+
 dist_udevrules_DATA += \
-	rules/99-systemd.rules \
+	$(SYSTEMD_UDEV_RULES) \
 	rules/42-usb-hid-pm.rules \
 	rules/50-udev-default.rules \
 	rules/60-persistent-storage-tape.rules \
@@ -1471,7 +1511,7 @@ EXTRA_DIST += \
 	src/udev/udev.pc.in
 
 CLEANFILES += \
-	rules/99-systemd.rules \
+	$(SYSTEMD_UDEV_RULES) \
 	src/udev/udev.pc
 
 EXTRA_DIST += \
@@ -1479,6 +1519,7 @@ EXTRA_DIST += \
 	units/systemd-udev-trigger.service.in \
 	units/systemd-udev-settle.service.in
 
+if ENABLE_SYSTEMD
 CLEANFILES += \
 	units/systemd-udev.service \
 	units/systemd-udev-trigger.service \
@@ -1493,6 +1534,7 @@ systemd-install-hook:
 	ln -sf ../systemd-udev-trigger.service $(DESTDIR)$(systemunitdir)/sysinit.target.wants/systemd-udev-trigger.service
 
 INSTALL_DATA_HOOKS += systemd-install-hook
+endif
 
 bin_PROGRAMS += \
 	udevadm
@@ -1731,9 +1773,12 @@ lib_LTLIBRARIES += libgudev-1.0.la
 pkgconfiglib_DATA += \
 	src/gudev/gudev-1.0.pc
 
+endif
+
 EXTRA_DIST += \
 	src/gudev/gudev-1.0.pc.in
 
+if ENABLE_GUDEV
 CLEANFILES += \
 	src/gudev/gudev-1.0.pc
 
@@ -1784,6 +1829,8 @@ libgudev_1_0_la_LDFLAGS = \
 	-export-dynamic -no-undefined \
 	-export-symbols-regex '^g_udev_.*'
 
+endif
+
 EXTRA_DIST += \
 	src/gudev/gudevmarshal.list \
 	src/gudev/gudevenumtypes.h.template \
@@ -1792,6 +1839,7 @@ EXTRA_DIST += \
 	src/gudev/seed-example-enum.js \
 	src/gudev/seed-example.js
 
+if ENABLE_GUDEV
 CLEANFILES += \
 	$(nodist_libgudev_1_0_la_SOURCES)
 
@@ -1910,10 +1958,14 @@ dist_udevhome_SCRIPTS = \
 TESTS += \
 	src/udev/keymap/check-keymaps.sh
 
+endif
+
 EXTRA_DIST += \
 	src/udev/keymap/check-keymaps.sh \
 	src/udev/keymap/keyboard-force-release.sh.in
 
+if ENABLE_KEYMAP
+
 CLEANFILES += \
 	$(nodist_keymap_SOURCES) \
 	src/udev/keymap/keys.txt \
@@ -2019,6 +2071,7 @@ dist_udevrules_DATA += \
 udevlibexec_PROGRAMS += \
 	mtd_probe
 
+if ENABLE_SYSTEMD
 # ------------------------------------------------------------------------------
 libsystemd_id128_la_SOURCES = \
 	src/libsystemd-id128/sd-id128.c
@@ -2077,10 +2130,14 @@ libsystemd-id128-uninstall-hook:
 UNINSTALL_EXEC_HOOKS += \
 	libsystemd-id128-uninstall-hook
 
+endif
+
 EXTRA_DIST += \
 	src/libsystemd-id128/libsystemd-id128.pc.in \
 	src/libsystemd-id128/libsystemd-id128.sym
 
+if ENABLE_SYSTEMD
+
 # ------------------------------------------------------------------------------
 systemd_journald_SOURCES = \
 	src/journal/journald.c \
@@ -2275,12 +2332,16 @@ journal-install-data-hook:
 INSTALL_DATA_HOOKS += \
 	journal-install-data-hook
 
+endif
+
 EXTRA_DIST += \
 	src/journal/libsystemd-journal.pc.in \
 	src/journal/libsystemd-journal.sym \
 	units/systemd-journald.service.in \
 	src/journal/journald-gperf.gperf
 
+if ENABLE_SYSTEMD
+
 CLEANFILES += \
 	src/journal/journald-gperf.c
 
@@ -2305,9 +2366,15 @@ rootlibexec_PROGRAMS += \
 sysctl_DATA = \
 	sysctl.d/coredump.conf
 
+endif # ENABLE_COREDUMP
+endif # ENABLE_SYSTEMD
+
 EXTRA_DIST += \
 	sysctl.d/coredump.conf.in
 
+if ENABLE_SYSTEMD
+if ENABLE_COREDUMP
+
 CLEANFILES += \
 	sysctl.d/coredump.conf
 endif
@@ -2353,9 +2420,13 @@ MANPAGES_ALIAS +=  \
 
 man/systemd-binfmt.8: man/systemd-binfmt.service.8
 
+endif
+endif # ENABLE_SYSTEMD
+
 EXTRA_DIST += \
 	units/systemd-binfmt.service.in
-endif
+
+if ENABLE_SYSTEMD
 
 # ------------------------------------------------------------------------------
 if ENABLE_VCONSOLE
@@ -2384,9 +2455,13 @@ INSTALL_DATA_HOOKS += \
 MANPAGES += \
 	man/vconsole.conf.5
 
+endif
+endif # ENABLE_SYSTEMD
+
 EXTRA_DIST += \
 	units/systemd-vconsole-setup.service.in
-endif
+
+if ENABLE_SYSTEMD
 
 # ------------------------------------------------------------------------------
 if ENABLE_READAHEAD
@@ -2425,15 +2500,19 @@ nodist_systemunit_DATA += \
 	units/systemd-readahead-replay.service \
 	units/systemd-readahead-done.service
 
+MANPAGES += \
+	man/sd_readahead.3 \
+	man/sd-readahead.7
+
+endif
+endif # ENABLE_SYSTEMD
+
 EXTRA_DIST += \
 	units/systemd-readahead-collect.service.in \
 	units/systemd-readahead-replay.service.in \
 	units/systemd-readahead-done.service.in
 
-MANPAGES += \
-	man/sd_readahead.3 \
-	man/sd-readahead.7
-endif
+if ENABLE_SYSTEMD
 
 # ------------------------------------------------------------------------------
 if ENABLE_QUOTACHECK
@@ -2443,15 +2522,19 @@ rootlibexec_PROGRAMS += \
 nodist_systemunit_DATA += \
 	units/quotacheck.service
 
-EXTRA_DIST += \
-	units/quotacheck.service.in
-
 systemd_quotacheck_SOURCES = \
 	src/quotacheck/quotacheck.c
 
 systemd_quotacheck_LDADD = \
 	libsystemd-shared.la
+
 endif
+endif # ENABLE_SYSTEMD
+
+EXTRA_DIST += \
+	units/quotacheck.service.in
+
+if ENABLE_SYSTEMD
 
 # ------------------------------------------------------------------------------
 if ENABLE_RANDOMSEED
@@ -2462,10 +2545,6 @@ nodist_systemunit_DATA += \
 	units/systemd-random-seed-save.service \
 	units/systemd-random-seed-load.service
 
-EXTRA_DIST += \
-	units/systemd-random-seed-save.service.in \
-	units/systemd-random-seed-load.service.in
-
 systemd_random_seed_SOURCES = \
 	src/random-seed/random-seed.c
 
@@ -2486,7 +2565,15 @@ randomseed-install-data-hook:
 
 INSTALL_DATA_HOOKS += \
 	randomseed-install-data-hook
+
 endif
+endif # ENABLE_SYSTEMD
+
+EXTRA_DIST += \
+	units/systemd-random-seed-save.service.in \
+	units/systemd-random-seed-load.service.in
+
+if ENABLE_SYSTEMD
 
 # ------------------------------------------------------------------------------
 if HAVE_LIBCRYPTSETUP
@@ -2556,9 +2643,6 @@ dist_dbuspolicy_DATA += \
 dist_dbussystemservice_DATA += \
 	src/hostname/org.freedesktop.hostname1.service
 
-polkitpolicy_in_files += \
-	src/hostname/org.freedesktop.hostname1.policy.in
-
 dbusinterface_DATA += \
 	org.freedesktop.hostname1.xml
 
@@ -2575,9 +2659,16 @@ hostnamed-install-data-hook:
 INSTALL_DATA_HOOKS += \
 	hostnamed-install-data-hook
 
+endif
+endif # ENABLE_SYSTEMD
+
+polkitpolicy_in_files += \
+	src/hostname/org.freedesktop.hostname1.policy.in
+
 EXTRA_DIST += \
 	units/systemd-hostnamed.service.in
-endif
+
+if ENABLE_SYSTEMD
 
 # ------------------------------------------------------------------------------
 if ENABLE_LOCALED
@@ -2606,9 +2697,6 @@ dist_dbuspolicy_DATA += \
 dist_dbussystemservice_DATA += \
 	src/locale/org.freedesktop.locale1.service
 
-polkitpolicy_in_files += \
-	src/locale/org.freedesktop.locale1.policy.in
-
 dbusinterface_DATA += \
 	org.freedesktop.locale1.xml
 
@@ -2625,9 +2713,6 @@ localed-install-data-hook:
 INSTALL_DATA_HOOKS += \
 	localed-install-data-hook
 
-EXTRA_DIST += \
-	units/systemd-localed.service.in
-
 dist_pkgdata_DATA = \
 	src/locale/kbd-model-map
 
@@ -2638,6 +2723,15 @@ update-kbd-model-map:
 	src/locale/generate-kbd-model-map > src/locale/kbd-model-map
 
 endif
+endif # ENABLE_SYSTEMD
+
+polkitpolicy_in_files += \
+	src/locale/org.freedesktop.locale1.policy.in
+
+EXTRA_DIST += \
+	units/systemd-localed.service.in
+
+if ENABLE_SYSTEMD
 
 # ------------------------------------------------------------------------------
 if ENABLE_TIMEDATED
@@ -2665,9 +2759,6 @@ dist_dbuspolicy_DATA += \
 nodist_systemunit_DATA += \
 	units/systemd-timedated.service
 
-polkitpolicy_in_files += \
-	src/timedate/org.freedesktop.timedate1.policy.in
-
 org.freedesktop.timedate1.xml: systemd-timedated
 	$(AM_V_GEN)$(LIBTOOL) --mode=execute $(OBJCOPY) -O binary -j introspect.timedate1 $< $@.tmp && \
 		$(STRINGS) $@.tmp | $(AWK) -f $(srcdir)/introspect.awk | \
@@ -2684,9 +2775,16 @@ timedated-install-data-hook:
 INSTALL_DATA_HOOKS += \
 	timedated-install-data-hook
 
+endif
+endif # ENABLE_SYSTEMD
+
+polkitpolicy_in_files += \
+	src/timedate/org.freedesktop.timedate1.policy.in
+
 EXTRA_DIST += \
 	units/systemd-timedated.service.in
-endif
+
+if ENABLE_SYSTEMD
 
 # ------------------------------------------------------------------------------
 if ENABLE_LOGIND
@@ -2882,9 +2980,6 @@ lib_LTLIBRARIES += \
 pkgconfiglib_DATA += \
 	src/login/libsystemd-login.pc
 
-polkitpolicy_in_files += \
-	src/login/org.freedesktop.login1.policy.in
-
 logind-install-data-hook:
 	$(MKDIR_P) -m 0755 \
 		$(DESTDIR)$(systemunitdir)/multi-user.target.wants \
@@ -2972,6 +3067,17 @@ man/sd_seat_can_multi_session.3: man/sd_seat_get_active.3
 man/sd_get_sessions.3: man/sd_get_seats.3
 man/sd_get_uids.3: man/sd_get_seats.3
 
+CLEANFILES += \
+	src/login/logind-gperf.c \
+	src/login/71-seat.rules \
+	src/login/73-seat-late.rules
+
+endif
+endif # ENABLE_SYSTEMD
+
+polkitpolicy_in_files += \
+	src/login/org.freedesktop.login1.policy.in
+
 EXTRA_DIST += \
 	src/login/logind-gperf.gperf \
 	src/login/libsystemd-login.pc.in \
@@ -2981,11 +3087,6 @@ EXTRA_DIST += \
 	units/systemd-logind.service.in \
 	units/systemd-user-sessions.service.in
 
-CLEANFILES += \
-	src/login/logind-gperf.c \
-	src/login/71-seat.rules \
-	src/login/73-seat-late.rules
-endif
 # ------------------------------------------------------------------------------
 
 SED_PROCESS = \
@@ -3057,9 +3158,13 @@ units/%: units/%.m4 Makefile
 units/user/%: units/%.m4 Makefile
 	$(M4_PROCESS_USER)
 
+if ENABLE_SYSTEMD
 nodist_polkitpolicy_DATA = \
 	$(polkitpolicy_in_files:.policy.in=.policy) \
 	$(polkitpolicy_in_in_files:.policy.in.in=.policy)
+else
+nodist_polkitpolicy_DATA =
+endif
 
 EXTRA_DIST += \
 	$(polkitpolicy_in_files) \
@@ -3115,6 +3220,8 @@ DBUS_PREPROCESS = $(CPP) -P $(DBUS_CFLAGS) -imacros dbus/dbus-protocol.h
 CLEANFILES += \
 	$(dbusinterface_DATA)
 
+if ENABLE_SYSTEMD
+
 systemd-install-data-hook:
 	$(MKDIR_P) -m 0755 \
 		$(DESTDIR)$(tmpfilesdir) \
@@ -3323,11 +3430,17 @@ if TARGET_MAGEIA
 		$(LN_S) $(systemunitdir)/display-manager.service display-manager.service )
 endif
 
+endif # ENABLE_SYSTEMD
+
 install-exec-hook: $(INSTALL_EXEC_HOOKS)
 
 uninstall-hook: $(UNINSTALL_EXEC_HOOKS)
 
-install-data-hook: systemd-install-data-hook $(INSTALL_DATA_HOOKS)
+if ENABLE_SYSTEMD
+SYSTEMD_INSTALL_DATA_HOOK = systemd-install-data-hook
+endif
+
+install-data-hook: $(SYSTEMD_INSTALL_DATA_HOOK) $(INSTALL_DATA_HOOKS)
 
 distclean-local: $(DISTCLEAN_LOCAL_HOOKS)
 
diff --git a/configure.ac b/configure.ac
index a4f9fea..bf825bd 100644
--- a/configure.ac
+++ b/configure.ac
@@ -44,8 +44,23 @@ AS_IF([test "x$host_cpu" = "xmips" || test "x$host_cpu" = "xmipsel" ||
 LT_PREREQ(2.2)
 LT_INIT
 
+dnl Figure out if we want a udev-only build early.  Inverted logic to match
+dnl autoconf expectations (passing --enable-foo should only ever turn something
+dnl on, never turn something off).
+AC_ARG_ENABLE([systemd],
+              [AS_HELP_STRING([--disable-systemd],
+                              [build udevd only, not systemd @<:@default: systemd enabled@:>@])],
+              [enable_systemd=$enableval], [enable_systemd=yes])
+
+dnl Anything other than --disable-systemd means "yes, build systemd as well"
+AS_IF([test "x$enable_systemd" != "xno"], [enable_systemd=yes])
+
+AM_CONDITIONAL([ENABLE_SYSTEMD], [test "x$enable_systemd" = "xyes"])
+
 # i18n stuff for the PolicyKit policy files
+AS_IF([test "x$enable_systemd" = "xyes"], [
 IT_PROG_INTLTOOL([0.40.0])
+])
 
 GETTEXT_PACKAGE=systemd
 AC_SUBST(GETTEXT_PACKAGE)
@@ -61,7 +76,9 @@ AC_PROG_CC_C99
 AM_PROG_CC_C_O
 AC_PROG_GCC_TRADITIONAL
 
+AS_IF([test "x$enable_systemd" = "xyes"], [
 AC_PATH_PROG([M4], [m4])
+])
 
 # gtkdocize greps for '^GTK_DOC_CHECK', so it needs to be on its own line
 m4_ifdef([GTK_DOC_CHECK], [
@@ -75,7 +92,7 @@ GOBJECT_INTROSPECTION_CHECK([1.31.1])
 AC_CHECK_TOOL(OBJCOPY, objcopy)
 AC_CHECK_TOOL(STRINGS, strings)
 AC_CHECK_TOOL(GPERF, gperf)
-if test -z "$GPERF" ; then
+if test -z "$GPERF" && test "x$enable_systemd" = "xyes" ; then
         AC_MSG_ERROR([*** gperf not found])
 fi
 
@@ -132,6 +149,7 @@ AC_SUBST([GCLDFLAGS], $with_ldflags)
 AC_SEARCH_LIBS([clock_gettime], [rt], [], [AC_MSG_ERROR([*** POSIX RT library not found])])
 AC_SEARCH_LIBS([dlsym], [dl], [], [AC_MSG_ERROR([*** Dynamic linking loader library not found])])
 
+AS_IF([test "x$enable_systemd" = "xyes"], [
 save_LIBS="$LIBS"
 LIBS=
 AC_SEARCH_LIBS([cap_init], [cap], [], [AC_MSG_ERROR([*** POSIX caps library not found])])
@@ -139,11 +157,14 @@ AC_CHECK_HEADERS([sys/capability.h], [], [AC_MSG_ERROR([*** POSIX caps headers n
 CAP_LIBS="$LIBS"
 LIBS="$save_LIBS"
 AC_SUBST(CAP_LIBS)
+])
 
 # This makes sure pkg.m4 is available.
 m4_pattern_forbid([^_?PKG_[A-Z_]+$],[*** pkg.m4 missing, please install pkg-config])
 
+AS_IF([test "x$enable_systemd" = "xyes"], [
 PKG_CHECK_MODULES(DBUS, [dbus-1 >= 1.3.2])
+])
 PKG_CHECK_MODULES(KMOD, [libkmod >= 5])
 PKG_CHECK_MODULES(BLKID,[blkid >= 2.20])
 
@@ -655,22 +676,22 @@ AM_CONDITIONAL(HAVE_SYSV_COMPAT, test "$SYSTEM_SYSV_COMPAT" = "yes")
 AC_ARG_WITH([dbuspolicydir],
         AS_HELP_STRING([--with-dbuspolicydir=DIR], [D-Bus policy directory]),
         [],
-        [with_dbuspolicydir=`pkg-config --variable=sysconfdir dbus-1`/dbus-1/system.d])
+        [AS_IF([test "x$enable_systemd" = "xyes"], [with_dbuspolicydir=`pkg-config --variable=sysconfdir dbus-1`/dbus-1/system.d])])
 
 AC_ARG_WITH([dbussessionservicedir],
         AS_HELP_STRING([--with-dbussessionservicedir=DIR], [D-Bus session service directory]),
         [],
-        [with_dbussessionservicedir=`pkg-config --variable=session_bus_services_dir dbus-1`])
+        [AS_IF([test "x$enable_systemd" = "xyes"], [with_dbussessionservicedir=`pkg-config --variable=session_bus_services_dir dbus-1`])])
 
 AC_ARG_WITH([dbussystemservicedir],
         AS_HELP_STRING([--with-dbussystemservicedir=DIR], [D-Bus system service directory]),
         [],
-        [with_dbussystemservicedir=`pkg-config --variable=session_bus_services_dir dbus-1`/../system-services])
+        [AS_IF([test "x$enable_systemd" = "xyes"], [with_dbussystemservicedir=`pkg-config --variable=session_bus_services_dir dbus-1`/../system-services])])
 
 AC_ARG_WITH([dbusinterfacedir],
         AS_HELP_STRING([--with-dbusinterfacedir=DIR], [D-Bus interface directory]),
         [],
-        [with_dbusinterfacedir=`pkg-config --variable=session_bus_services_dir dbus-1`/../interfaces])
+        [AS_IF([test "x$enable_systemd" = "xyes"], [with_dbusinterfacedir=`pkg-config --variable=session_bus_services_dir dbus-1`/../interfaces])])
 
 AC_ARG_WITH([rootprefix],
         AS_HELP_STRING([--with-rootprefix=DIR], [rootfs directory prefix for config files and kernel modules]),
@@ -684,7 +705,7 @@ AC_ARG_WITH([rootlibdir],
 AC_ARG_WITH([pamlibdir],
         AS_HELP_STRING([--with-pamlibdir=DIR], [Directory for PAM modules]),
         [],
-        [with_pamlibdir=${with_rootlibdir}/security])
+        [AS_IF([test "x$enable_systemd" = "xyes"], [with_pamlibdir=${with_rootlibdir}/security])])
 
 AC_ARG_ENABLE([split-usr],
         AS_HELP_STRING([--enable-split-usr], [Assume that /bin, /sbin aren\'t symlinks into /usr]),

^ permalink raw reply related	[flat|nested] 19+ messages in thread

* Re: [PATCH] Allow disabling the build of all of systemd, leaving just udev
  2012-06-02  6:56 [PATCH] Allow disabling the build of all of systemd, leaving just udev Bryan Kadzban
                   ` (2 preceding siblings ...)
  2012-06-03 21:21 ` Bryan Kadzban
@ 2012-06-03 21:22 ` William Hubbs
  2012-06-03 22:00 ` Bryan Kadzban
                   ` (13 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: William Hubbs @ 2012-06-03 21:22 UTC (permalink / raw)
  To: linux-hotplug

[-- Attachment #1: Type: text/plain, Size: 2131 bytes --]

On Sun, Jun 03, 2012 at 09:55:55AM -0700, Bryan Kadzban wrote:
> William Hubbs wrote:
> > this looks good to me, but there are still pieces being installed
> > which should not be installed for a udev-only build afaik.
> > 
> > You might want to look at removing those also.
> 
> Which pieces?
> 
> The only things that get installed in my case are the rules, udev.conf,
> systemd-udevd, udevadm, the helper binaries, the manpages, libudev, the
> udev and libudev pkg-config files, and stuff in /usr/share/doc.  Though
> I do use a lot of the existing ./configure knobs to turn other systemd
> things off; maybe that's related.

Maybe it is, because I get the following things that would also be
installed:

etc/bash_completion.d
etc/systemd
usr/include/systemd
usr/lib/sysctl.d
usr/lib/systemd/system-generators
usr/lib/systemd/user
usr/share/man/man1
usr/share/man/man3
usr/share/man/man5
usr/share/polkit-1
usr/share/polkit-1/actions
usr/share/systemd

> Unless you mean the directories that are getting created, as in the
> previous message -- but I don't see a way to stop automake from doing
> that.  Well, other than setting them to nothing in the Makefile.am if
> !ENABLE_SYSTEMD; duh, I should have done that.  But that still seems a
> bit cosmetic to me.
 
 Yes, I am referring to empty directories and I can see how you might
 see it as cosmetic, but would you consider not creating the
 directories?

> (One thing I need to do today is fix this so that "make distdir" works
> even with --disable-systemd.  Should be able to pull the EXTRA_DIST
> stuff out of the conditionals to do that.  So I'll probably look into
> setting these directories to nothing in that case as well.)

Ok, that may do it.

One more thing though, thinking about it, is that we will need the
systemd-tmpfiles tool because udev is not going to support the
/lib/udev/devices directory any longer for creating custom devices, so
you might want to still build and install all of the parts of that for a
standalone udev build if doing so doesn't bring in more dependencies.

Thanks,

William

[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH] Allow disabling the build of all of systemd, leaving just udev
  2012-06-02  6:56 [PATCH] Allow disabling the build of all of systemd, leaving just udev Bryan Kadzban
                   ` (3 preceding siblings ...)
  2012-06-03 21:22 ` William Hubbs
@ 2012-06-03 22:00 ` Bryan Kadzban
  2012-06-04  1:50 ` William Hubbs
                   ` (12 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: Bryan Kadzban @ 2012-06-03 22:00 UTC (permalink / raw)
  To: linux-hotplug

William Hubbs wrote:
> On Sun, Jun 03, 2012 at 09:55:55AM -0700, Bryan Kadzban wrote:
>> Which pieces?
> 
> etc/bash_completion.d
> etc/systemd
> usr/include/systemd
> usr/lib/sysctl.d
> usr/lib/systemd/system-generators
> usr/lib/systemd/user
> usr/share/man/man1
> usr/share/man/man3
> usr/share/man/man5
> usr/share/polkit-1
> usr/share/polkit-1/actions
> usr/share/systemd

Those are all the empty directories that a newer automake will get rid
of, except two. You can suppress those at install time with:

make pkgincludedir= pkgsysconfdir= install

I can't fix pkgincludedir without warnings from automake (since it's
unconditionally set to $(includedir)/$(PACKAGE), and overriding it in
different branches of a conditional generates warnings), so I didn't fix
either of them.

> One more thing though, thinking about it, is that we will need the
> systemd-tmpfiles tool because udev is not going to support the
> /lib/udev/devices directory any longer for creating custom devices, so
> you might want to still build and install all of the parts of that for a
> standalone udev build if doing so doesn't bring in more dependencies.

I'd rather not replace "cp -a /lib/udev/devices/* /dev" in a boot script
with a binary that nothing else uses, plus its configuration (which
doesn't use nodes in /lib/udev/devices like what has been the udev ABI
for *years*, but instead uses a list of device descriptions), plus any
systemd-level libraries it may or may not need in the future.

If a system is already running systemd, then systemd-tmpfiles may or may
not be the best place to do this (the ABI change is a problem for those
systems, unless I'm missing something in the *tmpfiles* manpages). But
if systemd is not running, then sticking to the previous ABI explicitly
is the right way to go I think.

(Previously, packages could dump a device node into /lib/udev/devices
and it would show up on every boot. Now, they have to describe the
device node and dump a file into $(tmpfilesdir), wherever that happens
to be. This is obviously an interface change.)

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH] Allow disabling the build of all of systemd, leaving just udev
  2012-06-02  6:56 [PATCH] Allow disabling the build of all of systemd, leaving just udev Bryan Kadzban
                   ` (4 preceding siblings ...)
  2012-06-03 22:00 ` Bryan Kadzban
@ 2012-06-04  1:50 ` William Hubbs
  2012-06-04  2:13 ` Bryan Kadzban
                   ` (11 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: William Hubbs @ 2012-06-04  1:50 UTC (permalink / raw)
  To: linux-hotplug

[-- Attachment #1: Type: text/plain, Size: 1568 bytes --]

On Sun, Jun 03, 2012 at 03:00:27PM -0700, Bryan Kadzban wrote:
> > One more thing though, thinking about it, is that we will need the
> > systemd-tmpfiles tool because udev is not going to support the
> > /lib/udev/devices directory any longer for creating custom devices, so
> > you might want to still build and install all of the parts of that for a
> > standalone udev build if doing so doesn't bring in more dependencies.
> 
> I'd rather not replace "cp -a /lib/udev/devices/* /dev" in a boot script
> with a binary that nothing else uses, plus its configuration (which
> doesn't use nodes in /lib/udev/devices like what has been the udev ABI
> for *years*, but instead uses a list of device descriptions), plus any
> systemd-level libraries it may or may not need in the future.

Actually other things could use it because of /tmp and /run and
creating/removing files/directories there on bootup.

> If a system is already running systemd, then systemd-tmpfiles may or may
> not be the best place to do this (the ABI change is a problem for those
> systems, unless I'm missing something in the *tmpfiles* manpages). But
> if systemd is not running, then sticking to the previous ABI explicitly
> is the right way to go I think.

Unless you don't have a previous abi. Gentoo relies on udev copying
things from /lib/udev/devices, which is gone with this version of udev,
so we need the new abi.

So, how about an extra switch --enable-tmpfiles-d that will toggle on or
off whether that is built on a standalone udev build?

William


[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH] Allow disabling the build of all of systemd, leaving just udev
  2012-06-02  6:56 [PATCH] Allow disabling the build of all of systemd, leaving just udev Bryan Kadzban
                   ` (5 preceding siblings ...)
  2012-06-04  1:50 ` William Hubbs
@ 2012-06-04  2:13 ` Bryan Kadzban
  2012-06-04 18:51 ` William Hubbs
                   ` (10 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: Bryan Kadzban @ 2012-06-04  2:13 UTC (permalink / raw)
  To: linux-hotplug

William Hubbs wrote:
> On Sun, Jun 03, 2012 at 03:00:27PM -0700, Bryan Kadzban wrote:
>> I'd rather not replace "cp -a /lib/udev/devices/* /dev" in a boot
>> script with a binary that nothing else uses, plus its configuration
>> (which doesn't use nodes in /lib/udev/devices like what has been
>> the udev ABI for *years*, but instead uses a list of device
>> descriptions), plus any systemd-level libraries it may or may not
>> need in the future.
> 
> Actually other things could use it because of /tmp and /run and 
> creating/removing files/directories there on bootup.

Possibly, but the full functionality will require systemd anyway.  The
program still has to be run by something; simply installing it won't do
anything useful.  Plus it will have to depend on having mounted the
various temporary filesystems that it changes.

>> If a system is already running systemd, then systemd-tmpfiles may
>> or may not be the best place to do this (the ABI change is a
>> problem for those systems, unless I'm missing something in the
>> *tmpfiles* manpages). But if systemd is not running, then sticking
>> to the previous ABI explicitly is the right way to go I think.
> 
> Unless you don't have a previous abi.

Except that udev-182 and earlier *provided* an ABI.  "Put files in
/lib/udev/devices and they'll be copied to /dev at boot time" was the
rule, just like "put programs in /lib/udev and refer to them in rules
you install with IMPORT{program}="" or RUN+="" without a path" was the
rule.

Now that rule has apparently been changed, so programs are going to have
to expend effort coping.  Unless I'm missing some functionality of
systemd-tmpfiles when I read the docs.

> Gentoo relies on udev copying things from /lib/udev/devices, which is
> gone with this version of udev, so we need the new abi.

I think you need something in the bootscripts somewhere that implements
the *old* ABI.  Adding a line to the udev start script that does the
copy will give you that.

Building and installing systemd-tmpfiles will not, unless you also add a
bootscript that runs it.  But then you also need to add configuration
files for it, and teach all the other programs that your users want to
run how to adapt to using the new configuration instead of the old
static tree.

(See man/tmpfiles.d.xml for the docs I'm looking at.  There is no way to
describe "copy this tree over to this other root", only "create this
file", "write this data to this file", "create this character device",
"create this block device", "delete this file", etc.)

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH] Allow disabling the build of all of systemd, leaving just udev
  2012-06-02  6:56 [PATCH] Allow disabling the build of all of systemd, leaving just udev Bryan Kadzban
                   ` (6 preceding siblings ...)
  2012-06-04  2:13 ` Bryan Kadzban
@ 2012-06-04 18:51 ` William Hubbs
  2012-06-05  3:10 ` Bryan Kadzban
                   ` (9 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: William Hubbs @ 2012-06-04 18:51 UTC (permalink / raw)
  To: linux-hotplug

[-- Attachment #1: Type: text/plain, Size: 2845 bytes --]

On Sun, Jun 03, 2012 at 07:13:03PM -0700, Bryan Kadzban wrote:
> William Hubbs wrote:
> > On Sun, Jun 03, 2012 at 03:00:27PM -0700, Bryan Kadzban wrote:
> >> I'd rather not replace "cp -a /lib/udev/devices/* /dev" in a boot
> >> script with a binary that nothing else uses, plus its configuration
> >> (which doesn't use nodes in /lib/udev/devices like what has been
> >> the udev ABI for *years*, but instead uses a list of device
> >> descriptions), plus any systemd-level libraries it may or may not
> >> need in the future.
> > 
> > Actually other things could use it because of /tmp and /run and 
> > creating/removing files/directories there on bootup.
> 
> Possibly, but the full functionality will require systemd anyway.  The
> program still has to be run by something; simply installing it won't do
> anything useful.  Plus it will have to depend on having mounted the
> various temporary filesystems that it changes.

I agree that just installing it does nothing. But, it can be run at the
appropriate time by your boot scripts, so the other concerns you mention
here would be taken care of that way.

> >> If a system is already running systemd, then systemd-tmpfiles may
> >> or may not be the best place to do this (the ABI change is a
> >> problem for those systems, unless I'm missing something in the
> >> *tmpfiles* manpages). But if systemd is not running, then sticking
> >> to the previous ABI explicitly is the right way to go I think.
> > 
> > Unless you don't have a previous abi.
> 
> Except that udev-182 and earlier *provided* an ABI.  "Put files in
> /lib/udev/devices and they'll be copied to /dev at boot time" was the
> rule, just like "put programs in /lib/udev and refer to them in rules
> you install with IMPORT{program}="" or RUN+="" without a path" was the
> rule.
>
> Now that rule has apparently been changed, so programs are going to have
> to expend effort coping.  Unless I'm missing some functionality of
> systemd-tmpfiles when I read the docs.

It has definitely been changed. See the systemd NEWS file. That is
exactly why I think we need the systemd-tmpfiles executable and man
page.

There are several tools in the systemd build that can be used on
non-systemd systems. Maybe those don't belong as part of the udev
ebuild, but as a separate --enable/--disable-tools switch or something
like that.

> > Gentoo relies on udev copying things from /lib/udev/devices, which is
> > gone with this version of udev, so we need the new abi.
> 
> I think you need something in the bootscripts somewhere that implements
> the *old* ABI.  Adding a line to the udev start script that does the
> copy will give you that.

Also it will allow users to copy any kind of file they please into /dev,
just by putting it in /usr/lib/udev/devices.

William


[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH] Allow disabling the build of all of systemd, leaving just udev
  2012-06-02  6:56 [PATCH] Allow disabling the build of all of systemd, leaving just udev Bryan Kadzban
                   ` (7 preceding siblings ...)
  2012-06-04 18:51 ` William Hubbs
@ 2012-06-05  3:10 ` Bryan Kadzban
  2012-06-05 17:56 ` William Hubbs
                   ` (8 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: Bryan Kadzban @ 2012-06-05  3:10 UTC (permalink / raw)
  To: linux-hotplug

William Hubbs wrote:
> On Sun, Jun 03, 2012 at 07:13:03PM -0700, Bryan Kadzban wrote:
>> William Hubbs wrote:
>>> Actually other things could use it because of /tmp and /run and 
>>> creating/removing files/directories there on bootup.
>> Possibly, but the full functionality will require systemd anyway.
>> The program still has to be run by something; simply installing it
>> won't do anything useful.  Plus it will have to depend on having
>> mounted the various temporary filesystems that it changes.
> 
> I agree that just installing it does nothing. But, it can be run at
> the appropriate time by your boot scripts, so the other concerns you
> mention here would be taken care of that way.

Why put effort into bootscripts that run a random other tool, when
instead we can resurrect the single line cp from a few years back?

It's somewhat annoying that we have to do anything, but that's what happens.

>> Except that udev-182 and earlier *provided* an ABI.  "Put files in 
>> /lib/udev/devices and they'll be copied to /dev at boot time" was
>> the rule, just like "put programs in /lib/udev and refer to them in
>> rules you install with IMPORT{program}="" or RUN+="" without a
>> path" was the rule.
>> 
>> Now that rule has apparently been changed, so programs are going to
>> have to expend effort coping.  Unless I'm missing some
>> functionality of systemd-tmpfiles when I read the docs.
> 
> It has definitely been changed. See the systemd NEWS file. That is 
> exactly why I think we need the systemd-tmpfiles executable and man 
> page.

But see, the thing about ABIs is that they're not supposed to change.

What I will be doing in my own bootscripts is adding back the
single-line copy, to allow programs that are still using the old
interface to continue to work.  (Like old versions of the nvidia driver,
which dumped the nvidia0 / nvidia1 / nvidiactl character device files in
that directory, when they couldn't use the sysfs class functions in the
kernel directly.  It's been a while since that was happening, of
course.)

If you want to try to get systemd-tmpfiles to work, and figure out which
extra dependencies are needed (like, oh for instance, selinux or
libcap), feel free; that patch shouldn't be too hard to apply on top of
this one, if this gets committed.

>>> Gentoo relies on udev copying things from /lib/udev/devices,
>>> which is gone with this version of udev, so we need the new abi.
>> I think you need something in the bootscripts somewhere that
>> implements the *old* ABI.  Adding a line to the udev start script
>> that does the copy will give you that.
> 
> Also it will allow users to copy any kind of file they please into
> /dev, just by putting it in /usr/lib/udev/devices.

Well, /lib/udev/devices; there is no such thing as /usr/lib/udev unless
you're also buying into merging /usr, which I'm not yet.  And if your
system build has done it, then /lib/udev/devices will continue to work
as well.  That's the (previously-)accepted path.

But ignoring that -- yes, exactly, good point.  Some software (sysvinit,
sysklogd, gpm) puts named pipes or sockets in /dev -- although they do
it without support from the udev bootscript, so not supporting those
files would be OK for them.  I don't know what's running in the wild
that has relied on this behavior in the past, though.

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH] Allow disabling the build of all of systemd, leaving just udev
  2012-06-02  6:56 [PATCH] Allow disabling the build of all of systemd, leaving just udev Bryan Kadzban
                   ` (8 preceding siblings ...)
  2012-06-05  3:10 ` Bryan Kadzban
@ 2012-06-05 17:56 ` William Hubbs
  2012-06-06  3:45 ` Bryan Kadzban
                   ` (7 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: William Hubbs @ 2012-06-05 17:56 UTC (permalink / raw)
  To: linux-hotplug

[-- Attachment #1: Type: text/plain, Size: 806 bytes --]

Hi Bryan,

On Mon, Jun 04, 2012 at 08:10:28PM -0700, Bryan Kadzban wrote:
> If you want to try to get systemd-tmpfiles to work, and figure out which
> extra dependencies are needed (like, oh for instance, selinux or
> libcap), feel free; that patch shouldn't be too hard to apply on top of
> this one, if this gets committed.
 
 I spoke with Kay on irc, and he expressed doubts that it will be
 committed. However, I did get another suggestion from one of the guys
 there.

 Automake supports includes, so it would be good to break up Makefile.am
 into several modules. That way it would be easy to include them based
 on condissionals.

 I have started breaking things apart, but if you want, I can send you
 the patch as I have it so far and we can collaborate on it. :-)

 William


[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH] Allow disabling the build of all of systemd, leaving just udev
  2012-06-02  6:56 [PATCH] Allow disabling the build of all of systemd, leaving just udev Bryan Kadzban
                   ` (9 preceding siblings ...)
  2012-06-05 17:56 ` William Hubbs
@ 2012-06-06  3:45 ` Bryan Kadzban
  2012-06-06  4:23 ` Bruce Dubbs
                   ` (6 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: Bryan Kadzban @ 2012-06-06  3:45 UTC (permalink / raw)
  To: linux-hotplug

William Hubbs wrote:
> I spoke with Kay on irc, and he expressed doubts that it will be 
> committed.

Not being terribly inclined to set up an IRC client, were there any
issues with the patch itself?  Or does he just not like the idea at all
for some reason?  (Er, Kay?  Maybe I should ask you directly.  :-) )

> However, I did get another suggestion from one of the guys there.
> 
> Automake supports includes, so it would be good to break up 
> Makefile.am into several modules. That way it would be easy to 
> include them based on condissionals.
> 
> I have started breaking things apart, but if you want, I can send you
> the patch as I have it so far and we can collaborate on it. :-)

Sure, we can start poking at it off-list.  Though I don't have more than
a few hours a day to put into it.  :-)

(That does sound like a lot less-invasive of a change, once the files
are split.)

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH] Allow disabling the build of all of systemd, leaving just udev
  2012-06-02  6:56 [PATCH] Allow disabling the build of all of systemd, leaving just udev Bryan Kadzban
                   ` (10 preceding siblings ...)
  2012-06-06  3:45 ` Bryan Kadzban
@ 2012-06-06  4:23 ` Bruce Dubbs
  2012-06-06 12:38 ` Dan Nicholson
                   ` (5 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: Bruce Dubbs @ 2012-06-06  4:23 UTC (permalink / raw)
  To: linux-hotplug

Bryan Kadzban wrote:
> William Hubbs wrote:
>> I spoke with Kay on irc, and he expressed doubts that it will be 
>> committed.
> 
> Not being terribly inclined to set up an IRC client, were there any
> issues with the patch itself?  Or does he just not like the idea at all
> for some reason?  (Er, Kay?  Maybe I should ask you directly.  :-) )
> 
>> However, I did get another suggestion from one of the guys there.
>>
>> Automake supports includes, so it would be good to break up 
>> Makefile.am into several modules. That way it would be easy to 
>> include them based on condissionals.
>>
>> I have started breaking things apart, but if you want, I can send you
>> the patch as I have it so far and we can collaborate on it. :-)

I'm interested in this too.  However, I'm not sure what you are 
referring to when you mention modules.  Do you mean the automake 
instruction 'include'?

The problem with udev as it's currently embedded in systemd is that the 
udev programs require several systemd .c utility programs, although they 
all build without the problematic libraries required by systemd 
(intltool, d-bus, etc).  These object files could be combined into each 
of the udev programs without problems, but I'm having a problem 
understanding the concept of what is acceptable.

AFAICT, there still needs to be a change to configure.ac to optionally 
avoid all the extras that systemd needs.  That seems to be where to 
start, but we need support from upstream to get these changes into the 
main distribution.

   -- Bruce

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH] Allow disabling the build of all of systemd, leaving just udev
  2012-06-02  6:56 [PATCH] Allow disabling the build of all of systemd, leaving just udev Bryan Kadzban
                   ` (11 preceding siblings ...)
  2012-06-06  4:23 ` Bruce Dubbs
@ 2012-06-06 12:38 ` Dan Nicholson
  2012-06-06 16:52 ` William Hubbs
                   ` (4 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: Dan Nicholson @ 2012-06-06 12:38 UTC (permalink / raw)
  To: linux-hotplug

On Tue, Jun 5, 2012 at 10:56 AM, William Hubbs <w.d.hubbs@gmail.com> wrote:
> Hi Bryan,
>
> On Mon, Jun 04, 2012 at 08:10:28PM -0700, Bryan Kadzban wrote:
>> If you want to try to get systemd-tmpfiles to work, and figure out which
>> extra dependencies are needed (like, oh for instance, selinux or
>> libcap), feel free; that patch shouldn't be too hard to apply on top of
>> this one, if this gets committed.
>
>  I spoke with Kay on irc, and he expressed doubts that it will be
>  committed. However, I did get another suggestion from one of the guys
>  there.
>
>  Automake supports includes, so it would be good to break up Makefile.am
>  into several modules. That way it would be easy to include them based
>  on condissionals.

Breaking up the Makefile.am into several files is probably cleaner,
but it doesn't actually change the problem you're trying to solve
here. You still have to wrap large parts of the build in
AM_CONDITIONALs. That doesn't change whether it's in one file or many.
The include happens at automake time, not build time, so conditionally
including the file won't do anything different for you. Everything
will get merge into the toplevel Makefile.in.

--
Dan

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH] Allow disabling the build of all of systemd, leaving just udev
  2012-06-02  6:56 [PATCH] Allow disabling the build of all of systemd, leaving just udev Bryan Kadzban
                   ` (12 preceding siblings ...)
  2012-06-06 12:38 ` Dan Nicholson
@ 2012-06-06 16:52 ` William Hubbs
  2012-06-06 17:15 ` William Hubbs
                   ` (3 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: William Hubbs @ 2012-06-06 16:52 UTC (permalink / raw)
  To: linux-hotplug

[-- Attachment #1: Type: text/plain, Size: 1603 bytes --]

On Tue, Jun 05, 2012 at 11:23:47PM -0500, Bruce Dubbs wrote:
> Bryan Kadzban wrote:
> > William Hubbs wrote:
> >> I spoke with Kay on irc, and he expressed doubts that it will be 
> >> committed.
> > 
> > Not being terribly inclined to set up an IRC client, were there any
> > issues with the patch itself?  Or does he just not like the idea at all
> > for some reason?  (Er, Kay?  Maybe I should ask you directly.  :-) )
> > 
> >> However, I did get another suggestion from one of the guys there.
> >>
> >> Automake supports includes, so it would be good to break up 
> >> Makefile.am into several modules. That way it would be easy to 
> >> include them based on condissionals.
> >>
> >> I have started breaking things apart, but if you want, I can send you
> >> the patch as I have it so far and we can collaborate on it. :-)
> 
> I'm interested in this too.  However, I'm not sure what you are 
> referring to when you mention modules.  Do you mean the automake 
> instruction 'include'?

Yes, that's correct. I am thinking we can break up the makefile using
includes then include them based on configure switches.

> AFAICT, there still needs to be a change to configure.ac to optionally 
> avoid all the extras that systemd needs.  That seems to be where to 
> start, but we need support from upstream to get these changes into the 
> main distribution.

Yes, there will also be changes to configure.ac as well to make this
work.

My thought is to make the makefile use includes as the first stage of
this then work on the changes to configure.ac.

William


[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH] Allow disabling the build of all of systemd, leaving just udev
  2012-06-02  6:56 [PATCH] Allow disabling the build of all of systemd, leaving just udev Bryan Kadzban
                   ` (13 preceding siblings ...)
  2012-06-06 16:52 ` William Hubbs
@ 2012-06-06 17:15 ` William Hubbs
  2012-06-06 18:51 ` Bruce Dubbs
                   ` (2 subsequent siblings)
  17 siblings, 0 replies; 19+ messages in thread
From: William Hubbs @ 2012-06-06 17:15 UTC (permalink / raw)
  To: linux-hotplug

[-- Attachment #1: Type: text/plain, Size: 1459 bytes --]

On Wed, Jun 06, 2012 at 05:38:29AM -0700, Dan Nicholson wrote:
> Breaking up the Makefile.am into several files is probably cleaner,
> but it doesn't actually change the problem you're trying to solve
> here. You still have to wrap large parts of the build in
> AM_CONDITIONALs. That doesn't change whether it's in one file or many.
> The include happens at automake time, not build time, so conditionally
> including the file won't do anything different for you. Everything
> will get merge into the toplevel Makefile.in.

If the am_condissionals are controlled by configure switches, we can set
things up so that the packager or user who is building udev or systemd
has control over what gets built. If they want to build udev only, or
systemd, or just the tools in the distribution that don't require
systemd, they will be able to.

This is where I want to go once we have the Makefile broken up. This
will also require some work in configure.ac, but I think it will be
worth that because it will give packagers the flexability to build what
they want.

include Makefile-shared.am
if ENABLE_UDEV
include Makefile-udev.am
endif
if ENABLE_TOOLS
include Makefile-tools.am
endif
if ENABLE_SYSTEMD
include Makefile-systemd.am
endif

The first stage of this will be breaking up Makefile.am and using
includes without condissionals. Once everything builds cleanly in that
setup, we can  do the work in configure.ac and add condissionals to
Makefile.am.

William


[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH] Allow disabling the build of all of systemd, leaving just udev
  2012-06-02  6:56 [PATCH] Allow disabling the build of all of systemd, leaving just udev Bryan Kadzban
                   ` (14 preceding siblings ...)
  2012-06-06 17:15 ` William Hubbs
@ 2012-06-06 18:51 ` Bruce Dubbs
  2012-06-06 22:53 ` William Hubbs
  2012-06-07 13:34 ` Dan Nicholson
  17 siblings, 0 replies; 19+ messages in thread
From: Bruce Dubbs @ 2012-06-06 18:51 UTC (permalink / raw)
  To: linux-hotplug

William Hubbs wrote:

> This is where I want to go once we have the Makefile broken up. This
> will also require some work in configure.ac, but I think it will be
> worth that because it will give packagers the flexability to build what
> they want.
> 
> include Makefile-shared.am
> if ENABLE_UDEV
> include Makefile-udev.am
> endif
> if ENABLE_TOOLS
> include Makefile-tools.am
> endif
> if ENABLE_SYSTEMD
> include Makefile-systemd.am
> endif

With this type of setup, ENABLE_SYSTEMD must imply ENABLE_TOOLS and 
ENABLE_UDEV.

> The first stage of this will be breaking up Makefile.am and using
> includes without condissionals. Once everything builds cleanly in that
> setup, we can  do the work in configure.ac and add condissionals to
> Makefile.am.

The first thing that will have to be done is to break up 
libsystemd_shared_la_SOURCES in Makefile.am.  That definition combines 
files incompatible with udev-only with files required by udev.  udev needs:

log
label
mkdir
cgroup-util
strv
path-util
conf-files
hashmap
set
exit-status
util
dev-setup

but does not need:

cgroup-show
conf-parser
hwclock
pager
ratelimit
socket-util
spawn-ask-password-agent
spawn-polkit-agent
specifier
utf8
virt
watchdog

Basically all of the above are combined into libsystemd-core.la and that 
needs to be split into two.  I'd just split the first group into 
libudev-core.la.

To link, udev also needs the file in libsystemd_daemon_la_SOURCES 
(sd-daumon) for udevd, but that probably could be removed with some 
appropriate ifdefs in udevd.c.

   -- Bruce

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH] Allow disabling the build of all of systemd, leaving just udev
  2012-06-02  6:56 [PATCH] Allow disabling the build of all of systemd, leaving just udev Bryan Kadzban
                   ` (15 preceding siblings ...)
  2012-06-06 18:51 ` Bruce Dubbs
@ 2012-06-06 22:53 ` William Hubbs
  2012-06-07 13:34 ` Dan Nicholson
  17 siblings, 0 replies; 19+ messages in thread
From: William Hubbs @ 2012-06-06 22:53 UTC (permalink / raw)
  To: linux-hotplug

[-- Attachment #1: Type: text/plain, Size: 1919 bytes --]

On Wed, Jun 06, 2012 at 01:51:05PM -0500, Bruce Dubbs wrote:
> William Hubbs wrote:
> 
> With this type of setup, ENABLE_SYSTEMD must imply ENABLE_TOOLS and 
> ENABLE_UDEV.

What I want is for all of the enable_* options to be true by default so
that we don't affect the result of the build unless a packager requests
it by disabling portions.

My goal for the tools option is to find the things in the distribution
that can be useful whether or not your distro is using systemd and set
up so you can build those separately from systemd and udev if you aren't
quite ready to make the jump to systemd.

> The first thing that will have to be done is to break up 
> libsystemd_shared_la_SOURCES in Makefile.am.  That definition combines 
> files incompatible with udev-only with files required by udev.  udev needs:
> 
> log
> label
> mkdir
> cgroup-util
> strv
> path-util
> conf-files
> hashmap
> set
> exit-status
> util
> dev-setup
> 
> but does not need:
> 
> cgroup-show
> conf-parser
> hwclock
> pager
> ratelimit
> socket-util
> spawn-ask-password-agent
> spawn-polkit-agent
> specifier
> utf8
> virt
> watchdog
> 
> Basically all of the above are combined into libsystemd-core.la and that 
> needs to be split into two.  I'd just split the first group into 
> libudev-core.la.

I'm confused here because you first refer to
libsystemd_shared_la_SOURCES then libsystemd_core.la. What about
libsystemd_shared.la? Also, there is already a libudev-core.la. I will
look at it and see what it includes.

> 
> To link, udev also needs the file in libsystemd_daemon_la_SOURCES 
> (sd-daumon) for udevd, but that probably could be removed with some 
> appropriate ifdefs in udevd.c.

I'''m not seeing where udev needs this off the top of my head. Actually
I just ran "git grep -i sd.daumon" on the tree and that turns up
nothing.


 Thanks,

 William


[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH] Allow disabling the build of all of systemd, leaving just udev
  2012-06-02  6:56 [PATCH] Allow disabling the build of all of systemd, leaving just udev Bryan Kadzban
                   ` (16 preceding siblings ...)
  2012-06-06 22:53 ` William Hubbs
@ 2012-06-07 13:34 ` Dan Nicholson
  17 siblings, 0 replies; 19+ messages in thread
From: Dan Nicholson @ 2012-06-07 13:34 UTC (permalink / raw)
  To: linux-hotplug

On Wed, Jun 6, 2012 at 10:15 AM, William Hubbs <w.d.hubbs@gmail.com> wrote:
> On Wed, Jun 06, 2012 at 05:38:29AM -0700, Dan Nicholson wrote:
>> Breaking up the Makefile.am into several files is probably cleaner,
>> but it doesn't actually change the problem you're trying to solve
>> here. You still have to wrap large parts of the build in
>> AM_CONDITIONALs. That doesn't change whether it's in one file or many.
>> The include happens at automake time, not build time, so conditionally
>> including the file won't do anything different for you. Everything
>> will get merge into the toplevel Makefile.in.
>
> If the am_condissionals are controlled by configure switches, we can set
> things up so that the packager or user who is building udev or systemd
> has control over what gets built. If they want to build udev only, or
> systemd, or just the tools in the distribution that don't require
> systemd, they will be able to.
>
> This is where I want to go once we have the Makefile broken up. This
> will also require some work in configure.ac, but I think it will be
> worth that because it will give packagers the flexability to build what
> they want.
>
> include Makefile-shared.am
> if ENABLE_UDEV
> include Makefile-udev.am
> endif
> if ENABLE_TOOLS
> include Makefile-tools.am
> endif
> if ENABLE_SYSTEMD
> include Makefile-systemd.am
> endif
>
> The first stage of this will be breaking up Makefile.am and using
> includes without condissionals. Once everything builds cleanly in that
> setup, we can  do the work in configure.ac and add condissionals to
> Makefile.am.

What do you know, that works. I had thought automake didn't support
that, but it works nicely. The one thing I was trying to do when I was
starting this patch was keep dist working regardless of your configure
flags. Usually that just mean leaving EXTRA_DIST out of the
conditionals. That's painful, though, and you can probably just bring
out a big hammer during dist. I have something like this in
pkg-config:

if !ENABLE_SYSTEMD
dist-hook:
        @echo "error: you need to enable systemd for dist"
        @exit 1
endif

--
Dan

^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2012-06-07 13:34 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-02  6:56 [PATCH] Allow disabling the build of all of systemd, leaving just udev Bryan Kadzban
2012-06-02 20:49 ` William Hubbs
2012-06-03 16:55 ` Bryan Kadzban
2012-06-03 21:21 ` Bryan Kadzban
2012-06-03 21:22 ` William Hubbs
2012-06-03 22:00 ` Bryan Kadzban
2012-06-04  1:50 ` William Hubbs
2012-06-04  2:13 ` Bryan Kadzban
2012-06-04 18:51 ` William Hubbs
2012-06-05  3:10 ` Bryan Kadzban
2012-06-05 17:56 ` William Hubbs
2012-06-06  3:45 ` Bryan Kadzban
2012-06-06  4:23 ` Bruce Dubbs
2012-06-06 12:38 ` Dan Nicholson
2012-06-06 16:52 ` William Hubbs
2012-06-06 17:15 ` William Hubbs
2012-06-06 18:51 ` Bruce Dubbs
2012-06-06 22:53 ` William Hubbs
2012-06-07 13:34 ` Dan Nicholson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.