diff --git a/board/common/overlay/etc/init.d/S05syslog b/board/common/overlay/etc/init.d/S05syslog index 78586fadf3..fe65281b6d 100755 --- a/board/common/overlay/etc/init.d/S05syslog +++ b/board/common/overlay/etc/init.d/S05syslog @@ -15,7 +15,7 @@ case "$1" in ${PROG} test $? == 0 && msg_done || msg_fail echo "---- booting ${OS_NAME} ${OS_VERSION} ----" >> ${DMESG_LOG} - ${PROG_D} -T -w >> ${DMESG_LOG} & + ${PROG_D} -w >> ${DMESG_LOG} & ;; stop) diff --git a/board/common/overlay/etc/init.d/S50date b/board/common/overlay/etc/init.d/S50date index 6d7e43dfa8..5cd0781abf 100755 --- a/board/common/overlay/etc/init.d/S50date +++ b/board/common/overlay/etc/init.d/S50date @@ -33,24 +33,45 @@ source ${CONF} set_current_date_http() { date_str=$(curl -v -s -m ${DATE_TIMEOUT} -X GET http://${DATE_HOST} 2>&1 | grep Date | sed -e 's/< Date: //') - test -z "${date_str}" && return 1 - ${PROG_DATE} -u -D "%a, %d %b %Y %H:%M:%S" -s "${date_str}" > /dev/null - return $? + if [[ -n "${date_str}" ]]; then + ${PROG_DATE} -u -D "%a, %d %b %Y %H:%M:%S" -s "${date_str}" > /dev/null + logger -t date -s "current system date/time set to $(date) via HTTP" + return 0 + else + logger -t date -s "failed to set current system date/time via HTTP" + return 1 + fi } set_current_date_ntp() { cat ${NTP_CONF} | grep server | head -n 1 | cut -d ' ' -f 2 | xargs ${PROG_NTPDATE} -t ${DATE_TIMEOUT} -s + if [[ $? == 0 ]]; then + logger -t date -s "current system date/time set to $(date) via NTP" + return 0 + else + logger -t date -s "failed to set current system date/time via NTP" + return 1 + fi } start_http() { msg_begin "Setting current date using http" - set_current_date_http || set_current_date_http - test $? == 0 && msg_done "$(${PROG_DATE})" || msg_fail + if set_current_date_http; then + sleep_interval=${DATE_INTERVAL} + msg_done "$(${PROG_DATE})" + else + sleep_interval=${DATE_TIMEOUT} + msg_fail + fi msg_begin "Starting http date updater" while true; do - sleep ${DATE_INTERVAL} - set_current_date_http + sleep ${sleep_interval} + if set_current_date_http; then + sleep_interval=${DATE_INTERVAL} + else + sleep_interval=${DATE_TIMEOUT} + fi done & msg_done } diff --git a/board/common/overlay/etc/profile b/board/common/overlay/etc/profile index f56cf28154..0224094d57 100644 --- a/board/common/overlay/etc/profile +++ b/board/common/overlay/etc/profile @@ -31,7 +31,8 @@ fi; test -f /data/etc/profile && source /data/etc/profile # global environment variables +set -a test -f /etc/environment && source /etc/environment test -f /data/etc/environment && source /data/etc/environment test -f /boot/etc/environment && source /boot/etc/environment - +set +a diff --git a/writeimage.sh b/writeimage.sh index 36946f8370..665df07481 100755 --- a/writeimage.sh +++ b/writeimage.sh @@ -162,9 +162,9 @@ fi if [ -n "$IP" ] && [ -n "$GW" ] && [ -n "$DNS" ]; then msg "setting static IP configuration" conf=$BOOT/static_ip.conf - echo "static_ip=\"$IP\"" > $conf - echo "static_gw=\"$GW\"" >> $conf - echo "static_dns=\"$DNS\"" >> $conf + echo "STATIC_IP=\"$IP\"" > $conf + echo "STATIC_GW=\"$GW\"" >> $conf + echo "STATIC_DNS=\"$DNS\"" >> $conf fi msg "unmounting sdcard"