libblkid: add erofs filesystem support

Enhanced Read-Only File System (EROFS) has been included in Linux
kernel, many Linux distributions, buildroot and Android AOSP for
a while. Plus, nowadays, it's known that EROFS has been commercially
used by several Android vendors for their system partitions.

This patch adds support for detecting EROFS filesystem to libblkid.

Since util-linux/util-linux@cd129b7 introduced blkid_probe_set_block_size
function to report filesystem block size, TWRP is using blkid 2.25.0, which
means blkid_probe_set_block_size wasn't supported and required, so remove
the blkszbits judgement and blkid_probe_set_block_size for fixing building.

Test: Add erofs mount point to twrp.flags, build and boot
OP4A7A:/ # logcat | grep erofs
I (6)[571:recovery]erofs: (device dm-0): mounted with opts: , root inode @ nid 58.
I (6)[571:recovery]erofs: (device dm-9): mounted with opts: , root inode @ nid 43.
I (6)[571:recovery]erofs: (device dm-1): mounted with opts: , root inode @ nid 52.
I (6)[571:recovery]erofs: (device dm-10): mounted with opts: , root inode @ nid 45.
I (6)[571:recovery]erofs: (device dm-8): mounted with opts: , root inode @ nid 42.
I (0)[571:recovery]erofs: (device dm-12): mounted with opts: , root inode @ nid 38.
I (3)[571:recovery]erofs: (device dm-0): mounted with opts: , root inode @ nid 58.
I (3)[571:recovery]erofs: (device dm-1): mounted with opts: , root inode @ nid 52.
I (3)[571:recovery]erofs: (device dm-0): mounted with opts: , root inode @ nid 58.
I (3)[571:recovery]erofs: (device dm-0): mounted with opts: , root inode @ nid 58.
I (3)[571:recovery]erofs: (device dm-9): mounted with opts: , root inode @ nid 43.
I (2)[571:recovery]erofs: (device dm-1): mounted with opts: , root inode @ nid 52.
I (2)[571:recovery]erofs: (device dm-10): mounted with opts: , root inode @ nid 45.
I (2)[571:recovery]erofs: (device dm-8): mounted with opts: , root inode @ nid 42.
I (2)[571:recovery]erofs: (device dm-12): mounted with opts: , root inode @ nid 38.
I (6)[571:recovery]erofs: (device dm-0): mounted with opts: , root inode @ nid 58.
I (6)[571:recovery]erofs: (device dm-0): mounted with opts: , root inode @ nid 58.

OP4A7A:/ # cat /tmp/recovery.log | grep erofs
   Current_File_System: erofs
   Fstab_File_System: erofs
   Current_File_System: erofs
   Fstab_File_System: erofs
   Fstab_File_System: erofs
   Current_File_System: erofs
   Fstab_File_System: erofs
   Current_File_System: erofs
   Fstab_File_System: erofs
   Current_File_System: erofs
   Fstab_File_System: erofs
   Current_File_System: erofs
   Fstab_File_System: erofs

Now TWRP can recognize the EROFS filesystem perfectly after setting fs in twrp.flags

Signed-off-by: Gao Xiang <hsiangkao@redhat.com>
[@pomelohan: Adapt for TWRP's libblkid version and add erofs.c to build]
Co-authored-by: GarfieldHan <2652609017@qq.com>
Signed-off-by: GarfieldHan <2652609017@qq.com>
Change-Id: I00263757b5b6ed881165e65795ef849d86763165
4 files changed
tree: 6e3f5c8ba5aa8544204f4e282b331406364c064a
  1. .github/
  2. adbbu/
  3. applypatch/
  4. attr/
  5. bmlutils/
  6. bootloader_message/
  7. crypto/
  8. dosfstools/
  9. edify/
  10. etc/
  11. exfat/
  12. fastboot/
  13. fb2png/
  14. flashutils/
  15. fonts/
  16. fuse/
  17. fuse_sideload/
  18. gpt/
  19. gui/
  20. htcdumlock/
  21. injecttwrp/
  22. install/
  23. libblkid/
  24. libcrecovery/
  25. libmincrypt/
  26. libpixelflinger/
  27. libtar/
  28. minadbd/
  29. minui/
  30. minuitwrp/
  31. minzip/
  32. mmcutils/
  33. mtdutils/
  34. mtp/
  35. openaes/
  36. orscmd/
  37. otafault/
  38. otautil/
  39. ozip_decrypt/
  40. pigz/
  41. prebuilt/
  42. recovery_ui/
  43. recovery_utils/
  44. res/
  45. res-hdpi/
  46. res-mdpi/
  47. res-xhdpi/
  48. res-xxhdpi/
  49. res-xxxhdpi/
  50. scripts/
  51. sepolicy/
  52. simg2img/
  53. soong/
  54. tests/
  55. tools/
  56. twrpDigest/
  57. twrpinstall/
  58. twrpTarMain/
  59. uncrypt/
  60. update_verifier/
  61. updater/
  62. updater_sample/
  63. .clang-format
  64. .gitignore
  65. Android.bp
  66. Android.mk
  67. BasePartition.cpp
  68. bootloader.h
  69. CleanSpec.mk
  70. data.cpp
  71. data.hpp
  72. exclude.cpp
  73. exclude.hpp
  74. find_file.cpp
  75. find_file.hpp
  76. fixContexts.cpp
  77. fixContexts.hpp
  78. fuse.h
  79. infomanager.cpp
  80. infomanager.hpp
  81. interlace-frames.py
  82. kernel_module_loader.cpp
  83. kernel_module_loader.hpp
  84. legacy_properties.h
  85. libaosprecovery_defaults.go
  86. mounts.c
  87. NOTICE
  88. openrecoveryscript.cpp
  89. openrecoveryscript.hpp
  90. OWNERS
  91. partition.cpp
  92. partitionmanager.cpp
  93. partitions.hpp
  94. PREUPLOAD.cfg
  95. progresstracking.cpp
  96. progresstracking.hpp
  97. README.md
  98. recovery-persist.cpp
  99. recovery-persist.rc
  100. recovery-refresh.cpp
  101. recovery-refresh.rc
  102. recovery.cpp
  103. recovery.h
  104. recovery_main.cpp
  105. recovery_ui.h
  106. startupArgs.cpp
  107. startupArgs.hpp
  108. tarWrite.c
  109. tarWrite.h
  110. TEST_MAPPING
  111. twcommon.h
  112. twrp-functions.cpp
  113. twrp-functions.hpp
  114. twrp.cpp
  115. twrpAdbBuFifo.cpp
  116. twrpAdbBuFifo.hpp
  117. twrpApex.cpp
  118. twrpApex.hpp
  119. twrpDigestDriver.cpp
  120. twrpDigestDriver.hpp
  121. twrpRepacker.cpp
  122. twrpRepacker.hpp
  123. twrpTar.cpp
  124. twrpTar.h
  125. twrpTar.hpp
  126. variables.h