If we're using /etc from the host, also use /usr/share/factory from
the host to account for symlinks from /etc into /usr/share/factory.
else:
cmdline += ["--bind", p, p]
+ # /etc might be full of symlinks to /usr/share/factory, so make sure we use /usr/share/factory
+ # from the host and not from the tools tree.
+ if tools != Path("/") and (factory := Path("/usr/share/factory")).exists():
+ cmdline += ["--bind", factory, factory]
+
if home := current_home_dir():
cmdline += ["--bind", home, home]
else: