Generate a separate fstab file for FIPS mode

Add a file "fstab.gs101-fips" alongside the existing "fstab.gs101" in
order to specify different encryption settings in FIPS mode.

"androidboot.fstab_suffix=gs101-fips" on the kernel command line will be
used to select the FIPS fstab when needed.

As the two fstabs should be otherwise identical, generate them from a
template file so that they will stay in sync.

Note that generating the fstabs requires that they be installed as build
system modules rather than via PRODUCT_COPY_FILES, which results in the
vendor_ramdisk copy of the fstabs being installed to system/etc rather
than /.  This shouldn't cause any problem, now that Android has been
updated to look for the fstab in this location too.

Bug: 191417025
Change-Id: I1d115e014df8ba2fb83046ac0b9b791597364846
diff --git a/BoardConfig-common.mk b/BoardConfig-common.mk
index b21f539..a3dcda0 100644
--- a/BoardConfig-common.mk
+++ b/BoardConfig-common.mk
@@ -59,7 +59,17 @@
 BOARD_MOVE_RECOVERY_RESOURCES_TO_VENDOR_BOOT := true
 BOARD_MOVE_GSI_AVB_KEYS_TO_VENDOR_BOOT := true
 TARGET_RECOVERY_WIPE := device/google/gs101/conf/recovery.wipe
-TARGET_RECOVERY_FSTAB := device/google/gs101/conf/fstab.gs101
+
+# This is the fstab file that will be included in the recovery image.  Note that
+# recovery doesn't care about the encryption settings, so it doesn't matter
+# whether we use the normal or the fips fstab here.
+#
+# Since this is a generated file, it's necessary to use intermediates-dir-for in
+# order to refer to it correctly.  And since intermediates-dir-for isn't defined
+# yet when this file is included, it's necessary to use a deferred variable
+# assignment ( = ) rather than an immediate variable assignment ( := ).
+TARGET_RECOVERY_FSTAB = $(call intermediates-dir-for,ETC,fstab.gs101)/fstab.gs101
+
 TARGET_RECOVERY_PIXEL_FORMAT := ABGR_8888
 TARGET_RECOVERY_UI_MARGIN_HEIGHT := 165
 TARGET_RECOVERY_UI_LIB := \