Commit graph

6 commits

Author SHA1 Message Date
Hridya Valsaraju
129d8743b9 Prevent debugfs unmount on debug builds with a persist property
In order to simplify developer/test flow, the persistent property
persist.dbg.keep_debugfs_mounted can be set to prevent debugfs from
being unmounted on boot.

Bug: 184381659
Test: build and boot
Change-Id: I714616b361e6c8fb59633ec0763f9bd55af7df0e
2021-04-16 13:59:15 -07:00
Hridya Valsaraju
d723f21fec Rename ro.product.enforce_debugfs_restriction appropriately
Rename ro.product.enforce_debugfs_restrictions to
ro.product.debugfs_restrictions.enabled as per the sysprop naming
scheme.

Bug: 184381659
Test: build, boot
Change-Id: Ie350eefa342e7e16d31363139257ed285780e874
2021-04-16 09:52:03 -07:00
Hridya Valsaraju
3f384a25fa Move debugfs mount/unmount to init-debug.rc
Debugfs cannot be mounted in userbuilds since Android R. Since init only
mounts/unmounts debugfs during boot for debug builds, move it to
init-debug.rc.

Bug: 184381659
Test: build/boot
Change-Id: Ib51e82b99ec1eb95a2647c91855f6d4d1585040a
2021-04-13 14:45:50 -07:00
Jeff Vander Stoep
082807f3b4 init-debug.rc: don't mount debugfs
Motivation:
1. Reduce skew between userdebug and user builds.
2. Make the decision to mount debugfs on debug builds on a
   per-device basis.
3. Prepare to not mount it at all to reduce the attack surface
   of the kernel, reduce boot time, and free up memory.
4. Remove the selinux denial on devices that mount twice, i.e.
   unconditionally in the device specific .rc file and in the
   init-debug.rc file.
   avc: denied { mounton } for path="/sys/kernel/debug" dev="debugfs"
   ino=1 scontext=u:r:init:s0 tcontext=u:object_r:debugfs:s0
   tclass=dir permissive=0

If desired, debugfs may be mounted in device specific rc files
instead.

Bug: 31856701
Bug: 35197529
Test: Build and boot Marlin. Selinux denial no longer observed.
Change-Id: Ie0d954f77f7cf70ed2b94f67a57a6c9eba45ba8e
2017-03-14 21:56:24 -07:00
Mihai Serban
afebc25bdd init-debug.rc: mount debugfs
Enable debugfs on non "user" builds.

BUG=27520850
Change-Id: I2bcc72b686d0477b553c0605adfd4c023e72cbfb
Signed-off-by: Mihai Serban <mihai.serban@intel.com>
2016-03-07 16:56:06 +02:00
Mark Salyzyn
7864e36751 init-debug.rc: add runtime mmc max speed property actors
persist.mmc.max_read_speed  - KB/s speed cap
persist.mmc.max_write_speed - KB/s speed cap
persist.mmc.cache_size      - MB of high-speed on-device write cache

device default directly to associated /sys/block/mmcblk0/ attributes,
not delivered on "user" builds.

Bug: 26976972
Change-Id: Ic82b9614489b6406ce830d127c85affc9095e256
2016-02-04 13:10:19 -08:00