Skip to content
Snippets Groups Projects

nor-update: Make sure we can dump the old env

Merged Michal Hrusecky requested to merge hotfix/nor-update into master
Compare and
2 files
+ 8
1
Preferences
Compare changes
Files
2
@@ -101,6 +101,13 @@ flash() {
uboot_preupdate() {
BACKUP_UBOOT_ENV="/usr/share/nor-update/uboot-env.backup"
v_echo "Storing old U-boot environment to be preserved"
if ! fw_printenv >/dev/null 2>&1; then
echo "Updating configuration for U-Boot environment access."
rm -f /etc/config/ubootenv
fw_env-config-init.sh
fi
fw_printenv >"$BACKUP_UBOOT_ENV" || {
# Let's assume that there is a default environment if we can't read it.
rm -f "$BACKUP_UBOOT_ENV"