 -	"clearenv=if sf probe; then " \
 -		"sf erase 0x100000 0x2000 && " \
 -		"echo restored environment to factory default ; fi\0" \
-+        "reprovision=if load mmc 0:1 ${loadaddr} /remove_to_reprovision; "\
-+                        "then env set resin_flash true; " \
-+                     "else " \
-+                        "env set resin_flash false; " \
-+                      "fi; \0" \
++        "reprovision=if mmc dev 0; then " \
++                        "if load mmc 0:1 ${loadaddr} /remove_to_reprovision; then " \
++                            "env set resin_flash true; " \
++                        "else " \
++                            "env set resin_flash false; " \
++                        "fi; " \
++                    "else " \
++                        "env set resin_flash true; " \
++                    "fi; \0" \
 +        "bootargs=root=/dev/mmcblk2p2 rootwait rw console=ttymxc0,115200 enable_wait_mode=off\0" \
  	"sdboot=echo Booting from the SD card ...; " \
  		"bbdetect; " \


Signed-off-by: Theodor Gherzan <theodor@resin.io>
---
 include/configs/ts4900.h | 71 ++++++++++--------------------------------------
 1 file changed, 14 insertions(+), 57 deletions(-)

diff --git a/include/configs/ts4900.h b/include/configs/ts4900.h
index 6a4e113..7dcee2f 100644
--- a/include/configs/ts4900.h
+++ b/include/configs/ts4900.h
@@ -190,87 +190,44 @@
 #define CONFIG_NFS_TIMEOUT 10000UL
 
 #define CONFIG_EXTRA_ENV_SETTINGS \

 /* Miscellaneous configurable options */
 #define CONFIG_SYS_LONGHELP
-- 
2.5.2

