From: Jo Zzsi Date: Fri, 9 Jan 2026 14:26:48 +0000 (-0500) Subject: refactor: move defining inst_sysusers to dracut-functions.sh X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6fc33b965e95d6d4efcd81322fc987996f578241;p=thirdparty%2Fdracut-ng.git refactor: move defining inst_sysusers to dracut-functions.sh inst_sysusers is a public interface to dracut modules, move it to `dracut-functions.sh`. Document inst_sysusers in the man page as from now on it is a public interface. --- diff --git a/dracut-functions.sh b/dracut-functions.sh index bb2edd57b..460499b0d 100755 --- a/dracut-functions.sh +++ b/dracut-functions.sh @@ -1304,6 +1304,15 @@ inst_rules() { done } +# install sysusers files +inst_sysusers() { + inst_multiple -o "$sysusers/$*" "$sysusers/acct-*-$*" + + if [[ ${hostonly-} ]]; then + inst_multiple -H -o "$sysusersconfdir/$*" "$sysusers/acct-*-$*" + fi +} + # inst_libdir_dir [...] # Install a located on a lib directory to the initramfs image inst_libdir_dir() { diff --git a/dracut.sh b/dracut.sh index 17367cfb1..2f83ad581 100755 --- a/dracut.sh +++ b/dracut.sh @@ -1633,16 +1633,6 @@ build_ld_cache() { fi } -# install sysusers files -# shellcheck disable=SC2317,SC2329 -inst_sysusers() { - inst_multiple -o "$sysusers/$*" "$sysusers/acct-*-$*" - - if [[ ${hostonly-} ]]; then - inst_multiple -H -o "$sysusersconfdir/$*" "$sysusers/acct-*-$*" - fi -} - module_functions=( check depends diff --git a/man/dracut.modules.7.adoc b/man/dracut.modules.7.adoc index cb1569c43..5db25e354 100644 --- a/man/dracut.modules.7.adoc +++ b/man/dracut.modules.7.adoc @@ -317,6 +317,11 @@ installs an executable/script in the dracut hook with priority installs one or more udev rules. Non-existent udev rules are reported, but do not let dracut fail. +==== inst_sysusers + +installs one sysuser config files. Non-existent sysuser config file +is reported, but does not let dracut fail. + ==== inst_libdir_dir [...] installs multiple directories (but not their content) located on a library