summaryrefslogtreecommitdiffstats
path: root/modules.d/01fips/fips-boot.sh
blob: 34760e018c9288d4bcb88a5cab486d3b4b03c946 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/bin/sh

type getarg > /dev/null 2>&1 || . /lib/dracut-lib.sh

if ! fipsmode=$(getarg fips) || [ "$fipsmode" = "0" ]; then
    rm -f -- /etc/modprobe.d/fips.conf > /dev/null 2>&1
elif [ -z "$fipsmode" ]; then
    die "FIPS mode have to be enabled by 'fips=1' not just 'fips'"
elif getarg boot= > /dev/null; then
    . /sbin/fips.sh
    fips_info "fips-boot: start"
    if mount_boot; then
        do_fips || die "FIPS integrity test failed"
    fi
    fips_info "fips-boot: done!"
fi