[PATCHv2] macros: Add macro to apply sysusers based users/groups inside the jail
Commit Message
This macro can be called inside a build file and easily allows to apply
any kind of users/groups specified in a sysusers file.
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
---
macros/systemd.macro | 11 +++++++++++
1 file changed, 11 insertions(+)
@@ -1,3 +1,14 @@
+MACRO_APPLY_SYSTEMD_SYSUSERS
+ mkdir -pv %{sysusersdir}
+
+ for file in %{DIR_SOURCE}/*.sysusers; do
+ [ -e "${file}" ] || continue
+ cat ${file} | \
+ systemd-sysusers --replace=%{sysusersdir}/$(basename ${file%*.sysusers}).conf -
+ done
+ unset file
+end
+
MACRO_INSTALL_SYSTEMD_FILES
for file in %{DIR_SOURCE}/systemd/*; do
[ -e "${file}" ] || continue