From: наб Date: Thu, 13 Oct 2022 16:14:53 +0000 (+0200) Subject: perf(90kernel-modules): use awk instead of shell monster X-Git-Tag: 058~111 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=77ac95d9091afcfdbd1fe0372389613914dd1bc6;p=thirdparty%2Fdracut.git perf(90kernel-modules): use awk instead of shell monster ~120ms -> ~2ms Downstream: https://bugs.debian.org/1017411 --- diff --git a/modules.d/90kernel-modules/module-setup.sh b/modules.d/90kernel-modules/module-setup.sh index 191af041b..566757bf3 100755 --- a/modules.d/90kernel-modules/module-setup.sh +++ b/modules.d/90kernel-modules/module-setup.sh @@ -5,16 +5,6 @@ installkernel() { 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' local -A _hostonly_drvs - find_kernel_modules_external() { - local a - - [[ -f "$srcmods/modules.dep" ]] || return 0 - - while IFS=: read -r a _ || [[ $a ]]; do - [[ $a =~ ^/ ]] && printf "%s\n" "$a" - done < "$srcmods/modules.dep" - } - record_block_dev_drv() { for _mod in $(get_dev_module /dev/block/"$1"); do @@ -105,7 +95,7 @@ installkernel() { "=drivers/scsi/hisi_sas" fi - find_kernel_modules_external | instmods + awk -F: '/^\// {print $1}' "$srcmods/modules.dep" 2> /dev/null | instmods # if not on hostonly mode, or there are hostonly block device # install block drivers