WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: How to make a new igb drivers  (Read 3577 times)

Offline zbs888

  • Newbie
  • *
  • Posts: 39
How to make a new igb drivers
« on: November 05, 2020, 05:41:43 PM »
Hi,i am a newbie.I want to make a new igb drivers in tc.
Here is my env:
Code: [Select]
Linux box 5.4.3-tinycore64 #2020 SMP Tue Dec 17 17:38:30 UTC 2019 x86_64 GNU/LinuxAnd i do this:
Code: [Select]
tar Jxfv linux-5.4.3-patched.txz -C /usr/src
ln -s linux-5.4.3 linux
ln -sf /usr/src/linux /lib/modules/5.4.3-tinycore64/build
ln -sf /usr/src/linux /lib/modules/5.4.3-tinycore64/source
cp config-5.4.3-tinycore64 /usr/src/linux/.config
make oldconfig
make headers_install
cd /mnt/sda1/soft/igb-5.4.6/src/
make install
And i got this:
common.mk:138: Missing System.map file - depmod will not check for missing symbols
make[1]: Entering directory '/usr/src/linux-5.4.3'
/mnt/sda1/soft/igb-5.4.6/src/Makefile:43: *** Cannot find common.mk build rules.  Stop.
make[1]: *** [Makefile:1652: /mnt/sda1/soft/igb-5.4.6/src] Error 2
make[1]: Leaving directory '/usr/src/linux-5.4.3'
make: *** [Makefile:86: default] Error 2

So,how to do next?

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11178
Re: How to make a new igb drivers
« Reply #1 on: November 05, 2020, 06:51:28 PM »
Hi zbs888
Welcome to the forum.

I thing the  igb.ko  driver is included in the base system. Take a look in here:
Code: [Select]
/lib/modules/5.4.3-tinycore64/kernel/drivers/net/ethernet/intel/igb/

Offline zbs888

  • Newbie
  • *
  • Posts: 39
Re: How to make a new igb drivers
« Reply #2 on: November 05, 2020, 08:41:12 PM »
Hi Rich,
Thanks for your reply.I knew the igb driver in the catalog.But i still want to compile the newer driver........

Online Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14516
Re: How to make a new igb drivers
« Reply #3 on: November 05, 2020, 11:53:59 PM »
After “make oldconfig” you need “make modules”.

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11178
Re: How to make a new igb drivers
« Reply #4 on: November 06, 2020, 10:37:33 AM »
Hi zbs888
I did some searching through the forum and pieced these instructions together:
Code: [Select]
# Setup instructions for building out of tree modules pieced together from
# the following links:
# http://forum.tinycorelinux.net/index.php/topic,23847.msg149973.html#msg149973
# http://forum.tinycorelinux.net/index.php/topic,23440.msg147476.html#msg147476
# http://forum.tinycorelinux.net/index.php/topic,23238.msg145635.html#msg145635
# http://tinycorelinux.net/10.x/x86_64/tcz/src/wl/compile_wl
# http://repo.tinycorelinux.net/11.x/x86_64/release/src/kernel/

# Extensions required for compiling.
tce-load -wil compiletc perl5 bash ncursesw-dev bc glibc_apps elfutils-dev

# Kernel source packages.
wget http://repo.tinycorelinux.net/11.x/x86_64/release/src/kernel/linux-5.4.3-patched.txz
wget http://repo.tinycorelinux.net/11.x/x86_64/release/src/kernel/config-5.4.3-tinycore64
wget http://repo.tinycorelinux.net/11.x/x86_64/release/src/kernel/Module.symvers-5.4.3-tinycore64.gz

# Unpack kernal source code.
tar xf linux-5.4.3-patched.txz

# Newly created kernel source directory.
cd  linux-5.4.3

# Make sure there are no leftover files from a previous build.
make mrproper

# Copy the current configuration.
cp ../config-5.4.3-tinycore64 .config

make oldconfig
make prepare
make modules_prepare

cp ../Module.symvers-5.4.3-tinycore64.gz ./Module.symvers.gz
gunzip Module.symvers.gz
make SUBDIRS=scripts/mod

sudo ln -s $PWD /lib/modules/5.4.3-tinycore64/build

# Now try building your modules
cd /mnt/sda1/soft/igb-5.4.6/src/
# This should install in the cureent directory under  lib/modules/5.4.3-tinycore64/......
make INSTALL_MOD_PATH=$PWD install

Let us know if this worked.

Offline zbs888

  • Newbie
  • *
  • Posts: 39
Re: How to make a new igb drivers
« Reply #5 on: November 16, 2020, 05:53:13 AM »
Thanks, it's a great help.
Code: [Select]
tce-load -i elfutils-dev
make mrproper
cp /mnt/sda1/tce/optional/src/kernel/config-5.4.3-tinycore64 /usr/src/linux/.config   
make oldconfig
make prepare
make modules_prepare
Then:
Code: [Select]
igb-5.4.6# cd src
make install
common.mk:138: Missing System.map file - depmod will not check for missing symbols
make[1]: Entering directory '/usr/src/linux-5.4.3'
  CC [M]  /mnt/sda1/soft/igb-5.4.6/src/igb_main.o
  CC [M]  /mnt/sda1/soft/igb-5.4.6/src/e1000_api.o
  CC [M]  /mnt/sda1/soft/igb-5.4.6/src/igb_ethtool.o
  CC [M]  /mnt/sda1/soft/igb-5.4.6/src/igb_hwmon.o
  CC [M]  /mnt/sda1/soft/igb-5.4.6/src/e1000_mbx.o
  CC [M]  /mnt/sda1/soft/igb-5.4.6/src/e1000_mac.o
  CC [M]  /mnt/sda1/soft/igb-5.4.6/src/e1000_manage.o
  CC [M]  /mnt/sda1/soft/igb-5.4.6/src/e1000_nvm.o
  CC [M]  /mnt/sda1/soft/igb-5.4.6/src/igb_param.o
  CC [M]  /mnt/sda1/soft/igb-5.4.6/src/e1000_phy.o
  CC [M]  /mnt/sda1/soft/igb-5.4.6/src/igb_procfs.o
  CC [M]  /mnt/sda1/soft/igb-5.4.6/src/igb_vmdq.o
  CC [M]  /mnt/sda1/soft/igb-5.4.6/src/e1000_82575.o
  CC [M]  /mnt/sda1/soft/igb-5.4.6/src/e1000_i210.o
  CC [M]  /mnt/sda1/soft/igb-5.4.6/src/igb_debugfs.o
  CC [M]  /mnt/sda1/soft/igb-5.4.6/src/igb_ptp.o
  CC [M]  /mnt/sda1/soft/igb-5.4.6/src/kcompat.o
  LD [M]  /mnt/sda1/soft/igb-5.4.6/src/igb.o

  WARNING: Symbol version dump ./Module.symvers
           is missing; modules will have no dependencies and modversions.

  Building modules, stage 2.
  MODPOST 1 modules
  CC [M]  /mnt/sda1/soft/igb-5.4.6/src/igb.mod.o
  LD [M]  /mnt/sda1/soft/igb-5.4.6/src/igb.ko
make[1]: Leaving directory '/usr/src/linux-5.4.3'
Copying manpages...
Installing modules...
make[1]: Entering directory '/usr/src/linux-5.4.3'
  INSTALL /mnt/sda1/soft/igb-5.4.6/src/igb.ko
  DEPMOD  5.4.3-tinycore64
Warning: modules_install: missing 'System.map' file. Skipping depmod.
make[1]: Leaving directory '/usr/src/linux-5.4.3'
Running depmod...
echo "Unable to update initramfs. You may need to do this manually."
Unable to update initramfs. You may need to do this manually.

Finaly,i got a igb.ko file in src.


Hi zbs888
I did some searching through the forum and pieced these instructions together:
Code: [Select]
# Setup instructions for building out of tree modules pieced together from
# the following links:
# http://forum.tinycorelinux.net/index.php/topic,23847.msg149973.html#msg149973
# http://forum.tinycorelinux.net/index.php/topic,23440.msg147476.html#msg147476
# http://forum.tinycorelinux.net/index.php/topic,23238.msg145635.html#msg145635
# http://tinycorelinux.net/10.x/x86_64/tcz/src/wl/compile_wl
# http://repo.tinycorelinux.net/11.x/x86_64/release/src/kernel/

# Extensions required for compiling.
tce-load -wil compiletc perl5 bash ncursesw-dev bc glibc_apps elfutils-dev

# Kernel source packages.
wget http://repo.tinycorelinux.net/11.x/x86_64/release/src/kernel/linux-5.4.3-patched.txz
wget http://repo.tinycorelinux.net/11.x/x86_64/release/src/kernel/config-5.4.3-tinycore64
wget http://repo.tinycorelinux.net/11.x/x86_64/release/src/kernel/Module.symvers-5.4.3-tinycore64.gz

# Unpack kernal source code.
tar xf linux-5.4.3-patched.txz

# Newly created kernel source directory.
cd  linux-5.4.3

# Make sure there are no leftover files from a previous build.
make mrproper

# Copy the current configuration.
cp ../config-5.4.3-tinycore64 .config

make oldconfig
make prepare
make modules_prepare

cp ../Module.symvers-5.4.3-tinycore64.gz ./Module.symvers.gz
gunzip Module.symvers.gz
make SUBDIRS=scripts/mod

sudo ln -s $PWD /lib/modules/5.4.3-tinycore64/build

# Now try building your modules
cd /mnt/sda1/soft/igb-5.4.6/src/
# This should install in the cureent directory under  lib/modules/5.4.3-tinycore64/......
make INSTALL_MOD_PATH=$PWD install

Let us know if this worked.

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11178
Re: How to make a new igb drivers
« Reply #6 on: November 16, 2020, 06:15:32 AM »
Hi zbs888
Code: [Select]
----- Snip -----

  WARNING: Symbol version dump ./Module.symvers
           is missing; modules will have no dependencies and modversions.

 ----- Snip -----


That warning is because you skipped these steps:
Code: [Select]
wget http://repo.tinycorelinux.net/11.x/x86_64/release/src/kernel/Module.symvers-5.4.3-tinycore64.gz
cd  linux-5.4.3
cp ../Module.symvers-5.4.3-tinycore64.gz ./Module.symvers.gz
gunzip Module.symvers.gz
make SUBDIRS=scripts/mod

If the module does not want to load, this is probably the reason.

Online Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14516
Re: How to make a new igb drivers
« Reply #7 on: November 16, 2020, 06:30:53 AM »
As of linux-5.something this bit:
Code: [Select]
cp ../Module.symvers-5.4.3-tinycore64.gz ./Module.symvers.gz
gunzip Module.symvers.gz
make SUBDIRS=scripts/mod

..no longer works so, unless there is a different work around, you are obliged to use "make modules", which will build all modules