[lxc-devel] [lxc-ci/master] images/openwrt: Ensure /var/lock

monstermunchkin on Github lxc-bot at linuxcontainers.org
Thu Feb 20 10:38:08 UTC 2020


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 574 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20200220/7ad354c8/attachment.bin>
-------------- next part --------------
From 805e9d4f2101deba022f29883ca4197856e08cb1 Mon Sep 17 00:00:00 2001
From: Thomas Hipp <thomas.hipp at canonical.com>
Date: Thu, 20 Feb 2020 11:37:09 +0100
Subject: [PATCH] images/openwrt: Ensure /var/lock

This ensures that /var/lock is always present, especially when running
distrobuilder pack-lx{c,d}.
Due to /var being a symlink to /tmp which in turn is a tmpfs, the
directory /var/lock will never be persistent.

Signed-off-by: Thomas Hipp <thomas.hipp at canonical.com>
---
 images/openwrt.yaml | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/images/openwrt.yaml b/images/openwrt.yaml
index 0ba5cb3..ca6814c 100644
--- a/images/openwrt.yaml
+++ b/images/openwrt.yaml
@@ -403,6 +403,20 @@ actions:
       mkdir -p /var/lock
       echo "console::askfirst:/usr/libexec/login.sh" >> /etc/inittab
 
+  - trigger: post-unpack
+    action: |
+      #!/bin/sh
+      mkdir -p /var/lock
+    types:
+     - container
+
+  - trigger: post-unpack
+    action: |
+      #!/bin/sh
+      mkdir -p /var/lock
+    types:
+     - vm
+
 packages:
   manager: opkg
   update: false


More information about the lxc-devel mailing list