mirror of
https://github.com/troglobit/finit.git
synced 2026-10-13 10:14:47 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2b2fcb740c |
@@ -1,3 +1,7 @@
|
|||||||
|
1.2 (20120927)
|
||||||
|
- Fix installation paths encoded in finit binary
|
||||||
|
- Update README with section on building and enviroment variables
|
||||||
|
|
||||||
1.1 (20120927)
|
1.1 (20120927)
|
||||||
- Build fixes for ARM eabi/uClibc
|
- Build fixes for ARM eabi/uClibc
|
||||||
- Rename signal.[ch]-->sig.[ch] to avoid name clash w/ system headers
|
- Rename signal.[ch]-->sig.[ch] to avoid name clash w/ system headers
|
||||||
@@ -25,11 +25,18 @@
|
|||||||
|
|
||||||
# Top directory for building complete system, fall back to this directory
|
# Top directory for building complete system, fall back to this directory
|
||||||
ROOTDIR ?= $(shell pwd)
|
ROOTDIR ?= $(shell pwd)
|
||||||
|
|
||||||
|
# Installation paths, always prepended with DESTDIR if set
|
||||||
|
prefix ?= /usr/local
|
||||||
|
sysconfdir ?= /etc
|
||||||
|
datadir = $(prefix)/share/doc/finit
|
||||||
|
mandir = $(prefix)/share/man/man8
|
||||||
|
|
||||||
# Plugin directory, fall back to this directory if unset in environment
|
# Plugin directory, fall back to this directory if unset in environment
|
||||||
PLUGIN_DIR ?= /lib/finit/plugins
|
PLUGIN_DIR ?= $(prefix)/lib/finit/plugins
|
||||||
|
|
||||||
#VERSION ?= $(shell git tag -l | tail -1)
|
#VERSION ?= $(shell git tag -l | tail -1)
|
||||||
VERSION ?= 1.1
|
VERSION ?= 1.2
|
||||||
EXEC = finit
|
EXEC = finit
|
||||||
PKG = $(EXEC)-$(VERSION)
|
PKG = $(EXEC)-$(VERSION)
|
||||||
ARCHIVE = $(PKG).tar.xz
|
ARCHIVE = $(PKG).tar.xz
|
||||||
@@ -46,11 +53,6 @@ CPPFLAGS += -DPLUGIN_PATH=\"$(PLUGIN_DIR)\"
|
|||||||
LDFLAGS += -rdynamic
|
LDFLAGS += -rdynamic
|
||||||
LDLIBS += -ldl
|
LDLIBS += -ldl
|
||||||
|
|
||||||
prefix ?= /usr/local
|
|
||||||
sysconfdir ?= /etc
|
|
||||||
datadir = $(prefix)/share/doc/finit
|
|
||||||
mandir = $(prefix)/share/man/man8
|
|
||||||
|
|
||||||
include common.mk
|
include common.mk
|
||||||
export PLUGIN_DIR ROOTDIR CPPFLAGS
|
export PLUGIN_DIR ROOTDIR CPPFLAGS
|
||||||
|
|
||||||
|
|||||||
+78
@@ -66,6 +66,84 @@ Finit handles SIGUSR1 and SIGUSR2 for reboot and halt, and listens to
|
|||||||
/dev/initctl so standard Linux reboot and halt commands should also
|
/dev/initctl so standard Linux reboot and halt commands should also
|
||||||
work.
|
work.
|
||||||
|
|
||||||
|
Building
|
||||||
|
--------
|
||||||
|
|
||||||
|
The finit build system does not employ the GNU Configure and Build System,
|
||||||
|
instead standard makefiles are used. The user is encouraged to make source
|
||||||
|
code changes, using defines and conditionally building plugins instead to
|
||||||
|
alter the behavior of finit.
|
||||||
|
|
||||||
|
The following environment variables are checked by the makefiles and control
|
||||||
|
what is built and where resulting binaries are installed.
|
||||||
|
|
||||||
|
**ROOTDIR=**
|
||||||
|
Top directory for building complete system, used in pretty printing
|
||||||
|
|
||||||
|
**PLUGINS=**
|
||||||
|
List of stock finit plugins to build and install.
|
||||||
|
|
||||||
|
**PLUGIN_DIR=**
|
||||||
|
Absolute path to where finit should look for dynamically loadable plugins
|
||||||
|
at runtime. At installation prepended by ''DESTDIR'' and ''prefix''-
|
||||||
|
|
||||||
|
**VERSION=**
|
||||||
|
Defaults to the currently released version of finit, e.g., 1.2 but can
|
||||||
|
be overridden by packages to add a suffix or completely alter the version.
|
||||||
|
|
||||||
|
**CFLAGS=**
|
||||||
|
Standard CFLAGS are inherited from the build enviornmant.
|
||||||
|
|
||||||
|
**CPPFLAGS=**
|
||||||
|
Standard CPPFLAGS are inherited from the build enviornmant.
|
||||||
|
|
||||||
|
**LDFLAGS=**
|
||||||
|
Standard LDFLAGS are inherited from the build enviornmant.
|
||||||
|
|
||||||
|
**LDLIBS=**
|
||||||
|
Standard LIBLIBS are inherited from the build enviornmant.
|
||||||
|
|
||||||
|
**prefix=**
|
||||||
|
Path to where resulting binaries should install to. Used in concert
|
||||||
|
with the ''DESTDIR'' variable. Defaults to /usr/local
|
||||||
|
|
||||||
|
**sysconfdir=**
|
||||||
|
Used after ''prefix'' to create the path to finit.conf configuration
|
||||||
|
file. Defaults to /etc
|
||||||
|
|
||||||
|
**DESTDIR=**
|
||||||
|
Used by packagers and distributions when building a relocatable
|
||||||
|
bundle of files. Alwawys prepended to the ''prefix'' destination
|
||||||
|
directory.
|
||||||
|
|
||||||
|
**Example**::
|
||||||
|
|
||||||
|
$ tar xfJ finit-1.2.tar.xz
|
||||||
|
$ PLUGINS="initctl.so hwclock.so" prefix= DESTDIR=/tmp/finit/dst \
|
||||||
|
make -C finit-1.2/ clean install
|
||||||
|
make: Entering directory `/home/troglobit/finit-1.2'
|
||||||
|
CC finit.o
|
||||||
|
CC conf.o
|
||||||
|
CC helpers.o
|
||||||
|
CC sig.o
|
||||||
|
CC svc.o
|
||||||
|
CC plugin.o
|
||||||
|
CC strlcpy.o
|
||||||
|
LINK finit
|
||||||
|
CC plugins/initctl.o
|
||||||
|
PLUGIN plugins/initctl.so
|
||||||
|
CC plugins/hwclock.o
|
||||||
|
PLUGIN plugins/hwclock.so
|
||||||
|
INSTALL /tmp/finit/dst/sbin/finit
|
||||||
|
INSTALL /tmp/finit/dst/lib/finit/plugins/initctl.so
|
||||||
|
INSTALL /tmp/finit/dst/lib/finit/plugins/hwclock.so
|
||||||
|
make: Leaving directory `/home/troglobit/finit-1.2'
|
||||||
|
|
||||||
|
In this example the finit-1.2.tar.xz archive is unpacked to the user's
|
||||||
|
home directory, built and installed to a temporary staging directory.
|
||||||
|
The enviroment variables ''prefix'', ''DESTDIR'' and ''PLUGINS'' are all
|
||||||
|
changed to suit this particular build.
|
||||||
|
|
||||||
|
|
||||||
Debugging
|
Debugging
|
||||||
---------
|
---------
|
||||||
|
|||||||
+1
-1
@@ -2,7 +2,7 @@
|
|||||||
CFLAGS = -fPIC -g -Os
|
CFLAGS = -fPIC -g -Os
|
||||||
CPPFLAGS += -I..
|
CPPFLAGS += -I..
|
||||||
LDFLAGS = -shared
|
LDFLAGS = -shared
|
||||||
PLUGINS = initctl.so alsa-utils.so bootmisc.so dbus.so hwclock.so \
|
PLUGINS ?= initctl.so alsa-utils.so bootmisc.so dbus.so hwclock.so \
|
||||||
resolvconf.so urandom.so x11-common.so
|
resolvconf.so urandom.so x11-common.so
|
||||||
DEPS = $(addprefix .,$(PLUGINS:.so=.d))
|
DEPS = $(addprefix .,$(PLUGINS:.so=.d))
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user