summaryrefslogtreecommitdiff
path: root/recipes-core/initscripts
diff options
context:
space:
mode:
authorJohn Klug <john.klug@multitech.com>2017-10-04 17:37:31 -0500
committerJohn Klug <john.klug@multitech.com>2017-10-04 17:37:31 -0500
commitc8f149db95f96d029e55a1142542fd57c57e4cd7 (patch)
tree0fd8191035a979e9d77e1275993744c47cb0a51e /recipes-core/initscripts
parentdadd1323eb57cc605760441fed3b69614cf498b7 (diff)
downloadmeta-mlinux-c8f149db95f96d029e55a1142542fd57c57e4cd7.tar.gz
meta-mlinux-c8f149db95f96d029e55a1142542fd57c57e4cd7.tar.bz2
meta-mlinux-c8f149db95f96d029e55a1142542fd57c57e4cd7.zip
New package update via tarball
Diffstat (limited to 'recipes-core/initscripts')
-rw-r--r--recipes-core/initscripts/initscripts-1.0/umountfs21
1 files changed, 20 insertions, 1 deletions
diff --git a/recipes-core/initscripts/initscripts-1.0/umountfs b/recipes-core/initscripts/initscripts-1.0/umountfs
index 300de4f..17b44cf 100644
--- a/recipes-core/initscripts/initscripts-1.0/umountfs
+++ b/recipes-core/initscripts/initscripts-1.0/umountfs
@@ -106,6 +106,7 @@ flash_upgrade() {
local rootfs_file=rootfs.jffs2
local kernel_file=uImage.bin
local uboot_file=uboot.bin
+ local install_file=install.sh
if [ ! -d "${flash_dir}" ]; then
echo "${flash_dir} not present, skipping"
@@ -172,7 +173,7 @@ flash_upgrade() {
cd /var/volatile
# rootfs should always be flashed last, so always keep it last here
- local files=(${bootstrap_file} ${uboot_file} ${config_file} ${oem_file} ${kernel_file} ${rootfs_file})
+ local files=(${bootstrap_file} ${uboot_file} ${config_file} ${oem_file} ${kernel_file} ${rootfs_file} ${install_file})
local devs=(${bootstrap_mtd} ${uboot_mtd} ${config_mtd} ${oem_mtd} ${kernel_mtd} ${rootfs_mtd})
if [ -f "${upgrade_file}" ]; then
@@ -189,6 +190,7 @@ flash_upgrade() {
fi
echo "Checking MD5s"
+ ((upgrade_script=0))
# check md5sum
for (( i = 0; i < ${#files[@]}; i++ )); do
local file=${files[i]}
@@ -202,6 +204,11 @@ flash_upgrade() {
return
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
@@ -237,6 +244,18 @@ flash_upgrade() {
err_leds
return 1
fi
+
+ # Run the upgrade script, if it exists, before we change
+ # flash-root to read-only
+ if ((upgrade_script == 1)) ; then
+ if (cd ${flash_dir};tar -xf ${upgrade_file}) ; then
+ exec ${flash_dir}/${install_file} ${flash_root}
+ else
+ echo "Extraction of ${upgrade_file} failed"
+ echo "Upgrade aborted"
+ umount_all
+ fi
+ fi
sync
sleep 2
mount -o remount,ro ${flash_root}