Allow building generic OTA packages.

We already have targets that build generic system images, which can be
applied (flashed) onto matching devices to replace their target-specific
system images. This CL adds PRODUCT_BUILD_GENERIC_OTA_PACKAGE that
allows building generic OTA packages to be installed over-the-air.

Since A/B and non-A/B OTAs have different package formats, currently the
support is limited to targets that use A/B OTAs. Note that this CL only
allows _building_ the package - will need additional changes for the
actual package install as well as targeting matching devices.

Bug: 122851610
Test: `m otapackage` on a target that sets
      `PRODUCT_BUILD_GENERIC_OTA_PACKAGE := true`.
Test: TreeHugger
Change-Id: If6fd2da15d24c5aaee09618efe94514c6d83292d
diff --git a/core/board_config.mk b/core/board_config.mk
index 6f04fb3..9ea3509 100644
--- a/core/board_config.mk
+++ b/core/board_config.mk
@@ -475,6 +475,13 @@
   endif
 endif
 
+# Sanity check for building generic OTA packages. Currently it only supports A/B OTAs.
+ifeq ($(PRODUCT_BUILD_GENERIC_OTA_PACKAGE),true)
+  ifneq ($(AB_OTA_UPDATER),true)
+    $(error PRODUCT_BUILD_GENERIC_OTA_PACKAGE with 'AB_OTA_UPDATER != true' is not supported)
+  endif
+endif
+
 # Check BOARD_VNDK_VERSION
 define check_vndk_version
   $(eval vndk_path := prebuilts/vndk/v$(1)) \