0001-install-block-avoid-conditional-addition-of-drivers.patch 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. From a3cb799a8f63186b843db6a57da12d74a9320686 Mon Sep 17 00:00:00 2001
  2. From: Dave Reisner <dreisner@archlinux.org>
  3. Date: Mon, 8 Oct 2018 19:45:11 -0400
  4. Subject: [PATCH 1/3] install/block: avoid conditional addition of drivers
  5. Avoid over-optimizing autodetect and always add these. This allows
  6. storage drivers to be builtins and still trigger addition of the block
  7. node driver.
  8. ---
  9. install/block | 25 ++++++++-----------------
  10. 1 file changed, 8 insertions(+), 17 deletions(-)
  11. diff --git a/install/block b/install/block
  12. index d9c627f..11c4665 100644
  13. --- a/install/block
  14. +++ b/install/block
  15. @@ -2,36 +2,27 @@
  16. build() {
  17. local filter
  18. - local -A blockdevs
  19. +
  20. + map add_module sd_mod? sr_mod? usb_storage? mmc_block? firewire-sbp2? virtio_blk?
  21. # pata, sata, scsi, nvme
  22. for filter in 'scsi/.*ata' '/(block|scsi|fusion|nvme)/' 'ata/[ps]ata_' \
  23. 'ata/(ahci|pdc_adma|ata_piix|ata_generic)'; do
  24. - add_checked_modules "$filter" && blockdevs['sd_mod']=1
  25. + add_checked_modules "$filter"
  26. done
  27. # usb
  28. - if add_checked_modules -f '(_cs|sl811_hcd|isp116x_hcd)' '/usb/host'; then
  29. - blockdevs+=(['usb_storage?']=1 ['sd_mod?']=1 ['sr_mod?']=1)
  30. - add_checked_modules '/drivers/usb/storage/'
  31. - fi
  32. + add_checked_modules -f '(_cs|sl811_hcd|isp116x_hcd)' '/usb/host'
  33. + add_checked_modules '/drivers/usb/storage/'
  34. # firewire
  35. - if add_checked_modules '/drivers/firewire/'; then
  36. - blockdevs+=(['firewire-sbp2?']=1 ['sd_mod?']=1 ['sr_mod?']=1)
  37. - fi
  38. + add_checked_modules '/drivers/firewire/'
  39. # mmc
  40. - if add_checked_modules '/(mmc|tifm_)'; then
  41. - blockdevs+=(['mmc_block?']=1)
  42. - fi
  43. + add_checked_modules '/(mmc|tifm_)'
  44. # virtio
  45. - if add_checked_modules 'virtio'; then
  46. - blockdevs['virtio_blk?']=1
  47. - fi
  48. -
  49. - map add_module "${!blockdevs[@]}"
  50. + add_checked_modules 'virtio'
  51. }
  52. help() {
  53. --
  54. 2.12.2