mirror of
https://github.com/kernelkit/infix.git
synced 2026-07-22 01:13:00 +02:00
package/finit: new init package, with skeleton
This patch imports Finit v4.3 from myLinux to infIX along with a rudimentary rootfs skeleton. Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
@@ -0,0 +1,5 @@
|
|||||||
|
menu "Packages"
|
||||||
|
|
||||||
|
source "$BR2_EXTERNAL_INFIX_PATH/package/Config.in"
|
||||||
|
|
||||||
|
endmenu
|
||||||
|
|||||||
@@ -0,0 +1 @@
|
|||||||
|
include $(sort $(wildcard $(BR2_EXTERNAL_INFIX_PATH)/package/*/*.mk))
|
||||||
|
|||||||
@@ -0,0 +1,2 @@
|
|||||||
|
source "$BR2_EXTERNAL_INFIX_PATH/package/finit/Config.in"
|
||||||
|
source "$BR2_EXTERNAL_INFIX_PATH/package/skeleton-init-finit/Config.in"
|
||||||
@@ -0,0 +1,153 @@
|
|||||||
|
config BR2_PACKAGE_FINIT
|
||||||
|
bool "finit"
|
||||||
|
depends on BR2_USE_MMU # fork()
|
||||||
|
select BR2_PACKAGE_LIBITE
|
||||||
|
select BR2_PACKAGE_LIBUEV
|
||||||
|
select BR2_PACKAGE_SKELETON_INIT_FINIT # before BR2_INIT_FINIT support
|
||||||
|
help
|
||||||
|
The original Asus EeePC fastinit clone, on steroids. With process
|
||||||
|
supervision, plugin support, and more!
|
||||||
|
|
||||||
|
https://github.com/troglobit/finit
|
||||||
|
|
||||||
|
if BR2_PACKAGE_FINIT
|
||||||
|
|
||||||
|
config BR2_PACKAGE_FINIT_CUSTOM_FSTAB
|
||||||
|
string "Custom /etc/fstab"
|
||||||
|
default "/etc/fstab"
|
||||||
|
help
|
||||||
|
In certain use-cases, e.g., embedded systems with a secondary
|
||||||
|
partition, or when testing in factory production. Users may
|
||||||
|
want to mount system partitions from an fstab file other than
|
||||||
|
/etC/fstab.
|
||||||
|
|
||||||
|
This menuconfing setting changes the default fstab Finit looks
|
||||||
|
for. To select a different at boot time, use kernel command
|
||||||
|
line option finit.fstab=/etc/fstab.alt, as usual, for command
|
||||||
|
line options destined for PID 1, remember the -- separator and
|
||||||
|
put them last.
|
||||||
|
|
||||||
|
config BR2_PACKAGE_FINIT_INITCTL_GROUP
|
||||||
|
string "Group for /run/finit/socket"
|
||||||
|
default "wheel"
|
||||||
|
help
|
||||||
|
On systems with multiple administrators, set the group
|
||||||
|
to their shared UNIX group, usually "wheel", to allow
|
||||||
|
them to start/stop services and reboot the system.
|
||||||
|
|
||||||
|
config BR2_PACKAGE_FINIT_KEVENTD
|
||||||
|
bool "finit-keventd"
|
||||||
|
default n
|
||||||
|
help
|
||||||
|
Build bundled finit-keventd, which monitors kernel events
|
||||||
|
for AC power status and generates sys/pwr/fail condition.
|
||||||
|
This is a new feature in Finit v4.1 and is still very much
|
||||||
|
in an experimental state.
|
||||||
|
|
||||||
|
For lxc/docker application builds you do not need this.
|
||||||
|
|
||||||
|
config BR2_PACKAGE_FINIT_SULOGIN
|
||||||
|
bool "finit-sulogin"
|
||||||
|
default n
|
||||||
|
help
|
||||||
|
Build bundled finit-sulogin, which handles rescue mode
|
||||||
|
and cases where fsck fails. Its job is to ask for the
|
||||||
|
password for the root user, and start a login shell so
|
||||||
|
an administrator can perform corrective maintenance.
|
||||||
|
|
||||||
|
This is disabled by default since most users prefer the
|
||||||
|
distribution specific (Busybox) sulogin instead.
|
||||||
|
|
||||||
|
For lxc/docker application builds you do not need this.
|
||||||
|
|
||||||
|
config BR2_PACKAGE_FINIT_WATCHDOG
|
||||||
|
bool "finit-watchdogd"
|
||||||
|
default n
|
||||||
|
help
|
||||||
|
Build bundled finit-watchdogd, which provides a simplistic
|
||||||
|
watchdog daemon that runs in the background, kicking the
|
||||||
|
systemd default /dev/watchdog to prevent reboot. This is
|
||||||
|
useful in very small systems where its grownup old cousin
|
||||||
|
watchdogd cannot be used.
|
||||||
|
|
||||||
|
For lxc/docker application builds you do not need this.
|
||||||
|
|
||||||
|
if BR2_PACKAGE_FINIT_WATCHDOG
|
||||||
|
|
||||||
|
config BR2_PACKAGE_FINIT_WATCHDOG_DEV
|
||||||
|
string "watchdog device"
|
||||||
|
default "/dev/watchdog"
|
||||||
|
help
|
||||||
|
Device node to use for finit-watchdogd. The default is
|
||||||
|
usually sufficient, but some systems have more than one.
|
||||||
|
|
||||||
|
endif
|
||||||
|
|
||||||
|
config BR2_PACKAGE_FINIT_PLUGIN_HOTPLUG
|
||||||
|
bool "hotplug plugin (mdev/udev)"
|
||||||
|
help
|
||||||
|
By default, Finit builds and launches its hotplug plugin.
|
||||||
|
It is responsible for detecting and starting the mdev tool,
|
||||||
|
or udevd daemon. The former exists in many BusyBox based
|
||||||
|
systems and is called for "cold plugging". The latter has
|
||||||
|
many various incarnations and is mostly used for desktop
|
||||||
|
systems.
|
||||||
|
|
||||||
|
For lxc/docker application builds you do not need this.
|
||||||
|
|
||||||
|
config BR2_PACKAGE_FINIT_PLUGIN_HOOK_SCRIPTS
|
||||||
|
bool "hook scripts"
|
||||||
|
default n
|
||||||
|
help
|
||||||
|
Adds a run-parts(8) script runner for Finit hook points. When
|
||||||
|
enabled, it allows extending and customizing the boot process
|
||||||
|
and do early boot debugging long before regular services are
|
||||||
|
available.
|
||||||
|
|
||||||
|
For example, say that you want to enable some kernel tracing
|
||||||
|
before modules are loaded. With hook-scripts, you can just
|
||||||
|
drop in a shell script in /libexec/finit/hook/mount/all/ that
|
||||||
|
will poke the right control files in tracefs.
|
||||||
|
|
||||||
|
config BR2_PACKAGE_FINIT_PLUGIN_MODULES_LOAD
|
||||||
|
bool "Scan /etc/modules-load.d"
|
||||||
|
help
|
||||||
|
Scans /etc/modules-load.d for modules to load.
|
||||||
|
|
||||||
|
For lxc/docker application builds you do not need this.
|
||||||
|
|
||||||
|
config BR2_PACKAGE_FINIT_PLUGIN_MODPROBE
|
||||||
|
bool "Coldplug modules using modalias magic"
|
||||||
|
help
|
||||||
|
Coldplug modules using modalias magic. Everything is
|
||||||
|
handled automatically based on device trees and their
|
||||||
|
matching kernel modules.
|
||||||
|
|
||||||
|
For lxc/docker application builds you do not need this.
|
||||||
|
|
||||||
|
config BR2_PACKAGE_FINIT_PLUGIN_RTC
|
||||||
|
bool "RTC plugin"
|
||||||
|
help
|
||||||
|
By default, Finit builds and launches its RTC plugin. It is
|
||||||
|
responsible for restoring the system clock from the RTC clock
|
||||||
|
at boot, and saving the system clock to RTC at reboot.
|
||||||
|
|
||||||
|
For lxc/docker application builds you do not need this.
|
||||||
|
|
||||||
|
config BR2_PACKAGE_FINIT_PLUGIN_TTY
|
||||||
|
bool "TTY plugin"
|
||||||
|
help
|
||||||
|
Automatically resart tty services that are plugged in.
|
||||||
|
|
||||||
|
For lxc/docker application builds you do not need this.
|
||||||
|
|
||||||
|
config BR2_PACKAGE_FINIT_PLUGIN_URANDOM
|
||||||
|
bool "/dev/urandom plugin"
|
||||||
|
help
|
||||||
|
By default, Finit builds and launches its urandom plugin. It
|
||||||
|
is responsible for seeding /dev/urandom from a previously saved
|
||||||
|
seed at boot, and saving a seed at reboot.
|
||||||
|
|
||||||
|
For lxc/docker application builds you do not need this.
|
||||||
|
|
||||||
|
endif
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
# From https://github.com/troglobit/finit/releases/
|
||||||
|
sha256 262d8cfea80d94e048e3f1b149f5d940b4579a38f2b7dba563cf4b0b497e7422 finit-4.3.tar.gz
|
||||||
|
|
||||||
|
# Locally calculated
|
||||||
|
sha256 abdb9adbbc1faacc35c80bc2974c7d6b842e3e50b066d688385b5d21be86206f LICENSE
|
||||||
|
|
||||||
|
# No hash for git snapshots:
|
||||||
|
#none none finit-099672f.tar.gz
|
||||||
@@ -0,0 +1,126 @@
|
|||||||
|
################################################################################
|
||||||
|
#
|
||||||
|
# finit
|
||||||
|
#
|
||||||
|
################################################################################
|
||||||
|
|
||||||
|
FINIT_VERSION = 4.3
|
||||||
|
FINIT_SITE = https://github.com/troglobit/finit/releases/download/$(FINIT_VERSION)
|
||||||
|
FINIT_LICENSE = MIT
|
||||||
|
FINIT_LICENSE_FILES = LICENSE
|
||||||
|
FINIT_INSTALL_STAGING = YES
|
||||||
|
FINIT_DEPENDENCIES = host-pkgconf libite libuev
|
||||||
|
FINIT_INSTALL_STAGING = YES
|
||||||
|
FINIT_D = $(TARGET_DIR)/etc/finit.d
|
||||||
|
|
||||||
|
# Create configure script using autoreconf when building from git
|
||||||
|
#FINIT_VERSION = 099672f
|
||||||
|
#FINIT_SITE = git://github.com/troglobit/finit.git
|
||||||
|
#FINIT_AUTORECONF = YES
|
||||||
|
#FINIT_DEPENDENCIES += host-automake host-autoconf host-libtool
|
||||||
|
|
||||||
|
# Buildroot defaults to /usr for both prefix and exec-prefix, this we
|
||||||
|
# must override because we want to install into /sbin and /bin for the
|
||||||
|
# finit and initctl programs, respectively. The expected plugin path is
|
||||||
|
# /lib/finit/ and scripts in /libexec, both are set by --exec-prefix.
|
||||||
|
# The localstatedir is set to the correct system path by Buildroot, so
|
||||||
|
# no override necessary there.
|
||||||
|
FINIT_CONF_OPTS = \
|
||||||
|
--prefix=/usr \
|
||||||
|
--exec-prefix= \
|
||||||
|
--disable-doc \
|
||||||
|
--disable-contrib \
|
||||||
|
--disable-silent-rules \
|
||||||
|
--with-group=$(BR2_PACKAGE_FINIT_INITCTL_GROUP)
|
||||||
|
|
||||||
|
# Disable/Enable features
|
||||||
|
ifeq ($(BR2_PACKAGE_FINIT_CUSTOM_FSTAB),)
|
||||||
|
FINIT_CONF_OPTS += --with-fstab=yes
|
||||||
|
else
|
||||||
|
FINIT_CONF_OPTS += --with-fstab=$(BR2_PACKAGE_FINIT_CUSTOM_FSTAB)
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(BR2_PACKAGE_FINIT_KEVENTD),y)
|
||||||
|
FINIT_CONF_OPTS += --with-keventd
|
||||||
|
else
|
||||||
|
FINIT_CONF_OPTS += --without-keventd
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(BR2_PACKAGE_FINIT_SULOGIN),y)
|
||||||
|
FINIT_CONF_OPTS += --with-sulogin
|
||||||
|
else
|
||||||
|
FINIT_CONF_OPTS += --without-sulogin
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(BR2_PACKAGE_FINIT_WATCHDOG),y)
|
||||||
|
FINIT_CONF_OPTS += --with-watchdog=$(BR2_PACKAGE_FINIT_WATCHDOG_DEV)
|
||||||
|
else
|
||||||
|
FINIT_CONF_OPTS += --without-watchdog
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(BR2_PACKAGE_FINIT_PLUGIN_HOTPLUG),y)
|
||||||
|
FINIT_CONF_OPTS += --enable-hotplug-plugin
|
||||||
|
else
|
||||||
|
FINIT_CONF_OPTS += --disable-hotplug-plugin
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(BR2_PACKAGE_FINIT_PLUGIN_HOOK_SCRIPTS),y)
|
||||||
|
FINIT_CONF_OPTS += --enable-hook-scripts-plugin
|
||||||
|
else
|
||||||
|
FINIT_CONF_OPTS += --disable-hook-scripts-plugin
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(BR2_PACKAGE_FINIT_PLUGIN_MODULES_LOAD),y)
|
||||||
|
FINIT_CONF_OPTS += --enable-modules-load-plugin
|
||||||
|
else
|
||||||
|
FINIT_CONF_OPTS += --disable-modules-load-plugin
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(BR2_PACKAGE_FINIT_PLUGIN_MODPROBE),y)
|
||||||
|
FINIT_CONF_OPTS += --enable-modprobe-plugin
|
||||||
|
else
|
||||||
|
FINIT_CONF_OPTS += --disable-modprobe-plugin
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(BR2_PACKAGE_FINIT_PLUGIN_RTC),y)
|
||||||
|
FINIT_CONF_OPTS += --enable-rtc-plugin
|
||||||
|
else
|
||||||
|
FINIT_CONF_OPTS += --disable-rtc-plugin
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(BR2_PACKAGE_FINIT_PLUGIN_TTY),y)
|
||||||
|
FINIT_CONF_OPTS += --enable-tty-plugin
|
||||||
|
else
|
||||||
|
FINIT_CONF_OPTS += --disable-tty-plugin
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(BR2_PACKAGE_FINIT_PLUGIN_URANDOM),y)
|
||||||
|
FINIT_CONF_OPTS += --enable-urandom-plugin
|
||||||
|
else
|
||||||
|
FINIT_CONF_OPTS += --disable-urandom-plugin
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifneq ($(SKELETON_INIT_COMMON_HOSTNAME),)
|
||||||
|
FINIT_CONF_OPTS += --with-hostname="$(SKELETON_INIT_COMMON_HOSTNAME)"
|
||||||
|
endif
|
||||||
|
|
||||||
|
# Disable/Enable features depending on other packages
|
||||||
|
ifeq ($(BR2_PACKAGE_ALSA_UTILS),y)
|
||||||
|
FINIT_CONF_OPTS += --enable-alsa-utils-plugin
|
||||||
|
else
|
||||||
|
FINIT_CONF_OPTS += --disable-alsa-utils-plugin
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(BR2_PACKAGE_DBUS),y)
|
||||||
|
FINIT_CONF_OPTS += --enable-dbus-plugin
|
||||||
|
else
|
||||||
|
FINIT_CONF_OPTS += --disable-dbus-plugin
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(BR2_PACKAGE_XORG7),y)
|
||||||
|
FINIT_CONF_OPTS += --enable-x11-common-plugin
|
||||||
|
else
|
||||||
|
FINIT_CONF_OPTS += --disable-x11-common-plugin
|
||||||
|
endif
|
||||||
|
|
||||||
|
$(eval $(autotools-package))
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
config BR2_PACKAGE_SKELETON_INIT_FINIT
|
||||||
|
bool
|
||||||
|
select BR2_PACKAGE_HAS_SKELETON
|
||||||
|
select BR2_PACKAGE_SKELETON_INIT_COMMON
|
||||||
|
|
||||||
|
config BR2_PACKAGE_PROVIDES_SKELETON
|
||||||
|
default "skeleton-init-finit" if BR2_PACKAGE_SKELETON_INIT_FINIT
|
||||||
|
|
||||||
|
if BR2_PACKAGE_SKELETON_INIT_FINIT
|
||||||
|
menu "finit init skeleton"
|
||||||
|
|
||||||
|
config BR2_PACKAGE_SKELETON_INIT_FINIT_TELNETD
|
||||||
|
bool "/etc/inetd.conf telnetd"
|
||||||
|
help
|
||||||
|
Enable telnetd from inetd service (disabled).
|
||||||
|
|
||||||
|
endmenu
|
||||||
|
endif
|
||||||
@@ -0,0 +1,143 @@
|
|||||||
|
################################################################################
|
||||||
|
#
|
||||||
|
# skeleton-init-finit
|
||||||
|
#
|
||||||
|
################################################################################
|
||||||
|
|
||||||
|
# The skeleton can't depend on the toolchain, since all packages depends on the
|
||||||
|
# skeleton and the toolchain is a target package, as is skeleton.
|
||||||
|
# Hence, skeleton would depends on the toolchain and the toolchain would depend
|
||||||
|
# on skeleton.
|
||||||
|
SKELETON_INIT_FINIT_ADD_TOOLCHAIN_DEPENDENCY = NO
|
||||||
|
SKELETON_INIT_FINIT_ADD_SKELETON_DEPENDENCY = NO
|
||||||
|
SKELETON_INIT_FINIT_TMPFILE := $(shell mktemp)
|
||||||
|
SKELETON_INIT_FINIT_DEPENDENCIES = skeleton-init-common
|
||||||
|
|
||||||
|
# Enable when BR2_INIT_FINT
|
||||||
|
#SKELETON_INIT_FINIT_PROVIDES = skeleton
|
||||||
|
|
||||||
|
# Prefer Finit built-in getty unless options are set, squash zero baudrate
|
||||||
|
define SKELETON_INIT_FINIT_GETTY
|
||||||
|
if [ -z "$(SYSTEM_GETTY_OPTIONS)" ]; then \
|
||||||
|
if [ $(SYSTEM_GETTY_BAUDRATE) -eq 0 ]; then \
|
||||||
|
SYSTEM_GETTY_BAUDRATE=""; \
|
||||||
|
fi; \
|
||||||
|
echo "tty [12345789] $(SYSTEM_GETTY_PORT) $(SYSTEM_GETTY_BAUDRATE) $(SYSTEM_GETTY_TERM) noclear"; \
|
||||||
|
else \
|
||||||
|
echo "tty [12345789] /sbin/getty -L $(SYSTEM_GETTY_OPTIONS) $(SYSTEM_GETTY_BAUDRATE) $(SYSTEM_GETTY_PORT) $(SYSTEM_GETTY_TERM)"; \
|
||||||
|
fi
|
||||||
|
endef
|
||||||
|
|
||||||
|
define SKELETON_INIT_FINIT_SET_GENERIC_GETTY
|
||||||
|
$(SKELETON_INIT_FINIT_GETTY) > $(SKELETON_INIT_FINIT_TMPFILE)
|
||||||
|
grep -qxF "`cat $(SKELETON_INIT_FINIT_TMPFILE)`" $(FINIT_D)/available/getty.conf \
|
||||||
|
|| cat $(SKELETON_INIT_FINIT_TMPFILE) >> $(FINIT_D)/available/getty.conf
|
||||||
|
rm $(SKELETON_INIT_FINIT_TMPFILE)
|
||||||
|
ln -sf ../available/getty.conf $(FINIT_D)/enabled/getty.conf
|
||||||
|
endef
|
||||||
|
SKELETON_INIT_FINIT_TARGET_FINALIZE_HOOKS += SKELETON_INIT_FINIT_SET_GENERIC_GETTY
|
||||||
|
|
||||||
|
# Dropbear SSH
|
||||||
|
ifeq ($(BR2_PACKAGE_DROPBEAR),y)
|
||||||
|
define SKELETON_INIT_FINIT_SET_DROPBEAR
|
||||||
|
ln -sf ../available/dropbear.conf $(FINIT_D)/enabled/dropbear.conf
|
||||||
|
endef
|
||||||
|
SKELETON_INIT_FINIT_TARGET_FINALIZE_HOOKS += SKELETON_INIT_FINIT_SET_DROPBEAR
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(BR2_PACKAGE_MINI_SNMPD),y)
|
||||||
|
define SKELETON_INIT_FINIT_SET_MINI_SNMPD
|
||||||
|
ln -sf ../available/mini-snmpd.conf $(FINIT_D)/enabled/mini-snmpd.conf
|
||||||
|
endef
|
||||||
|
SKELETON_INIT_FINIT_TARGET_FINALIZE_HOOKS += SKELETON_INIT_FINIT_SET_MINI_SNMPD
|
||||||
|
endif
|
||||||
|
|
||||||
|
# Enable Busybox syslogd unless sysklogd is enabled
|
||||||
|
ifeq ($(BR2_PACKAGE_SYSKLOGD),y)
|
||||||
|
define SKELETON_INIT_FINIT_SET_SYSLOGD
|
||||||
|
ln -sf ../available/sysklogd.conf $(FINIT_D)/enabled/sysklogd.conf
|
||||||
|
rm -f $(FINIT_D)/enabled/syslogd.conf
|
||||||
|
endef
|
||||||
|
else
|
||||||
|
define SKELETON_INIT_FINIT_SET_SYSLOGD
|
||||||
|
ln -sf ../available/syslogd.conf $(FINIT_D)/enabled/syslogd.conf
|
||||||
|
rm -f $(FINIT_D)/enabled/sysklogd.conf
|
||||||
|
endef
|
||||||
|
endif
|
||||||
|
SKELETON_INIT_FINIT_TARGET_FINALIZE_HOOKS += SKELETON_INIT_FINIT_SET_SYSLOGD
|
||||||
|
|
||||||
|
# SSDP Responder
|
||||||
|
ifeq ($(BR2_PACKAGE_SSDP_RESPONDER),y)
|
||||||
|
define SKELETON_INIT_FINIT_SET_SSDP_RESPONDER
|
||||||
|
ln -sf ../available/ssdp-responder.conf $(FINIT_D)/enabled/ssdp-responder.conf
|
||||||
|
endef
|
||||||
|
SKELETON_INIT_FINIT_TARGET_FINALIZE_HOOKS += SKELETON_INIT_FINIT_SET_SSDP_RESPONDER
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(BR2_PACKAGE_SMCROUTE),y)
|
||||||
|
define SKELETON_INIT_FINIT_SET_SMCROUTE
|
||||||
|
ln -sf ../available/smcroute.conf $(FINIT_D)/enabled/smcroute.conf
|
||||||
|
endef
|
||||||
|
SKELETON_INIT_FINIT_TARGET_FINALIZE_HOOKS += SKELETON_INIT_FINIT_SET_SMCROUTE
|
||||||
|
endif
|
||||||
|
|
||||||
|
# Watchdogd
|
||||||
|
ifeq ($(BR2_PACKAGE_WATCHDOGD),y)
|
||||||
|
define SKELETON_INIT_FINIT_SET_WATCHDOGD
|
||||||
|
ln -sf ../available/watchdogd.conf $(FINIT_D)/enabled/watchdogd.conf
|
||||||
|
endef
|
||||||
|
SKELETON_INIT_FINIT_TARGET_FINALIZE_HOOKS += SKELETON_INIT_FINIT_SET_WATCHDOGD
|
||||||
|
endif
|
||||||
|
|
||||||
|
# Enable gdbserver when running in Qemu mode
|
||||||
|
ifeq ($(QEMU_GDB),y)
|
||||||
|
define SKELETON_INIT_FINIT_SET_GDBSERVER
|
||||||
|
ln -sf ../available/gdbserver.conf $(FINIT_D)/enabled/gdbserver.conf
|
||||||
|
endef
|
||||||
|
SKELETON_INIT_FINIT_TARGET_FINALIZE_HOOKS += SKELETON_INIT_FINIT_SET_GDBSERVER
|
||||||
|
endif
|
||||||
|
|
||||||
|
# Workaround, should be in ifupdown-scripts package
|
||||||
|
ifeq ($(BR2_PACKAGE_IFUPDOWN_SCRIPTS),y)
|
||||||
|
define SKELETON_INIT_FINIT_IFUPDOWN_WORKAROUND
|
||||||
|
$(IFUPDOWN_SCRIPTS_PREAMBLE)
|
||||||
|
$(IFUPDOWN_SCRIPTS_LOCALHOST)
|
||||||
|
$(IFUPDOWN_SCRIPTS_DHCP)
|
||||||
|
endef
|
||||||
|
SKELETON_INIT_FINIT_TARGET_FINALIZE_HOOKS += SKELETON_INIT_FINIT_IFUPDOWN_WORKAROUND
|
||||||
|
endif
|
||||||
|
|
||||||
|
|
||||||
|
ifeq ($(BR2_TARGET_GENERIC_REMOUNT_ROOTFS_RW),y)
|
||||||
|
# Uncomment /dev/root entry in fstab to allow Finit to remount it rw
|
||||||
|
define SKELETON_INIT_FINIT_ROOT_RO_OR_RW
|
||||||
|
$(SED) '\:^#[[:blank:]]*/dev/root[[:blank:]]:s/^# //' $(TARGET_DIR)/etc/fstab
|
||||||
|
endef
|
||||||
|
else
|
||||||
|
# Comment out /dev/root entry to prevent Finit from remounting it rw
|
||||||
|
define SKELETON_INIT_FINIT_ROOT_RO_OR_RW
|
||||||
|
$(SED) '\:^/dev/root[[:blank:]]:s/^/# /' $(TARGET_DIR)/etc/fstab
|
||||||
|
endef
|
||||||
|
endif
|
||||||
|
|
||||||
|
ifeq ($(BR2_PACKAGE_SKELETON_INIT_FINIT_TELNETD),y)
|
||||||
|
define SKELETON_INIT_FINIT_TELNETD
|
||||||
|
$(SED) '\:^#[[:blank:]]*telnet[[:blank:]]:s/^# //' $(TARGET_DIR)/etc/inetd.conf
|
||||||
|
endef
|
||||||
|
else
|
||||||
|
define SKELETON_INIT_FINIT_TELNETD
|
||||||
|
$(SED) '\:^telnet[[:blank:]]:s/^/# /' $(TARGET_DIR)/etc/inetd.conf
|
||||||
|
endef
|
||||||
|
endif
|
||||||
|
|
||||||
|
define SKELETON_INIT_FINIT_INSTALL_TARGET_CMDS
|
||||||
|
$(call SYSTEM_RSYNC,$(SKELETON_INIT_FINIT_PKGDIR)/skeleton,$(TARGET_DIR))
|
||||||
|
mkdir -p $(TARGET_DIR)/home
|
||||||
|
mkdir -p $(TARGET_DIR)/srv
|
||||||
|
mkdir -p $(TARGET_DIR)/var
|
||||||
|
[ -L $(TARGET_DIR)/var/run ] || ln -s ../run $(TARGET_DIR)/var/run
|
||||||
|
$(SKELETON_INIT_FINIT_ROOT_RO_OR_RW)
|
||||||
|
$(SKELETON_INIT_FINIT_TELNETD)
|
||||||
|
endef
|
||||||
|
|
||||||
|
$(eval $(generic-package))
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
# TCP connection
|
||||||
|
#GDBSERVER_ARGS="--multi :1235"
|
||||||
|
|
||||||
|
# Qemu debug console
|
||||||
|
GDBSERVER_ARGS="--multi /dev/hvc1"
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
# -i NAME :: Set daemon identity (syslog, .conf, .sock, .pid, etc.)
|
||||||
|
# -l LVL :: Log level
|
||||||
|
QUERIERD_ARGS=""
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
# -m0 :: Disable periodic syslog MARK entries
|
||||||
|
# -s :: Enable secure mode, don't listen to remote logs
|
||||||
|
# -r 1M:5 :: Log rotation every 1 MiB and keep 5 rotated ones
|
||||||
|
SYSLOGD_ARGS="-m0 -s -r 1M:5"
|
||||||
|
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
# /etc/finit.conf: Buildroot defaults
|
||||||
|
# See /etc/finit.d/available/*.conf and `initctl list` for other services
|
||||||
|
|
||||||
|
## Runlevel to start after bootstrap, runlevel 'S'
|
||||||
|
# Default is 2
|
||||||
|
#runlevel 2
|
||||||
|
|
||||||
|
## Bootstrap services and tasks
|
||||||
|
# Can be listed here or in /etc/finit.d/*.conf
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
service [2345] dnsmasq -k -- DHCP/DNS proxy
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
# <!>: dropbear does not honor SIGHUP.
|
||||||
|
# -R: Create hostkeys if needed.
|
||||||
|
# -F: Run in foreground.
|
||||||
|
service [2345789] <!> env:-/etc/default/dropbear dropbear -F -R $DROPBEAR_ARGS -- Dropbear SSH daemon
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
service [123456789] env:-/etc/default/gdbserver gdbserver $GDBSERVER_ARGS -- GDB Server
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
# This is a console auto-detect for the built-in getty. It matches
|
||||||
|
# ttyS0, ttyAMA0, or ttymxc0 depending on the system.
|
||||||
|
#tty [12345] @console 115200 noclear
|
||||||
|
|
||||||
|
# For board bringup or debug purposes the `nologin` flag can be used
|
||||||
|
# to bypass the login prompt and get a shell directly.
|
||||||
|
#tty [12345] @console noclear nologin
|
||||||
|
|
||||||
|
# Alternatively you can run on the exact TTY device
|
||||||
|
#tty [12345] /dev/ttyS0 115200 noclear
|
||||||
|
#tty [12345] /dev/ttyAMA0 115200 noclear vt220
|
||||||
|
|
||||||
|
# Example using an external getty, here from BusyBox
|
||||||
|
#tty [12345] /sbin/getty -L 115200 ttyAMA0 vt100 nowait
|
||||||
|
#tty [12345] /sbin/getty -L 115200 @console vt100 noclear
|
||||||
|
|
||||||
|
# Allow login on ttyUSB0, for systems with no dedicated console port
|
||||||
|
#tty [12345] /dev/ttyUSB0 115200 noclear
|
||||||
|
|
||||||
|
# Automatically generated from Buildroot menuconfig
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
service [2345] <net/route/default> inadyn -ns -t 30 -- DDNS client
|
||||||
|
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
# Busybox inetd uses /etc/inetd.conf, example:
|
||||||
|
# nntp stream tcp nowait news /usr/sbin/leafnode
|
||||||
|
service [2345] inetd -f -- Internet super server
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
service [2345] log:null <!pid/zebra> isisd -A 127.0.0.1 -u root -g root -- IS-IS daemon
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
service [2345] env:-/etc/default/lldpd lldpd -d $LLDPD_ARGS -- LLDP daemon (IEEE 802.1ab)
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
service [2345] /usr/sbin/mini-snmpd -sn -- Mini snmpd
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
# Wait for the system to have a default route before starting
|
||||||
|
service [2345] log <!net/route/default> ntpd -n -l -I eth0 -- NTP daemon
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
service [2345] log:null <!pid/zebra> ospf6d -A 127.0.0.1 -u root -g root -- OSPF IPv6 daemon
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
service [2345] log:null <!pid/zebra> ospfd -A 127.0.0.1 -u root -g root -- OSPF daemon
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
service [2345789] env:-/etc/default/querierd querierd -sn $QUERIERD_ARGS -- Multicast query daemon
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
service [2345] log:null <pid/zebra> ripd -A 127.0.0.1 -u root -g root -- RIP daemon
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
service [2345] log:null <pid/zebra> ripngd -A 127.0.0.1 -u root -g root -- RIP IPv6 daemon
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
service [2345] smcrouted -ns -- Static multicast routing daemon
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
service [2345] ssdpd -ns -- SSDP Responder
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
service name:sysklogd [S123456789] env:-/etc/default/sysklogd syslogd -F $SYSLOGD_ARGS -- System log daemon
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
# BusyBox syslogd + klogd
|
||||||
|
|
||||||
|
# We want syslogd to always run, never be stopped, regardless of runlevel
|
||||||
|
# so it can send to any remote syslog server the user has set up.
|
||||||
|
service [S123456789] <!> syslogd -n -s 512 -b 3 -t -- System log daemon
|
||||||
|
|
||||||
|
# klogd depends on syslogd, but BusyBox syslogd doesn't create a PID file to sync with
|
||||||
|
service [S123456789] <!pid/syslogd> klogd -n -- Kernel log daemon
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
service [2345] <!> :23 telnetd -F -p 23 -- Telnet daemon on port 23
|
||||||
|
service [2345] <!> :2323 telnetd -F -p 2323 -- Telnet daemon on port 2323
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
# Finit has a built-in watchdog daemon that starts very early
|
||||||
|
# to take care of the hand-over from any bootloader. Therefore
|
||||||
|
# watchdogd does not need to start until the default runlevel.
|
||||||
|
service [123456789] watchdogd -xns -- System watchdog daemon
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
service [2345] pid:!/run/quagga/zebra.pid zebra -A 127.0.0.1 -u root -g root -- Zebra routing daemon
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
# <file system> <mount pt> <type> <options> <dump> <pass>
|
||||||
|
/dev/root / auto rw,noauto 0 1
|
||||||
|
tmpfs /tmp tmpfs mode=1777 0 0
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
# Services started by Busybox inetd on demand
|
||||||
|
#
|
||||||
|
# [ADDR:]service_name must be in /etc/services, or port number
|
||||||
|
# socket_type stream/dgram/raw/rdm/seqpacket
|
||||||
|
# protocol tcp/udp
|
||||||
|
# wait/nowait[.max] wait is usually for udp, nowait for tcp
|
||||||
|
# max: max copies to run
|
||||||
|
# user[.group] or user[:group] user and group to run under
|
||||||
|
# binary program to run
|
||||||
|
# arg0 arg1 arg2... arguments, INCLUDING program name (arg0)
|
||||||
|
|
||||||
|
# serv socket pro w/nw user binary args
|
||||||
|
|
||||||
|
# IPv6
|
||||||
|
#555 dgram udp6 wait root echo echo Hello IPv6 udp world
|
||||||
|
# ...with ADDR prefix:
|
||||||
|
#::1:444 stream tcp6 nowait root echo echo Hello IPv6 localhost
|
||||||
|
|
||||||
|
# Regualar telnetd service
|
||||||
|
telnet stream tcp nowait root telnetd telnetd
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
../run
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
config BR2_INIT_FINIT
|
||||||
|
bool "Finit"
|
||||||
|
select BR2_PACKAGE_FINIT
|
||||||
|
select BR2_PACKAGE_SKELETON_INIT_FINIT if BR2_ROOTFS_SKELETON_DEFAULT
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
config BR2_ROOTFS_SKELETON_FINIT
|
||||||
|
bool "Finit services skeleton"
|
||||||
|
select BR2_PACKAGE_SKELETON_INIT_FINIT
|
||||||
Reference in New Issue
Block a user