[firmware][avb] Add include directory sdk_source_set specifies the include dir as `"pkg/avb/include"` in the meta.json. But the directory doesn't exist because we have forced the headers to live with the source required by libavb compilation. Add an include dir and headers that redirect to true headers so that the source layout conforms to sdk expectations. Bug: b/269166466 Change-Id: Ia38fc0d66767ae267607961ad5314533b2ffbada
diff --git a/BUILD.gn b/BUILD.gn index 05c49b7..208a8ea 100644 --- a/BUILD.gn +++ b/BUILD.gn
@@ -40,10 +40,12 @@ "libavb/avb_vbmeta_image.h", "libavb/avb_version.c", "libavb/avb_version.h", + "libavb/libavb.h", "libavb_atx/avb_atx_ops.h", "libavb_atx/avb_atx_types.h", "libavb_atx/avb_atx_validate.c", "libavb_atx/avb_atx_validate.h", + "libavb_atx/libavb_atx.h", ] cflags_c = [ @@ -53,12 +55,13 @@ "-Wno-strict-prototypes", ] - # Headers of this library live with the source directly instead of in - # a "include" folder. Therefore we use |public| directly to specify the - # paths of the public header files. public = [ - "libavb/libavb.h", - "libavb_atx/libavb_atx.h", + "include/libavb/avb_rsa.h", + "include/libavb/avb_sha.h", + "include/libavb/avb_sysdeps.h", + "include/libavb/avb_util.h", + "include/libavb/libavb.h", + "include/libavb_atx/libavb_atx.h", ] public_configs = [ ":public_include_dirs" ] @@ -93,5 +96,5 @@ } config("public_include_dirs") { - include_dirs = [ "." ] + include_dirs = [ "include" ] }
diff --git a/include/libavb/avb_rsa.h b/include/libavb/avb_rsa.h new file mode 100644 index 0000000..88c3e8a --- /dev/null +++ b/include/libavb/avb_rsa.h
@@ -0,0 +1,10 @@ +// Copyright 2023 The Fuchsia Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef THIRD_PARTY_ANDROID_PLATFORM_EXTERNAL_AVB_INCLUDE_LIBAVB_AVB_RSA_H_ +#define THIRD_PARTY_ANDROID_PLATFORM_EXTERNAL_AVB_INCLUDE_LIBAVB_AVB_RSA_H_ + +#include "../../libavb/avb_rsa.h" + +#endif // THIRD_PARTY_ANDROID_PLATFORM_EXTERNAL_AVB_INCLUDE_LIBAVB_AVB_RSA_H_
diff --git a/include/libavb/avb_sha.h b/include/libavb/avb_sha.h new file mode 100644 index 0000000..2e12c66 --- /dev/null +++ b/include/libavb/avb_sha.h
@@ -0,0 +1,10 @@ +// Copyright 2023 The Fuchsia Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef THIRD_PARTY_ANDROID_PLATFORM_EXTERNAL_AVB_INCLUDE_LIBAVB_AVB_SHA_H_ +#define THIRD_PARTY_ANDROID_PLATFORM_EXTERNAL_AVB_INCLUDE_LIBAVB_AVB_SHA_H_ + +#include "../../libavb/avb_sha.h" + +#endif // THIRD_PARTY_ANDROID_PLATFORM_EXTERNAL_AVB_INCLUDE_LIBAVB_AVB_SHA_H_
diff --git a/include/libavb/avb_sysdeps.h b/include/libavb/avb_sysdeps.h new file mode 100644 index 0000000..5959152 --- /dev/null +++ b/include/libavb/avb_sysdeps.h
@@ -0,0 +1,10 @@ +// Copyright 2023 The Fuchsia Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef THIRD_PARTY_ANDROID_PLATFORM_EXTERNAL_AVB_INCLUDE_LIBAVB_AVB_SYSDEPS_H_ +#define THIRD_PARTY_ANDROID_PLATFORM_EXTERNAL_AVB_INCLUDE_LIBAVB_AVB_SYSDEPS_H_ + +#include "../../libavb/avb_sysdeps.h" + +#endif // THIRD_PARTY_ANDROID_PLATFORM_EXTERNAL_AVB_INCLUDE_LIBAVB_AVB_SYSDEPS_H_
diff --git a/include/libavb/avb_util.h b/include/libavb/avb_util.h new file mode 100644 index 0000000..73f763d --- /dev/null +++ b/include/libavb/avb_util.h
@@ -0,0 +1,10 @@ +// Copyright 2023 The Fuchsia Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef THIRD_PARTY_ANDROID_PLATFORM_EXTERNAL_AVB_INCLUDE_LIBAVB_AVB_UTIL_H_ +#define THIRD_PARTY_ANDROID_PLATFORM_EXTERNAL_AVB_INCLUDE_LIBAVB_AVB_UTIL_H_ + +#include "../../libavb/avb_util.h" + +#endif // THIRD_PARTY_ANDROID_PLATFORM_EXTERNAL_AVB_INCLUDE_LIBAVB_AVB_UTIL_H_
diff --git a/include/libavb/libavb.h b/include/libavb/libavb.h new file mode 100644 index 0000000..9f38731 --- /dev/null +++ b/include/libavb/libavb.h
@@ -0,0 +1,10 @@ +// Copyright 2023 The Fuchsia Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef THIRD_PARTY_ANDROID_PLATFORM_EXTERNAL_AVB_INCLUDE_LIBAVB_LIBAVB_H_ +#define THIRD_PARTY_ANDROID_PLATFORM_EXTERNAL_AVB_INCLUDE_LIBAVB_LIBAVB_H_ + +#include "../../libavb/libavb.h" + +#endif // THIRD_PARTY_ANDROID_PLATFORM_EXTERNAL_AVB_INCLUDE_LIBAVB_LIBAVB_H_
diff --git a/include/libavb_atx/libavb_atx.h b/include/libavb_atx/libavb_atx.h new file mode 100644 index 0000000..6ab4125 --- /dev/null +++ b/include/libavb_atx/libavb_atx.h
@@ -0,0 +1,10 @@ +// Copyright 2023 The Fuchsia Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef THIRD_PARTY_ANDROID_PLATFORM_EXTERNAL_AVB_INCLUDE_LIBAVB_ATX_LIBAVB_ATX_H_ +#define THIRD_PARTY_ANDROID_PLATFORM_EXTERNAL_AVB_INCLUDE_LIBAVB_ATX_LIBAVB_ATX_H_ + +#include "../../libavb_atx/libavb_atx.h" + +#endif // THIRD_PARTY_ANDROID_PLATFORM_EXTERNAL_AVB_INCLUDE_LIBAVB_ATX_LIBAVB_ATX_H_