summaryrefslogtreecommitdiff
path: root/recipes-core
diff options
context:
space:
mode:
authorJohn Klug <john.klug@multitech.com>2017-03-14 13:29:15 -0500
committerJohn Klug <john.klug@multitech.com>2017-03-14 13:29:42 -0500
commitdce05d230989046baae5514c2b527f6c174b29e2 (patch)
tree6fb75c514daec57ac1fb0e6fd9c47ffe8ba173ba /recipes-core
parent9380851641e29262352b94b75086c7911cea8a3a (diff)
downloadmeta-mlinux-dce05d230989046baae5514c2b527f6c174b29e2.tar.gz
meta-mlinux-dce05d230989046baae5514c2b527f6c174b29e2.tar.bz2
meta-mlinux-dce05d230989046baae5514c2b527f6c174b29e2.zip
Allow u-boot to be reflashed by itsef.
Diffstat (limited to 'recipes-core')
-rw-r--r--recipes-core/initscripts/initscripts-1.0/umountfs12
1 files changed, 11 insertions, 1 deletions
diff --git a/recipes-core/initscripts/initscripts-1.0/umountfs b/recipes-core/initscripts/initscripts-1.0/umountfs
index 3403cca..8c12ebe 100644
--- a/recipes-core/initscripts/initscripts-1.0/umountfs
+++ b/recipes-core/initscripts/initscripts-1.0/umountfs
@@ -61,6 +61,7 @@ flash_upgrade() {
local upgrade_file=${flash_dir}/upgrade.bin
local kernel_solo_file=${flash_dir}/uImage.bin
local rootfs_solo_file=${flash_dir}/rootfs.jffs2
+ local uboot_solo_file=${flash_dir}/u-boot.bin
local reboot_cmd=/usr/sbin/upgrade-reboot
local nandwrite_cmd=/usr/bin/nandwrite.static
@@ -179,7 +180,7 @@ flash_upgrade() {
echo ""
if [ -f "${upgrade_file}" ]; then
echo "Starting flash upgrade from ${upgrade_file}..."
- elif [ -f "${kernel_solo_file}" ] || [ -f "${rootfs_solo_file}" ]; then
+ elif [ -f "${kernel_solo_file}" ] || [ -f "${rootfs_solo_file}" ] || [ -f "${uboot_solo_file}" ] ; then
echo "Starting flash upgrade from ${flash_dir}..."
else
return
@@ -217,6 +218,15 @@ flash_upgrade() {
fi
done
else
+ if [ -f ${uboot_solo_file} ]; then
+ echo "Flashing ${uboot_mtd} (u-boot) with ${uboot_solo_file}..."
+
+ flash_erase ${uboot_mtd} 0 0
+ ${flash_dir}/nandwrite.static -p ${uboot_mtd} ${uboot_solo_file}
+ else
+ echo "u-boot file ${uboot_solo_file} not found"
+ fi
+
if [ -f ${kernel_solo_file} ]; then
echo "Flashing ${kernel_mtd} (uImage) with ${kernel_solo_file}..."