]> rtime.felk.cvut.cz Git - coffee/buildroot.git/commitdiff
Rework of the init system
authorMaxime Ripard <maxime.ripard@free-electrons.com>
Sat, 28 Jul 2012 07:21:20 +0000 (09:21 +0200)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Mon, 30 Jul 2012 21:12:17 +0000 (23:12 +0200)
Since we have now two uncompatible init systems, and we want only one of
them at the same time in use in the rootfs, we need to select a
particular init system. This patch also adds $(PKG)_INSTALL_INIT_SYSTEMD
and $(PKG)_INSTALL_INIT_SYSV hooks that are called when the matching
init systems are selected to install properly the init scripts of the
package.

Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Acked-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
package/busybox/busybox.mk
package/pkg-generic.mk
target/generic/Config.in

index 394a1aeddd9001fe23c2340d09728da5992e4037..17ee50a8fd922135e7b4b8b66710fe9e4f6c7b71 100644 (file)
@@ -134,6 +134,12 @@ define BUSYBOX_DISABLE_MMU_APPLETS
 endef
 endif
 
+ifeq ($(BR2_INIT_BUSYBOX),y)
+define BUSYBOX_SET_INIT
+       $(call KCONFIG_ENABLE_OPT,CONFIG_INIT,$(BUSYBOX_BUILD_CONFIG))
+endef
+endif
+
 define BUSYBOX_INSTALL_LOGGING_SCRIPT
        if grep -q CONFIG_SYSLOGD=y $(@D)/.config; then \
                [ -f $(TARGET_DIR)/etc/init.d/S01logging ] || \
@@ -168,6 +174,7 @@ define BUSYBOX_CONFIGURE_CMDS
        $(BUSYBOX_NETKITTELNET)
        $(BUSYBOX_INTERNAL_SHADOW_PASSWORDS)
        $(BUSYBOX_DISABLE_MMU_APPLETS)
+       $(BUSYBOX_SET_INIT)
        $(BUSYBOX_SET_WATCHDOG)
        @yes "" | $(MAKE) ARCH=$(KERNEL_ARCH) CROSS_COMPILE="$(TARGET_CROSS)" \
                -C $(@D) oldconfig
index d1f4f2a2ceab8ac7fe490893bef0f7e664509aa7..68d23bae43686c8a718eea6a3ccd8f9673a39f7b 100644 (file)
@@ -133,6 +133,10 @@ $(BUILD_DIR)/%/.stamp_images_installed:
 # Install to target dir
 $(BUILD_DIR)/%/.stamp_target_installed:
        @$(call MESSAGE,"Installing to target")
+       $(if $(BR2_INIT_SYSTEMD),\
+               $($(PKG)_INSTALL_INIT_SYSTEMD))
+       $(if $(BR2_INIT_SYSV)$(BR2_INIT_BUSYBOX),\
+               $($(PKG)_INSTALL_INIT_SYSV))
        $($(PKG)_INSTALL_TARGET_CMDS)
        $(foreach hook,$($(PKG)_POST_INSTALL_TARGET_HOOKS),$(call $(hook))$(sep))
        $(Q)touch $@
@@ -151,6 +155,10 @@ $(BUILD_DIR)/%/.stamp_uninstalled:
        rm -f $($(PKG)_TARGET_INSTALL_TARGET)
        $($(PKG)_UNINSTALL_STAGING_CMDS)
        $($(PKG)_UNINSTALL_TARGET_CMDS)
+       $(if $(BR2_INIT_SYSTEMD),\
+               $($(PKG)_UNINSTALL_INIT_SYSTEMD))
+       $(if $(BR2_INIT_SYSV)$(BR2_INIT_BUSYBOX),\
+               $($(PKG)_UNINSTALL_INIT_SYSV))
 
 # Remove package sources
 $(BUILD_DIR)/%/.stamp_dircleaned:
index 88f0718e2c55a43bb4bbee004129445adc1477f9..a83ba442ceac90dffc93f369849f1fe9ea4b4f0a 100644 (file)
@@ -37,6 +37,35 @@ comment "udev requires a toolchain with LARGEFILE + WCHAR support"
 
 endchoice
 
+choice
+       prompt "Init system"
+       default BR2_INIT_BUSYBOX
+
+config BR2_INIT_BUSYBOX
+       bool "Busybox"
+       select BR2_PACKAGE_BUSYBOX
+
+config BR2_INIT_SYSV
+       bool "systemV"
+       select BR2_PACKAGE_SYSVINIT
+
+config BR2_INIT_SYSTEMD
+       bool "systemd"
+       depends on BR2_LARGEFILE
+       depends on BR2_USE_WCHAR
+       depends on BR2_INET_IPV6
+       depends on BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_UDEV
+       depends on BR2_TOOLCHAIN_HAS_THREADS
+       select BR2_PACKAGE_DBUS
+       select BR2_PACKAGE_SYSTEMD
+
+comment 'systemd requires largefile, wchar, IPv6, threads and udev support'
+       depends on !(BR2_LARGEFILE && BR2_USE_WCHAR && \
+                    BR2_INET_IPV6 && BR2_TOOLCHAIN_HAS_THREADS && \
+                    BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_UDEV)
+
+endchoice
+
 config BR2_ROOTFS_DEVICE_TABLE
        string "Path to the permission tables"
        default "target/generic/device_table.txt"