Kernel modules from Entware-NG on NAS326

Options
alfaalfa
alfaalfa Posts: 6  Freshman Member
First Anniversary
edited February 2019 in Personal Cloud Storage
Hi everyone,
I have a question. Could Entware-NG recognize USB devices on NAS? E.g. I have a scanner (recognized by sane by default in Entware). I've installed all necessary Entware packages and zyxel-modules-3.10.39 from Meta repository, but Entware cannot see it. I have tested some other devices with the same result. The output of usb-devices command confirms that NAS recognizes all of them as any other linux. Is there a way to make it work for Entware? Thank you in advance!

#NAS_Feb_2019

Accepted Solution

  • Mijzelf
    Mijzelf Posts: 2,605  Guru Member
    First Anniversary 10 Comments Friend Collector First Answer
    Answer ✓
    Options
    It's a bit complicated.

    The kernel modules from zyxel-modules-3.10.39 are not known to "the system", and so they will not be loaded automagically.

    A construction called hotplug is responsible for automatically loading device drivers (kernel modules) when needed. The hotplug binary or script uses modprobe functionality to load the module.
    Modprobe uses some database generated by depmod to know the dependencies.

    And there is something called udev, which generates device nodes in /dev/ on the fly.

    On my NAS520 the hotplug functionality is implemented by /sbin/mdev, which is a busybox applet.
    You can find the configuration in /etc/mdev.conf, which tells that on change of any disk/usb, /sbin/hotplug is called, which is a script, which on his term calls (one of) the /usr/sbin/hotplug_* scripts.
    As I don't think ZyXEL has covered scanners in their hotplug scripts, needed actions will not be taken.

    So, to get that scanner running, you'll have to find out what your full blown Linux system is actually doing, and do that manually.
    Don't know if it's possible to get /dev/mdev to load device drivers on the fly. There are some scripts in /etc/hotplug.d/, but I don't know if, and how they are used. There are some /etc/hotplug2* config/scripts, but I don't know/can't find who uses these.
    But it's always possible to pre-load needed modules using insmod. (or modprobe, if you run depmod first, for the right modules directory.)

    When the scanner needs firmware, you'll have to provide that in /lib/firmware/. That is a memory drive, so maybe you'd better use a symlink.

All Replies

  • alfaalfa
    alfaalfa Posts: 6  Freshman Member
    First Anniversary
    Options
    Ok, there are a lot of ready modules in zyxel-modules-3.10.39 from Meta repository, they are not loaded, i can't figure out how to load them correctly.
  • Mijzelf
    Mijzelf Posts: 2,605  Guru Member
    First Anniversary 10 Comments Friend Collector First Answer
    Answer ✓
    Options
    It's a bit complicated.

    The kernel modules from zyxel-modules-3.10.39 are not known to "the system", and so they will not be loaded automagically.

    A construction called hotplug is responsible for automatically loading device drivers (kernel modules) when needed. The hotplug binary or script uses modprobe functionality to load the module.
    Modprobe uses some database generated by depmod to know the dependencies.

    And there is something called udev, which generates device nodes in /dev/ on the fly.

    On my NAS520 the hotplug functionality is implemented by /sbin/mdev, which is a busybox applet.
    You can find the configuration in /etc/mdev.conf, which tells that on change of any disk/usb, /sbin/hotplug is called, which is a script, which on his term calls (one of) the /usr/sbin/hotplug_* scripts.
    As I don't think ZyXEL has covered scanners in their hotplug scripts, needed actions will not be taken.

    So, to get that scanner running, you'll have to find out what your full blown Linux system is actually doing, and do that manually.
    Don't know if it's possible to get /dev/mdev to load device drivers on the fly. There are some scripts in /etc/hotplug.d/, but I don't know if, and how they are used. There are some /etc/hotplug2* config/scripts, but I don't know/can't find who uses these.
    But it's always possible to pre-load needed modules using insmod. (or modprobe, if you run depmod first, for the right modules directory.)

    When the scanner needs firmware, you'll have to provide that in /lib/firmware/. That is a memory drive, so maybe you'd better use a symlink.

  • alfaalfa
    alfaalfa Posts: 6  Freshman Member
    First Anniversary
    edited February 2019
    Options
    Thank you for your detailed response, Mijzelf!! I really appreciate your time and your help with this. I will follow your kind answer in order to try to make it work. Anyway, it's the best explanation one could get on this topic. Automagically won't work for certain. Thanks again!

Consumer Product Help Center