Skip to content
Permalink
Browse files
Allow /dsp partition labels to be set correctly
AOSP sets selinux contexts on system partitions at
build time but our /dsp partition is not built so
AOSP does not have the correct selinux context.

To fix this we must mount as rw, set our contexts,
then remount as ro.

Remounting a system partition is ugly, but without
this our /dsp partition is seen as unlabled, and
requires poor selinux policy that grants 'god mode'
to the adsprpcd service.

Pixel devices do not require this as their /dsp is
actually a symlink to /vendor/lib/dsp.
  • Loading branch information
stellirin committed Nov 20, 2017
1 parent 20a3678 commit 0bfc628924d467b8b916c7ed4ff681e6dfbc535d
Showing 2 changed files with 6 additions and 1 deletion.
@@ -9,7 +9,7 @@
/dev/block/bootdevice/by-name/boot /boot emmc defaults defaults
/dev/block/bootdevice/by-name/FOTAKernel /recovery emmc defaults defaults
/dev/block/bootdevice/by-name/frp /persistent emmc defaults defaults
/dev/block/bootdevice/by-name/dsp /dsp ext4 ro,noatime,nosuid,nodev,barrier=1 defaults
/dev/block/bootdevice/by-name/dsp /dsp ext4 nosuid,nodev,barrier=1,data=ordered,nodelalloc,nomblk_io_submit,errors=panic wait,notrim
/dev/block/bootdevice/by-name/apps_log /misc emmc defaults defaults
/dev/block/bootdevice/by-name/modem /firmware vfat ro,shortname=lower,uid=1000,gid=1000,dmask=227,fmask=337,context=u:object_r:firmware_file:s0 wait
/dev/block/bootdevice/by-name/persist /persist ext4 nosuid,nodev,barrier=1,data=ordered,nodelalloc,nomblk_io_submit,errors=panic wait,notrim
@@ -25,6 +25,11 @@ on fs
mount_all ./fstab.tone
swapon_all ./fstab.tone

# /dsp is initially unlabelled so we need to mount
# it as rw, restore AOSP labels, then remount
restorecon_recursive /dsp
mount rootfs rootfs /dsp ro remount

restorecon_recursive /persist
write /sys/kernel/boot_adsp/boot 1
write /sys/kernel/boot_slpi/boot 1

0 comments on commit 0bfc628

Please sign in to comment.