diff --git a/board/common/busybox.config b/board/common/busybox.config index 6cdd1becd1..7c34aa9650 100644 --- a/board/common/busybox.config +++ b/board/common/busybox.config @@ -1,7 +1,7 @@ # # Automatically generated make config: don't edit # Busybox version: 1.29.3 -# Wed Dec 18 22:45:43 2019 +# Tue Jan 14 23:44:35 2020 # CONFIG_HAVE_DOT_CONFIG=y @@ -659,7 +659,7 @@ CONFIG_NSENTER=y # CONFIG_RDEV is not set # CONFIG_READPROFILE is not set CONFIG_RENICE=y -# CONFIG_REV is not set +CONFIG_REV=y # CONFIG_RTCWAKE is not set # CONFIG_SCRIPT is not set # CONFIG_SCRIPTREPLAY is not set diff --git a/board/common/overlay/etc/init.d/S14postupgrade b/board/common/overlay/etc/init.d/S14postupgrade index ee7eae241f..1e8512c6b0 100755 --- a/board/common/overlay/etc/init.d/S14postupgrade +++ b/board/common/overlay/etc/init.d/S14postupgrade @@ -3,6 +3,7 @@ SYS_VERSION_FILE="/etc/version" VERSION_FILE="/data/etc/version" POST_UPGRADE_DIR="/usr/share/post-upgrade" +POST_UPGRADE_NET_SCHEDULED="/data/.post-upgrade-net-scheduled" LOG="/var/log/post-upgrade.log" @@ -33,11 +34,18 @@ function run_post_upgrade() { echo "---- post-upgrade from ${version} to ${sys_version} ----" >> ${LOG} - versions=$(ls -1 ${POST_UPGRADE_DIR} | cut -d '.' -f 1) + echo -n > ${POST_UPGRADE_NET_SCHEDULED} + + versions=$(ls -1 ${POST_UPGRADE_DIR} | rev | cut -d '.' -f 2-100 | rev) for v in ${versions}; do if [[ ${v} == "post-upgrade" ]]; then continue fi + + if [[ ${v} == *-net ]]; then # scripts that require network + echo "${POST_UPGRADE_DIR}/${v}.sh" >> ${POST_UPGRADE_NET_SCHEDULED} + continue + fi if [[ -z "${version}" ]] || version_gt ${v} ${version}; then msg_begin "Post-upgrading to version ${v}" @@ -69,4 +77,3 @@ case "$1" in esac exit $? - diff --git a/board/common/overlay/etc/init.d/S42postupgradenet b/board/common/overlay/etc/init.d/S42postupgradenet new file mode 100755 index 0000000000..2b10d950e6 --- /dev/null +++ b/board/common/overlay/etc/init.d/S42postupgradenet @@ -0,0 +1,36 @@ +#!/bin/bash + +POST_UPGRADE_NET_SCHEDULED="/data/.post-upgrade-net-scheduled" + +LOG="/var/log/post-upgrade.log" + + +test -n "${OS_VERSION}" || source /etc/init.d/base + +test -s ${POST_UPGRADE_NET_SCHEDULED} || exit 0 + +function run_post_upgrade() { + for script in $(cat ${POST_UPGRADE_NET_SCHEDULED}); do + msg_begin "Running post-upgrade script ${script}" + ${script} >> ${LOG} 2>&1 + test $? == 0 && msg_done || msg_fail + done +} + +case "$1" in + start) + run_post_upgrade + rm ${POST_UPGRADE_NET_SCHEDULED} + ;; + + stop) + true + ;; + + *) + echo "Usage: $0 {start}" + exit 1 +esac + +exit $? +