Generic binary for managing the /misc partition.
This CL only uses it to do a basic health check for the /misc
partition, but the idea is this is a single place that can manage
misc partition operations for the Android platform, rather than
having to write a new tool each time.
Bug: 317262681
Test: boot, check bugreport
Change-Id: I29a4189e2e9aee57cf66520207297d39d666f7a4
bootloader_message.h currently divides /misc into four segments. The
space between 2K and 16K is reserved for vendor use (e.g. bootloader
persists flags). This CL adds a vendor tool "misc_writer", to allow
writing data to the vendor space in /misc, before getting a dedicated
HAL for accessing /misc partition (b/131775112).
Targets need to explicitly include the module, then invoke the
executable to write data. For example, the following command will write
3-byte data ("0xABCDEF") to offset 4 in vendor space (i.e. 2048 + 4 in
/misc).
$ /vendor/bin/misc_writer --vendor-space-offset 4 --hex-string 0xABCDEF
Bug: 132906936
Test: Run recovery_unit_test on crosshatch.
Test: Call the command via init.hardware.rc on crosshatch. Check that
the call finishes successfully. Then check the contents written to
/misc (`dd bs=1 skip=2048 if=/dev/block/sda2 count=32 | xxd`).
Change-Id: I79548fc63fc79b705a0320868690569c3106949f
libfstab is not built for darwin, don't build libbootloader_message
either.
Bug: 131709594
Test: m PRODUCT-sdk-sdk sdk_repo
Change-Id: I6e3b04f1c3e97d5aa6ac0452bf13e714f8dae437
Also, strlcat is not available on host, so use
std::string::operator+= instead.
Test: cuttlefish
Bug: 79094284
Change-Id: I1e69daeb522ca73f43e0c4855cf099a021ed4d47
And uses the shared lib version of libbase and libfs_mgr.
Bug: 78793464
Test: `m dist`
Test: Run recovery_{unit,component}_test on marlin.
Change-Id: I750c02d0bfccd6e58fb01f641de02532ace52e00
Libraries that are direct or indirect dependencies of modules installed
to recovery partition (e.g. adbd) are marked as recovery_available:
true. This allows a recovery variant of the lib is created when it is
depended by other recovery or recovery_available modules.
Bug: 79146551
Test: m -j
Change-Id: I9ca07ef53fbd89e7c86c0ba269fa52bb48d6deb4
Turn on -Wall for all modules. Also remove the obsolete file_cmp() in
apply_patch test and now() in wear_ui.
The only exception is lib_edify due to the unused functions in the
intermediate cpp files generated from the lex files. It will be handled
in a seperate CL.
Bug: 64939312
Test: mma, unit tests pass
Change-Id: Ic53f76b60b6401ab20db3d98130d674c08e3702f