From a3cb799a8f63186b843db6a57da12d74a9320686 Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Mon, 8 Oct 2018 19:45:11 -0400 Subject: install/block: avoid conditional addition of drivers Avoid over-optimizing autodetect and always add these. This allows storage drivers to be builtins and still trigger addition of the block node driver. --- install/block | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-) (limited to 'install/block') diff --git a/install/block b/install/block index d9c627f..11c4665 100644 --- a/install/block +++ b/install/block @@ -2,36 +2,27 @@ build() { local filter - local -A blockdevs + + map add_module sd_mod? sr_mod? usb_storage? mmc_block? firewire-sbp2? virtio_blk? # pata, sata, scsi, nvme for filter in 'scsi/.*ata' '/(block|scsi|fusion|nvme)/' 'ata/[ps]ata_' \ 'ata/(ahci|pdc_adma|ata_piix|ata_generic)'; do - add_checked_modules "$filter" && blockdevs['sd_mod']=1 + add_checked_modules "$filter" done # usb - if add_checked_modules -f '(_cs|sl811_hcd|isp116x_hcd)' '/usb/host'; then - blockdevs+=(['usb_storage?']=1 ['sd_mod?']=1 ['sr_mod?']=1) - add_checked_modules '/drivers/usb/storage/' - fi + add_checked_modules -f '(_cs|sl811_hcd|isp116x_hcd)' '/usb/host' + add_checked_modules '/drivers/usb/storage/' # firewire - if add_checked_modules '/drivers/firewire/'; then - blockdevs+=(['firewire-sbp2?']=1 ['sd_mod?']=1 ['sr_mod?']=1) - fi + add_checked_modules '/drivers/firewire/' # mmc - if add_checked_modules '/(mmc|tifm_)'; then - blockdevs+=(['mmc_block?']=1) - fi + add_checked_modules '/(mmc|tifm_)' # virtio - if add_checked_modules 'virtio'; then - blockdevs['virtio_blk?']=1 - fi - - map add_module "${!blockdevs[@]}" + add_checked_modules 'virtio' } help() { -- cgit v1.2.3-24-g4f1b