From 07639ff186b7b07d843f901bd2413f0b0918b687 Mon Sep 17 00:00:00 2001 From: Fabio Porcedda Date: Fri, 4 May 2012 02:02:13 +0000 Subject: busybox: add watchdog daemon startup script Signed-off-by: Fabio Porcedda Acked-by: Arnout Vandecappelle (Essensium/Mind) Signed-off-by: Peter Korsgaard --- package/busybox/busybox.mk | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'package/busybox/busybox.mk') diff --git a/package/busybox/busybox.mk b/package/busybox/busybox.mk index 59448d5a2..1d988f838 100644 --- a/package/busybox/busybox.mk +++ b/package/busybox/busybox.mk @@ -142,6 +142,19 @@ define BUSYBOX_INSTALL_LOGGING_SCRIPT else rm -f $(TARGET_DIR)/etc/init.d/S01logging; fi endef +ifeq ($(BR2_PACKAGE_BUSYBOX_WATCHDOG),y) +define BUSYBOX_SET_WATCHDOG + $(call KCONFIG_ENABLE_OPT,CONFIG_WATCHDOG,$(BUSYBOX_BUILD_CONFIG)) +endef +define BUSYBOX_INSTALL_WATCHDOG_SCRIPT + [ -f $(TARGET_DIR)/etc/init.d/S15watchdog ] || \ + install -D -m 0755 package/busybox/S15watchdog \ + $(TARGET_DIR)/etc/init.d/S15watchdog && \ + sed -i s/PERIOD/$(BR2_PACKAGE_BUSYBOX_WATCHDOG_PERIOD)/ \ + $(TARGET_DIR)/etc/init.d/S15watchdog +endef +endif + # We do this here to avoid busting a modified .config in configure BUSYBOX_POST_EXTRACT_HOOKS += BUSYBOX_COPY_CONFIG @@ -155,6 +168,7 @@ define BUSYBOX_CONFIGURE_CMDS $(BUSYBOX_NETKITTELNET) $(BUSYBOX_INTERNAL_SHADOW_PASSWORDS) $(BUSYBOX_DISABLE_MMU_APPLETS) + $(BUSYBOX_SET_WATCHDOG) @yes "" | $(MAKE) ARCH=$(KERNEL_ARCH) CROSS_COMPILE="$(TARGET_CROSS)" \ -C $(@D) oldconfig endef @@ -172,6 +186,7 @@ define BUSYBOX_INSTALL_TARGET_CMDS $(BUSYBOX_INSTALL_MDEV_SCRIPT) $(BUSYBOX_INSTALL_MDEV_CONF) $(BUSYBOX_INSTALL_LOGGING_SCRIPT) + $(BUSYBOX_INSTALL_WATCHDOG_SCRIPT) endef define BUSYBOX_UNINSTALL_TARGET_CMDS -- cgit v1.2.3