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

    How to compile the kernel just like how pfsense has it?

    Scheduled Pinned Locked Moved General pfSense Questions
    1 Posts 1 Posters 1.3k 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.
    • T
      Tantamount
      last edited by

      So, I had an issue where I needed to disable a driver that's compiled into the kernel.  I assume this meant that I needed to recompile the kernel.

      I think I've done this correctly, but wanted to verify with others here since uname -a is returning a version less than p25:

      Here's what I did from a clean FreeBSD 10.1 vm install:
      (as root)

      mkdir /usr/local/src
      cd /usr/local/src
      git clone -b RELENG_2_2 --single-branch https://github.com/pfsense/FreeBSD-src
      cd FreeBSD-src
      vi sys/amd64/conf/GENERIC
      

      commented out line 207:

      #device        em                      # Intel PRO/1000 Gigabit Ethernet Family

      make buildkernel
      make installkernel
      

      I then renamed the /boot/kernel directory on the pfsense system and scp'ed the /boot/kernel directory that was created from the 'make installkernel' command.

      I then compiled a newer driver against the FreeBSD-src git branch:
      ln -s /usr/local/src/FreeBSD-src /usr/src
      (Download drivers from the internet and put in /usr/local/src/em-7.6.1)

      cd /usr/local/src/em-7.6.1/src
      make clean
      make
      

      copy the resultant if_em.ko file over to the pfsense's /boot/kernel directory.

      Finally, I added this to the /boot/loader.conf file:

      if_em_load="YES"
      

      and rebooted.

      Did I miss anything?  According to this page:
      https://doc.pfsense.org/index.php/Versions_of_pfSense_and_FreeBSD
      the kernel version should be 10.1-RELEASE-p25, however, after reboot, uname -a shows:

      FreeBSD pfSense.domain.com 10.1-RELEASE-p24 FreeBSD 10.1-RELEASE-p24 #1 a595f80(RELENG_2_2)-dirty: Thu Mar  3 21:39:01 UTC 2016     root@:/usr/obj/usr/local/src/FreeBSD-src/sys/GENERIC  amd64
      

      p24 instead of p25?  Did I check out the wrong branch?  Any other gotchas?  There seems to be WAY more kernel modules in /boot/kernel than what comes from the pfsense 2.2.6 distro.  Is there an official 'make' command I should be using when compiling the kernel?

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