Revert "avbtool: Generate forward-error-correcting codes for hashtree by default."

This reverts commit 02c550f85abc41491756495b9ea33d966e6e9585.
diff --git a/README.md b/README.md
index 8421383..a6d033e 100644
--- a/README.md
+++ b/README.md
@@ -331,7 +331,7 @@
         [--include_descriptors_from_footer /path/to/image.bin]                     \
         [--setup_rootfs_from_kernel /path/to/image.bin]                            \
         [--output_vbmeta_image OUTPUT_IMAGE] [--do_not_append_vbmeta_image]        \
-        [--do_not_generate_fec] [--fec_num_roots FEC_NUM_ROOTS]                    \
+        [--generate_fec] [--fec_num_roots FEC_NUM_ROOTS]                           \
         [--signing_helper /path/to/external/signer]                                \
         [--append_to_release_string STR]
 
@@ -441,14 +441,12 @@
 The variable `BOARD_AVB_SYSTEM_ADD_HASHTREE_FOOTER_ARGS` can be used
 to specify additional options passed to `avbtool add_hashtree_footer`
 for `system.img`. Typical options to be used here include
-`--hash_algorithm`, `--salt`, `--block_size`, and
-`--do_not_generate_fec`.
+`--hash_algorithm`, `--salt`, `--block_size`, and `--generate_fec`.
 
 The variable `BOARD_AVB_VENDOR_ADD_HASHTREE_FOOTER_ARGS` can be used
 to specify additional options passed to `avbtool add_hashtree_footer`
 for `vendor.img`. Typical options to be used here include
-`--hash_algorithm`, `--salt`, `--block_size`, and
-`--do_not_generate_fec`.
+`--hash_algorithm`, `--salt`, `--block_size`, and `--generate_fec`.
 
 The variable `BOARD_AVB_DTBO_ADD_HASH_FOOTER_ARGS` can be used to
 specify additional options passed to `avbtool add_hash_footer` for
diff --git a/avbtool b/avbtool
index 7c18d46..08876a2 100755
--- a/avbtool
+++ b/avbtool
@@ -3279,16 +3279,8 @@
                             help='Block size (default: 4096)',
                             type=parse_number,
                             default=4096)
-    # TODO(zeuthen): The --generate_fec option was removed when we
-    # moved to generating FEC by default. To avoid breaking existing
-    # users needing to transition we simply just print a warning below
-    # in add_hashtree_footer(). Remove this option and the warning at
-    # some point in the future.
     sub_parser.add_argument('--generate_fec',
-                            help=argparse.SUPPRESS,
-                            action='store_true')
-    sub_parser.add_argument('--do_not_generate_fec',
-                            help='Do not generate forward-error-correction codes',
+                            help='Add forward-error-correction codes',
                             action='store_true')
     sub_parser.add_argument('--fec_num_roots',
                             help='Number of roots for FEC (default: 2)',
@@ -3493,16 +3485,10 @@
   def add_hashtree_footer(self, args):
     """Implements the 'add_hashtree_footer' sub-command."""
     args = self._fixup_common_args(args)
-    # TODO(zeuthen): Remove when removing support for the
-    # '--generate_fec' option above.
-    if args.generate_fec:
-      sys.stderr.write('The --generate_fec option is deprecated since FEC '
-                       'is now generated by default. Use the option '
-                       '--do_not_generate_fec to not generate FEC.\n')
     self.avb.add_hashtree_footer(args.image.name if args.image else None,
                                  args.partition_size,
                                  args.partition_name,
-                                 not args.do_not_generate_fec, args.fec_num_roots,
+                                 args.generate_fec, args.fec_num_roots,
                                  args.hash_algorithm, args.block_size,
                                  args.salt, args.chain_partition, args.algorithm,
                                  args.key, args.public_key_metadata,
diff --git a/test/avb_ab_flow_unittest.cc b/test/avb_ab_flow_unittest.cc
index ea79224..3d16b60 100644
--- a/test/avb_ab_flow_unittest.cc
+++ b/test/avb_ab_flow_unittest.cc
@@ -201,8 +201,7 @@
                    " --partition_size %zd"
                    " --salt deadbeef"
                    " --algorithm SHA512_RSA4096 "
-                   " --key test/data/testkey_rsa4096.pem"
-                   " --do_not_generate_fec",
+                   " --key test/data/testkey_rsa4096.pem",
                    odm_path.value().c_str(),
                    rollback_odm,
                    odm_partition_size);
diff --git a/test/avb_slot_verify_unittest.cc b/test/avb_slot_verify_unittest.cc
index 76ce2f5..d8c414a 100644
--- a/test/avb_slot_verify_unittest.cc
+++ b/test/avb_slot_verify_unittest.cc
@@ -1299,8 +1299,7 @@
                  "--partition_size %d --partition_name foobar "
                  "--algorithm SHA256_RSA2048 "
                  "--key test/data/testkey_rsa2048.pem "
-                 "--internal_release_string \"\" "
-                 "--do_not_generate_fec",
+                 "--internal_release_string \"\"",
                  rootfs_path.value().c_str(),
                  (int)partition_size);
 
@@ -1430,8 +1429,7 @@
                  "--partition_size %d --partition_name system "
                  "--algorithm SHA256_RSA2048 "
                  "--key test/data/testkey_rsa2048.pem "
-                 "--internal_release_string \"\" "
-                 "--do_not_generate_fec",
+                 "--internal_release_string \"\"",
                  system_path.value().c_str(),
                  (int)system_part_size);
 
@@ -1440,8 +1438,7 @@
                  "--partition_size %d --partition_name foobar "
                  "--algorithm SHA256_RSA2048 "
                  "--key test/data/testkey_rsa2048.pem "
-                 "--internal_release_string \"\" "
-                 "--do_not_generate_fec",
+                 "--internal_release_string \"\"",
                  foobar_path.value().c_str(),
                  (int)foobar_part_size);
 
@@ -1450,8 +1447,7 @@
                  "--partition_size %d --partition_name bazboo "
                  "--algorithm SHA512_RSA4096 "
                  "--key test/data/testkey_rsa4096.pem "
-                 "--internal_release_string \"\" "
-                 "--do_not_generate_fec",
+                 "--internal_release_string \"\"",
                  bazboo_path.value().c_str(),
                  (int)bazboo_part_size);
 
@@ -1708,8 +1704,7 @@
                  "--partition_size %d --partition_name system "
                  "--algorithm SHA256_RSA2048 "
                  "--key test/data/testkey_rsa2048.pem "
-                 "--internal_release_string \"\" "
-                 "--do_not_generate_fec",
+                 "--internal_release_string \"\"",
                  system_path.value().c_str(),
                  (int)system_part_size);
 
diff --git a/test/avbtool_unittest.cc b/test/avbtool_unittest.cc
index 6cb9ac0..b9d058a 100644
--- a/test/avbtool_unittest.cc
+++ b/test/avbtool_unittest.cc
@@ -700,8 +700,7 @@
                    "--algorithm SHA256_RSA2048 "
                    "--key test/data/testkey_rsa2048.pem "
                    "--output_vbmeta_image %s "
-                   "--internal_release_string \"\" "
-                   "--do_not_generate_fec",
+                   "--internal_release_string \"\"",
                    rootfs_path.value().c_str(),
                    (int)partition_size,
                    ext_vbmeta_path.value().c_str());
@@ -915,8 +914,7 @@
                  "--algorithm SHA256_RSA2048 "
                  "--key test/data/testkey_rsa2048.pem "
                  "--output_vbmeta %s_2nd_run --do_not_append_vbmeta_image "
-                 "--internal_release_string \"\" "
-                 "--do_not_generate_fec",
+                 "--internal_release_string \"\"",
                  rootfs_path.value().c_str(),
                  (int)partition_size,
                  ext_vbmeta_path.value().c_str());
@@ -970,6 +968,7 @@
     EXPECT_COMMAND(0,
                    "./avbtool add_hashtree_footer --salt d00df00d --image %s "
                    "--partition_size %d --partition_name foobar "
+                   "--generate_fec "
                    "--algorithm SHA256_RSA2048 "
                    "--key test/data/testkey_rsa2048.pem "
                    "--internal_release_string \"\"",
@@ -1150,8 +1149,7 @@
 
   EXPECT_COMMAND(0,
                  "./avbtool add_hashtree_footer "
-                 "--partition_size %zd --calc_max_image_size "
-                 "--do_not_generate_fec > %s",
+                 "--partition_size %zd --calc_max_image_size > %s",
                  partition_size,
                  output_path.value().c_str());
   std::string max_image_size_data;
@@ -1174,8 +1172,7 @@
                  " --salt deadbeef"
                  " --algorithm SHA512_RSA4096 "
                  " --key test/data/testkey_rsa4096.pem"
-                 " --internal_release_string \"\" "
-                 "--do_not_generate_fec",
+                 " --internal_release_string \"\"",
                  system_path.value().c_str(),
                  partition_size);
 }
@@ -1186,7 +1183,8 @@
 
   EXPECT_COMMAND(0,
                  "./avbtool add_hashtree_footer "
-                 "--partition_size %zd --calc_max_image_size > %s",
+                 "--partition_size %zd --generate_fec "
+                 "--calc_max_image_size > %s",
                  partition_size,
                  output_path.value().c_str());
   std::string max_image_size_data;
@@ -1207,6 +1205,7 @@
                  " --partition_name system"
                  " --partition_size %zd"
                  " --salt deadbeef"
+                 " --generate_fec "
                  " --algorithm SHA512_RSA4096 "
                  " --key test/data/testkey_rsa4096.pem"
                  " --internal_release_string \"\"",