Avoid ro->rw->ro mounts for /factory
When manta boots, the /factory partition was handled as follows:
1) Mount /factory read-only from fstab.manta
2) Remount /factory read-write from init.manta.rc
3) Update SELinux labels on /factory via restorecon_recursive /factory
4) Remount /factory read-only from init.manta.rc
Due to system/core commit e18c0d508a6d8b4376c6f0b8c22600e5aca37f69,
when a read-only partition is mounted via fstab.manta, we also set
the BLKROSET ioctl so that the underlying block device is also marked
read-only. This breaks the above sequence of steps.
Specifically, when we attempt to remount /factory read-write, the kernel
realizes that the underlying block device is marked read-only, and
refuses the remount. This causes the restorecon_recursive call to
fail.
This change simplifies the above sequence by avoiding the initial
read-only mount. The steps are now:
1) Mount /factory read-write from fstab.manta
2) Update SELinux labels on /factory via restorecon_recursive /factory
3) Remount /factory read-only from init.manta.rc
Bug: 18036999
Change-Id: I39fde77e85242c67f67bb601d4ffcdb3b4b087df
2 files changed