"Fossies" - the Fresh Open Source Software Archive

Member "cryptsetup-2.4.3/tests/00modules-test" (13 Jan 2022, 1003 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. See also the last Fossies "Diffs" side-by-side code changes report for "00modules-test": 2.4.0_vs_2.4.1.

    1 #!/bin/bash
    2 
    3 [ -z "$CRYPTSETUP_PATH" ] && CRYPTSETUP_PATH=".."
    4 
    5 function pversion() {
    6     if [ ! -x $CRYPTSETUP_PATH/$1 ] ; then
    7         return
    8     fi
    9 
   10     echo -n "$CRYPTSETUP_PATH/"
   11     $CRYPTSETUP_PATH/$1 --version
   12 }
   13 
   14 echo "Cryptsetup test environment ($(date))"
   15 uname -a
   16 if [ "$(cat /proc/sys/crypto/fips_enabled 2>/dev/null)" = "1" ] ; then
   17     echo "Kernel running in FIPS mode."
   18 fi
   19 
   20 if [ -f /etc/os-release ] ; then
   21     source /etc/os-release
   22     echo "$PRETTY_NAME ($NAME) $VERSION"
   23 fi
   24 
   25 echo "Memory"
   26 free -m
   27 
   28 pversion cryptsetup
   29 pversion veritysetup
   30 pversion integritysetup
   31 pversion cryptsetup-reencrypt
   32 
   33 [ -x $CRYPTSETUP_PATH/cryptsetup ] && {
   34     echo -e "Cryptsetup defaults:"
   35     $CRYPTSETUP_PATH/cryptsetup --help | sed -n '/optional key file for/,$p' | tail -n +3
   36 }
   37 
   38 [ $(id -u) != 0 ] && exit 77
   39 
   40 modprobe dm-crypt     >/dev/null 2>&1
   41 modprobe dm-verity    >/dev/null 2>&1
   42 modprobe dm-integrity >/dev/null 2>&1
   43 modprobe dm-zero      >/dev/null 2>&1
   44 
   45 dmsetup version
   46 
   47 echo "Device mapper targets:"
   48 dmsetup targets
   49 
   50 exit 0