summaryrefslogtreecommitdiff
path: root/recipes-core/initscripts
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-04-04 16:06:12 -0500
commit27c615de5a9c4029259c4c0fe90363f97103f3c9 (patch)
tree32f45248814c7db750214b4571eb8b876b09cf27 /recipes-core/initscripts
parent9df446722a949d4995250f5f9e5b61bc26afb6e4 (diff)
downloadmeta-mlinux-27c615de5a9c4029259c4c0fe90363f97103f3c9.tar.gz
meta-mlinux-27c615de5a9c4029259c4c0fe90363f97103f3c9.tar.bz2
meta-mlinux-27c615de5a9c4029259c4c0fe90363f97103f3c9.zip
Allow u-boot to be reflashed by itsef.
Diffstat (limited to 'recipes-core/initscripts')
-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}..."