Fixed the build error for riscv64 arch using gcc 13
[platform/upstream/cryptsetup.git] / misc / dracut_90reencrypt / module-setup.sh
index a843964..fcd7c92 100755 (executable)
@@ -7,16 +7,26 @@ check() {
 
 depends() {
     echo dm rootfs-block
-    return 0
 }
 
 installkernel() {
-    instmods dm_crypt =crypto
+    # requires hostonly='' override so that loop module is pulled in initramfs
+    # even if not loaded in actual kernel. dracut bug?
+    hostonly='' instmods dm_crypt =crypto loop
 }
 
 install() {
+    if dracut_module_included crypt; then
+        derror "'reencrypt' can't be installed together with 'crypt'."
+        derror "Add '-o crypt' option to install reencrypt module."
+        return 1
+    fi
+
     dracut_install cryptsetup-reencrypt
 
+    # moddir variable is assigned in dracut general shell lib
+    # shellcheck disable=SC2154
     inst_hook cmdline 30 "$moddir/parse-reencrypt.sh"
     inst_simple "$moddir"/reencrypt.sh /sbin/reencrypt
-}
\ No newline at end of file
+    inst_simple "$moddir"/reencrypt-verbose.sh /sbin/cryptsetup-reencrypt-verbose
+}