First, I use osmc on raspberry pi 2 on usb power connected to the tv (which is not really recommended) and turn the pi on and off as i turn on/off the tv.
Sometimes it wont boot and there are 4 green flashing lights. I fix this by taking out the microsd card and copying config.txt from a backup and overwriting the 0/empty config.txt file on the card.
why does this happen?
is there a way to lock the config.txt file to stop it from being written to? or so that it cannot change the files contents. it seems to be only this config.txt file that is causing the boot failure.