Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    Can I bring over a module built on FreeBSD ?

    Scheduled Pinned Locked Moved General pfSense Questions
    12 Posts 4 Posters 4.0k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • A
      apfusertoo
      last edited by

      @stephenw10:

      Yes, generally speaking.
      What sort of module are you trying to compile?
      I have done that with network drivers and also with my own code for small binaries.

      Steve

      I need xircom pcmcia cards to work, and they do not on 8.3.  There's a PR for it, and there is fixed code in 9.x, and will even be in place if they release 8.4, but it is not in 8.3, and therefore it will not be in pfsense 2.1.

      1 Reply Last reply Reply Quote 0
      • stephenw10S
        stephenw10 Netgate Administrator
        last edited by

        There is a good chance that will work.
        I seem to remember something about this in the forum recently. Might be worth searching.

        Steve

        Edit: I think I must have only read it recently, looks like it was you anyway!  ::)

        1 Reply Last reply Reply Quote 0
        • jimpJ
          jimp Rebel Alliance Developer Netgate
          last edited by

          You can bring over a module provided that it was compiled on the same version of FreeBSD that pfSense was built on.

          So if you can get the updated code to compile on 8.3, then you can bring the resulting module over. But you can't take a module compiled for 9.x and load it on 8.x

          Remember: Upvote with the 👍 button for any user/post you find to be helpful, informative, or deserving of recognition!

          Need help fast? Netgate Global Support!

          Do not Chat/PM for help!

          1 Reply Last reply Reply Quote 0
          • A
            apfusertoo
            last edited by

            @jimp:

            You can bring over a module provided that it was compiled on the same version of FreeBSD that pfSense was built on.

            So if you can get the updated code to compile on 8.3, then you can bring the resulting module over. But you can't take a module compiled for 9.x and load it on 8.x

            Yes, I figured as much.  Also, the architecture needs to match (ie., i386 vs. amd64).

            But here's the problem I now run into:  'dc' is already part of the default pfsense kernel, so I can't kldload my new dc module:

            module_register: module dc/miibus already exists!

            So … is there a way to do this without compiling a custom pfsense kernel ?  I'm not excited about doing that because I do not have a pfsense build environment set up ...

            Is there a kernel config file for pfsense that I can pull into FreeBSD, edit to my liking, build a kernel, and then drag it back to pfsense ?

            What's the easiest way from point A to point B if I need a custom module for a driver that is already compiled into the pfsense kernel ?

            Thanks.

            1 Reply Last reply Reply Quote 0
            • stephenw10S
              stephenw10 Netgate Administrator
              last edited by

              I have done this with a few different network drivers. I'm not sure you can kldload the module at run time.
              If you add the line:
              if_dc_load="yes"
              To the file /boot/loader.conf.local you should find it works. You will have create that file. Make sure your new module is in /boot/modules.

              Steve

              1 Reply Last reply Reply Quote 0
              • A
                apfusertoo
                last edited by

                @stephenw10:

                I have done this with a few different network drivers. I'm not sure you can kldload the module at run time.
                If you add the line:
                if_dc_load="yes"
                To the file /boot/loader.conf.local you should find it works. You will have create that file. Make sure your new module is in /boot/modules.

                Steve

                Ok, so create my new module, then copy my new if_dc.ko into /boot/kernel, and then add the line to /boot/loader.conf

                Yes ?

                1 Reply Last reply Reply Quote 0
                • stephenw10S
                  stephenw10 Netgate Administrator
                  last edited by

                  Yes.
                  However if you use loader.conf.local and /boot/modules your changes will survive a firmware update.

                  Steve

                  1 Reply Last reply Reply Quote 0
                  • A
                    apfusertoo
                    last edited by

                    @apfusertoo:

                    @stephenw10:

                    I have done this with a few different network drivers. I'm not sure you can kldload the module at run time.
                    If you add the line:
                    if_dc_load="yes"
                    To the file /boot/loader.conf.local you should find it works. You will have create that file. Make sure your new module is in /boot/modules.

                    Steve

                    Ok, so create my new module, then copy my new if_dc.ko into /boot/kernel, and then add the line to /boot/loader.conf

                    Yes ?

                    Hmmm…  not quite.

                    So, the if_dc.ko that I created (and brought over from FreeBSD 8.3) is indeed loaded now - I can see it in the list when I 'kldstat'.

                    However, in dmesg, I am seeing:

                    module_register: module dc/miibus already exists!
                    Module dc/miibus failed to register: 17

                    I get the same set of errors for pci/dc and miibus/dcphy...

                    So do I need to bring over my corresponding miibus.ko from my 8.3 system ?

                    1 Reply Last reply Reply Quote 0
                    • C
                      cmb
                      last edited by

                      Use the latest 2.1 snapshot, we went to the trouble of getting that back ported at your request and need someone with the hardware to test it.

                      You can't necessarily override the built-in driver with a kernel module.

                      1 Reply Last reply Reply Quote 0
                      • A
                        apfusertoo
                        last edited by

                        ok, I will get latest snapshot - thanks.

                        1 Reply Last reply Reply Quote 0
                        • First post
                          Last post
                        Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.