grpc: Separate unsecure and channelz packages

Currently, the grpc recipe packages all runtime shared libraries into
the main ${PN} package. This pulls libgrpc_unsecure, libgrpc++_unsecure,
and libgrpcpp_channelz into any target image installing grpc. Target
binaries linking against gRPC (e.g. bmcweb) link against standard
libgrpc and libgrpc++, which support both secure (TLS) and insecure
plaintext channels via grpc::InsecureChannelCredentials(). No binaries
in target images have a DT_NEEDED dependency on the unsecure variants.
Additionally, an ELF dependency audit confirmed that zero binaries or
libraries in the target root filesystem reference libgrpcpp_channelz.
Split libgrpc*_unsecure.so.* into ${PN}-unsecure and
libgrpcpp_channelz.so.* into ${PN}-channelz via PACKAGE_BEFORE_PN.
Packages that explicitly require these variants can declare an RDEPENDS
on grpc-unsecure or grpc-channelz. On flash-constrained 64MB SPI NOR
platforms, this removes ~9.5–10 MB of uncompressed shared libraries
(~2.5–2.7 MB compressed in squashfs-xz), substantially expanding free
flash headroom.

Tested:
- platform17 (64MB SPI NOR, NPCM845x / Cortex-A35):
  - Built obmc-phosphor-image
  - Verified libgrpc*_unsecure.so.* and libgrpcpp_channelz.so.* are
    absent from target /usr/lib
  - cr51-image-layout.json:
    - rofs reduced from 52.94 MB (55,508,992 B) to 50.44 MB (52887552 B)
    - empty margin expanded from 64 KB (65,536 B) to 2.56 MB (2686976 B)
      (41x increase)
- platform11 (64MB SPI NOR, NPCM730 / ARMv7a):
  - Built obmc-phosphor-image
  - Rootfs gRPC footprint dropped from 26.22 MB (27,491,164 B) to
    16.72 MB (17,537,196 B) uncompressed (-9.49 MB)
  - cr51-image-layout.json:
    - rofs reduced from 53.81 MB (56,426,496 B) to 51.13 MB
      (53608448 B) (-2.69 MB)
    - empty margin expanded from 256 KB (262,144 B) to 2.94 MB
      (3080192 B) (11.7x increase)

- platform5: http://fusion2/07e96813-e509-357b-9acc-3a83d536a660
- platform15: http://fusion2/4a4d37e8-3a24-3011-b5d9-9667cf1f52d7
- platform18: http://fusion2/039f9c31-1433-329f-9a4a-9de8c7e7c535
- platform17: http://fusion2/4d77663a-81d3-3140-813c-82eb267aa42a
- platform11+ext: http://fusion2/96c53567-d19e-3509-9163-7e7978c4a6a6
- platform11: http://fusion2/d650156d-7e78-3c70-93d6-56bea6a393f5
- platform25: http://fusion2/b68d4d26-157e-3ded-86ec-6d69f216ba56
Google-Bug-Id: 425362808
Change-Id: I031bbf6d526f9097b0d5ed460fbf96c589b247de
Signed-off-by: Willy Tu <wltu@google.com>
diff --git a/recipes-devtools/grpc/grpc_%.bbappend b/recipes-devtools/grpc/grpc_%.bbappend
index c595577..ec5aa85 100644
--- a/recipes-devtools/grpc/grpc_%.bbappend
+++ b/recipes-devtools/grpc/grpc_%.bbappend
@@ -18,3 +18,13 @@
 EXTRA_OECMAKE += " \
     -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON \
 "
+
+PACKAGE_BEFORE_PN:append = " ${PN}-unsecure ${PN}-channelz"
+
+FILES:${PN}-unsecure = " \
+  ${libdir}/libgrpc*_unsecure${SOLIBS} \
+"
+
+FILES:${PN}-channelz = " \
+  ${libdir}/libgrpcpp_channelz${SOLIBS} \
+"