Every time I edit a file in /, /sbin, or /system/bin it overwrites on restart (device is rooted and in r/w mode). I assume this is because Android mounts a temporary root? Or maybe it's just a problem on my device?
How do I make a permanent change to root files? Can I do this through adb? Do I need to edit the system image, and if so can anyone point me in the right direction on where to start on this?
Answer
The root file system (/
) and the files therein (plus several more in some sub-directories) are overwritten at boot time from the so-called InitRd ("initial RAM disk", or "boot image"). So if you must change/add stuff there, you will have to modify that image.
If you just want to store some additional binaries/scripts, you should rather do so in /system/xbin
(which usually is also contained in the $PATH
) – though files in /system/bin
should survive a reboot as well (/system
is a separate partition usually mounted read-only, and thus not touched except for OS updates).
No comments:
Post a Comment