virtual-appliance/scripts/RUN
Jörg Deckert ddcb8119f3 fixes to avoid lots of error messages
- disable cgroups portage feature
- allow CAP_NET_ADMIN for the use of systemd-nspawn
  (https://github.com/systemd/systemd/issues/13308)
2021-02-05 16:09:03 +01:00

29 lines
667 B
Python
Executable File

#!/usr/bin/env python3
import os
import subprocess
import sys
def main():
environ = os.environ
command = [
"systemd-nspawn",
"--quiet",
f"--directory={environ['CHROOT']}",
f"--machine={environ['container']}",
f"--capability=CAP_NET_ADMIN",
f"--bind={environ['PORTAGE_DIR']}:/var/db/repos/gentoo",
f"--bind={environ['VA_PKGDIR']}:/var/cache/binpkgs",
f"--bind={environ['DISTDIR']}:/var/cache/distfiles",
] + sys.argv[1:]
if os.environ.get("VA_ARCH") == "linux32":
command = ["linux32"] + command
sys.exit(subprocess.call(command))
if __name__ == "__main__":
main()