Closed Drewsif closed 1 month ago
How about "if /etc/rc.local.bak already exists, don't overwrite it". Overwrite rc.local all you want, but keep the original backup to be eventually restored. that's what I did to keep a multistage build (where I use a shrunken image as the input to the next phase, then shrink again) from ending up with an rc.local-loop. It works in my case because I know pishrink is the only thing messing with /etc/rc.local.
When would you have a case where you edit the expansion script and need to retain those changes? Why not just put them in the backup, which gets run at the end of the expansion?
Currently PiShrink uses
md5sum
to detect if we have already changed/etc/rc.local
. This is extremely fragile and not the best choice.The new method should:
/etc/rc.local
should not be touchedMy initial idea for a new method is to put a unique string into the expansion script which we key on.