robertklep / dsm7-usb-serial-drivers

Synology DSM 7 USB serial drivers
530 stars 90 forks source link

usb-serial-drivers.sh is unnecessary #7

Open tomkv opened 3 years ago

tomkv commented 3 years ago

Just a heads-up: the loader script is not necessary.

DSM7 comes with systemd as the service manager. One of the supplied services is systemd-modules-load.service, which can ensure loading the modules.

So all you need is a single .conf file containing a list of wanted modules in /etc/modules-load.d/ and they will be loaded at boot (or whenever systemd-modules-load service is started).

robertklep commented 3 years ago

@tomkv thanks for the tip, I'll add it to the README. Do you have any idea what happens when any of the modules that should be loaded from a .conf file doesn't exist? I'm trying to figure out if I can just provide a single file that contains all drivers, even if the user hasn't installed them all.

tomkv commented 3 years ago

@robertklep Looking at the source, you will get logged message, if the module cannot be loaded, is on the blacklist or is already loaded.

You could also provide file - separate .conf - for each driver, and only what user installs,would get loaded.

robertklep commented 3 years ago

For some reason, the systemd solution is failing (see #8). I'm not inclined to fix it at the moment so I'll remove the systemd-related instructions from the README.

fdebrus commented 3 years ago

Hello, this is how I got mine loaded and reloaded at each reboot of the NAS. let me know if that works for you too.

// Copy your module to /lib/modules cp my-module.ko /lib/modules/my-module.ko

// Add a .conf file in /etc/modules-load.d echo my-module >> /etc/modules-load.d/my-module.conf

// Add the module to /lib/modules/modules.dep echo my-module.ko: >> /lib/modules/modules.dep

// Create depmod as symlink to kmod ln -s /usr/bin/kmod /sbin/depmod

// Execute depmod, no param's needed, ignore warning and error if any depmod

// Restart systemctl restart systemd-modules-load

Now your module is loaded and will be loaded at each restart.