files: rootfs-postcommands: move helper commands to script

OverlayFS systemd helper unit might require more pre-processing
commands. It gets more complicated to embed them in a unit file, because
systemd shell subset is limited and might require additional escaping.
Move the command to a separate script, thus simplifying systemd unit.

(From OE-Core rev: 86a457016e7f3fc7acacf86cd87f5d8d882132dd)

Signed-off-by: Vyacheslav Yurkov <v.yurkov@precitec.de>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Vyacheslav Yurkov
2022-06-01 21:30:10 +02:00
committed by Richard Purdie
parent 48bb4f6628
commit 5fc131c5a9
3 changed files with 21 additions and 3 deletions

View File

@@ -6,8 +6,7 @@ DefaultDependencies=no
[Service]
Type=oneshot
ExecStart=mkdir -p {DATA_MOUNT_POINT}/upper{LOWERDIR}
ExecStart=mkdir -p {DATA_MOUNT_POINT}/workdir{LOWERDIR}
ExecStart=/usr/sbin/overlayfs-create-dirs.sh {LOWERDIR} {DATA_MOUNT_POINT}
RemainAfterExit=true
StandardOutput=journal

View File

@@ -0,0 +1,8 @@
#!/bin/sh
# This script is intended to be used sorely by overlayfs-create-dirs.service
# Usage: overlayfs-create-dirs.sh <LOWERDIR> <DATA_MOUNT_POINT>
lowerdir=$1
datamountpoint=$2
mkdir -p ${datamountpoint}/upper${lowerdir}
mkdir -p ${datamountpoint}/workdir${lowerdir}