From 271f13d47b0ddbce3993c43588ab26256c9d98be Mon Sep 17 00:00:00 2001 From: vanhofen Date: Tue, 23 Feb 2021 23:17:09 +0100 Subject: [PATCH] - add rc.local support --- make/target-scripts.mk | 6 ++++++ skel-root/general/files-etc/rc.local | 14 ++++++++++++++ skel-root/general/scripts/rc.local.init | 12 ++++++++++++ 3 files changed, 32 insertions(+) create mode 100644 skel-root/general/files-etc/rc.local create mode 100644 skel-root/general/scripts/rc.local.init diff --git a/make/target-scripts.mk b/make/target-scripts.mk index 5e4f317f..90e8cc6d 100644 --- a/make/target-scripts.mk +++ b/make/target-scripts.mk @@ -22,6 +22,7 @@ init-scripts: \ $(TARGET_sysconfdir)/init.d/networking \ $(TARGET_sysconfdir)/init.d/partitions-by-name \ $(TARGET_sysconfdir)/init.d/proc \ + $(TARGET_sysconfdir)/init.d/rc.local \ $(TARGET_sysconfdir)/init.d/resizerootfs \ $(TARGET_sysconfdir)/init.d/swap \ $(TARGET_sysconfdir)/init.d/sys_update.sh \ @@ -106,6 +107,11 @@ ifeq ($(BOXMODEL),$(filter $(BOXMODEL),hd51 bre2ze4k h7 hd60 hd61 vusolo4k vuduo $(UPDATE-RC.D) $(@F) start 90 S . endif +$(TARGET_sysconfdir)/init.d/rc.local: + $(INSTALL_EXEC) -D $(TARGET_FILES)/scripts/rc.local.init $(@) + $(UPDATE-RC.D) $(@F) start 99 2 3 4 5 . + $(INSTALL_EXEC) -D $(TARGET_FILES)/files-etc/rc.local $(TARGET_sysconfdir)/rc.local + $(TARGET_sysconfdir)/init.d/resizerootfs: ifeq ($(BOXMODEL),$(filter $(BOXMODEL),hd51 bre2ze4k h7 hd60 hd61)) $(INSTALL_EXEC) -D $(TARGET_FILES)/scripts/resizerootfs.init $(@) diff --git a/skel-root/general/files-etc/rc.local b/skel-root/general/files-etc/rc.local new file mode 100644 index 00000000..abb454b7 --- /dev/null +++ b/skel-root/general/files-etc/rc.local @@ -0,0 +1,14 @@ +#!/bin/sh -e +# +# rc.local +# +# This script is executed at the end of each multiuser runlevel. +# Make sure that the script will "exit 0" on success or any other +# value on error. +# +# In order to enable or disable this script just change the execution +# bits. +# +# By default this script does nothing. + +exit 0 diff --git a/skel-root/general/scripts/rc.local.init b/skel-root/general/scripts/rc.local.init new file mode 100644 index 00000000..04ac466c --- /dev/null +++ b/skel-root/general/scripts/rc.local.init @@ -0,0 +1,12 @@ +#!/bin/sh + +. /etc/init.d/globals + +case $1 in + start) + /etc/rc.local + ;; + *) + echo "[${BASENAME}] Usage: $0 {start}" + ;; +esac