Menu

#102 adding an entry to modules.devname

open
nobody
vhba-module
default
2017-08-31
2017-02-05
Ivo Santos
No

I am somewhat stuck and I don't know if this is a problem or not.

when i go to yast and install the vhba package and open a cmd shell and type 'ls /dev/vhba_ctl' is show that the path exists and that the vhba-module is loaded.

When I later restart my pc and run the same command then the path does not exist because the module is not loaded, typing 'modprobe vhba' as root does load the module and I can thereafter type cdemu load 0

and everything will work.

So after doing some testing it seems that the cdemu-daemon expects that the path '/dev/vhba_ctl' exists or it will throw an error.
Now as I understand the file '/lib/modules/$(uname -r)/modules.devname' holds a list of device names to modules so as I understand this correctly. If there was an entry for vhba_ctl in that file the the system should load the vhba module whenever the cdemu-daemon opens the /dev/vbba_ctl path.

So the question or request is whether it is possible to add the relevent entries to the module so that when depmod or similar cmd then the relevant data is added to the modules.devname file?

My setup:
Opensuse Leap 42.1 on Intel x64 system

Discussion

  • Henrik Stokseth

    Henrik Stokseth - 2017-02-06

    It's been a long time since I used SuSE so I forwarded your bug report to the package maintainer, since this is clearly a packaging issue.

    Had a quick glance at the SuSE package, and made some observations.
    https://build.opensuse.org/package/show/filesystems/vhba-kmp

    First it seems they haven't yet adopted the uaccess udev rule for the device node. It should work fine with the old rules, but as far as I know SuSE now also uses systemd.

    More interestingly there is a patch to change from dynamic device numbering to static. I suspect this might be the culprit without investigating any futher. I think the idea is to trigger load of vhba when the device node is accessed. But as you've observed this device node gets created after the module is loaded.

    Could be a classic chicken & egg problem this :-)

    Anyway, since manual modprobing works for you at the moment, I guess you could just add that to your startup scripts in the meantime. This is preferred way for upstream as well, since the module takes some time to initialize, yet uses very little memory.

     
  • Mike Frysinger

    Mike Frysinger - 2017-02-06

    using static major/minor numbers is strongly discouraged in Linux, especially when the code is already done to use dynamic ones. modules.devname is only used for static numbers which means it wouldn't work in modules.devname.

     
  • Jan Engelhardt

    Jan Engelhardt - 2017-02-06

    There are two angles to autoloading.
    1. If you load the module, the device nodes will come into existence.
    2. Or, if you have a device node present, the module can be autoloaded when something opens the node.
    The chicken-egg issue is that because of MISC_DYNAMIC_MINOR, you cannot create a device node in advance. So in openSUSE, a patch is added to set a static number. This way, vhba.ko will have a char-major-10-170 alias, which depmod will pick up and record in modules.devname, which udev picks up to create the static node, and so on.

    However, this patch is not present in openSUSE Leap 42.1 or 42.2, only Tumbleweed (and probably 42.3).
    I would suggest to make use of the /etc/modules-load.d mechanism to autoload vhba on boot on 42.1/42.2.

     
  • Ivo Santos

    Ivo Santos - 2017-05-12

    i have managed to find a solution to this problem.

    I guess if I had been using Ubuntu or Debian distro there would not have been any problem what so ever, however i am using Opensuse Leap 42.1 which means that some of the thing i have been reading on the internet does not help me alot.

    the thing is that everytime I restart my computer I have to run the following command in order for cdemu to work:
    - sudo modprobe vhba

    Which is not optimal.

    Here is what i did to solve my problem!!..

    1. open up file '/etc/init.d/boot.local' in either vi or another texteditor.
    2. add the following text to the bottom of the file: 'modprobe vhba'
    3. save the text file and restart computer

    here is my new /etc/init.d/boot.local file:

    #! /bin/sh
    #
    # Copyright (c) 2002 SuSE Linux AG Nuernberg, Germany.  All rights reserved.
    #
    # Author: Werner Fink, 1996
    #         Burchard Steinbild, 1996
    #
    # /etc/init.d/boot.local
    #
    # script with local commands to be executed from init on system startup
    #
    # Here you should add things, that should happen directly after booting
    # before we're going to the first run level.
    #
    modprobe vhba
    
     

    Last edit: Ivo Santos 2017-05-12
  • Jan Engelhardt

    Jan Engelhardt - 2017-05-13

    Like I said, by using modules-load.d, you don't need boot.local.

     
  • Ivo Santos

    Ivo Santos - 2017-08-31

    Very well then!

    First I opened a command prompt and used su to login as root
    next I did: 'cd /etc/modules-load.d'

    In that folder I created a file named vhba.conf (vi vhba.conf) or what text editor the next reader who reads this post.
    In vi I added the text 'vhba' without the quotation marks and saved the file

    And after reboot... Success!!

    Note: I had forget that the user has to be a member of the cdrom group but after adding myself to the cdrom group everything workt without any problem.

     

Log in to post a comment.

MongoDB Logo MongoDB