From 21dc7c91af2f21fa7c95e96d75e506863d03ed85 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Tue, 9 Mar 2021 20:54:23 +0100 Subject: [PATCH] - cst/hd2: fix profile.local and rc.local --- make/target-files.mk | 3 +-- make/target-scripts.mk | 3 +++ skel-root/general/files-etc/rc.local | 2 +- skel-root/general/files-etc/rc.local-var | 14 ++++++++++++++ skel-root/general/scripts/rc.local.init | 6 +++++- 5 files changed, 24 insertions(+), 4 deletions(-) create mode 100644 skel-root/general/files-etc/rc.local-var diff --git a/make/target-files.mk b/make/target-files.mk index 9b9b97a5..6b9441b9 100644 --- a/make/target-files.mk +++ b/make/target-files.mk @@ -57,9 +57,8 @@ $(TARGET_sysconfdir)/profile: $(TARGET_sysconfdir)/profile.local: ifeq ($(PERSISTENT_VAR_PARTITION),yes) $(INSTALL_DATA) -D $(TARGET_FILES)/files-etc/profile.local-var $(TARGET_localstatedir)/etc/profile.local -else - $(INSTALL_DATA) -D $(TARGET_FILES)/files-etc/profile.local $(@) endif + $(INSTALL_DATA) -D $(TARGET_FILES)/files-etc/profile.local $(@) $(TARGET_sysconfdir)/profile.d: $(foreach p,$(wildcard $(TARGET_FILES)/files-etc/profile.d/*.sh),\ diff --git a/make/target-scripts.mk b/make/target-scripts.mk index 628260a7..f63f16aa 100644 --- a/make/target-scripts.mk +++ b/make/target-scripts.mk @@ -73,6 +73,9 @@ $(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 +ifeq ($(PERSISTENT_VAR_PARTITION),yes) + $(INSTALL_DATA) -D $(TARGET_FILES)/files-etc/rc.local-var $(TARGET_localstatedir)/etc/rc.local +endif $(TARGET_sysconfdir)/init.d/resizerootfs: ifeq ($(BOXMODEL),$(filter $(BOXMODEL),hd51 bre2ze4k h7 hd60 hd61)) diff --git a/skel-root/general/files-etc/rc.local b/skel-root/general/files-etc/rc.local index abb454b7..8fe07e5e 100644 --- a/skel-root/general/files-etc/rc.local +++ b/skel-root/general/files-etc/rc.local @@ -1,6 +1,6 @@ #!/bin/sh -e # -# rc.local +# /etc/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 diff --git a/skel-root/general/files-etc/rc.local-var b/skel-root/general/files-etc/rc.local-var new file mode 100644 index 00000000..5e851f4f --- /dev/null +++ b/skel-root/general/files-etc/rc.local-var @@ -0,0 +1,14 @@ +#!/bin/sh -e +# +# /var/etc/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 index 04ac466c..d407b772 100644 --- a/skel-root/general/scripts/rc.local.init +++ b/skel-root/general/scripts/rc.local.init @@ -4,7 +4,11 @@ case $1 in start) - /etc/rc.local + if [ -e /var/etc/rc.local ]; then + /var/etc/rc.local + elif [ -e /etc/rc.local ]; then + /etc/rc.local + fi ;; *) echo "[${BASENAME}] Usage: $0 {start}"