find_kernel_modules_by_path drivers
}
-# instmods [-c] <kernel module> [<kernel module> ... ]
-# instmods [-c] <kernel subsystem>
+# instmods [-c [-s]] <kernel module> [<kernel module> ... ]
+# instmods [-c [-s]] <kernel subsystem>
# install kernel modules along with all their dependencies.
# <kernel subsystem> can be e.g. "=block" or "=drivers/usb/storage"
instmods() {
# called [sub]functions inherit _fderr
local _fderr=9
local _check=no
+ local _silent=no
if [[ $1 = '-c' ]]; then
_check=yes
shift
fi
+ if [[ $1 = '-s' ]]; then
+ _silent=yes
+ shift
+ fi
+
function inst1mod() {
local _ret=0 _mod="$1"
case $_mod in
if (($# == 0)); then # filenames from stdin
while read _mod; do
inst1mod "${_mod%.ko*}" || {
- if [ "$_check" = "yes" ]; then
- dfatal "Failed to install $_mod"
+ if [[ "$_check" == "yes" ]]; then
+ [[ "$_silent" == "no" ]] && dfatal "Failed to install $_mod"
return 1
fi
}
fi
while (($# > 0)); do # filenames as arguments
inst1mod ${1%.ko*} || {
- if [ "$_check" = "yes" ]; then
- dfatal "Failed to install $1"
+ if [[ "$_check" == "yes" ]]; then
+ [[ "$_silent" == "no" ]] && dfatal "Failed to install $1"
return 1
fi
}
installkernel() {
local _fipsmodules _mod
_fipsmodules="aead aes_generic xts aes-x86_64 ansi_cprng cbc ccm chainiv ctr"
- _fipsmodules+=" des deflate ecb eseqiv hmac seqiv sha256_generic sha512"
+ _fipsmodules+=" des deflate ecb eseqiv hmac seqiv sha256 sha256_generic sha512 sha512_generic"
_fipsmodules+=" cryptomgr crypto_null tcrypt dm-mod dm-crypt"
mkdir -m 0755 -p "${initdir}/etc/modprobe.d"
for _mod in $_fipsmodules; do
- if hostonly='' instmods $_mod; then
+ if hostonly='' instmods -c -s $_mod; then
echo $_mod >> "${initdir}/etc/fipsmodules"
echo "blacklist $_mod" >> "${initdir}/etc/modprobe.d/fips.conf"
fi