mirror of
https://github.com/troglobit/finit.git
synced 2026-11-03 13:28:27 +00:00
Refactor --with-sysconfig, default to /etc/default and /etc/conf.d
Both Debian and Builroot based systems use /etc/default and Alpine Linux use /etc/conf.d, so let's just put both in by default. If the directories exist we monitor them. The --with-syconfig configure option is now disabled by default. Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
1 parent
7e3b18a38d
commit
6862d7cd5f
5 files changed
+18
-17
No files matched your search
+7
-8
@@ -110,8 +110,8 @@ AC_ARG_WITH(rc-local,
|
|||||||
[rclocal=$withval], [rclocal=yes])
|
[rclocal=$withval], [rclocal=yes])
|
||||||
|
|
||||||
AC_ARG_WITH(sysconfig,
|
AC_ARG_WITH(sysconfig,
|
||||||
AS_HELP_STRING([--with-sysconfig=DIR], [Enviroment config directory, default /etc/default]),
|
AS_HELP_STRING([--with-sysconfig=DIR], [System environment, default /etc/default & /etc/conf.d]),
|
||||||
[sysconfig=$withval], [sysconfig=yes])
|
[sysconfig=$withval], [sysconfig=default])
|
||||||
|
|
||||||
AC_ARG_WITH(hostname,
|
AC_ARG_WITH(hostname,
|
||||||
AS_HELP_STRING([--with-hostname=NAME], [If /etc/hostname is missing, default: noname]),
|
AS_HELP_STRING([--with-hostname=NAME], [If /etc/hostname is missing, default: noname]),
|
||||||
@@ -170,11 +170,10 @@ AC_EXPAND_DIR(rclocal_path, "$rclocal")
|
|||||||
AC_DEFINE_UNQUOTED(FINIT_RC_LOCAL, "$rclocal_path", [Compat SysV /etc/rc.local file to run last at boot.])
|
AC_DEFINE_UNQUOTED(FINIT_RC_LOCAL, "$rclocal_path", [Compat SysV /etc/rc.local file to run last at boot.])
|
||||||
|
|
||||||
AS_IF([test "x$with_sysconfig" != "xno"], [
|
AS_IF([test "x$with_sysconfig" != "xno"], [
|
||||||
AS_IF([test "x$sysconfig" = "xyes"], [
|
AS_IF([test "x$sysconfig" != "xdefault"], [
|
||||||
sysconfig=$sysconfdir/default])
|
AC_EXPAND_DIR(sysconfig_path, "$sysconfig")
|
||||||
AC_EXPAND_DIR(sysconfig_path, "$sysconfig")
|
AC_DEFINE_UNQUOTED(FINIT_SYSCONFIG, "$sysconfig_path",
|
||||||
AC_DEFINE_UNQUOTED(FINIT_SYSCONFIG, "$sysconfig_path",
|
[System environment, default /etc/default & /etc/conf.d])])])
|
||||||
[System environment, default /etc/default])])
|
|
||||||
|
|
||||||
AS_IF([test "x$with_heading" != "xno"], [
|
AS_IF([test "x$with_heading" != "xno"], [
|
||||||
AS_IF([test "x$heading" = "xyes"], [
|
AS_IF([test "x$heading" = "xyes"], [
|
||||||
@@ -233,7 +232,7 @@ cat <<EOF
|
|||||||
Finit config.d path...: $rcsd_path
|
Finit config.d path...: $rcsd_path
|
||||||
Finit plugin path.....: $plugin_path
|
Finit plugin path.....: $plugin_path
|
||||||
Compat rc.local path..: $rclocal_path
|
Compat rc.local path..: $rclocal_path
|
||||||
System environment....: $sysconfig_path
|
System environment....: ${sysconfig_path:-${sysconfig}}
|
||||||
Random seed path......: $random_path
|
Random seed path......: $random_path
|
||||||
C Compiler............: $CC $CFLAGS $CPPFLAGS $LDFLAGS $LIBS
|
C Compiler............: $CC $CFLAGS $CPPFLAGS $LDFLAGS $LIBS
|
||||||
Linker................: $LD $LLDP_LDFLAGS $LLDP_BIN_LDFLAGS $LDFLAGS $LIBS
|
Linker................: $LD $LLDP_LDFLAGS $LLDP_BIN_LDFLAGS $LDFLAGS $LIBS
|
||||||
|
|||||||
@@ -18,7 +18,6 @@ PKG_CONFIG_LIBDIR=/usr/lib/pkgconfig:/usr/local/lib/pkgconfig ./configure \
|
|||||||
--sysconfdir=/etc --localstatedir=/var \
|
--sysconfdir=/etc --localstatedir=/var \
|
||||||
--enable-dbus-plugin --enable-x11-common-plugin \
|
--enable-dbus-plugin --enable-x11-common-plugin \
|
||||||
--enable-alsa-utils-plugin --enable-watchdog \
|
--enable-alsa-utils-plugin --enable-watchdog \
|
||||||
--with-sysconfig=/etc/conf.d --with-hostname=alpine \
|
|
||||||
--with-heading="Alpine Linux 3.13"
|
--with-heading="Alpine Linux 3.13"
|
||||||
|
|
||||||
echo
|
echo
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ echo
|
|||||||
--enable-dbus-plugin --enable-x11-common-plugin \
|
--enable-dbus-plugin --enable-x11-common-plugin \
|
||||||
--enable-alsa-utils-plugin \
|
--enable-alsa-utils-plugin \
|
||||||
--with-random-seed=/var/lib/urandom/random-seed \
|
--with-random-seed=/var/lib/urandom/random-seed \
|
||||||
--with-heading="Debian GNU/Linux" --with-hostname="stretch"
|
--with-heading="Debian GNU/Linux"
|
||||||
|
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo
|
echo
|
||||||
|
|||||||
@@ -14,11 +14,11 @@ fi
|
|||||||
# The plugins are optional, but you may need D-Bus and X11 if you want
|
# The plugins are optional, but you may need D-Bus and X11 if you want
|
||||||
# to run X-Window, the other configure flags are however required.
|
# to run X-Window, the other configure flags are however required.
|
||||||
PKG_CONFIG_LIBDIR=/usr/lib/pkgconfig:/usr/local/lib/pkgconfig ./configure \
|
PKG_CONFIG_LIBDIR=/usr/lib/pkgconfig:/usr/local/lib/pkgconfig ./configure \
|
||||||
--prefix=/usr --exec-prefix= \
|
--prefix=/usr --exec-prefix= \
|
||||||
--sysconfdir=/etc --localstatedir=/var \
|
--sysconfdir=/etc --localstatedir=/var \
|
||||||
--enable-dbus-plugin --enable-x11-common-plugin \
|
--enable-dbus-plugin --enable-x11-common-plugin \
|
||||||
--enable-alsa-utils-plugin \
|
--enable-alsa-utils-plugin --enable-watchdog \
|
||||||
--with-heading="Void Linux" --with-hostname=void
|
--with-heading="Void Linux"
|
||||||
|
|
||||||
echo
|
echo
|
||||||
echo "*** Building ..."
|
echo "*** Building ..."
|
||||||
|
|||||||
+5
-2
@@ -855,9 +855,12 @@ int conf_monitor(void)
|
|||||||
rc += iwatch_add(&iw_conf, FINIT_CONF, 0);
|
rc += iwatch_add(&iw_conf, FINIT_CONF, 0);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Systems with /etc/default, or similar, can also monitor changes
|
* Systems with /etc/default, /etc/conf.d, or similar, can also
|
||||||
* in env files sourced by .conf files (above)
|
* monitor changes in env files sourced by .conf files (above)
|
||||||
|
* define your own with --with-sysconfig=/path/to/envfiles
|
||||||
*/
|
*/
|
||||||
|
rc += iwatch_add(&iw_conf, "/etc/default/", IN_ONLYDIR);
|
||||||
|
rc += iwatch_add(&iw_conf, "/etc/conf.d/", IN_ONLYDIR);
|
||||||
#ifdef FINIT_SYSCONFIG
|
#ifdef FINIT_SYSCONFIG
|
||||||
rc += iwatch_add(&iw_conf, FINIT_SYSCONFIG, IN_ONLYDIR);
|
rc += iwatch_add(&iw_conf, FINIT_SYSCONFIG, IN_ONLYDIR);
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in new issue
Block a user