浏览代码

package/skeleton-init-systemd: support /var/lock again

systemd's own configuration file is not installed anymore,
as side effect of disabling sysv support in commit
96f0d9969e6220154b39d9d80cda97998d41f670.

Add the legacy.conf functionality back in skeleton-init-systemd,
since this is a buildroot feature to support software expecting
these directories to exist, as well as trying to be similar to
other init systems.

Create our own legacy.conf instead of using the one from upstream,
because:

- upstream has legacy.conf.in which has to be preprocessed;
- we don't want to enable upstream's full sysv support as explained in
  commit 96f0d9969e6220154b39d9d80cda97998d41f670;
- we would probably need to post-process upstream's legacy.conf anyway
  since it doesn't fully match with buildroot expectations.

Signed-off-by: Norbert Lange <nolange79@gmail.com>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Norbert Lange 3 年之前
父节点
当前提交
97eb7d0c13
共有 2 个文件被更改,包括 8 次插入0 次删除
  1. 7 0
      package/skeleton-init-systemd/legacy.conf
  2. 1 0
      package/skeleton-init-systemd/skeleton-init-systemd.mk

+ 7 - 0
package/skeleton-init-systemd/legacy.conf

@@ -0,0 +1,7 @@
+# Create legacy directories for buildroot
+# This is a subset of systemd's legacy.conf
+
+d /run/lock 0755 root root -
+d /run/lock/subsys 0755 root root -
+
+L /var/lock - - - - ../run/lock

+ 1 - 0
package/skeleton-init-systemd/skeleton-init-systemd.mk

@@ -62,6 +62,7 @@ define SKELETON_INIT_SYSTEMD_INSTALL_TARGET_CMDS
 	mkdir -p $(TARGET_DIR)/srv
 	mkdir -p $(TARGET_DIR)/var
 	ln -s ../run $(TARGET_DIR)/var/run
+	install -D -m644 $(SKELETON_INIT_SYSTEMD_PKGDIR)/legacy.conf $(TARGET_DIR)/usr/lib/tmpfiles.d/legacy.conf
 	$(SKELETON_INIT_SYSTEMD_ROOT_RO_OR_RW)
 endef