]> git.ipfire.org Git - thirdparty/dracut-ng.git/commitdiff
refactor: move defining inst_sysusers to dracut-functions.sh
authorJo Zzsi <jozzsicsataban@gmail.com>
Fri, 9 Jan 2026 14:26:48 +0000 (09:26 -0500)
committerBenjamin Drung <bdrung@ubuntu.com>
Tue, 13 Jan 2026 12:29:55 +0000 (13:29 +0100)
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.

dracut-functions.sh
dracut.sh
man/dracut.modules.7.adoc

index bb2edd57b6b7353d14ab41954a22090ea5332e8e..460499b0d53305ed9fcfdf68c74906c6b1d6a00b 100755 (executable)
@@ -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 <dir> [<dir>...]
 # Install a <dir> located on a lib directory to the initramfs image
 inst_libdir_dir() {
index 17367cfb133db0b8e93b4cd148f3bd09943639be..2f83ad5812be65495dca15bb99f2b36e334d3d5a 100755 (executable)
--- 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
index cb1569c43def30a8f5cefed9077ca249e33b2dc2..5db25e3547af3e7f31a3d420a8ab2a75414e7958 100644 (file)
@@ -317,6 +317,11 @@ installs an executable/script <src> in the dracut hook <hookdir> with priority
 installs one or more udev rules. Non-existent udev rules are reported, but do
 not let dracut fail.
 
+==== inst_sysusers <sysuserconf>
+
+installs one sysuser config files. Non-existent sysuser config file
+is reported, but does not let dracut fail.
+
 ==== inst_libdir_dir <dir> [<dir>...]
 
 installs multiple directories (but not their content) located on a library