diff options
| author | Vyacheslav Yurkov <v.yurkov@precitec.de> | 2022-06-01 21:30:10 +0200 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-06-04 11:28:23 +0100 |
| commit | 5fc131c5a91b056a173eab4cd04148fdfc297b8c (patch) | |
| tree | cd7f97b5be4e991455819d69001e10f7ddefdc4d /meta/classes | |
| parent | 48bb4f6628e5419e54e18c8204961633dbad265b (diff) | |
| download | poky-5fc131c5a91b056a173eab4cd04148fdfc297b8c.tar.gz | |
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>
Diffstat (limited to 'meta/classes')
| -rw-r--r-- | meta/classes/rootfs-postcommands.bbclass | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/meta/classes/rootfs-postcommands.bbclass b/meta/classes/rootfs-postcommands.bbclass index d302c23cf4..3f9fdb602d 100644 --- a/meta/classes/rootfs-postcommands.bbclass +++ b/meta/classes/rootfs-postcommands.bbclass | |||
| @@ -39,7 +39,7 @@ ROOTFS_POSTPROCESS_COMMAND += '${@bb.utils.contains("DISTRO_FEATURES", "systemd" | |||
| 39 | 39 | ||
| 40 | ROOTFS_POSTPROCESS_COMMAND += 'empty_var_volatile;' | 40 | ROOTFS_POSTPROCESS_COMMAND += 'empty_var_volatile;' |
| 41 | 41 | ||
| 42 | ROOTFS_POSTPROCESS_COMMAND += '${@bb.utils.contains("DISTRO_FEATURES", "overlayfs", "overlayfs_qa_check;", "", d)}' | 42 | ROOTFS_POSTPROCESS_COMMAND += '${@bb.utils.contains("DISTRO_FEATURES", "overlayfs", "overlayfs_qa_check; overlayfs_postprocess;", "", d)}' |
| 43 | 43 | ||
| 44 | inherit image-artifact-names | 44 | inherit image-artifact-names |
| 45 | 45 | ||
| @@ -422,3 +422,14 @@ python overlayfs_qa_check() { | |||
| 422 | if not allUnitExist: | 422 | if not allUnitExist: |
| 423 | bb.fatal('Not all mount paths and units are installed in the image') | 423 | bb.fatal('Not all mount paths and units are installed in the image') |
| 424 | } | 424 | } |
| 425 | |||
| 426 | python overlayfs_postprocess() { | ||
| 427 | import shutil | ||
| 428 | |||
| 429 | # install helper script | ||
| 430 | helperScriptName = "overlayfs-create-dirs.sh" | ||
| 431 | helperScriptSource = oe.path.join(d.getVar("COREBASE"), "meta/files", helperScriptName) | ||
| 432 | helperScriptDest = oe.path.join(d.getVar("IMAGE_ROOTFS"), "/usr/sbin/", helperScriptName) | ||
| 433 | shutil.copyfile(helperScriptSource, helperScriptDest) | ||
| 434 | os.chmod(helperScriptDest, 0o755) | ||
| 435 | } | ||
