"Fossies" - the Fresh Open Source Software Archive

Member "cryptsetup-2.4.3/misc/dracut_90reencrypt/module-setup.sh" (24 Jul 2021, 879 Bytes) of package /linux/misc/cryptsetup-2.4.3.tar.xz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Bash source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 #!/bin/bash
    2 
    3 check() {
    4     [ -x /sbin/cryptsetup-reencrypt ] || return 1
    5     return 255
    6 }
    7 
    8 depends() {
    9     echo dm rootfs-block
   10 }
   11 
   12 installkernel() {
   13     # requires hostonly='' override so that loop module is pulled in initramfs
   14     # even if not loaded in actual kernel. dracut bug?
   15     hostonly='' instmods dm_crypt =crypto loop
   16 }
   17 
   18 install() {
   19     if dracut_module_included crypt; then
   20         derror "'reencrypt' can't be installed together with 'crypt'."
   21         derror "Add '-o crypt' option to install reencrypt module."
   22         return 1
   23     fi
   24 
   25     dracut_install cryptsetup-reencrypt
   26 
   27     # moddir variable is assigned in dracut general shell lib
   28     # shellcheck disable=SC2154
   29     inst_hook cmdline 30 "$moddir/parse-reencrypt.sh"
   30     inst_simple "$moddir"/reencrypt.sh /sbin/reencrypt
   31     inst_simple "$moddir"/reencrypt-verbose.sh /sbin/cryptsetup-reencrypt-verbose
   32 }