Support v2 fstab format

Auto detect and support both the v1 and v2 fstab formats
Support putting TWRP style flags in a separate /etc/twrp.flags file

twrp.flags format is the same as twrp.fstab (v1 with TWRP flags)

Support using a wildcard in a block device and find all partitions:
/usb-otg vfat /dev/block/sda*

Support using sysfs entries (voldmanaged) and read uevents and scan for
wildcard partitions from uevent data. (twvold?)

May not be complete for some of the newer flags found in fstabs in newer
build trees and there is a slim chance of a crash if the user removes a
removable device while TWRP is performing actions. May need to add some
kind of mutex to prevent the 2 threads from causing this crash. We need
to start somewhere though and this change is pretty innocuous when not
using a v2 fstab.

Change-Id: I617d97c7db332cbe671a9d2b8ad98b3d9c4f03cc
13 files changed
tree: e0a0635a0812fda8801fa6874c6dfc47bc277cae
  1. adbbu/
  2. applypatch/
  3. attr/
  4. bmlutils/
  5. bootloader_message/
  6. bootloader_message_twrp/
  7. crypto/
  8. dosfstools/
  9. edify/
  10. etc/
  11. exfat/
  12. fb2png/
  13. flashutils/
  14. fonts/
  15. fuse/
  16. gpt/
  17. gui/
  18. htcdumlock/
  19. injecttwrp/
  20. libblkid/
  21. libcrecovery/
  22. libmincrypt/
  23. libpixelflinger/
  24. libtar/
  25. minadbd/
  26. minadbd21/
  27. minui/
  28. minui21/
  29. minuitwrp/
  30. minzip/
  31. mmcutils/
  32. mtdutils/
  33. mtp/
  34. openaes/
  35. orscmd/
  36. otafault/
  37. otautil/
  38. pigz/
  39. prebuilt/
  40. private/
  41. res/
  42. res-hdpi/
  43. res-mdpi/
  44. res-xhdpi/
  45. res-xxhdpi/
  46. res-xxxhdpi/
  47. scripts/
  48. sepolicy/
  49. simg2img/
  50. tests/
  51. toolbox/
  52. tools/
  53. toybox/
  54. twrpDigest/
  55. twrpTarMain/
  56. uncrypt/
  57. update_verifier/
  58. updater/
  59. verifier24/
  60. .clang-format
  61. .gitignore
  62. adb_install.cpp
  63. adb_install.h
  64. Android.mk
  65. asn1_decoder.cpp
  66. asn1_decoder.h
  67. bootloader.h
  68. CleanSpec.mk
  69. common.h
  70. data.cpp
  71. data.hpp
  72. default_device.cpp
  73. device.cpp
  74. device.h
  75. error_code.h
  76. exclude.cpp
  77. exclude.hpp
  78. find_file.cpp
  79. find_file.hpp
  80. fixContexts.cpp
  81. fixContexts.hpp
  82. fuse.h
  83. fuse_sdcard_provider.cpp
  84. fuse_sdcard_provider.h
  85. fuse_sideload.cpp
  86. fuse_sideload.h
  87. infomanager.cpp
  88. infomanager.hpp
  89. install.cpp
  90. install.h
  91. installcommand.cpp
  92. installcommand.h
  93. interlace-frames.py
  94. legacy_properties.h
  95. legacy_property_service.cpp
  96. legacy_property_service.h
  97. mounts.c
  98. mounts.cpp
  99. mounts.h
  100. mounts.h~HEAD
  101. NOTICE
  102. openrecoveryscript.cpp
  103. openrecoveryscript.hpp
  104. partition.cpp
  105. partitionmanager.cpp
  106. partitions.hpp
  107. print_sha1.h
  108. progresstracking.cpp
  109. progresstracking.hpp
  110. README.md
  111. recovery-persist.cpp
  112. recovery-persist.rc
  113. recovery-refresh.cpp
  114. recovery-refresh.rc
  115. recovery.cpp
  116. recovery_ui.h
  117. roots.cpp
  118. roots.h
  119. rotate_logs.cpp
  120. rotate_logs.h
  121. screen_ui.cpp
  122. screen_ui.h
  123. set_metadata.cpp
  124. set_metadata.h
  125. stub_ui.h
  126. tarWrite.c
  127. tarWrite.h
  128. tw_atomic.cpp
  129. tw_atomic.hpp
  130. twcommon.h
  131. twinstall.cpp
  132. twinstall.h
  133. twinstallorig.cpp
  134. twinstallorig.h
  135. twrp-functions.cpp
  136. twrp-functions.hpp
  137. twrp.cpp
  138. twrpAdbBuFifo.cpp
  139. twrpAdbBuFifo.hpp
  140. twrpDigestDriver.cpp
  141. twrpDigestDriver.hpp
  142. twrpTar.cpp
  143. twrpTar.h
  144. twrpTar.hpp
  145. ui.cpp
  146. ui.h
  147. variables.h
  148. verifier.cpp
  149. verifier.h
  150. wear_touch.cpp
  151. wear_touch.h
  152. wear_ui.cpp
  153. wear_ui.h
  154. zipwrap.cpp
  155. zipwrap.hpp
README.md

Team Win Recovery Project (TWRP)

You can find a compiling guide here.