File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -777,6 +777,19 @@ func switchPaperProBootPartition(newPart int, targetVersion string) error {
777777 newPartLabel = "b"
778778 }
779779
780+ // Reset error count for target partition
781+ errCntPath := fmt .Sprintf ("/sys/devices/platform/lpgpr/root%s_errcnt" , newPartLabel )
782+ if err := os .WriteFile (errCntPath , []byte ("0" ), 0644 ); err != nil {
783+ fmt .Printf ("Warning: Could not reset error count at %s: %v\n " , errCntPath , err )
784+ if * debug {
785+ logToFile (fmt .Sprintf ("Warning: Failed to reset error count: %v" , err ))
786+ }
787+ } else {
788+ if * debug {
789+ logToFile (fmt .Sprintf ("Reset error count at %s" , errCntPath ))
790+ }
791+ }
792+
780793 // Step 1: If current version is < 3.22, write to sysfs (for current OS to boot correctly)
781794 if ! currentIsNew {
782795 if err := os .WriteFile ("/sys/devices/platform/lpgpr/root_part" , []byte (newPartLabel ), 0644 ); err != nil {
You can’t perform that action at this time.
0 commit comments