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
96f0d9969e.

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>
This commit is contained in:
Norbert Lange 2022-01-09 12:01:30 +01:00 committed by Arnout Vandecappelle (Essensium/Mind)
parent 85aab41ef9
commit 97eb7d0c13
2 changed files with 8 additions and 0 deletions

View File

@ -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

View File

@ -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