Android 13.0.0 release 0.105
build_utils.sh: Add support for specifying modules for recovery/charger

Currently, build.sh makes it so that the same modules.load file is
used for normal boot and booting into recovery/fastbootd and charger
modes during first-stage init. This means that during normal boot,
the modules that are needed for recovery and charger modes are loaded
during first-stage init, which is not required.

Add support for specifying a list of modules that are required for
booting into recovery or charger mode, in addition to the set of modules
loaded during first-stage init. This introduces two new environment
variables called MODULES_RECOVERY_LIST and MODULES_CHARGER_LIST, which
point to files that contain lists the modules that are needed for
booting into recovery or charger mode respectively, in addition
to the modules required for first-stage init (defined by MODULES_LIST).

Defining MODULES_[RECOVERY/CHARGER]_LIST also produces a file named
modules.load.[recovery/charger] in the initramfs, which init uses
instead of modules.load when booting into recovery or charger mode
respectively to load the first-stage init and recovery and charger modules.
In case of normal boot, init will use the modules.load file, which will
only contain the modules needed for first stage-init, and the recovery and charger
modules will be loaded from from the vendor_dlkm partition during second-stage init.

Bug: 266752750
Change-Id: I11503b11683ef64cf0933b8641959ea5acd63ab1
Signed-off-by: Isaac J. Manjarres <isaacmanjarres@google.com>
3 files changed