iscsi/module-setup.sh: speedup installkernel()
parent
94165394ff
commit
9c2a1d0de6
|
@ -41,16 +41,38 @@ installkernel() {
|
||||||
|
|
||||||
instmods iscsi_tcp iscsi_ibft crc32c bnx2i iscsi_boot_sysfs qla4xxx cxgb3i cxgb4i be2iscsi
|
instmods iscsi_tcp iscsi_ibft crc32c bnx2i iscsi_boot_sysfs qla4xxx cxgb3i cxgb4i be2iscsi
|
||||||
iscsi_module_filter() {
|
iscsi_module_filter() {
|
||||||
local _iscsifuncs='iscsi_register_transport'
|
local _funcs='iscsi_register_transport'
|
||||||
local _f
|
# subfunctions inherit following FDs
|
||||||
while read _f; do case "$_f" in
|
local _merge=8 _side2=9
|
||||||
*.ko) [[ $(< $_f) =~ $_iscsifuncs ]] && echo "$_f" ;;
|
function bmf1() {
|
||||||
*.ko.gz) [[ $(gzip -dc <$_f) =~ $_iscsifuncs ]] && echo "$_f" ;;
|
local _f
|
||||||
*.ko.xz) [[ $(xz -dc <$_f) =~ $_iscsifuncs ]] && echo "$_f" ;;
|
while read _f; do
|
||||||
esac
|
case "$_f" in
|
||||||
done
|
*.ko) [[ $(< $_f) =~ $_funcs ]] && echo "$_f" ;;
|
||||||
return 0;
|
*.ko.gz) [[ $(gzip -dc <$_f) =~ $_funcs ]] && echo "$_f" ;;
|
||||||
|
*.ko.xz) [[ $(xz -dc <$_f) =~ $_funcs ]] && echo "$_f" ;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
function rotor() {
|
||||||
|
local _f1 _f2
|
||||||
|
while read _f1; do
|
||||||
|
echo "$_f1"
|
||||||
|
if read _f2; then
|
||||||
|
echo "$_f2" 1>&${_side2}
|
||||||
|
fi
|
||||||
|
done | bmf1 1>&${_merge}
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
# Use two parallel streams to filter alternating modules.
|
||||||
|
set +x
|
||||||
|
eval "( ( rotor ) ${_side2}>&1 | bmf1 ) ${_merge}>&1"
|
||||||
|
[[ $debug ]] && set -x
|
||||||
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
{ find_kernel_modules_by_path drivers/scsi; if [ "$_arch" = "s390" -o "$_arch" = "s390x" ]; then find_kernel_modules_by_path drivers/s390/scsi; fi;} \
|
{ find_kernel_modules_by_path drivers/scsi; if [ "$_arch" = "s390" -o "$_arch" = "s390x" ]; then find_kernel_modules_by_path drivers/s390/scsi; fi;} \
|
||||||
| iscsi_module_filter | instmods
|
| iscsi_module_filter | instmods
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue