Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: module load at bootup

  1. #1

    Default module load at bootup

    Hello!
    How do I load module on boot-up for device that is not detected?

    I need to load pata_via for IDE controller that is not detected on bootup.

    I tried to enter module manually via (KDE) Administrator Settings -> System -> Kernel Settings … here I add pata_via for VIA IDE controler at 0:0f.0tha
    That creates configurarion file /etc/modprobe.d/50-newid.conf:

    Code:
    install pata_via /sbin/modprobe --ignore-install pata_via; echo '8086 7111' > '/sys/bus/pci/drivers/pata_via/new_id'

    (that's how it looks on virtual machine, on real PC numbers are slight different … 5337...)

    Then I do (as root) mkinitrd and check:
    Code:
    linux-fdho:~ # lsinitrd |grep pata -rw-r--r-- 1 root root 26712 Dec 6 18:10 lib/modules/4.12.14-lp151.28.36-default/kernel/drivers/ata/pata_via.ko
    linux-fdho:~ # lsinitrd |grep 50-newid -rw-r--r-- 1 root root 118 Dec 30 00:36 etc/modprobe.d/50-newid.conf

    Unfortunately, after restart module is not loaded.



    After some googling I add /etc/sysconfig/kernel with
    Code:
    MODULES_LOADED_ON_BOOT="pata_via"

    Unfortunately it doesn't get added to initrd and it doesn't work also.

    How to make module loaded at bootup (via initrd)?

    BR,
    Kuba

  2. #2
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    27,832
    Blog Entries
    15

    Default Re: module load at bootup

    Hi and welcome to the Forum
    You need to add a file /etc/modules-load.d/pata_via.conf

    and in that file just have;

    Code:
    pata_via
    Then rebuild initrd with the mkinitrd command.
    Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
    SUSE SLE, openSUSE Leap/Tumbleweed (x86_64) | GNOME DE
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below... Thanks!

  3. #3
    Join Date
    Jun 2008
    Location
    San Diego, Ca, USA
    Posts
    11,853
    Blog Entries
    2

    Default Re: module load at bootup

    Here is the arch wiki documentation which should work for openSUSE as well

    https://wiki.archlinux.org/index.php/Kernel_module

    Note that after you have built your kernel modules you do should not need to remake your mkintrd or rebuild your modules, just load your modules as described, your mobules should then load not when GRUB loads but late in the system boot process and be available long before the time you login.

    TSU
    Beginner Wiki Quickstart - https://en.opensuse.org/User:Tsu2/Quickstart_Wiki
    Solved a problem recently? Create a wiki page for future personal reference!
    Learn something new?
    Attended a computing event?
    Post and Share!

  4. #4
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    27,832
    Blog Entries
    15

    Default Re: module load at bootup

    Quote Originally Posted by tsu2 View Post
    Here is the arch wiki documentation which should work for openSUSE as well

    https://wiki.archlinux.org/index.php/Kernel_module

    Note that after you have built your kernel modules you do should not need to remake your mkintrd or rebuild your modules, just load your modules as described

    TSU
    Hi
    There is no module to build, the module exists in the kernel, in this case the OP needs to inject the PCI ID...
    Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
    SUSE SLE, openSUSE Leap/Tumbleweed (x86_64) | GNOME DE
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below... Thanks!

  5. #5
    Join Date
    Jun 2008
    Location
    San Diego, Ca, USA
    Posts
    11,853
    Blog Entries
    2

    Default Re: module load at bootup

    Quote Originally Posted by malcolmlewis View Post
    Hi
    There is no module to build, the module exists in the kernel, in this case the OP needs to inject the PCI ID...
    If the module already exists, then just load the module as described...
    Requires testing but likely won't require adding to the initrd.

    Background info...
    Nowadays, kernel modules can be built into the base initrd, and generally those are determined by our openSUSE/SUSE maintainers.
    But we Users can modify by dynamically loading additional modules as needed (BTW - I'd be very surprised if the module to support PATA is not already loaded but anything is possible and I haven't checked) and would not be added to the initrd. Nowadays, I see us mostly running mkinitrd to modify configurations in the initrd, not adding modules. Also, disks can be mounted a few different ways which can afford flexibility if there is some kind of timing issue.

    If I were troubleshooting this,
    The following assumes the problem disk is a system disk and not a removable disk, which usually means the PATA controller is installed in something like a PCI (or ancient ISA) slot and bus. If the interface/card is installed in something like a USB, PCMCIA or Firewire slot there might be complications.
    I'd probably start with a default openSUSE and simply attempt to mount the disk manually, if successful that would indicate that the necessary parts including any kernel module is fully loaded by the time the User logs in.
    Assuming that the disk can be mounted by the User without any special system modification (like loading a kernel module), my next step might be try to determine why udev isn't finding the disk and mounting in fstab during boot... For instance is there a problem with the device vendorid:deviceid?
    But even before all of this, of course, you need to verify the BIOS/UEFI is able to find the disk.

    TSU
    Beginner Wiki Quickstart - https://en.opensuse.org/User:Tsu2/Quickstart_Wiki
    Solved a problem recently? Create a wiki page for future personal reference!
    Learn something new?
    Attended a computing event?
    Post and Share!

  6. #6
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    27,832
    Blog Entries
    15

    Default Re: module load at bootup

    Quote Originally Posted by tsu2 View Post
    If the module already exists, then just load the module as described...
    Requires testing but likely won't require adding to the initrd.

    Background info...
    Nowadays, kernel modules can be built into the base initrd, and generally those are determined by our openSUSE/SUSE maintainers.
    But we Users can modify by dynamically loading additional modules as needed (BTW - I'd be very surprised if the module to support PATA is not already loaded but anything is possible and I haven't checked) and would not be added to the initrd. Nowadays, I see us mostly running mkinitrd to modify configurations in the initrd, not adding modules. Also, disks can be mounted a few different ways which can afford flexibility if there is some kind of timing issue.

    If I were troubleshooting this,
    The following assumes the problem disk is a system disk and not a removable disk, which usually means the PATA controller is installed in something like a PCI (or ancient ISA) slot and bus. If the interface/card is installed in something like a USB, PCMCIA or Firewire slot there might be complications.
    I'd probably start with a default openSUSE and simply attempt to mount the disk manually, if successful that would indicate that the necessary parts including any kernel module is fully loaded by the time the User logs in.
    Assuming that the disk can be mounted by the User without any special system modification (like loading a kernel module), my next step might be try to determine why udev isn't finding the disk and mounting in fstab during boot... For instance is there a problem with the device vendorid:deviceid?
    But even before all of this, of course, you need to verify the BIOS/UEFI is able to find the disk.

    TSU
    Hi
    A better way is to patch the module to add the missing PCI-ID and upstream.... I think there is a file somewhere in /etc that can be added too as well?
    Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
    SUSE SLE, openSUSE Leap/Tumbleweed (x86_64) | GNOME DE
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below... Thanks!

  7. #7

    Default Re: module load at bootup

    Hello!
    To clear this case out...
    Actually a problem is with stock kernel/initrd not loading proper module on boot-up.
    Motherboard is Asus
    P5VD2-VM that has Via IDE controller and I have IDE HDD for installation.
    I did workaround by attaching disk to SATA port via IDE-SATA adapter (taken from other PC) and then I looked for a way to load module during bootup and get rid of this adapter (that's why my initial post came).

    Module pata_via does the job for IDE controller (confirmed after bootup) but it's somehow not loaded by default auto-magically.
    I can post vendor and device strings once I'll be back from vacation (that means after Jan 6th). Hope this helps to upstream changes to module/kernel.

    BR,
    Kuba





  8. #8
    Join Date
    Jun 2008
    Location
    San Diego, Ca, USA
    Posts
    11,853
    Blog Entries
    2

    Default Re: module load at bootup

    Quote Originally Posted by kglos View Post
    Hello!
    To clear this case out...
    Actually a problem is with stock kernel/initrd not loading proper module on boot-up.
    Motherboard is Asus
    P5VD2-VM that has Via IDE controller and I have IDE HDD for installation.
    I did workaround by attaching disk to SATA port via IDE-SATA adapter (taken from other PC) and then I looked for a way to load module during bootup and get rid of this adapter (that's why my initial post came).

    Module pata_via does the job for IDE controller (confirmed after bootup) but it's somehow not loaded by default auto-magically.
    I can post vendor and device strings once I'll be back from vacation (that means after Jan 6th). Hope this helps to upstream changes to module/kernel.

    BR,
    Kuba
    Recommend insert your mount command exactly as you'd do it in a console manually into /etc/sysctl.conf this file is typically read during boot well after your system disks are loaded. In other words your SATA controller which likely is required should already be loaded so your IDE controller can also load. This location is supposedly being deprecated sometime, and your command may need to be inserted into any of the other listed sysctl files that will continue to be supported.

    Would be interesting to know what driver is required and implemented by your system, if it's actually the kernel module you're trying to load... and yest, your sata to pci controller is likely the complication. I'd expect if you were able to use an IDE controller that connects directly to your PCI bus you probably wouldn't have this issue, and I'd also guess that your disk isn't identified by your BIOS.

    TSU
    Beginner Wiki Quickstart - https://en.opensuse.org/User:Tsu2/Quickstart_Wiki
    Solved a problem recently? Create a wiki page for future personal reference!
    Learn something new?
    Attended a computing event?
    Post and Share!

  9. #9
    Join Date
    Jun 2008
    Location
    San Diego, Ca, USA
    Posts
    11,853
    Blog Entries
    2

    Default Re: module load at bootup

    Quote Originally Posted by tsu2 View Post
    Recommend insert your mount command exactly as you'd do it in a console manually into /etc/sysctl.conf this file is typically read during boot well after your system disks are loaded. In other words your SATA controller which likely is required should already be loaded so your IDE controller can also load. This location is supposedly being deprecated sometime, and your command may need to be inserted into any of the other listed sysctl files that will continue to be supported.

    Would be interesting to know what driver is required and implemented by your system, if it's actually the kernel module you're trying to load... and yest, your sata to pci controller is likely the complication. I'd expect if you were able to use an IDE controller that connects directly to your PCI bus you probably wouldn't have this issue, and I'd also guess that your disk isn't identified by your BIOS.

    TSU
    In other words, I suspect that your IDE isn't working during stage 1 boot because it likely requires the SATA controller to be working first.
    i describe mounting your IDE disk well after your SATA controller loads first, after which your IDE controller should work just fine.
    No need and IMO it's even questionable whether making your IDE controller kernel module part of the initrd would make it work.

    Yes, some speculating but based on what I think is happening...
    TSU
    Beginner Wiki Quickstart - https://en.opensuse.org/User:Tsu2/Quickstart_Wiki
    Solved a problem recently? Create a wiki page for future personal reference!
    Learn something new?
    Attended a computing event?
    Post and Share!

  10. #10
    Join Date
    Jun 2008
    Location
    San Diego, Ca, USA
    Posts
    11,853
    Blog Entries
    2

    Default Re: module load at bootup

    Here is some more info you might be able to use,


    Thus us a brief Wiki page I wrote several years ago introducing the idea of Loadable Kernel Modules. AFAIK all should still work in today's openSUSE, only diff is that with all the device drivers that are being implemented as kernel modules people are describing the current Linux kernel as "monolithic" again, but the "loadable" has not changed recently.


    https://en.opensuse.org/User:Tsu2/LKM


    Even further back,
    I wrote an article about optimizing network connections, and it describes how to make changes to kernel default configuration settings as well as how to load a specific kernel module on boot. Although it's possible to write specific commands that fit specific distros, I chose to recommend methods that should work across all distros.


    https://sites.google.com/site/4techs...nnection/linux


    TSU
    Beginner Wiki Quickstart - https://en.opensuse.org/User:Tsu2/Quickstart_Wiki
    Solved a problem recently? Create a wiki page for future personal reference!
    Learn something new?
    Attended a computing event?
    Post and Share!

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •