implement partial matching using PCRE

To speed up the boot process, Android doesn't visit every directory
in /sys. Instead, only those directories which match a regular
expression in /file_contexts are visited. Other directories are
skipped. This results in 2-3 second boot time reduction.

The initial version of this optimization was implemented in
change 0e7340fb99b931540e2baf4778abeb53d40084e7. However, because
PCRE wasn't available, it was recognized that false positives and
false negatives might occur.

Now that PCRE is available, start using it. It will avoid the
false positive / negatives problem.

Bug: 17682157

(cherry picked from commit d0b768abcd2b4adb1853ac38e59aa80f09872ac3)

Change-Id: I403e32cdb23e45abcf6f2a702af88a3eacc47942
2 files changed
tree: 47c919e09c49dbc130a2314d11cbf8639f4abeae
  1. include/
  2. src/
  3. Android.mk
  4. NOTICE