helloSystem / ISO

helloSystem Live and installation ISO
https://github.com/helloSystem/
BSD 3-Clause "New" or "Revised" License
808 stars 58 forks source link

Load FireWire kernel module automatically #77

Open probonopd opened 3 years ago

probonopd commented 3 years ago

Make firewire.ko kernel module load automatically on machines that have a FireWire controller (like many Macs do).

We could do it via loader.conf but then it would get loaded even on machines without FireWire.

How to do this properly?

probonopd commented 3 years ago

Similarly,

https://github.com/helloSystem/ISO/blob/77fb82caa1df84dc2b8079174ed4f297686d000c/overlays/boot/boot/loader.conf#L64-L65

might be replaced by a better solution?

probonopd commented 3 years ago

Does

https://github.com/helloSystem/ISO/blob/6732d7ea89d6f9620f9044abd18955882db6df22/overlays/uzip/furybsd-live-settings/files/usr/local/bin/furybsd-init-helper#L82

have to do with it?

     kld_list    (str) A list of kernel modules to load right after the local
         disks are mounted.  Loading modules at this point in the boot
         process is much faster than doing it via /boot/loader.conf
         for those modules not necessary for mounting local disk.

No mention of "hardware autodetection" though.

probonopd commented 3 years ago

Can https://www.freebsd.org/cgi/man.cgi?devd(8) be used to load such modules only when the matching hardware is present?

Maybe @vermaden knows how to do this "properly"?

probonopd commented 3 years ago

In the case of the FireWire module, Macs actually can boot from FireWire, and for older Macs (pre-USB 3) this is the only way to attach fast external SSD storage, hence greatly increasing their usable lifespan (one use case for which helloSystem is intended). Hence in the case of the FireWire module it may be justified to load it via loader.conf actually.

probonopd commented 3 years ago

Which ones are actually needed to boot Macs using FireWire?

https://lists.freebsd.org/pipermail/freebsd-firewire/2010-May/001196.html has

+firewire_load="NO"             # IEEE1394 High-performance Serial Bus
+fwe_load="NO"                  # Ethernet emulation driver for FireWire
+fwip_load="NO"                 # IP over FireWire driver
+fwohci_load="NO"               # OHCI FireWire chipset device driver
(load with firewire)
+sbp_load="NO"                  # SBP-2 Mass Storage Devices driver

Mac OS X seems to be using OHCI, so I will put in

# IEEE1394 High-performance Serial Bus and OHCI FireWire chipset device driver
# Does this allow Macs to be booted via FireWire?
firewire_load="YES"
fwohci_load="YES"

Needs to be tested.

probonopd commented 3 years ago

Maybe DSBDriverd https://github.com/mrclksr/DSBDriverd?

probonopd commented 3 years ago

Added dsbdriverd in https://github.com/helloSystem/ISO/commit/0681dcee2622a7f51950459f2d4c51f3505b19cd

vermaden commented 3 years ago

Maybe DSBDriverd https://github.com/mrclksr/DSBDriverd?

Yes, that one can also be used.

Keep in mind that as devd(8) is used to execute automount it can also be used to execute any script - in this special case a script that will load needed kernel modules.

... but if they are just one or two modules I would consider just adding them to /etc/rc.conf file to load them anyway.

probonopd commented 3 years ago

if they are just one or two modules I would consider just adding them to /etc/rc.conf file to load them anyway

As for FireWire, I assume that this is needed to get this to boot? (Assuming that FreeBSD can be booted over FireWire at all, which I am just blindly assuming at this point due to the lack of test hardware.)

vermaden commented 3 years ago

if they are just one or two modules I would consider just adding them to /etc/rc.conf file to load them anyway

As for FireWire, I assume that this is needed to get this to boot? (Assuming that FreeBSD can be booted over FireWire at all, which I am just blindly assuming at this point due to the lack of test hardware.)

When was the last time you booted from FireWire? :)

probonopd commented 3 years ago

Not that long ago. On an iMac3,1 which has an intenal slow rotating hard drive and is much speedier when booted from an SSD attached via FireWire.

vermaden commented 3 years ago

Not that long ago. On an iMac3,1 which has an intenal slow rotating hard drive and is much speedier when booted from an SSD attached via FireWire.

I assume that You could as well boot from that SSD using USB port?

probonopd commented 3 years ago

Yes, but it's only USB2... Apple had FireWire and hence was slow embracing USB3.