From 3f9a68e40fa953795b8863ca00e2f61943703ef2 Mon Sep 17 00:00:00 2001 From: Ramon Moesching Date: Wed, 24 Apr 2019 09:46:21 +0200 Subject: [PATCH] dnsmasq lease: add image tasks for creating tmpfiles.d configuration Since user move directories in /var/lib aren't deployed in sota images. So create them by systemd's tmpfiles.d. /var/lib/misc is required for dnsmasq lease file. BugzID: 56729 Signed-off-by: Ramon Moesching --- recipes-core/images/includes/image-preprocessing.inc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/recipes-core/images/includes/image-preprocessing.inc b/recipes-core/images/includes/image-preprocessing.inc index 7e88345..86477b5 100644 --- a/recipes-core/images/includes/image-preprocessing.inc +++ b/recipes-core/images/includes/image-preprocessing.inc @@ -1,4 +1,4 @@ -IMAGE_PREPROCESS_COMMAND_sota += " moveRPMDatabase;" +IMAGE_PREPROCESS_COMMAND_sota += " moveRPMDatabase; dnsmasqlease;" # Change the location of /var/lib/rpm to /usr/lib/rpm. @@ -9,3 +9,10 @@ moveRPMDatabase() { rm -r var/lib/rpm echo "L /var/lib/rpm - - - - /usr/lib/rpm" > etc/tmpfiles.d/ostree-rpm.conf } + +dnsmasqlease() { + cd ${WORKDIR}/rootfs + mkdir -p var/lib/misc + echo "d /var/lib/misc 0755 - - -" > etc/tmpfiles.d/dnsmasq-leasesdir.conf + cd - +}