OPNsense
  • Home
  • Help
  • Search
  • Login
  • Register

  • OPNsense Forum »
  • Profile of d3pr3cat3d »
  • Show Posts »
  • Topics
  • Profile Info
    • Summary
    • Show Stats
    • Show Posts...
      • Messages
      • Topics
      • Attachments

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

  • Messages
  • Topics
  • Attachments

Topics - d3pr3cat3d

Pages: [1]
1
Tutorials and FAQs / [Tutorial] Compile network driver
« on: February 14, 2021, 08:39:42 pm »
This tutorial is how to compile and install the latest Intel if_em.ko driver, this may work for other drivers that you want to compile?

The right way is to use a OPNsense version that is the same version that you are using in production.

Thanks to almodovaris for pointing this out.
Quote
https://forum.opnsense.org/index.php?action=post;quote=101093;topic=21484.0;last_msg=101093

I found an old topic from franco that explained how to do this in OPNsense.
Quote
https://forum.opnsense.org/index.php?topic=3689.msg12644#msg12644

Prior to finding franco's post I ran in to this error while trying to compile the driver.
Code: [Select]
root@OPNsense:/tmp/em-7.7.8/src # make
make: "/usr/share/mk/bsd.kmod.mk" line 16: Unable to locate the kernel source tree. Set SYSDIR to override.

This my process for OPNsense version 21.1. I was using Arch Linux and running OPNsense as a VM using KVM with libvirt. The driver was copied to /tmp on the OPNsense VM.

Code: [Select]
root@OPNsense:~ # pkg install git
Updating OPNsense repository catalogue...
Fetching meta.conf: 100%    163 B   0.2kB/s    00:01   
Fetching packagesite.txz: 100%  199 KiB 203.4kB/s    00:01   
Processing entries: 100%
OPNsense repository update completed. 728 packages processed.
All repositories are up to date.
Updating database digests format: 100%
The following 3 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
cvsps: 2.1_2
git: 2.30.0
p5-Error: 0.17029

Number of packages to be installed: 3

The process will require 22 MiB more space.
4 MiB to be downloaded.

Proceed with this action? [y/N]: y
[1/3] Fetching git-2.30.0.txz: 100%    4 MiB   1.1MB/s    00:04   
[2/3] Fetching p5-Error-0.17029.txz: 100%   27 KiB  27.4kB/s    00:01   
[3/3] Fetching cvsps-2.1_2.txz: 100%   41 KiB  41.9kB/s    00:01   
Checking integrity... done (0 conflicting)
[1/3] Installing p5-Error-0.17029...
[1/3] Extracting p5-Error-0.17029: 100%
[2/3] Installing cvsps-2.1_2...
[2/3] Extracting cvsps-2.1_2: 100%
[3/3] Installing git-2.30.0...
===> Creating groups.
Creating group 'git_daemon' with gid '964'.
===> Creating users
Creating user 'git_daemon' with uid '964'.
[3/3] Extracting git-2.30.0: 100%
=====
Message from git-2.30.0:

--
If you installed the GITWEB option please follow these instructions:

In the directory /usr/local/share/examples/git/gitweb you can find all files to
make gitweb work as a public repository on the web.

All you have to do to make gitweb work is:
1) Please be sure you're able to execute CGI scripts in
   /usr/local/share/examples/git/gitweb.
2) Set the GITWEB_CONFIG variable in your webserver's config to
   /usr/local/etc/git/gitweb.conf. This variable is passed to gitweb.cgi.
3) Restart server.


If you installed the CONTRIB option please note that the scripts are
installed in /usr/local/share/git-core/contrib. Some of them require
other ports to be installed (perl, python, etc), which you may need to
install manually.

root@OPNsense:~ # cd /usr

root@OPNsense:/usr # git clone https://github.com/opnsense/plugins
Cloning into 'plugins'...
remote: Enumerating objects: 96, done.
remote: Counting objects: 100% (96/96), done.
remote: Compressing objects: 100% (72/72), done.
remote: Total 45587 (delta 27), reused 67 (delta 16), pack-reused 45491
Receiving objects: 100% (45587/45587), 8.93 MiB | 8.63 MiB/s, done.
Resolving deltas: 100% (17821/17821), done.

root@OPNsense:/usr # git clone https://github.com/opnsense/ports
Cloning into 'ports'...
remote: Enumerating objects: 11654, done.
remote: Counting objects: 100% (11654/11654), done.
remote: Compressing objects: 100% (10196/10196), done.
remote: Total 1216799 (delta 2252), reused 7971 (delta 1393), pack-reused 1205145
Receiving objects: 100% (1216799/1216799), 406.62 MiB | 16.51 MiB/s, done.
Resolving deltas: 100% (559702/559702), done.
Updating files: 100% (137844/137844), done.

root@OPNsense:/usr # git clone https://github.com/opnsense/src
Cloning into 'src'...
remote: Enumerating objects: 296, done.
remote: Counting objects: 100% (296/296), done.
remote: Compressing objects: 100% (175/175), done.
remote: Total 218175 (delta 178), reused 164 (delta 115), pack-reused 217879
Receiving objects: 100% (218175/218175), 493.89 MiB | 17.60 MiB/s, done.
Resolving deltas: 100% (134226/134226), done.
Updating files: 100% (80527/80527), done.

root@OPNsense:/usr # cd src/

root@OPNsense:/usr/src # git checkout
COPYRIGHT             ObsoleteFiles.inc     contrib/              libexec/              sys/
LOCKS                 README                crypto/               release/              targets/
MAINTAINERS           README.md             etc/                  rescue/               tests/
Makefile              UPDATING              gnu/                  sbin/                 tools/
Makefile.inc1         UPDATING-HardenedBSD  include/              secure/               usr.bin/
Makefile.libcompat    bin/                  kerberos5/            share/                usr.sbin/
Makefile.sys.inc      cddl/                 lib/                  stand/               

root@OPNsense:/usr/src # git checkout stable/21.1
Branch 'stable/21.1' set up to track remote branch 'stable/21.1' from 'origin'.
Switched to a new branch 'stable/21.1'

root@OPNsense:/tmp # cd /tmp

root@OPNsense:/tmp # tar xzf em-7.7.8.tar.gz

root@OPNsense:/tmp # cd em-7.7.8/src

root@OPNsense:/tmp/em-7.7.8/src # make
machine -> /usr/src/sys/amd64/include
x86 -> /usr/src/sys/x86/include
awk -f /usr/src/sys/tools/makeobjops.awk /usr/src/sys/kern/device_if.m -h
awk -f /usr/src/sys/tools/makeobjops.awk /usr/src/sys/kern/bus_if.m -h
awk -f /usr/src/sys/tools/makeobjops.awk /usr/src/sys/dev/pci/pci_if.m -h
Warning: Object directory not changed from original /tmp/em-7.7.8/src
cc  -O2 -pipe -DHARDENEDBSD -DINET -DINET6 -DEM_STANDALONE_BUILD  -fno-strict-aliasing -Werror -D_KERNEL -DKLD_MODULE -nostdinc   -I. -I/usr/src/sys -I/usr/src/sys/contrib/ck/include -fno-common  -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -fdebug-prefix-map=./machine=/usr/src/sys/amd64/include -fdebug-prefix-map=./x86=/usr/src/sys/x86/include   -MD  -MF.depend.if_em.o -MTif_em.o -mcmodel=kernel -mno-red-zone -mno-mmx -mno-sse -msoft-float  -fno-asynchronous-unwind-tables -ffreestanding -fwrapv -fstack-protector -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wcast-qual -Wundef -Wno-pointer-sign -D__printf__=__freebsd_kprintf__ -Wmissing-include-dirs -fdiagnostics-show-option -Wno-unknown-pragmas -Wno-error-tautological-compare -Wno-error-empty-body -Wno-error-parentheses-equality -Wno-error-unused-function -Wno-error-pointer-sign -Wno-error-shift-negative-value -Wno-address-of-packed-member  -mno-aes -mno-avx  -std=iso9899:1999 -c if_em.c -o if_em.o
cc  -O2 -pipe -DHARDENEDBSD -DINET -DINET6 -DEM_STANDALONE_BUILD  -fno-strict-aliasing -Werror -D_KERNEL -DKLD_MODULE -nostdinc   -I. -I/usr/src/sys -I/usr/src/sys/contrib/ck/include -fno-common  -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -fdebug-prefix-map=./machine=/usr/src/sys/amd64/include -fdebug-prefix-map=./x86=/usr/src/sys/x86/include   -MD  -MF.depend.if_lem.o -MTif_lem.o -mcmodel=kernel -mno-red-zone -mno-mmx -mno-sse -msoft-float  -fno-asynchronous-unwind-tables -ffreestanding -fwrapv -fstack-protector -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wcast-qual -Wundef -Wno-pointer-sign -D__printf__=__freebsd_kprintf__ -Wmissing-include-dirs -fdiagnostics-show-option -Wno-unknown-pragmas -Wno-error-tautological-compare -Wno-error-empty-body -Wno-error-parentheses-equality -Wno-error-unused-function -Wno-error-pointer-sign -Wno-error-shift-negative-value -Wno-address-of-packed-member  -mno-aes -mno-avx  -std=iso9899:1999 -c if_lem.c -o if_lem.o
cc  -O2 -pipe -DHARDENEDBSD -DINET -DINET6 -DEM_STANDALONE_BUILD  -fno-strict-aliasing -Werror -D_KERNEL -DKLD_MODULE -nostdinc   -I. -I/usr/src/sys -I/usr/src/sys/contrib/ck/include -fno-common  -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -fdebug-prefix-map=./machine=/usr/src/sys/amd64/include -fdebug-prefix-map=./x86=/usr/src/sys/x86/include   -MD  -MF.depend.e1000_osdep.o -MTe1000_osdep.o -mcmodel=kernel -mno-red-zone -mno-mmx -mno-sse -msoft-float  -fno-asynchronous-unwind-tables -ffreestanding -fwrapv -fstack-protector -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wcast-qual -Wundef -Wno-pointer-sign -D__printf__=__freebsd_kprintf__ -Wmissing-include-dirs -fdiagnostics-show-option -Wno-unknown-pragmas -Wno-error-tautological-compare -Wno-error-empty-body -Wno-error-parentheses-equality -Wno-error-unused-function -Wno-error-pointer-sign -Wno-error-shift-negative-value -Wno-address-of-packed-member  -mno-aes -mno-avx  -std=iso9899:1999 -c e1000_osdep.c -o e1000_osdep.o
cc  -O2 -pipe -DHARDENEDBSD -DINET -DINET6 -DEM_STANDALONE_BUILD  -fno-strict-aliasing -Werror -D_KERNEL -DKLD_MODULE -nostdinc   -I. -I/usr/src/sys -I/usr/src/sys/contrib/ck/include -fno-common  -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -fdebug-prefix-map=./machine=/usr/src/sys/amd64/include -fdebug-prefix-map=./x86=/usr/src/sys/x86/include   -MD  -MF.depend.em_compat.o -MTem_compat.o -mcmodel=kernel -mno-red-zone -mno-mmx -mno-sse -msoft-float  -fno-asynchronous-unwind-tables -ffreestanding -fwrapv -fstack-protector -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wcast-qual -Wundef -Wno-pointer-sign -D__printf__=__freebsd_kprintf__ -Wmissing-include-dirs -fdiagnostics-show-option -Wno-unknown-pragmas -Wno-error-tautological-compare -Wno-error-empty-body -Wno-error-parentheses-equality -Wno-error-unused-function -Wno-error-pointer-sign -Wno-error-shift-negative-value -Wno-address-of-packed-member  -mno-aes -mno-avx  -std=iso9899:1999 -c em_compat.c -o em_compat.o
cc  -O2 -pipe -DHARDENEDBSD -DINET -DINET6 -DEM_STANDALONE_BUILD  -fno-strict-aliasing -Werror -D_KERNEL -DKLD_MODULE -nostdinc   -I. -I/usr/src/sys -I/usr/src/sys/contrib/ck/include -fno-common  -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -fdebug-prefix-map=./machine=/usr/src/sys/amd64/include -fdebug-prefix-map=./x86=/usr/src/sys/x86/include   -MD  -MF.depend.e1000_api.o -MTe1000_api.o -mcmodel=kernel -mno-red-zone -mno-mmx -mno-sse -msoft-float  -fno-asynchronous-unwind-tables -ffreestanding -fwrapv -fstack-protector -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wcast-qual -Wundef -Wno-pointer-sign -D__printf__=__freebsd_kprintf__ -Wmissing-include-dirs -fdiagnostics-show-option -Wno-unknown-pragmas -Wno-error-tautological-compare -Wno-error-empty-body -Wno-error-parentheses-equality -Wno-error-unused-function -Wno-error-pointer-sign -Wno-error-shift-negative-value -Wno-address-of-packed-member  -mno-aes -mno-avx  -std=iso9899:1999 -c e1000_api.c -o e1000_api.o
cc  -O2 -pipe -DHARDENEDBSD -DINET -DINET6 -DEM_STANDALONE_BUILD  -fno-strict-aliasing -Werror -D_KERNEL -DKLD_MODULE -nostdinc   -I. -I/usr/src/sys -I/usr/src/sys/contrib/ck/include -fno-common  -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -fdebug-prefix-map=./machine=/usr/src/sys/amd64/include -fdebug-prefix-map=./x86=/usr/src/sys/x86/include   -MD  -MF.depend.e1000_phy.o -MTe1000_phy.o -mcmodel=kernel -mno-red-zone -mno-mmx -mno-sse -msoft-float  -fno-asynchronous-unwind-tables -ffreestanding -fwrapv -fstack-protector -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wcast-qual -Wundef -Wno-pointer-sign -D__printf__=__freebsd_kprintf__ -Wmissing-include-dirs -fdiagnostics-show-option -Wno-unknown-pragmas -Wno-error-tautological-compare -Wno-error-empty-body -Wno-error-parentheses-equality -Wno-error-unused-function -Wno-error-pointer-sign -Wno-error-shift-negative-value -Wno-address-of-packed-member  -mno-aes -mno-avx  -std=iso9899:1999 -c e1000_phy.c -o e1000_phy.o
cc  -O2 -pipe -DHARDENEDBSD -DINET -DINET6 -DEM_STANDALONE_BUILD  -fno-strict-aliasing -Werror -D_KERNEL -DKLD_MODULE -nostdinc   -I. -I/usr/src/sys -I/usr/src/sys/contrib/ck/include -fno-common  -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -fdebug-prefix-map=./machine=/usr/src/sys/amd64/include -fdebug-prefix-map=./x86=/usr/src/sys/x86/include   -MD  -MF.depend.e1000_nvm.o -MTe1000_nvm.o -mcmodel=kernel -mno-red-zone -mno-mmx -mno-sse -msoft-float  -fno-asynchronous-unwind-tables -ffreestanding -fwrapv -fstack-protector -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wcast-qual -Wundef -Wno-pointer-sign -D__printf__=__freebsd_kprintf__ -Wmissing-include-dirs -fdiagnostics-show-option -Wno-unknown-pragmas -Wno-error-tautological-compare -Wno-error-empty-body -Wno-error-parentheses-equality -Wno-error-unused-function -Wno-error-pointer-sign -Wno-error-shift-negative-value -Wno-address-of-packed-member  -mno-aes -mno-avx  -std=iso9899:1999 -c e1000_nvm.c -o e1000_nvm.o
cc  -O2 -pipe -DHARDENEDBSD -DINET -DINET6 -DEM_STANDALONE_BUILD  -fno-strict-aliasing -Werror -D_KERNEL -DKLD_MODULE -nostdinc   -I. -I/usr/src/sys -I/usr/src/sys/contrib/ck/include -fno-common  -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -fdebug-prefix-map=./machine=/usr/src/sys/amd64/include -fdebug-prefix-map=./x86=/usr/src/sys/x86/include   -MD  -MF.depend.e1000_mac.o -MTe1000_mac.o -mcmodel=kernel -mno-red-zone -mno-mmx -mno-sse -msoft-float  -fno-asynchronous-unwind-tables -ffreestanding -fwrapv -fstack-protector -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wcast-qual -Wundef -Wno-pointer-sign -D__printf__=__freebsd_kprintf__ -Wmissing-include-dirs -fdiagnostics-show-option -Wno-unknown-pragmas -Wno-error-tautological-compare -Wno-error-empty-body -Wno-error-parentheses-equality -Wno-error-unused-function -Wno-error-pointer-sign -Wno-error-shift-negative-value -Wno-address-of-packed-member  -mno-aes -mno-avx  -std=iso9899:1999 -c e1000_mac.c -o e1000_mac.o
cc  -O2 -pipe -DHARDENEDBSD -DINET -DINET6 -DEM_STANDALONE_BUILD  -fno-strict-aliasing -Werror -D_KERNEL -DKLD_MODULE -nostdinc   -I. -I/usr/src/sys -I/usr/src/sys/contrib/ck/include -fno-common  -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -fdebug-prefix-map=./machine=/usr/src/sys/amd64/include -fdebug-prefix-map=./x86=/usr/src/sys/x86/include   -MD  -MF.depend.e1000_manage.o -MTe1000_manage.o -mcmodel=kernel -mno-red-zone -mno-mmx -mno-sse -msoft-float  -fno-asynchronous-unwind-tables -ffreestanding -fwrapv -fstack-protector -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wcast-qual -Wundef -Wno-pointer-sign -D__printf__=__freebsd_kprintf__ -Wmissing-include-dirs -fdiagnostics-show-option -Wno-unknown-pragmas -Wno-error-tautological-compare -Wno-error-empty-body -Wno-error-parentheses-equality -Wno-error-unused-function -Wno-error-pointer-sign -Wno-error-shift-negative-value -Wno-address-of-packed-member  -mno-aes -mno-avx  -std=iso9899:1999 -c e1000_manage.c -o e1000_manage.o
cc  -O2 -pipe -DHARDENEDBSD -DINET -DINET6 -DEM_STANDALONE_BUILD  -fno-strict-aliasing -Werror -D_KERNEL -DKLD_MODULE -nostdinc   -I. -I/usr/src/sys -I/usr/src/sys/contrib/ck/include -fno-common  -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -fdebug-prefix-map=./machine=/usr/src/sys/amd64/include -fdebug-prefix-map=./x86=/usr/src/sys/x86/include   -MD  -MF.depend.e1000_82540.o -MTe1000_82540.o -mcmodel=kernel -mno-red-zone -mno-mmx -mno-sse -msoft-float  -fno-asynchronous-unwind-tables -ffreestanding -fwrapv -fstack-protector -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wcast-qual -Wundef -Wno-pointer-sign -D__printf__=__freebsd_kprintf__ -Wmissing-include-dirs -fdiagnostics-show-option -Wno-unknown-pragmas -Wno-error-tautological-compare -Wno-error-empty-body -Wno-error-parentheses-equality -Wno-error-unused-function -Wno-error-pointer-sign -Wno-error-shift-negative-value -Wno-address-of-packed-member  -mno-aes -mno-avx  -std=iso9899:1999 -c e1000_82540.c -o e1000_82540.o
cc  -O2 -pipe -DHARDENEDBSD -DINET -DINET6 -DEM_STANDALONE_BUILD  -fno-strict-aliasing -Werror -D_KERNEL -DKLD_MODULE -nostdinc   -I. -I/usr/src/sys -I/usr/src/sys/contrib/ck/include -fno-common  -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -fdebug-prefix-map=./machine=/usr/src/sys/amd64/include -fdebug-prefix-map=./x86=/usr/src/sys/x86/include   -MD  -MF.depend.e1000_82542.o -MTe1000_82542.o -mcmodel=kernel -mno-red-zone -mno-mmx -mno-sse -msoft-float  -fno-asynchronous-unwind-tables -ffreestanding -fwrapv -fstack-protector -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wcast-qual -Wundef -Wno-pointer-sign -D__printf__=__freebsd_kprintf__ -Wmissing-include-dirs -fdiagnostics-show-option -Wno-unknown-pragmas -Wno-error-tautological-compare -Wno-error-empty-body -Wno-error-parentheses-equality -Wno-error-unused-function -Wno-error-pointer-sign -Wno-error-shift-negative-value -Wno-address-of-packed-member  -mno-aes -mno-avx  -std=iso9899:1999 -c e1000_82542.c -o e1000_82542.o
cc  -O2 -pipe -DHARDENEDBSD -DINET -DINET6 -DEM_STANDALONE_BUILD  -fno-strict-aliasing -Werror -D_KERNEL -DKLD_MODULE -nostdinc   -I. -I/usr/src/sys -I/usr/src/sys/contrib/ck/include -fno-common  -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -fdebug-prefix-map=./machine=/usr/src/sys/amd64/include -fdebug-prefix-map=./x86=/usr/src/sys/x86/include   -MD  -MF.depend.e1000_82541.o -MTe1000_82541.o -mcmodel=kernel -mno-red-zone -mno-mmx -mno-sse -msoft-float  -fno-asynchronous-unwind-tables -ffreestanding -fwrapv -fstack-protector -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wcast-qual -Wundef -Wno-pointer-sign -D__printf__=__freebsd_kprintf__ -Wmissing-include-dirs -fdiagnostics-show-option -Wno-unknown-pragmas -Wno-error-tautological-compare -Wno-error-empty-body -Wno-error-parentheses-equality -Wno-error-unused-function -Wno-error-pointer-sign -Wno-error-shift-negative-value -Wno-address-of-packed-member  -mno-aes -mno-avx  -std=iso9899:1999 -c e1000_82541.c -o e1000_82541.o
cc  -O2 -pipe -DHARDENEDBSD -DINET -DINET6 -DEM_STANDALONE_BUILD  -fno-strict-aliasing -Werror -D_KERNEL -DKLD_MODULE -nostdinc   -I. -I/usr/src/sys -I/usr/src/sys/contrib/ck/include -fno-common  -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -fdebug-prefix-map=./machine=/usr/src/sys/amd64/include -fdebug-prefix-map=./x86=/usr/src/sys/x86/include   -MD  -MF.depend.e1000_82543.o -MTe1000_82543.o -mcmodel=kernel -mno-red-zone -mno-mmx -mno-sse -msoft-float  -fno-asynchronous-unwind-tables -ffreestanding -fwrapv -fstack-protector -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wcast-qual -Wundef -Wno-pointer-sign -D__printf__=__freebsd_kprintf__ -Wmissing-include-dirs -fdiagnostics-show-option -Wno-unknown-pragmas -Wno-error-tautological-compare -Wno-error-empty-body -Wno-error-parentheses-equality -Wno-error-unused-function -Wno-error-pointer-sign -Wno-error-shift-negative-value -Wno-address-of-packed-member  -mno-aes -mno-avx  -std=iso9899:1999 -c e1000_82543.c -o e1000_82543.o
cc  -O2 -pipe -DHARDENEDBSD -DINET -DINET6 -DEM_STANDALONE_BUILD  -fno-strict-aliasing -Werror -D_KERNEL -DKLD_MODULE -nostdinc   -I. -I/usr/src/sys -I/usr/src/sys/contrib/ck/include -fno-common  -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -fdebug-prefix-map=./machine=/usr/src/sys/amd64/include -fdebug-prefix-map=./x86=/usr/src/sys/x86/include   -MD  -MF.depend.e1000_80003es2lan.o -MTe1000_80003es2lan.o -mcmodel=kernel -mno-red-zone -mno-mmx -mno-sse -msoft-float  -fno-asynchronous-unwind-tables -ffreestanding -fwrapv -fstack-protector -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wcast-qual -Wundef -Wno-pointer-sign -D__printf__=__freebsd_kprintf__ -Wmissing-include-dirs -fdiagnostics-show-option -Wno-unknown-pragmas -Wno-error-tautological-compare -Wno-error-empty-body -Wno-error-parentheses-equality -Wno-error-unused-function -Wno-error-pointer-sign -Wno-error-shift-negative-value -Wno-address-of-packed-member  -mno-aes -mno-avx  -std=iso9899:1999 -c e1000_80003es2lan.c -o e1000_80003es2lan.o
cc  -O2 -pipe -DHARDENEDBSD -DINET -DINET6 -DEM_STANDALONE_BUILD  -fno-strict-aliasing -Werror -D_KERNEL -DKLD_MODULE -nostdinc   -I. -I/usr/src/sys -I/usr/src/sys/contrib/ck/include -fno-common  -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -fdebug-prefix-map=./machine=/usr/src/sys/amd64/include -fdebug-prefix-map=./x86=/usr/src/sys/x86/include   -MD  -MF.depend.e1000_ich8lan.o -MTe1000_ich8lan.o -mcmodel=kernel -mno-red-zone -mno-mmx -mno-sse -msoft-float  -fno-asynchronous-unwind-tables -ffreestanding -fwrapv -fstack-protector -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wcast-qual -Wundef -Wno-pointer-sign -D__printf__=__freebsd_kprintf__ -Wmissing-include-dirs -fdiagnostics-show-option -Wno-unknown-pragmas -Wno-error-tautological-compare -Wno-error-empty-body -Wno-error-parentheses-equality -Wno-error-unused-function -Wno-error-pointer-sign -Wno-error-shift-negative-value -Wno-address-of-packed-member  -mno-aes -mno-avx  -std=iso9899:1999 -c e1000_ich8lan.c -o e1000_ich8lan.o
cc  -O2 -pipe -DHARDENEDBSD -DINET -DINET6 -DEM_STANDALONE_BUILD  -fno-strict-aliasing -Werror -D_KERNEL -DKLD_MODULE -nostdinc   -I. -I/usr/src/sys -I/usr/src/sys/contrib/ck/include -fno-common  -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -fdebug-prefix-map=./machine=/usr/src/sys/amd64/include -fdebug-prefix-map=./x86=/usr/src/sys/x86/include   -MD  -MF.depend.e1000_82571.o -MTe1000_82571.o -mcmodel=kernel -mno-red-zone -mno-mmx -mno-sse -msoft-float  -fno-asynchronous-unwind-tables -ffreestanding -fwrapv -fstack-protector -Wall -Wredundant-decls -Wnested-externs -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wcast-qual -Wundef -Wno-pointer-sign -D__printf__=__freebsd_kprintf__ -Wmissing-include-dirs -fdiagnostics-show-option -Wno-unknown-pragmas -Wno-error-tautological-compare -Wno-error-empty-body -Wno-error-parentheses-equality -Wno-error-unused-function -Wno-error-pointer-sign -Wno-error-shift-negative-value -Wno-address-of-packed-member  -mno-aes -mno-avx  -std=iso9899:1999 -c e1000_82571.c -o e1000_82571.o
ld -m elf_x86_64_fbsd -d -warn-common --build-id=sha1 -r -d -o if_em.ko if_em.o if_lem.o e1000_osdep.o em_compat.o e1000_api.o e1000_phy.o e1000_nvm.o e1000_mac.o e1000_manage.o e1000_82540.o e1000_82542.o e1000_82541.o e1000_82543.o e1000_80003es2lan.o e1000_ich8lan.o e1000_82571.o
:> export_syms
awk -f /usr/src/sys/conf/kmod_syms.awk if_em.ko  export_syms | xargs -J% objcopy % if_em.ko
objcopy --strip-debug if_em.ko

There are two files that you want to copy to your production OPNsense system, /tmp/em-7.7.8/src/em.4 and /tmp/em-7.7.8/src/if_em.ko

I copied them to /root.

Copy the man page to the proper directory
Code: [Select]
# gzip -c em.4 > /usr/share/man/man4/em.4.gz
When I copied the if_em.ko driver to /root I changed the name to if_em.ko-OPNsense-21.1v7.7.8 we need to put this in the right place now.

Edit/Update 1
The user DimitriDC posted a link below witch lead to user Franco posting the correct location to put the driver, it should be placed in /boot/modules/
Code: [Select]
cp if_em.ko-OPNsense-21.1v7.7.8 /boot/modules/if_em_updated.ko
Edit /boot/load.conf.local to contain the line:
Code: [Select]
if_em_updated_load="YES
Reboot and test.
Code: [Select]
# kldstat | grep update
12    1 0xffffffff82956000    67bd8 if_em_updated.ko

2
21.1 Legacy Series / v21.1 stil using old if_em driver
« on: February 12, 2021, 09:38:57 pm »
I was really hoping to see an updated driver.  :-[
updating to version 21.1 reverted me back to:

Code: [Select]
# strings /boot/kernel/if_em.ko | grep '7.*'
……………….
7.6.1-k

Can a package not be included to upgrade the driver?
https://forum.opnsense.org/index.php?topic=18922.msg86510#msg86510

I had to manually update the if_em driver to 7.7.8 to be able to use the interfaces on my motherboard.

and when I ran kldload it crashed the system but it booted up fine and has been running the past week w/o issue(s).

But this may have tainted the kernel?
Code: [Select]
>>> Check for missing or altered kernel files
Error 2 ocurred.
boot/kernel/if_em.ko:
size (452264, 407664)
sha256digest (0x62f2834640257d977749b40f648fad77fed5bccef7e89d9bb350fc3d42a625d4, 0xebd3c948caa4f55ddb45fafb187aa93f5588017fad777281b59f94c5211de2f1)
>>> Check installed base version
Version 21.1 is correct.

Reference:
https://forum.opnsense.org/index.php?topic=18922.msg86503#msg86503

3
General Discussion / [SOLVED] serial console connection
« on: February 03, 2021, 12:25:18 am »
I am trying to get the serial console to function. I have enabled it as secondary console, set the speed as 115200, and have set " Use USB-based serial ports " as enabled.

I then have have joined two USB to serial converter (tripp-lite u209-000-r) with a null modem (https://www.amazon.com/dp/B075XGRLXW/ref=cm_sw_em_r_mt_dp_AH3V8N07GZY398GQJYQA?_encoding=UTF8&psc=1) in the middle. This should work correct?

I my Linux system I then type:

Code: [Select]
# minicom -b 115200 -D /dev/ttyUSB0
I press the enter key a few times but only have a blank screen.  :(

from my Linux host dmesg shows.

Code: [Select]
[596342.276400] usb 1-2: pl2303 converter now attached to ttyUSB0
dmesg form the OPNsense firewall

Code: [Select]
ugen0.4: <Prolific Technology Inc. USB-Serial Controller D> at usbus0
uplcom0 on uhub0
uplcom0: <Prolific Technology Inc. USB-Serial Controller D, class 0/0, rev 1.10/3.00, addr 7> on usbus0

OPNsense /etc/ttys shows:
Code: [Select]
# Serial terminals
# The 'dialup' keyword identifies dialin lines to login, fingerd etc.
ttyU0 "/usr/libexec/getty 3wire.115200" vt100 onifconsole secure
ttyU1 "/usr/libexec/getty 3wire.115200" vt100 onifconsole secure
ttyU2 "/usr/libexec/getty 3wire.115200" vt100 onifconsole secure
ttyU3 "/usr/libexec/getty 3wire.115200" vt100 onifconsole secure
# Dumb console
dcons "/usr/libexec/getty std.9600" vt100 off secure

This is the motherboard in use on the OPNsense firewall and I am running v20.7.2
https://www.asrock.com/MB/Intel/H470M-ITXac/index.asp

Thank you.





4
20.7 Legacy Series / Reporting logs time zone
« on: October 13, 2020, 06:00:33 am »
I have the time zone under System > Settings > General set to America/Los_Angeles. All logs show the correct time except for any of the logs under Reporting. The logs under reporting are using UTC. Is there a way for them to report using America/Los_Angeles?

5
20.7 Legacy Series / Got updated NIC drivers?
« on: September 01, 2020, 09:56:50 pm »
Maybe I can save some time for others?

I was using and ASA5506X and it just deiced to up and die on me while watching Umbrella Academy. Years prior I have used both IPCop and Pfsense. Time for a new firewall and I was not very happy using an ASA in my home network.

I purchased an SG-3100 but is back ordered for many weeks. In the meantime I started researching the hardware it used and was not very pleased that it was not using an Intel processor (AES-NI support) and only had 2 GB of RAM. I could purchase the next model up, SG-5100, but this was $700! :o I cancelled the SG-3100 order

So I decided to roll my own. I bought an Asrock H470M-ITX/AC, Intel Core-i3 10100 processor, 16 GB RAM, 500 GB NVMe storage, and a Fractal Node 202 with power supply. I wanted small form factor and dual onboard NICs, I got all this for $500! ;D This is more then enough compute power to run the firewall with all the cool apps and can expand the hardware if needed?

I deiced to go with OPNsense, I am always interested in forks.

Now to share my woes with OPNsense/FreeBSD. I could not get any of the onboard NICs to be identified!
Code: [Select]
root@OPNsense:~ # pciconf -lvc

……………………….
none5@pci0:0:31:6: class=0x020000 card=0x0d4d1849 chip=0x0d4d8086 rev=0x00 hdr=0x00
    vendor     = 'Intel Corporation'
    class      = network
    subclass   = ethernet
    cap 01[c8] = powerspec 3  supports D0 D3  current D0
    cap 05[d0] = MSI supports 1 message, 64 bit
………………………
none6@pci0:3:0:0: class=0x020000 card=0x81681849 chip=0x812510ec rev=0x05 hdr=0x00
    vendor     = 'Realtek Semiconductor Co., Ltd.'
    class      = network
    subclass   = ethernet
    cap 01[40] = powerspec 3  supports D0 D1 D2 D3  current D0
    cap 05[50] = MSI supports 1 message, 64 bit, vector masks
    cap 10[70] = PCI-Express 2 endpoint MSI 1 max data 256(256) RO
                 link x1(x1) speed 5.0(5.0) ASPM disabled(L0s/L1)
    cap 11[b0] = MSI-X supports 32 messages
                 Table in map 0x20[0x0], PBA in map 0x20[0x800]
    cap 03[d0] = VPD
    ecap 0001[100] = AER 2 0 fatal 0 non-fatal 0 corrected
    ecap 0002[148] = VC 1 max VC0
    ecap 0003[168] = Serial 1 a0ce2b59a1a80000
    ecap 0017[178] = TPH Requester 1
    ecap 0018[204] = LTR 1
    ecap 001e[20c] = unknown 1
    ecap 000b[21c] = Vendor 1 ID 2

root@OPNsense:~ # strings /boot/kernel/if_em.ko | grep '7.*'
……………….
7.6.1-k                                     # Version 7.6.1-k! This driver is over 4 years old!
………………

root@OPNsense:~ # strings /boot/kernel/if_re.ko | grep '1.*'
…………..
version:1.95.00                      # May be just as old?
None of the driver are seen but yet my Intel dual port card uses if_em and it was working.
Code: [Select]
root@OPNsense:~ # kldstat
Id Refs Address                Size Name
 1   66                0x0  248da78 kernel
 2    1                0x0    10250 carp.ko
 3    1                0x0     f998 if_bridge.ko
 4    2                0x0     72a8 bridgestp.ko
 5    1                0x0     3e78 if_enc.ko
 6    1                0x0     b1c0 if_gre.ko
 7    1                0x0    15fe8 if_lagg.ko
 8    1                0x0     8b60 if_tap.ko
 9    3                0x0    582f0 pf.ko
10    1                0x0     2af8 pflog.ko
11    1                0x0     ebd0 pfsync.ko
12    1                0x0    15d20 if_iwm.ko
13    1                0x0    fb11f iwm3168fw.ko
14    1                0x0     18a0 uhid.ko
15    1                0x0     1aa0 wmt.ko
16    1                0x0     2928 ums.ko
17    1                0x0     8d50 aesni.ko
18    1                0x0     cd70 snd_uaudio.ko
19    1                0x0     4260 ng_ubt.ko
20    6                0x0     9e30 netgraph.ko
21    2                0x0     91b8 ng_hci.ko
22    3                0x0      9c0 ng_bluetooth.ko
23    1                0x0     cad0 ng_l2cap.ko
24    1                0x0    1ba00 ng_btsocket.ko
25    1                0x0     21c0 ng_socket.ko
I have tried to force unloading both if_em and if_re, both failed with some error that read they could not be found. So I tried loading them again, the message then read that the drivers were already loaded!  :(

Now it is time for some Google-Fu. Luckily I found:

https://www.reddit.com/r/PFSENSE/comments/hrp7ck/asrock_b460mitx_onboard_nic_issue_with_pfsense/    Follow the links within the post for details.

As of writing OPNsense is based on FreeBSD 12.1. So I downloaded that version and used KVM to create a virtual machine to compile the drivers.
And, “Now witness the firepower of this fully armed and operational battle station!”
Code: [Select]
root@OPNsense:~ # pciconf -lvc
……………………………………………….

em2@pci0:0:31:6: class=0x020000 card=0x0d4d1849 chip=0x0d4d8086 rev=0x00 hdr=0x00
    vendor     = 'Intel Corporation'
    class      = network
    subclass   = ethernet
    cap 01[c8] = powerspec 3  supports D0 D3  current D0
    cap 05[d0] = MSI supports 1 message, 64 bit enabled with 1 message
………………………………………………..

re0@pci0:3:0:0: class=0x020000 card=0x81681849 chip=0x812510ec rev=0x05 hdr=0x00
    vendor     = 'Realtek Semiconductor Co., Ltd.'
    class      = network
    subclass   = ethernet
    cap 01[40] = powerspec 3  supports D0 D1 D2 D3  current D0
    cap 05[50] = MSI supports 1 message, 64 bit, vector masks
    cap 10[70] = PCI-Express 2 endpoint MSI 1 max data 256(256) RO
                 link x1(x1) speed 5.0(5.0) ASPM disabled(L0s/L1)
    cap 11[b0] = MSI-X supports 32 messages, enabled
                 Table in map 0x20[0x0], PBA in map 0x20[0x800]
    cap 03[d0] = VPD
    ecap 0001[100] = AER 2 0 fatal 0 non-fatal 0 corrected
    ecap 0002[148] = VC 1 max VC0
    ecap 0003[168] = Serial 1 a0ce2b59a1a80000
    ecap 0017[178] = TPH Requester 1
    ecap 0018[204] = LTR 1
    ecap 001e[20c] = unknown 1
    ecap 000b[21c] = Vendor 1 ID 2

root@OPNsense:~ # strings /boot/kernel/if_em.ko | grep '7.*'
…………………..
7.7.8

root@OPNsense:~ # strings /boot/kernel/if_re.ko | grep '1.*'
…………………..
1.96.04

Pages: [1]
OPNsense is an OSS project © Deciso B.V. 2015 - 2024 All rights reserved
  • SMF 2.0.19 | SMF © 2021, Simple Machines
    Privacy Policy
    | XHTML | RSS | WAP2