diff options
author | John Klug <john.klug@multitech.com> | 2018-05-07 10:39:15 -0500 |
---|---|---|
committer | John Klug <john.klug@multitech.com> | 2018-05-07 10:39:15 -0500 |
commit | 7470ff4fc2279b53a542a5b87ad6df26635427ad (patch) | |
tree | 9d826b0071e2d23a72704d11df11695d0d49411c | |
parent | 1a4afbb7cb136e15b4cdf11590a866565f176991 (diff) | |
download | meta-mlinux-7470ff4fc2279b53a542a5b87ad6df26635427ad.tar.gz meta-mlinux-7470ff4fc2279b53a542a5b87ad6df26635427ad.tar.bz2 meta-mlinux-7470ff4fc2279b53a542a5b87ad6df26635427ad.zip |
Upgrade Fix model file check and symlink issue for external device
-rw-r--r-- | recipes-core/initscripts/initscripts-1.0/umountfs | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/recipes-core/initscripts/initscripts-1.0/umountfs b/recipes-core/initscripts/initscripts-1.0/umountfs index 5229646..9c36bd3 100644 --- a/recipes-core/initscripts/initscripts-1.0/umountfs +++ b/recipes-core/initscripts/initscripts-1.0/umountfs @@ -83,7 +83,8 @@ flash_upgrade() { return fi # flash_root must be a mountpoint that is not the rootfs and be mounted rw - local flash_root=${1} + # External mount may be on symlink. + local flash_root=$(readlink -f ${1}) local flash_dir=${flash_root}/flash-upgrade local upgrade_file=${flash_dir}/upgrade.bin @@ -182,12 +183,15 @@ flash_upgrade() { shopt -s nocasematch local hw_version=$(cat /sys/devices/platform/mts-io/hw-version) local firmware_model=$(tar -xO -f ${upgrade_file} model) - if [[ ! "${hw_version}" =~ ^${firmware_model}- ]]; then + # Do case insensity character match. + shopt -s nocasematch + if [[ ! "${hw_version}" =~ ^(${firmware_model})- ]]; then echo "Wrong firmware for this hardware" echo "hw version: ${hw_version}" echo "firmware model: ${firmware_model}" return fi + shopt -u nocasematch echo "Checking MD5s" ((upgrade_script=0)) @@ -207,11 +211,6 @@ flash_upgrade() { ((upgrade_script=1)) fi fi - # Extract files early if we are going to - # execute the upgrade script. - if [[ ${file} == ${install_file} ]] ; then - ((upgrade_script=1)) - fi done fi @@ -331,6 +330,14 @@ if [[ -f ${upgrade_fname} ]] ; then if ((${#owner} > 0)) && ((owner == 0)) ; then flash_upgrade /var/volatile flash_upgrade /media/card + # Look for upgrade on external media besides + # SD card. + cd /run/media + # See if there is a USB driver + last=$(dirname $(ls -d */flash-upgrade)) + if ((${#last} > 0)) ; then + flash_upgrade "/run/media/${last}" + fi fi fi |