diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 17:44:12 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 17:44:12 +0000 |
commit | 1be69c2c660b70ac2f4de2a5326e27e3e60eb82d (patch) | |
tree | bb299ab6f411f4fccd735907035de710e4ec6abc /misc/dracut_90reencrypt/module-setup.sh | |
parent | Initial commit. (diff) | |
download | cryptsetup-1be69c2c660b70ac2f4de2a5326e27e3e60eb82d.tar.xz cryptsetup-1be69c2c660b70ac2f4de2a5326e27e3e60eb82d.zip |
Adding upstream version 2:2.3.7.upstream/2%2.3.7upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'misc/dracut_90reencrypt/module-setup.sh')
-rwxr-xr-x | misc/dracut_90reencrypt/module-setup.sh | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/misc/dracut_90reencrypt/module-setup.sh b/misc/dracut_90reencrypt/module-setup.sh new file mode 100755 index 0000000..fcd7c92 --- /dev/null +++ b/misc/dracut_90reencrypt/module-setup.sh @@ -0,0 +1,32 @@ +#!/bin/bash + +check() { + [ -x /sbin/cryptsetup-reencrypt ] || return 1 + return 255 +} + +depends() { + echo dm rootfs-block +} + +installkernel() { + # 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 + inst_simple "$moddir"/reencrypt-verbose.sh /sbin/cryptsetup-reencrypt-verbose +} |