Skip to content

Commit 77ac95d

Browse files
nabijaczlewelijohannbg
authored andcommitted
perf(90kernel-modules): use awk instead of shell monster
~120ms -> ~2ms Downstream: https://bugs.debian.org/1017411
1 parent 03babd9 commit 77ac95d

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

modules.d/90kernel-modules/module-setup.sh

+1-11
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,6 @@ installkernel() {
55
local _blockfuncs='ahci_platform_get_resources|ata_scsi_ioctl|scsi_add_host|blk_cleanup_queue|register_mtd_blktrans|scsi_esp_register|register_virtio_device|usb_stor_disconnect|mmc_add_host|sdhci_add_host|scsi_add_host_with_dma|blk_mq_alloc_disk|blk_cleanup_disk'
66
local -A _hostonly_drvs
77

8-
find_kernel_modules_external() {
9-
local a
10-
11-
[[ -f "$srcmods/modules.dep" ]] || return 0
12-
13-
while IFS=: read -r a _ || [[ $a ]]; do
14-
[[ $a =~ ^/ ]] && printf "%s\n" "$a"
15-
done < "$srcmods/modules.dep"
16-
}
17-
188
record_block_dev_drv() {
199

2010
for _mod in $(get_dev_module /dev/block/"$1"); do
@@ -105,7 +95,7 @@ installkernel() {
10595
"=drivers/scsi/hisi_sas"
10696
fi
10797

108-
find_kernel_modules_external | instmods
98+
awk -F: '/^\// {print $1}' "$srcmods/modules.dep" 2> /dev/null | instmods
10999

110100
# if not on hostonly mode, or there are hostonly block device
111101
# install block drivers

0 commit comments

Comments
 (0)