Allow to shrink ext2 filesystems.

There was a function a long time ago that didn't handle shrinking an
ext2 filesystem when computing the diff of the blocks that were not
part of a file nor metadata (mostly empty space blocks). This is now
handled in a different way, which is not related to how the filesystems
are parsed in the ABGenerator.

This patch removes the check that prevents the delta generator from
generating those payloads and fixes the inplace generator for partitions
that shrink in size.

Bug: 28846535
TEST=Generated a payload to a smaller ext2 system image, both for
minor version 1 and 2+.

Change-Id: Ide408c48b0032dbe478c8e348c40e1a0b5665ea8
4 files changed
tree: 152231d91c02c8af067663708520ae101e80f2f0
  1. binder_bindings/
  2. client_library/
  3. common/
  4. dbus_bindings/
  5. include/
  6. init/
  7. payload_consumer/
  8. payload_generator/
  9. sample_images/
  10. scripts/
  11. update_manager/
  12. update_payload_key/
  13. weaved/
  14. .gitignore
  15. Android.mk
  16. binder_service_android.cc
  17. binder_service_android.h
  18. binder_service_brillo.cc
  19. binder_service_brillo.h
  20. boot_control_android.cc
  21. boot_control_android.h
  22. boot_control_chromeos.cc
  23. boot_control_chromeos.h
  24. boot_control_chromeos_unittest.cc
  25. chrome_browser_proxy_resolver.cc
  26. chrome_browser_proxy_resolver.h
  27. chrome_browser_proxy_resolver_unittest.cc
  28. common_service.cc
  29. common_service.h
  30. common_service_unittest.cc
  31. connection_manager.cc
  32. connection_manager.h
  33. connection_manager_android.cc
  34. connection_manager_android.h
  35. connection_manager_interface.h
  36. connection_manager_unittest.cc
  37. connection_utils.cc
  38. connection_utils.h
  39. daemon.cc
  40. daemon.h
  41. daemon_state_android.cc
  42. daemon_state_android.h
  43. daemon_state_interface.h
  44. dbus_connection.cc
  45. dbus_connection.h
  46. dbus_service.cc
  47. dbus_service.h
  48. dbus_test_utils.h
  49. fake_file_writer.h
  50. fake_p2p_manager.h
  51. fake_p2p_manager_configuration.h
  52. fake_shill_proxy.cc
  53. fake_shill_proxy.h
  54. fake_system_state.cc
  55. fake_system_state.h
  56. generate_pc_file.sh
  57. hardware_android.cc
  58. hardware_android.h
  59. hardware_chromeos.cc
  60. hardware_chromeos.h
  61. hardware_chromeos_unittest.cc
  62. image_properties.h
  63. image_properties_android.cc
  64. image_properties_chromeos.cc
  65. image_properties_chromeos_unittest.cc
  66. libcros_proxy.cc
  67. libcros_proxy.h
  68. libupdate_engine-client-test.pc.in
  69. libupdate_engine-client.pc.in
  70. local_coverage_rate
  71. main.cc
  72. metrics.cc
  73. metrics.h
  74. metrics_utils.cc
  75. metrics_utils.h
  76. metrics_utils_unittest.cc
  77. mock_connection_manager.h
  78. mock_file_writer.h
  79. mock_omaha_request_params.h
  80. mock_p2p_manager.h
  81. mock_payload_state.h
  82. mock_power_manager.h
  83. mock_proxy_resolver.h
  84. mock_update_attempter.h
  85. MODULE_LICENSE_APACHE2
  86. NOTICE
  87. omaha_request_action.cc
  88. omaha_request_action.h
  89. omaha_request_action_unittest.cc
  90. omaha_request_params.cc
  91. omaha_request_params.h
  92. omaha_request_params_unittest.cc
  93. omaha_response.h
  94. omaha_response_handler_action.cc
  95. omaha_response_handler_action.h
  96. omaha_response_handler_action_unittest.cc
  97. omaha_utils.cc
  98. omaha_utils.h
  99. omaha_utils_unittest.cc
  100. OWNERS
  101. p2p_manager.cc
  102. p2p_manager.h
  103. p2p_manager_unittest.cc
  104. parcelable_update_engine_status.cc
  105. parcelable_update_engine_status.h
  106. payload_state.cc
  107. payload_state.h
  108. payload_state_interface.h
  109. payload_state_unittest.cc
  110. power_manager_android.cc
  111. power_manager_android.h
  112. power_manager_chromeos.cc
  113. power_manager_chromeos.h
  114. power_manager_interface.h
  115. PRESUBMIT.cfg
  116. proxy_resolver.cc
  117. proxy_resolver.h
  118. real_system_state.cc
  119. real_system_state.h
  120. run_unittests
  121. sample_omaha_v3_response.xml
  122. service_delegate_android_interface.h
  123. service_observer_interface.h
  124. shill_proxy.cc
  125. shill_proxy.h
  126. shill_proxy_interface.h
  127. system_state.h
  128. tar_bunzip2.gypi
  129. test_http_server.cc
  130. test_subprocess.cc
  131. testrunner.cc
  132. unittest_key.pem
  133. unittest_key2.pem
  134. update_attempter.cc
  135. update_attempter.h
  136. update_attempter_android.cc
  137. update_attempter_android.h
  138. update_attempter_unittest.cc
  139. update_engine-client.gyp
  140. update_engine.conf
  141. update_engine.gyp
  142. update_engine.rc
  143. update_engine_client.cc
  144. update_engine_client_android.cc
  145. update_metadata.proto
  146. update_status_utils.cc
  147. update_status_utils.h
  148. UpdateEngine.conf
  149. utils_android.cc
  150. utils_android.h
  151. WATCHLISTS
  152. weave_service.cc
  153. weave_service.h
  154. weave_service_factory.cc
  155. weave_service_factory.h
  156. weave_service_interface.h