nisargjhaveri / WirelessAndroidAutoDongle

Use Wireless Android Auto with a car that supports only wired Android Auto using a Raspberry Pi.
MIT License
656 stars 70 forks source link

Update README.md: add hardening paragraph #109

Open manio opened 5 months ago

nisargjhaveri commented 4 months ago

Are you seeing any issues because the sdcard is writable? We should not be writing anything apart from the bt config anyway. If we're not writing anything, sdcard should be safe anyway, no? Is some other process trying to write to sdcard?

manio commented 4 months ago

Not exactly. I had a problem with the Pi Zero 2 W stopped booting. I was plugging it to the car's USB multiple times and it was not booting at all. Finally I just inserted the SD card to my main linux machine and mounted the filesystem, dmesg told "recovery complete" and It was working back again in the Pi and AndroidAuto was working fine again. In fact when the fs is mounted read-write a lot of changes are written to this filesystem, like last timestamp for accessing files, timestamp for filesystem mount, whole journal, etc. So overall a lot of writes are done to the SD even when there are no file changes at all. Read-only mode is much more safe, especially for system with unexpected power offs (like in the car).

hkfuertes commented 4 months ago

I think I also have my sdcard corrupted, I will try this with a new card.... In the mean time... how about this? https://github.com/azlux/log2ram

hkfuertes commented 4 months ago

Also, this could be even automated via ansible or something similar... maybe a bash script with ssh... or with Termux, from the phone itself (so that it could be mounted/remounted at will from the phone...)

krish-ag commented 3 months ago

I think I also have my sdcard corrupted, I will try this with a new card.... In the mean time... how about this? https://github.com/azlux/log2ram

I also have faced this issue on both raspberry pi 4 and zero 2 w that it does not work after some switching between android devices

I can make fs read only but I dont want to lose Android switching functionality

anegrin commented 3 months ago

this looks like a good idea in general:

this project is fantastic...i hope i will have time in the future to create some companion app to do:

nisargjhaveri commented 1 month ago

We already log on RAM, but even then looks like there was continuous activity. Couldn't really figure out who and what it was trying to write.

See #159, which makes root readonly and creates a new partition for required persistent data. Have a look if it makes sense? My hunch is that it should greatly reduce chances of SD card failure.