From 7f7c5f5ea8eef00e7b39511c6144f51997f3ba55 Mon Sep 17 00:00:00 2001 From: Joseph Bisch Date: Sat, 5 Aug 2017 16:07:54 -0400 Subject: [PATCH 1/2] Detect running in LXC container using new method It seems LXC 2.0 switched to using the systemd container interface specification and one can no longer detect LXC containers using /proc/1/cgroup (but I am leaving the old method, so that people using distros with older versions of LXC can still use Gitian). https://www.freedesktop.org/wiki/Software/systemd/ContainerInterface/ --- target-bin/bootstrap-fixup.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target-bin/bootstrap-fixup.in b/target-bin/bootstrap-fixup.in index 222b368..5c04c1f 100755 --- a/target-bin/bootstrap-fixup.in +++ b/target-bin/bootstrap-fixup.in @@ -22,7 +22,7 @@ fi echo '127.0.1.1 gitian' >> /etc/hosts # If LXC -if grep /lxc/gitian /proc/1/cgroup > /dev/null; then +if grep /lxc/gitian /proc/1/cgroup > /dev/null || grep container=lxc /proc/1/environ > /dev/null; then adduser --disabled-password --gecos ${DISTRIB_NAME,,} --quiet ${DISTRIB_NAME,,} || true apt-get remove -y rsyslog || true dpkg-divert --local --rename --add /sbin/initctl From c2ff3f9025ab6d5c7bc8bbfbd72f79d40e119401 Mon Sep 17 00:00:00 2001 From: Joseph Bisch Date: Sat, 5 Aug 2017 16:14:41 -0400 Subject: [PATCH 2/2] Add LXC mount entry for shm This change gets rid of a mount failure message output by lxc when running gbuild. --- etc/lxc.config.in | 1 + 1 file changed, 1 insertion(+) diff --git a/etc/lxc.config.in b/etc/lxc.config.in index 8879f43..1a17675 100644 --- a/etc/lxc.config.in +++ b/etc/lxc.config.in @@ -22,6 +22,7 @@ lxc.cgroup.devices.allow = c 254:0 rwm # mounts points lxc.mount.entry=proc ROOTFS/proc proc nodev,noexec,nosuid 0 0 lxc.mount.entry=sysfs ROOTFS/sys sysfs defaults 0 0 +lxc.mount.entry=shm dev/shm tmpfs rw,nodev,noexec,nosuid,relatime,mode=1777,create=dir 0 0 # Container with network virtualized using a pre-configured bridge named br0 and # veth pair virtual network devices