summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xrecipes-core/mlinux-scripts/mlinux-scripts-1.1/mlinux-firmware-upgrade16
-rw-r--r--recipes-core/mlinux-scripts/mlinux-scripts_1.1.bb2
2 files changed, 15 insertions, 3 deletions
diff --git a/recipes-core/mlinux-scripts/mlinux-scripts-1.1/mlinux-firmware-upgrade b/recipes-core/mlinux-scripts/mlinux-scripts-1.1/mlinux-firmware-upgrade
index 94027d5..a377309 100755
--- a/recipes-core/mlinux-scripts/mlinux-scripts-1.1/mlinux-firmware-upgrade
+++ b/recipes-core/mlinux-scripts/mlinux-scripts-1.1/mlinux-firmware-upgrade
@@ -1,4 +1,5 @@
#!/bin/bash
+dofile=/var/volatile/do_flash_upgrade
if [ $# != 1 ]; then
echo "Usage: $0 upgrade.bin"
@@ -22,7 +23,7 @@ if [[ ! "$hw_version" =~ ^$firmware_model- ]]; then
exit 1
fi
-files=(bstrap.bin uboot.bin uImage.bin config.jffs2 oem.jffs2 rootfs.jffs2)
+files=(bstrap.bin uboot.bin uImage.bin config.jffs2 oem.jffs2 rootfs.jffs2 install.sh)
tobeflashed=0
# verify all MD5 sums
@@ -46,7 +47,18 @@ done
if (( $tobeflashed )); then
mkdir -p /var/volatile/flash-upgrade
mv -f $upgrade /var/volatile/flash-upgrade/upgrade.bin
- touch /var/volatile/do_flash_upgrade
+ touch "${dofile}"
+ chown "root:root" "${dofile}" || true
+ uid=$(stat -c %u "${dofile}") || true
+ result=$?
+ if ((result != 0)) ; then
+ logger -s -t firmware_upgrade "Cannot create ${dofile}"
+ exit 1
+ fi
+ if ((uid != 0)) ; then
+ logger -s -t firmware_upgrade "Cannot set ownership of ${dofile} to root"
+ exit 1
+ fi
logger -s -t firmware_upgrade "Rebooting"
sleep 1
reboot
diff --git a/recipes-core/mlinux-scripts/mlinux-scripts_1.1.bb b/recipes-core/mlinux-scripts/mlinux-scripts_1.1.bb
index 43dc162..338b62f 100644
--- a/recipes-core/mlinux-scripts/mlinux-scripts_1.1.bb
+++ b/recipes-core/mlinux-scripts/mlinux-scripts_1.1.bb
@@ -2,6 +2,6 @@ DESCRIPTION = "Scripts to easily get started with common mLinux use cases"
require mlinux-scripts.inc
-PR = "r2"
+PR = "r3"
S = "${WORKDIR}/mlinux-scripts-${PV}"