- find "$initdir" -type f \
- '(' -perm -0100 -or -perm -0010 -or -perm -0001 \
- -or -path '*/lib/modules/*.ko' ')' -print0 \
- | xargs -r -0 strip -g 2>/dev/null
+ if [[ $DRACUT_FIPS_MODE ]]; then
+ find "$initdir" -type f \
+ '(' -perm -0100 -or -perm -0010 -or -perm -0001 \
+ -or -path '*/lib/modules/*.ko' ')' -print0 \
+ | while read -r -d $'\0' f; do
+ if ! [[ -e "${f%/*}/.${f##*/}.hmac" ]] \
+ && ! [[ -e "/lib/fipscheck/${f##*/}.hmac" ]] \
+ && ! [[ -e "/lib64/fipscheck/${f##*/}.hmac" ]]; then
+ echo -n "$f"; echo -n -e "\000"
+ fi
+ done |xargs -r -0 strip -g 2>/dev/null
+ else
+ find "$initdir" -type f \
+ '(' -perm -0100 -or -perm -0010 -or -perm -0001 \
+ -or -path '*/lib/modules/*.ko' ')' -print0 \
+ | xargs -r -0 strip -g 2>/dev/null
+ fi