libavb: Don't pass androidboot.slot_suffix in generated kernel command-line.
It's not appropriate to do this since the boot loader's A/B stack will
likely do this. Also add new avb_strdupv() utility function so it's
easy to do this yourself and update UEFI example bootloader to use
this.
Bug: None
Test: New unit tests + all unit tests pass.
Test: Manually tested on UEFI based bootloader.
Change-Id: I9f9596b1f273330e80a38d857233167fefcce01b
diff --git a/test/avb_util_unittest.cc b/test/avb_util_unittest.cc
index 0c8c375..4ee155d 100644
--- a/test/avb_util_unittest.cc
+++ b/test/avb_util_unittest.cc
@@ -470,6 +470,13 @@
std::string(avb_replace("$(FOO)$(FOO)", "$(FOO)", "LONGSTRING")));
}
+TEST(UtilTest, StrDupV) {
+ // We don't care about leaking avb_strdupv() result.
+ EXPECT_EQ("xyz", std::string(avb_strdupv("x", "y", "z", NULL)));
+ EXPECT_EQ("HelloWorld XYZ",
+ std::string(avb_strdupv("Hello", "World", " XYZ", NULL)));
+}
+
TEST(UtilTest, Crc32) {
/* Compare with output of crc32(1):
*