I compared 2 devices; one running Android v5.1.1 and other v9.0. So I noticed that files under
/proc are same in both.
Can anyone explain why there is no difference even though OEM's are different and SDK versions are poles apart?
Android OS has two parts: kernel and userspace binaries, libraries, configuration etc. Android's kernel is taken from Linux, slightly modified and rarely gets major updates in years (other than critical security patches), while the second part gets frequent changes and updates, particularly with version releases.
The procfs is Linux kernel's virtual filesystem which:
contains (among other things) one sub-directory for each process running on the system, which is named after the process ID (PID)
So it's not directly affected by changes made to AOSP by OEMs or Google itself.
Since Android is based on Linux, its filesystem hierarchy also resembles Linux distributions. So there are least chances of it being changed with Android version updates. What Android (Google or OEM) changes resides mostly in
/vendor partitions. Libraries (native or java), executable and configuration files may possibly change but most of the changes related to Graphical User Interface or Android's internal API's are only within source code and don't reflect at filesystem level.
Android's root filesystem is extracted from RAM disk which is a part of boot partition.
boot.img that also contains kernel binary is built along with ROM (Android OS for a specific device). Starting with Android Pie for non-A/B devices, contents of RAM disk are moved to
/system partition, making
system.img essentially the root filesystem. See System-as-root.
- One important file in root directory is
/initexecutable binary which is the very first process started by kernel. It's the supervisor of all subsequently starting and stopping processes.
/*.rcfiles are its configuration files.
- Some other necessary binaries are included in
/sepolicyis the SELinux policy file that's loaded before starting any services and processes on boot.
/vendorare mountpoints where different block devices are mounted. Last three contain most of the Android OS stuff while
/datacontains settings and user's media.
/systemhas a partial rootfs hierarchy of a standard Linux distro.
/cacheholds temporary files.
/dsp(directory or symlink to
/firmware(directory or symlink to
/vendor/firmware_mnt) hold some read-only firmware related to SoC (Qualcomm) and
/persist(directory or symlink to
/mnt/vendor/persist) has configurations that are rarely changed.
/storageare also mountpoints of virtual filesystems to manage mounting of SD cards and external storage. Details here.
/procis a pseudo filesystem as stated above.
/sysis also a similar filesystem.
/devis also a virtul filesystem (
tmpfs) which is populated from
sysfsand contains interfaces to all available devices.
/acctis one of Android's
control groupimplementation to control load-balancing of CPUs. Other cgroups are mounted on
/dev/cpusetto control usage of hardware resources.
/rootis the traditional
homedirectory of Linux's
rootuser, not used on Android.
/default.propis a file or symlink to
/etc/default.propwhich contains some of default Android System Properties.
- To retain compatibility,
/sdcardis a symlink to
/sys/kernel/debug. The traditional Linux's configuration directory
/etcis a symlink to
Almost all of this filesystem hierarchy is the backbone of Android OS and there are very least chances of it being largely affected by Android's internal changes that occur to native services/daemons or Java-based framework.
For more details: ANDROID DEVICE PARTITIONS and FILESYSTEMS