@@ -113,58 +113,61 @@ do_fips() {
113
113
114
114
KERNEL=$( uname -r)
115
115
116
- fips_info " Checking integrity of kernel"
117
- if [ -e " /run/initramfs/live/vmlinuz0" ]; then
118
- do_rhevh_check /run/initramfs/live/vmlinuz0 || return 1
119
- elif [ -e " /run/initramfs/live/isolinux/vmlinuz0" ]; then
120
- do_rhevh_check /run/initramfs/live/isolinux/vmlinuz0 || return 1
121
- elif [ -e " /run/install/repo/images/pxeboot/vmlinuz" ]; then
122
- # This is a boot.iso with the .hmac inside the install.img
123
- do_rhevh_check /run/install/repo/images/pxeboot/vmlinuz || return 1
124
- else
125
- BOOT_IMAGE=" $( getarg BOOT_IMAGE) "
126
-
127
- # On s390x, BOOT_IMAGE isn't a path but an integer representing the
128
- # entry number selected. Let's try the root of /boot first, and
129
- # otherwise fallback to trying to parse the BLS entries if it's a
130
- # BLS-based system.
131
- if [ " $( uname -m) " = s390x ]; then
132
- if [ -e " /boot/vmlinuz-${KERNEL} " ]; then
133
- BOOT_IMAGE=" vmlinuz-${KERNEL} "
134
- elif [ -d /boot/loader/entries ]; then
135
- bls=$( find /boot/loader/entries -name ' *.conf' | sort -rV | sed -n " $(( BOOT_IMAGE + 1 )) p" )
136
- if [ -e " ${bls} " ]; then
137
- BOOT_IMAGE=$( grep ^linux " ${bls} " | cut -d' ' -f2)
116
+ if ! getarg rd.fips.skipkernel > /dev/null; then
117
+
118
+ fips_info " Checking integrity of kernel"
119
+ if [ -e " /run/initramfs/live/vmlinuz0" ]; then
120
+ do_rhevh_check /run/initramfs/live/vmlinuz0 || return 1
121
+ elif [ -e " /run/initramfs/live/isolinux/vmlinuz0" ]; then
122
+ do_rhevh_check /run/initramfs/live/isolinux/vmlinuz0 || return 1
123
+ elif [ -e " /run/install/repo/images/pxeboot/vmlinuz" ]; then
124
+ # This is a boot.iso with the .hmac inside the install.img
125
+ do_rhevh_check /run/install/repo/images/pxeboot/vmlinuz || return 1
126
+ else
127
+ BOOT_IMAGE=" $( getarg BOOT_IMAGE) "
128
+
129
+ # On s390x, BOOT_IMAGE isn't a path but an integer representing the
130
+ # entry number selected. Let's try the root of /boot first, and
131
+ # otherwise fallback to trying to parse the BLS entries if it's a
132
+ # BLS-based system.
133
+ if [ " $( uname -m) " = s390x ]; then
134
+ if [ -e " /boot/vmlinuz-${KERNEL} " ]; then
135
+ BOOT_IMAGE=" vmlinuz-${KERNEL} "
136
+ elif [ -d /boot/loader/entries ]; then
137
+ bls=$( find /boot/loader/entries -name ' *.conf' | sort -rV | sed -n " $(( BOOT_IMAGE + 1 )) p" )
138
+ if [ -e " ${bls} " ]; then
139
+ BOOT_IMAGE=$( grep ^linux " ${bls} " | cut -d' ' -f2)
140
+ fi
138
141
fi
139
142
fi
140
- fi
141
143
142
- # Trim off any leading GRUB boot device (e.g. ($root) )
143
- BOOT_IMAGE=" $( echo " ${BOOT_IMAGE} " | sed ' s/^(.*)//' ) "
144
+ # Trim off any leading GRUB boot device (e.g. ($root) )
145
+ BOOT_IMAGE=" $( echo " ${BOOT_IMAGE} " | sed ' s/^(.*)//' ) "
144
146
145
- BOOT_IMAGE_NAME=" ${BOOT_IMAGE##*/ } "
146
- BOOT_IMAGE_PATH=" ${BOOT_IMAGE% ${BOOT_IMAGE_NAME} } "
147
+ BOOT_IMAGE_NAME=" ${BOOT_IMAGE##*/ } "
148
+ BOOT_IMAGE_PATH=" ${BOOT_IMAGE% ${BOOT_IMAGE_NAME} } "
147
149
148
- if [ -z " $BOOT_IMAGE_NAME " ]; then
149
- BOOT_IMAGE_NAME=" vmlinuz-${KERNEL} "
150
- elif ! [ -e " /boot/${BOOT_IMAGE_PATH} /${BOOT_IMAGE_NAME} " ]; then
151
- # if /boot is not a separate partition BOOT_IMAGE might start with /boot
152
- BOOT_IMAGE_PATH=${BOOT_IMAGE_PATH# " /boot" }
153
- # on some achitectures BOOT_IMAGE does not contain path to kernel
154
- # so if we can't find anything, let's treat it in the same way as if it was empty
155
- if ! [ -e " /boot/${BOOT_IMAGE_PATH} /${BOOT_IMAGE_NAME} " ]; then
150
+ if [ -z " $BOOT_IMAGE_NAME " ]; then
156
151
BOOT_IMAGE_NAME=" vmlinuz-${KERNEL} "
157
- BOOT_IMAGE_PATH=" "
152
+ elif ! [ -e " /boot/${BOOT_IMAGE_PATH} /${BOOT_IMAGE_NAME} " ]; then
153
+ # if /boot is not a separate partition BOOT_IMAGE might start with /boot
154
+ BOOT_IMAGE_PATH=${BOOT_IMAGE_PATH# " /boot" }
155
+ # on some achitectures BOOT_IMAGE does not contain path to kernel
156
+ # so if we can't find anything, let's treat it in the same way as if it was empty
157
+ if ! [ -e " /boot/${BOOT_IMAGE_PATH} /${BOOT_IMAGE_NAME} " ]; then
158
+ BOOT_IMAGE_NAME=" vmlinuz-${KERNEL} "
159
+ BOOT_IMAGE_PATH=" "
160
+ fi
158
161
fi
159
- fi
160
162
161
- BOOT_IMAGE_HMAC=" /boot/${BOOT_IMAGE_PATH} /.${BOOT_IMAGE_NAME} .hmac"
162
- if ! [ -e " ${BOOT_IMAGE_HMAC} " ]; then
163
- warn " ${BOOT_IMAGE_HMAC} does not exist"
164
- return 1
165
- fi
163
+ BOOT_IMAGE_HMAC=" /boot/${BOOT_IMAGE_PATH} /.${BOOT_IMAGE_NAME} .hmac"
164
+ if ! [ -e " ${BOOT_IMAGE_HMAC} " ]; then
165
+ warn " ${BOOT_IMAGE_HMAC} does not exist"
166
+ return 1
167
+ fi
166
168
167
- (cd " ${BOOT_IMAGE_HMAC%/* } " && sha512hmac -c " ${BOOT_IMAGE_HMAC} " ) || return 1
169
+ (cd " ${BOOT_IMAGE_HMAC%/* } " && sha512hmac -c " ${BOOT_IMAGE_HMAC} " ) || return 1
170
+ fi
168
171
fi
169
172
170
173
fips_info " All initrd crypto checks done"
0 commit comments