lxc: set --with-runtime-path to the /var/run path

The default runtime directory used by LXC is /run which doesn't exist
in OpenWrt. It causes errors like:

Failed to create lock for foo
lxc-create: foo: tools/lxc_create.c: main: 260 Failed to create lxc container

There has been workaround for that in the lxc-auto.init but it requires
installing "lxc-auto" package. Replacing that "ln -s" workaround with
Makefile specifying --with-runtime-path allows using pure "lxc" in
OpenWrt (without the "lxc-auto").

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit 90fef036fe)
This commit is contained in:
Rafał Miłecki 2023-04-08 18:18:55 +02:00
parent ac57ec2dd8
commit 550965cce6
2 changed files with 2 additions and 5 deletions

View File

@ -144,7 +144,8 @@ CONFIGURE_ARGS += \
--disable-selinux \
--$(if $(CONFIG_LXC_SECCOMP),en,dis)able-seccomp \
--enable-capabilities \
--disable-examples
--disable-examples \
--with-runtime-path=/var/run
ifdef CONFIG_USE_MIPS16
TARGET_CFLAGS += -minterlink-mips16

View File

@ -69,9 +69,5 @@ boot() {
mount -t cgroup -o rw,nosuid,nodev,noexec,relatime,none,name=systemd cgroup /sys/fs/cgroup/systemd
fi
if [ ! -d /run ]; then
ln -s /var/run /run
fi
start
}