Refactor: Move HAVE_DBUS and CONSOLE to configure script.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
Joachim Nilsson committed 2015-06-22 15:12:20 +02:00
1 parent 36c59e77b4
commit 70af5d7f8d
3 files changed
+25 -3

No files matched your search

Vendored
+22
View File
@@ -26,11 +26,13 @@ defaults()
config=${config:="$sysconfdir/$conf"} config=${config:="$sysconfdir/$conf"}
confdir=${confdir:="finit.d"} confdir=${confdir:="finit.d"}
rcsd=${rcsd:="$sysconfdir/$confdir"} rcsd=${rcsd:="$sysconfdir/$confdir"}
console=${console:='_PATH_CONSOLE'}
defuser=${defuser:="root"} defuser=${defuser:="root"}
defhost=${defhost:="noname"} defhost=${defhost:="noname"}
runlevel=${runlevel:=2} runlevel=${runlevel:=2}
debug=${debug:=0} debug=${debug:=0}
embedded=${embedded:=0} embedded=${embedded:=0}
dbus=${dbus:=0}
remount=${remount:=0} remount=${remount:=0}
inetd=${inetd:=1} inetd=${inetd:=1}
verbose=${verbose:=1} verbose=${verbose:=1}
@@ -53,6 +55,7 @@ result()
echo "FIFO : $fifo" echo "FIFO : $fifo"
echo "Config file : $config" echo "Config file : $config"
echo "rcs.d/ directory : $rcsd" echo "rcs.d/ directory : $rcsd"
echo "Default console : $console"
if [ x"$sysroot" != x"" ]; then if [ x"$sysroot" != x"" ]; then
echo "Swap rootfs to : $sysroot" echo "Swap rootfs to : $sysroot"
fi fi
@@ -68,6 +71,10 @@ result()
echo "Embedded target : YES (BusyBox getty, and mdev instead of udev)" echo "Embedded target : YES (BusyBox getty, and mdev instead of udev)"
fi fi
if [ $dbus -ne 0 ]; then
echo "D-Bus : YES, remember to install dbus.so plugin as well!"
fi
if [ $remount -ne 0 ]; then if [ $remount -ne 0 ]; then
echo "Remount ROOT fs : YES, / will be remounted as read-write at bootstrap" echo "Remount ROOT fs : YES, / will be remounted as read-write at bootstrap"
fi fi
@@ -118,6 +125,7 @@ usage()
echo echo
echo "Usage: $0 [ARG]" echo "Usage: $0 [ARG]"
echo echo
echo " --help This help text"
echo " --prefix=PREFIX Set installation prefix, default '$prefix'" echo " --prefix=PREFIX Set installation prefix, default '$prefix'"
echo " --sysconfdir=CONF Set conf dir, default '$sysconfdir'" echo " --sysconfdir=CONF Set conf dir, default '$sysconfdir'"
echo " --sbindir=SBIN Set sbin dir, default '$sbindir'" echo " --sbindir=SBIN Set sbin dir, default '$sbindir'"
@@ -134,6 +142,7 @@ usage()
echo " files, or as built-in if --enable-static is given," echo " files, or as built-in if --enable-static is given,"
echo " defaults to all plugins. Exclude extension!" echo " defaults to all plugins. Exclude extension!"
echo " --with-rcsd=RCSD Finit RCSD directory, default '\$sysconfdir/$confdir'" echo " --with-rcsd=RCSD Finit RCSD directory, default '\$sysconfdir/$confdir'"
echo " --with-console=DEV Console to use, default: /dev/console"
echo " --with-sysroot=PATH Some distributions keep a different (writable) rootfs" echo " --with-sysroot=PATH Some distributions keep a different (writable) rootfs"
echo " that is used at runtime, usually /sysroot or /mnt" echo " that is used at runtime, usually /sysroot or /mnt"
echo " --with-username=USER User for 'startx' .conf option, default: root" echo " --with-username=USER User for 'startx' .conf option, default: root"
@@ -141,6 +150,7 @@ usage()
echo " --with-runlevel=LEVEL Runlevel to switch to after bootstrap (S), default: 2" echo " --with-runlevel=LEVEL Runlevel to switch to after bootstrap (S), default: 2"
echo echo
echo " --enable-embedded Embedded defaults, BusBox getty, mdev etc." echo " --enable-embedded Embedded defaults, BusBox getty, mdev etc."
echo " --enable-dbus Enable D-Bus plugin. Note: install plugin as well!"
echo " --enable-rw-rootfs Remount / as read-write at bootstrap, not for embedded" echo " --enable-rw-rootfs Remount / as read-write at bootstrap, not for embedded"
echo " --enable-debug Enable debug flags, '-O0, -g'" echo " --enable-debug Enable debug flags, '-O0, -g'"
echo " --enable-quiet Quiet mode, reduce screen output to absolute minimum" echo " --enable-quiet Quiet mode, reduce screen output to absolute minimum"
@@ -214,6 +224,10 @@ while [ "$*" != "" ]; do
rcsd="$arg" rcsd="$arg"
;; ;;
with-console)
console="\"$arg\""
;;
with-sysroot) with-sysroot)
sysroot="$arg" sysroot="$arg"
;; ;;
@@ -238,6 +252,10 @@ while [ "$*" != "" ]; do
embedded=1 embedded=1
;; ;;
enable-dbus)
dbus=1
;;
enable-rw-rootfs) enable-rw-rootfs)
remount=1 remount=1
;; ;;
@@ -339,6 +357,9 @@ fi
if [ $remount -eq 1 ]; then if [ $remount -eq 1 ]; then
echo "#define REMOUNT_ROOTFS 1" >> config.h echo "#define REMOUNT_ROOTFS 1" >> config.h
fi fi
if [ $dbus -eq 1 ]; then
echo "#define HAVE_DBUS 1" >> config.h
fi
if [ $inetd -eq 0 ]; then if [ $inetd -eq 0 ]; then
echo "#define INETD_DISABLED" >> config.h echo "#define INETD_DISABLED" >> config.h
@@ -346,6 +367,7 @@ fi
echo "#define FINIT_FIFO \"$fifo\"" >> config.h echo "#define FINIT_FIFO \"$fifo\"" >> config.h
echo "#define FINIT_CONF \"$config\"" >> config.h echo "#define FINIT_CONF \"$config\"" >> config.h
echo "#define FINIT_RCSD \"$rcsd\"" >> config.h echo "#define FINIT_RCSD \"$rcsd\"" >> config.h
echo "#define CONSOLE $console" >> config.h
if [ x"$sysroot" != x"" ]; then if [ x"$sysroot" != x"" ]; then
echo "#define SYSROOT \"$sysroot\"" >> config.h echo "#define SYSROOT \"$sysroot\"" >> config.h
fi fi
-3
View File
@@ -38,18 +38,15 @@
/* Distribution specific configuration */ /* Distribution specific configuration */
#if defined EMBEDDED_SYSTEM #if defined EMBEDDED_SYSTEM
# define CONSOLE _PATH_CONSOLE
# define SETUP_DEVFS "/sbin/mdev -s" # define SETUP_DEVFS "/sbin/mdev -s"
# define GETTY "/sbin/getty -L" # define GETTY "/sbin/getty -L"
# define GETTY_BUSYBOX /* Tell tty.c about the getty argument order */ # define GETTY_BUSYBOX /* Tell tty.c about the getty argument order */
# define BAUDRATE 115200 # define BAUDRATE 115200
#else /* Debian/Ubuntu based distributions */ #else /* Debian/Ubuntu based distributions */
# define CONSOLE "/dev/tty1"
# define SETUP_DEVFS "/sbin/udevd --daemon" # define SETUP_DEVFS "/sbin/udevd --daemon"
# define GETTY "/sbin/getty -8" # define GETTY "/sbin/getty -8"
# define GETTY_AGETTY /* Tell tty.c about the getty argument order */ # define GETTY_AGETTY /* Tell tty.c about the getty argument order */
# define BAUDRATE 38400 # define BAUDRATE 38400
# define HAVE_DBUS
#endif #endif
/* If the user configures us to not know about any getty use the system /* If the user configures us to not know about any getty use the system
+3
View File
@@ -21,7 +21,10 @@
* THE SOFTWARE. * THE SOFTWARE.
*/ */
#include <sys/types.h>
#include "../finit.h" #include "../finit.h"
#include "../config.h"
#include "../helpers.h" #include "../helpers.h"
#include "../plugin.h" #include "../plugin.h"
#include "libite/lite.h" #include "libite/lite.h"