signer: Preserve capabilities on Android system image
signer: Preserve capabilities on Android system image

Since crrev.com/c/2511121 we no longer use xattrs when using
unsquashfs on the Android system image. A side-effect of this change
is the loss of capabilities for a handful of Android binaries such as
/system/bin/run-as.

This change records the capabilities on the system image and applies
them manually to the output system image.

BUG=b:179170462
BRANCH=None
TEST=unittests
TEST=Locally sign hatch (ARC R) and kevin (ARC P) base images and
     verify signed base image's system.raw.img contents

Signed-off-by: Josh Horwich <da55d05b8cf83e98983e9faf049de68964018148@chromium.org>

Change-Id: Ied824d5ebf7a5139e71341abca810b14e67623e0
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/vboot_reference/+/3723017
Reviewed-by: Allen Webb <880184b418addffb87cd9c8e8e882ca6764ac96b@google.com>
Tested-by: Josh Horwich <da55d05b8cf83e98983e9faf049de68964018148@chromium.org>
Reviewed-by: Prameet Shah <5a73bbd7277181c78900a0e3bfb4ee66a65a05ce@chromium.org>
Commit-Queue: Josh Horwich <da55d05b8cf83e98983e9faf049de68964018148@chromium.org>
Reviewed-by: Yury Khmel <de5301c0e09287153db4d7fb0690fdd7ea7a25b5@google.com>
Reviewed-by: Yury Khmel <de5301c0e09287153db4d7fb0690fdd7ea7a25b5@chromium.org>

coreboot/vboot,coreboot/vboot,coreboot/vboot,coreboot/vboot,coreboot/vboot