Allow /usr/grte to exist in EdgeOS builds BUG=b/290986313 TEST=Built a VM image with this and didn't get shot down by hook script RELEASE_NOTE=None Change-Id: I90cf0e8b8e5cebcdd4bec5a50186a546ded1b228 Reviewed-on: https://cos-review.googlesource.com/c/third_party/platform/crosutils/+/61862 Reviewed-by: Alan Berryhill <berryhill@google.com> Reviewed-by: Robert Kolchmeyer <rkolchmeyer@google.com> Tested-by: Cusky Presubmit Bot <presubmit@cos-infra-prod.iam.gserviceaccount.com>
diff --git a/hooks/filesystem-layout.py b/hooks/filesystem-layout.py index c57e5d2..111cd15 100755 --- a/hooks/filesystem-layout.py +++ b/hooks/filesystem-layout.py
@@ -88,6 +88,10 @@ # Paths that are allowed in the /usr dir for the SDK chroot. VALID_HOST_USR = set() +VALID_EDGEOS_USR = { + "grte", +} + # Paths under /usr that should not have any subdirs. NOSUBDIRS_USR = { "bin", @@ -191,7 +195,7 @@ return False -def check_usr(usr, host=False): +def check_usr(usr, host=False, edgeos=False): """Check the /usr filesystem at |usr|.""" ret = True @@ -217,6 +221,9 @@ logging.warning("Ignoring known bad /usr install for now") unknown -= {"www"} + if edgeos: + unknown -= VALID_EDGEOS_USR + if unknown: logging.error( "Paths are not allowed in the /usr dir: %s", sorted(unknown) @@ -303,7 +310,7 @@ "Package has improved; please update BAD_RUN_PACKAGES" ) - if not check_usr(os.path.join(root, "usr"), host): + if not check_usr(os.path.join(root, "usr"), host, edgeos): ret = False return ret