Browse Source

- change dummy date handling; fix camd_datefix script

master
vanhofen 4 years ago
parent
commit
7f63d46e4f
  1. 4
      make/target-files.mk
  2. 2
      make/target-scripts.mk
  3. 2
      skel-root/general/files-etc/init.d/rcS-hd1
  4. 2
      skel-root/general/files-etc/init.d/rcS-hd2
  5. 2
      skel-root/general/files-etc/init.d/rcS-hd5x
  6. 2
      skel-root/general/files-etc/init.d/rcS-hd6x
  7. 2
      skel-root/general/files-etc/init.d/rcS-vuduo
  8. 2
      skel-root/general/files-etc/init.d/rcS-vuplus
  9. 7
      skel-root/general/scripts/camd_datefix.init

4
make/target-files.mk

@ -6,6 +6,7 @@
files-etc: \
$(TARGET_sysconfdir)/default/rcS \
$(TARGET_sysconfdir)/network/interfaces \
$(TARGET_sysconfdir)/date-dummy \
$(TARGET_sysconfdir)/exports \
$(TARGET_sysconfdir)/filesystems \
$(TARGET_sysconfdir)/fstab \
@ -31,6 +32,9 @@ else
$(INSTALL_DATA) -D $(TARGET_FILES)/files-etc/network/interfaces $(@)
endif
$(TARGET_sysconfdir)/date-dummy:
echo "$(shell date +%Y)01010000" > $(@)
$(TARGET_sysconfdir)/exports:
ifeq ($(PERSISTENT_VAR_PARTITION), yes)
$(INSTALL_DATA) -D $(TARGET_FILES)/files-etc/exports-var $(TARGET_localstatedir)/etc/exports

2
make/target-scripts.mk

@ -51,7 +51,7 @@ ifeq ($(BOXMODEL), $(filter $(BOXMODEL), vusolo4k vuduo4k vuduo4kse vuultimo4k v
else
$(INSTALL_EXEC) -D $(TARGET_FILES)/files-etc/init.d/rcS-$(BOXSERIES) $(@)
endif
$(SED) "s|%(BOXMODEL)|$(BOXMODEL)|g; s|%(YEAR)|$(shell date +%Y)|g" $(@)
$(SED) "s|%(BOXMODEL)|$(BOXMODEL)|g" $(@)
$(TARGET_sysconfdir)/init.d/rcK:
$(INSTALL_EXEC) -D $(TARGET_FILES)/files-etc/init.d/rcK $(@)

2
skel-root/general/files-etc/init.d/rcS-hd1

@ -48,7 +48,7 @@ mkdir -p /var/run/wpa_supplicant
dmesg -n 1
# set dummy date
date -s "%(YEAR)-01-01 00:00"
test -e /etc/date-dummy && date -s "$(cat /etc/date-dummy)"
# create nodes
# <name> <type> <mode> <uid> <gid> <major> <minor> <start> <inc> <count>

2
skel-root/general/files-etc/init.d/rcS-hd2

@ -56,7 +56,7 @@ mkdir -p /var/run/wpa_supplicant
dmesg -n 1
# set dummy date
date -s "%(YEAR)-01-01 00:00"
test -e /etc/date-dummy && date -s "$(cat /etc/date-dummy)"
# automatic restore
if [ -e /var/backup_flash.tar.gz ]; then

2
skel-root/general/files-etc/init.d/rcS-hd5x

@ -52,7 +52,7 @@ mkdir -p /var/run/wpa_supplicant
dmesg -n 1
# set dummy date
date -s "%(YEAR)-01-01 00:00"
test -e /etc/date-dummy && date -s "$(cat /etc/date-dummy)"
# automatic restore
if [ -e /var/backup_flash.tar.gz ]; then

2
skel-root/general/files-etc/init.d/rcS-hd6x

@ -52,7 +52,7 @@ mkdir -p /var/run/wpa_supplicant
dmesg -n 1
# set dummy date
date -s "%(YEAR)-01-01 00:00"
test -e /etc/date-dummy && date -s "$(cat /etc/date-dummy)"
# automatic restore
if [ -e /var/backup_flash.tar.gz ]; then

2
skel-root/general/files-etc/init.d/rcS-vuduo

@ -48,7 +48,7 @@ mkdir -p /var/run/wpa_supplicant
dmesg -n 1
# set dummy date
date -s "%(YEAR)-01-01 00:00"
test -e /etc/date-dummy && date -s "$(cat /etc/date-dummy)"
# automatic restore
if [ -e /var/backup_flash.tar.gz ]; then

2
skel-root/general/files-etc/init.d/rcS-vuplus

@ -48,7 +48,7 @@ mkdir -p /var/run/wpa_supplicant
dmesg -n 1
# set dummy date
date -s "%(YEAR)-01-01 00:00"
test -e /etc/date-dummy && date -s "$(cat /etc/date-dummy)"
# automatic restore
if [ -e /var/backup_flash.tar.gz ]; then

7
skel-root/general/scripts/camd_datefix.init

@ -10,9 +10,14 @@ FLAGFILE="/var/etc/.$2"
case "$1" in
"start")
if [ ! -e /etc/date-dummy ]; then
SHOWINFO "can't work. /etc/date-dummy is missing"
exit 1
fi
DATE_DUMMY=$(cat /etc/date-dummy)
DATE_TODAY=$(date +%Y%m%d%H%M)
# keep line below in sync with dummy time in rcS
if [ "${DATE_TODAY:0:8}" = "20170101" ]; then
if [ "${DATE_TODAY:0:8}" = "${DATE_DUMMY:0:8}" ]; then
# try to read date from flagfile
test -e $FLAGFILE && \
DATE_FLAG=$(date -r $FLAGFILE +%Y%m%d%H%M)

Loading…
Cancel
Save