-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
systemd: nspawn: add and populate persistent directory for containers
Signed-off-by: Ian Leonard <[email protected]>
- Loading branch information
1 parent
dda952d
commit fb11ab7
Showing
4 changed files
with
28 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -164,6 +164,10 @@ post_makeinstall_target() { | |
if [ ${NSPAWN_SUPPORT} != "yes" ]; then | ||
safe_remove ${INSTALL}/usr/bin/systemd-nspawn | ||
safe_remove ${INSTALL}/usr/lib/systemd/system/[email protected] | ||
safe_remove ${INSTALL}/usr/lib/tmpfiles.d/z_02_systemd-nspawn.conf | ||
safe_remove ${INSTALL}/usr/lib/systemd/system/nspawn-symlink.service | ||
else | ||
find_file_path scripts/nspawn-symlink && cp -PRv ${FOUND_PATH} ${INSTALL}/usr/bin | ||
fi | ||
|
||
# remove unneeded generators | ||
|
@@ -310,4 +314,7 @@ post_install() { | |
enable_service network-base.service | ||
enable_service systemd-timesyncd.service | ||
enable_service systemd-timesyncd-setup.service | ||
if [ "${NSPAWN_SUPPORT}" = "yes" ]; then | ||
enable_service nspawn-symlink.service | ||
fi | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/sh | ||
|
||
for entry in $(find /storage/containers -mindepth 1 -maxdepth 1); do | ||
ln -s "${entry}" /var/lib/machines/ | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
[Unit] | ||
Description=Make symlinks from /storage/containers to /var/lib/machines | ||
After=systemd-tmpfiles-setup.service | ||
Requires=systemd-tmpfiles-setup.service | ||
|
||
[Service] | ||
Type=oneshot | ||
ExecStart=/usr/bin/nspawn-symlink | ||
RemainAfterExit=yes | ||
|
||
[Install] | ||
WantedBy=basic.target |
4 changes: 4 additions & 0 deletions
4
packages/sysutils/systemd/tmpfiles.d/z_02_systemd-nspawn.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# SPDX-License-Identifier: GPL-2.0-only | ||
# Copyright (C) 2024-present Team LibreELEC (https://libreleec.tv) | ||
|
||
d /storage/containers 0755 root root - - |