mirror of
https://github.com/motioneye-project/motioneyeos.git
synced 2025-07-29 14:16:31 +00:00
busybox: add watchdog daemon startup script
Signed-off-by: Fabio Porcedda <fabio.porcedda@gmail.com> Acked-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
This commit is contained in:
parent
2daf2de6e1
commit
07639ff186
@ -56,6 +56,23 @@ config BR2_PACKAGE_BUSYBOX_SHOW_OTHERS
|
|||||||
Show packages in menuconfig that are potentially also provided
|
Show packages in menuconfig that are potentially also provided
|
||||||
by busybox.
|
by busybox.
|
||||||
|
|
||||||
|
config BR2_PACKAGE_BUSYBOX_WATCHDOG
|
||||||
|
bool "Install the watchdog daemon startup script"
|
||||||
|
help
|
||||||
|
Install the watchdog daemon startup script,
|
||||||
|
that just start at the boot the busybox watchdog daemon.
|
||||||
|
|
||||||
|
if BR2_PACKAGE_BUSYBOX_WATCHDOG
|
||||||
|
|
||||||
|
config BR2_PACKAGE_BUSYBOX_WATCHDOG_PERIOD
|
||||||
|
int "Delay between reset"
|
||||||
|
default "5"
|
||||||
|
help
|
||||||
|
Select the number of seconds between each
|
||||||
|
reset of the watchdog (default 5)
|
||||||
|
|
||||||
|
endif
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if !BR2_PACKAGE_BUSYBOX # kconfig doesn't support else
|
if !BR2_PACKAGE_BUSYBOX # kconfig doesn't support else
|
||||||
|
20
package/busybox/S15watchdog
Normal file
20
package/busybox/S15watchdog
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
#
|
||||||
|
# Start watchdog
|
||||||
|
#
|
||||||
|
|
||||||
|
case "$1" in
|
||||||
|
start)
|
||||||
|
echo "Starting watchdog..."
|
||||||
|
watchdog -t PERIOD /dev/watchdog
|
||||||
|
;;
|
||||||
|
stop)
|
||||||
|
;;
|
||||||
|
restart|reload)
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo $"Usage: $0 {start|stop|restart}"
|
||||||
|
exit 1
|
||||||
|
esac
|
||||||
|
|
||||||
|
exit $?
|
@ -142,6 +142,19 @@ define BUSYBOX_INSTALL_LOGGING_SCRIPT
|
|||||||
else rm -f $(TARGET_DIR)/etc/init.d/S01logging; fi
|
else rm -f $(TARGET_DIR)/etc/init.d/S01logging; fi
|
||||||
endef
|
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
|
# We do this here to avoid busting a modified .config in configure
|
||||||
BUSYBOX_POST_EXTRACT_HOOKS += BUSYBOX_COPY_CONFIG
|
BUSYBOX_POST_EXTRACT_HOOKS += BUSYBOX_COPY_CONFIG
|
||||||
|
|
||||||
@ -155,6 +168,7 @@ define BUSYBOX_CONFIGURE_CMDS
|
|||||||
$(BUSYBOX_NETKITTELNET)
|
$(BUSYBOX_NETKITTELNET)
|
||||||
$(BUSYBOX_INTERNAL_SHADOW_PASSWORDS)
|
$(BUSYBOX_INTERNAL_SHADOW_PASSWORDS)
|
||||||
$(BUSYBOX_DISABLE_MMU_APPLETS)
|
$(BUSYBOX_DISABLE_MMU_APPLETS)
|
||||||
|
$(BUSYBOX_SET_WATCHDOG)
|
||||||
@yes "" | $(MAKE) ARCH=$(KERNEL_ARCH) CROSS_COMPILE="$(TARGET_CROSS)" \
|
@yes "" | $(MAKE) ARCH=$(KERNEL_ARCH) CROSS_COMPILE="$(TARGET_CROSS)" \
|
||||||
-C $(@D) oldconfig
|
-C $(@D) oldconfig
|
||||||
endef
|
endef
|
||||||
@ -172,6 +186,7 @@ define BUSYBOX_INSTALL_TARGET_CMDS
|
|||||||
$(BUSYBOX_INSTALL_MDEV_SCRIPT)
|
$(BUSYBOX_INSTALL_MDEV_SCRIPT)
|
||||||
$(BUSYBOX_INSTALL_MDEV_CONF)
|
$(BUSYBOX_INSTALL_MDEV_CONF)
|
||||||
$(BUSYBOX_INSTALL_LOGGING_SCRIPT)
|
$(BUSYBOX_INSTALL_LOGGING_SCRIPT)
|
||||||
|
$(BUSYBOX_INSTALL_WATCHDOG_SCRIPT)
|
||||||
endef
|
endef
|
||||||
|
|
||||||
define BUSYBOX_UNINSTALL_TARGET_CMDS
|
define BUSYBOX_UNINSTALL_TARGET_CMDS
|
||||||
|
Loading…
x
Reference in New Issue
Block a user