Support for grow on mount when resizing FS to max (#19659)

This commit is contained in:
s-hadinger 2023-10-03 19:14:45 +02:00 committed by GitHub
parent 58d43333f5
commit 94842bc0d1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 729 additions and 815 deletions

View File

@ -591,7 +591,6 @@ class Partition
var fs_slot = self.slots[-1]
fs_slot.sz += unallocated * 1024
self.save()
self.invalidate_spiffs() # erase SPIFFS or data is corrupt
# restart
tasmota.global.restart_flag = 2
@ -601,19 +600,6 @@ class Partition
end
end
#- invalidate SPIFFS partition to force format at next boot -#
#- we simply erase the first byte of the first 2 blocks in the SPIFFS partition -#
def invalidate_spiffs()
import flash
#- we expect the SPIFFS partition to be the last one -#
var spiffs = self.slots[-1]
if !spiffs.is_spiffs() raise 'value_error', 'No SPIFFS partition found' end
var b = bytes("00") #- flash memory: we can turn bits from '1' to '0' -#
flash.write(spiffs.start , b) #- block #0 -#
flash.write(spiffs.start + 0x1000, b) #- block #1 -#
end
# switch to safeboot `factory` partition
def switch_factory(force_ota)
import flash

View File

@ -593,7 +593,6 @@ class Partition
var fs_slot = self.slots[-1]
fs_slot.sz += unallocated * 1024
self.save()
self.invalidate_spiffs() # erase SPIFFS or data is corrupt
# restart
tasmota.global.restart_flag = 2
@ -603,19 +602,6 @@ class Partition
end
end
#- invalidate SPIFFS partition to force format at next boot -#
#- we simply erase the first byte of the first 2 blocks in the SPIFFS partition -#
def invalidate_spiffs()
import flash
#- we expect the SPIFFS partition to be the last one -#
var spiffs = self.slots[-1]
if !spiffs.is_spiffs() raise 'value_error', 'No SPIFFS partition found' end
var b = bytes("00") #- flash memory: we can turn bits from '1' to '0' -#
flash.write(spiffs.start , b) #- block #0 -#
flash.write(spiffs.start + 0x1000, b) #- block #1 -#
end
# switch to safeboot `factory` partition
def switch_factory(force_ota)
import flash