hooks: disallow SDK packages installing into /dev

Since we always bind mount /dev from the host distro, we don't want
packages randomly installing content into it & corrupting things.

BUG=None
TEST=SDK builders passes

Change-Id: Ie60e89391fa3557e2fcf627e53ea761ef26cf597
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/crosutils/+/2113297
Reviewed-by: Alex Klein <saklein@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
Tested-by: George Engelbrecht <engeg@google.com>
Commit-Queue: George Engelbrecht <engeg@google.com>
diff --git a/hooks/filesystem-sanity.py b/hooks/filesystem-sanity.py
index ce85e3a..b5770b0 100755
--- a/hooks/filesystem-sanity.py
+++ b/hooks/filesystem-sanity.py
@@ -19,14 +19,18 @@
 
 
 # Paths that are allowed in the / dir.
+#
+# NB: We don't allow packages to install into some subdirs because they are
+# always bind mounted with the host distro, and we don't want to pollute them.
+# Those are: /dev
 VALID_ROOT = {
-    'bin', 'boot', 'dev', 'etc', 'home', 'lib', 'lib32', 'lib64', 'media',
+    'bin', 'boot', 'etc', 'home', 'lib', 'lib32', 'lib64', 'media',
     'mnt', 'opt', 'proc', 'root', 'run', 'sbin', 'sys', 'tmp', 'usr', 'var',
 }
 
 # Paths that are allowed in the / dir for boards.
 VALID_BOARD_ROOT = {
-    'build', 'firmware',
+    'build', 'dev', 'firmware',
     # TODO(): We should clean this up.
     'postinst',
 }