View unanswered posts | View active topics It is currently Fri Dec 15, 2017 1:31 pm



Reply to topic  [ 8 posts ] 
 ESXI 5.x Drivers Part 2: Preparing to compile 
Author Message

Joined: Mon Jan 28, 2013 5:09 pm
Posts: 100
Reply with quote
Post ESXI 5.x Drivers Part 2: Preparing to compile
So you have constructed a working build environment and you've tested compilation and usage of a VMWare supplied driver. What is the next step? In this guide I am going to walk through the initial stages of generating a driver for a network card, but the instructions should be applicable and adaptable to other device types. I won't actually be doing any compilation in this part of the guide; just preparation. These instructions depend upon you having constructed the build environment according to part 1. We'll be working on coaxing the atl1c driver to build.

Login to your build host and change to to the top level directory where much of the fun will start.

Code:
cd ~/vsphere/vmkdrivers-gpl


VMWare have provided everything you need to compile your own driver, but no real documentation on how to actually do it. The first thing you are going to need is a directory to compile your driver in. The provided network card drivers can be seen here:

Code:
build@esx-build:~/vsphere/vmkdrivers-gpl$ ls -l vmkdrivers/src_9/drivers/net/
total 56
drwxr-xr-x 2 build build 4096 Nov 23 13:46 bnx2
drwxr-xr-x 3 build build 4096 Nov 23 13:46 bnx2x
drwxr-xr-x 2 build build 4096 Nov 23 13:46 e1000
drwxr-xr-x 2 build build 4096 Nov 23 13:46 e1000e
drwxr-xr-x 2 build build 4096 Nov 23 13:46 enic
drwxr-xr-x 2 build build 4096 Nov 23 13:46 forcedeth
drwxr-xr-x 2 build build 4096 Nov 23 13:46 igb
drwxr-xr-x 2 build build 4096 Nov 23 13:46 ixgbe
drwxr-xr-x 3 build build 4096 Nov 23 13:46 nx_nic
drwxr-xr-x 2 build build 4096 Nov 23 13:46 r8168
drwxr-xr-x 2 build build 4096 Nov 23 13:46 r8169
drwxr-xr-x 2 build build 4096 Nov 23 13:46 s2io
drwxr-xr-x 2 build build 4096 Nov 23 13:46 sky2
drwxr-xr-x 2 build build 4096 Nov 23 13:46 tg3


Here we'll make a directory and it'll be named after the module we'll eventually create. We'll also move in to that directory and download the source code:

Code:
build@esx-build:~/vsphere/vmkdrivers-gpl$ mkdir vmkdrivers/src_9/drivers/net/atl1c
build@esx-build:~/vsphere/vmkdrivers-gpl$ cd vmkdrivers/src_9/drivers/net/atl1c
build@esx-build:~/vsphere/vmkdrivers-gpl/vmkdrivers/src_9/drivers/net/atl1c$
build@esx-build:~/vsphere/vmkdrivers-gpl/vmkdrivers/src_9/drivers/net/atl1c$ wget https://kyosls.googlecode.com/files/AR81Family-linux-v1.0.1.14.tar.gz
--2013-03-13 13:56:19--  https://kyosls.googlecode.com/files/AR81Family-linux-v1.0.1.14.tar.gz
Resolving kyosls.googlecode.com (kyosls.googlecode.com)... 74.125.133.82, 2607:f8b0:4001:c02::52
Connecting to kyosls.googlecode.com (kyosls.googlecode.com)|74.125.133.82|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 175725 (172K) [application/x-gzip]
Saving to: `AR81Family-linux-v1.0.1.14.tar.gz'

100%[======================================================================================================================>] 175,725      943K/s   in 0.2s   

2013-03-13 13:56:19 (943 KB/s) - `AR81Family-linux-v1.0.1.14.tar.gz' saved [175725/175725]l


You should now have the tar.gz in the directory. We are not going to need all the contents of that tar ball, so to save some work, we'll just have the tar command pull out what we need and place the files where we want them (in the current directory).

Code:
build@esx-build:~/vsphere/vmkdrivers-gpl/vmkdrivers/src_9/drivers/net/atl1c$ tar xf AR81Family-linux-v1.0.1.14.tar.gz --strip-components=2 --wildcards --no-anchored 'src/*.c' 'src/*.h'

gzip: stdin: decompression OK, trailing garbage ignored
tar: Child returned status 2
tar: Error is not recoverable: exiting now

build@esx-build:~/vsphere/vmkdrivers-gpl/vmkdrivers/src_9/drivers/net/atl1c$ ls -l
total 680
-rw-rw-r-- 1 build build 175725 Apr 20  2011 AR81Family-linux-v1.0.1.14.tar.gz
-r-xr--r-x 1 build build   4075 Jun 24  2010 at_common.h
-rwxrw-r-x 1 build build   7092 Sep 14  2010 at_common_main.c
-r-xr--r-x 1 build build  10893 Jun 24  2010 atl1c_ethtool.c
-r-xr--r-x 1 build build  22306 Jul 21  2010 atl1c.h
-r-xr--r-x 1 build build  19417 Jun 24  2010 atl1c_hw.c
-r-xr--r-x 1 build build  33678 Aug  6  2010 atl1c_hw.h
-rwxrw-r-x 1 build build  91461 Sep 14  2010 atl1c_main.c
-r-xr--r-x 1 build build   7041 Jun 24  2010 atl1c_param.c
-r-xr--r-x 1 build build  15949 Jun 24  2010 atl1e_ethtool.c
-r-xr--r-x 1 build build   4826 Jun 24  2010 atl1e.h
-r-xr--r-x 1 build build  24225 Jun 24  2010 atl1e_hw.c
-r-xr--r-x 1 build build  52924 Jun 24  2010 atl1e_hw.h
-r-xr--r-x 1 build build 101017 Jun 24  2010 atl1e_main.c
-r-xr--r-x 1 build build   7981 Jun 24  2010 atl1e_param.c
-r-xr--r-x 1 build build   2732 Jun 24  2010 at_osdep.h
-r-xr--r-x 1 build build   5997 Jun 24  2010 kcompat.c
-r-xr--r-x 1 build build  30563 Jun 24  2010 kcompat_ethtool.c
-rwxrw-r-x 1 build build  50085 Sep 14  2010 kcompat.h


This is your first glimpse of the enemy. Now, back to the top level directory. We have the source, and it's in the right place. The next step is to generate a build script that's going to do the work of compiling the code and linking the various modules. Back to the top level directory.

Code:
build@esx-build:~/vsphere/vmkdrivers-gpl/vmkdrivers/src_9/drivers/net/atl1c$ cd ~build/vsphere/vmkdrivers-gpl/
build@esx-build:~/vsphere/vmkdrivers-gpl$


There's no sense in reinventing the wheel, so the way to prepare your build script is to reuse pretty much everything VMWare provided already, all of which you know works because you tested it in part 1. Right? First we will copy the start of the shell script. You need the first 28 lines up to the point where the first $CC call is.

Code:
build@esx-build:~/vsphere/vmkdrivers-gpl$ head -28 build-vmkdrivers.sh | sed 's/build-vmkdrivers/build-atl1c/' > build-atl1c.sh


Notice how the first 28 lines were piped through sed. That was just a quick substitution to change the reference to build-vmkdrivers to our script name. It should now look like this:

Code:
build@esx-build:~/vsphere/vmkdrivers-gpl$ cat build-atl1c.sh
#!/bin/sh

# Use gcc version 4.1.2-9
# Below is the internal VMWare location.  Please change as required for your
# installed location.
CC=/home/build/toolchain/lin32/gcc-4.1.2-9/bin/x86_64-linux-gcc

# Use ld from binutils-2.17.50.0.15-modcall
# Below is the internal VMWare location.  Please change as required for your
# installed location.
LD=/home/build/toolchain/lin32/binutils-2.17.50.0.15-modcall/bin/x86_64-linux-ld

# Use GNU grep 2.5.1
GREP=grep
# Use GNU sed 4.5.1
SED=sed
# Use GNU xargs 4.2.27
XARGS=xargs
# Use mkdir from GNU coreutils 5.97
MKDIR=mkdir

# Create output directories
$GREP -v -e "SED" build-atl1c.sh \
| $GREP -o -e "-o [^ ]*\."            \
| $SED -e 's?-o \(.*\)/[^/]*\.?\1?'   \
| $GREP -v -e "\*"                    \
| $XARGS $MKDIR -p


Now we need to move on to adding in the actual lines that do the compilation. In my previous post I used the sky2 driver as my reference so I'm continuing that here. If you look in the sky2 directory:

Code:
build@esx-build:~/vsphere/vmkdrivers-gpl$ ls -l vmkdrivers/src_9/drivers/net/sky2/
total 208
-r--r--r-- 1 build build   2482 Nov 23 13:46 bitrev.c
-r--r--r-- 1 build build 122046 Nov 23 13:46 sky2.c
-r--r--r-- 1 build build  83285 Nov 23 13:46 sky2.h


You'll see there are 2 .c source files.

Now, if you look at the build-vmkdrivers.sh script for refences to sky2:

Code:
build@esx-build:~/vsphere/vmkdrivers-gpl$ cat build-vmkdrivers.sh | grep sky2

$CC -fwrapv -fno-working-directory -g -ggdb3 -O2 -fno-strict-aliasing -Wall -Werror -Wstrict-prototypes -fPIE -falign-functions=4 -falign-jumps=4 -falign-loops=4 -ffreestanding -fno-common -fno-omit-frame-pointer -fno-strength-reduce -march=x86-64 -mcmodel=small -minline-all-stringops -mno-red-zone -nostartfiles -nostdlib --sysroot=/nowhere -Wno-error -Wdeclaration-after-statement -Wno-unused-value -Wno-pointer-sign -Wno-strict-prototypes -Wno-declaration-after-statement -Wno-declaration-after-statement -DCONFIG_COMPAT -DCONFIG_PROC_FS -DCPU=x86-64 -DDEBUG_STUB -DESX3_NETWORKING_NOT_DONE_YET -DGPLED_CODE -DKBUILD_MODNAME=\"sky2\" -DLINUX_MODULE_AUX_HEAP_NAME=vmklnx_sky2 -DLINUX_MODULE_HEAP_INITIAL=1024*100 -DLINUX_MODULE_HEAP_MAX=1024*4096 -DLINUX_MODULE_HEAP_NAME=vmklnx_sky2 -DLINUX_MODULE_SKB_HEAP -DLINUX_MODULE_SKB_HEAP_INITIAL=512*1024 -DLINUX_MODULE_SKB_HEAP_MAX=22*1024*1024 -DLINUX_MODULE_VERSION=\"1.20\" -DMODULE -DNET_DRIVER -DVMKERNEL_MODULE -DVMK_DEVKIT_HAS_API_VMKAPI_BASE -DVMK_DEVKIT_HAS_API_VMKAPI_DEVICE -DVMK_DEVKIT_HAS_API_VMKAPI_ISCSI -DVMK_DEVKIT_HAS_API_VMKAPI_NET -DVMK_DEVKIT_HAS_API_VMKAPI_SCSI -DVMK_DEVKIT_IS_DDK -DVMK_DEVKIT_USES_BINARY_COMPATIBLE_APIS -DVMK_DEVKIT_USES_PUBLIC_APIS -DVMNIX -DVMX86_RELEASE -DVMX86_SERVER -DVMX86_VPROBES -D_LINUX -D__KERNEL__ -D__VMKERNEL_MODULE__ -D__VMKERNEL__ -D__VMKLNX__ -D__VMK_GCC_BUG_ALIGNMENT_PADDING__ -D__VMWARE__ -Ivmkdrivers/src_9/drivers/net/sky2 -IBLD/build/version -IBLD/build/HEADERS/vmkdrivers-vmkernel/vmkernel64/release -Ivmkdrivers/src_9/include -Ivmkdrivers/src_9/include/vmklinux_9 -IBLD/build/HEADERS/CUR-9-vmkdrivers-asm-x64/vmkernel64/release -Ivmkdrivers/src_9/drivers/net -IBLD/build/HEADERS/vmkapi-current-all-public-bincomp/vmkernel64/release -include bora/vmkernel/distribute/push-hidden.h -include vmkdrivers/src_9/include/linux/autoconf.h -c -o BLD/build/vmkdriver-sky2-CUR/release/vmkernel64/SUBDIRS/vmkdrivers/src_9/drivers/net/sky2/bitrev.o vmkdrivers/src_9/drivers/net/sky2/bitrev.c

$CC -fwrapv -fno-working-directory -g -ggdb3 -O2 -fno-strict-aliasing -Wall -Werror -Wstrict-prototypes -fPIE -falign-functions=4 -falign-jumps=4 -falign-loops=4 -ffreestanding -fno-common -fno-omit-frame-pointer -fno-strength-reduce -march=x86-64 -mcmodel=small -minline-all-stringops -mno-red-zone -nostartfiles -nostdlib --sysroot=/nowhere -Wno-error -Wdeclaration-after-statement -Wno-unused-value -Wno-pointer-sign -Wno-strict-prototypes -Wno-declaration-after-statement -Wno-declaration-after-statement -DCONFIG_COMPAT -DCONFIG_PROC_FS -DCPU=x86-64 -DDEBUG_STUB -DESX3_NETWORKING_NOT_DONE_YET -DGPLED_CODE -DKBUILD_MODNAME=\"sky2\" -DLINUX_MODULE_AUX_HEAP_NAME=vmklnx_sky2 -DLINUX_MODULE_HEAP_INITIAL=1024*100 -DLINUX_MODULE_HEAP_MAX=1024*4096 -DLINUX_MODULE_HEAP_NAME=vmklnx_sky2 -DLINUX_MODULE_SKB_HEAP -DLINUX_MODULE_SKB_HEAP_INITIAL=512*1024 -DLINUX_MODULE_SKB_HEAP_MAX=22*1024*1024 -DLINUX_MODULE_VERSION=\"1.20\" -DMODULE -DNET_DRIVER -DVMKERNEL_MODULE -DVMK_DEVKIT_HAS_API_VMKAPI_BASE -DVMK_DEVKIT_HAS_API_VMKAPI_DEVICE -DVMK_DEVKIT_HAS_API_VMKAPI_ISCSI -DVMK_DEVKIT_HAS_API_VMKAPI_NET -DVMK_DEVKIT_HAS_API_VMKAPI_SCSI -DVMK_DEVKIT_IS_DDK -DVMK_DEVKIT_USES_BINARY_COMPATIBLE_APIS -DVMK_DEVKIT_USES_PUBLIC_APIS -DVMNIX -DVMX86_RELEASE -DVMX86_SERVER -DVMX86_VPROBES -D_LINUX -D__KERNEL__ -D__VMKERNEL_MODULE__ -D__VMKERNEL__ -D__VMKLNX__ -D__VMK_GCC_BUG_ALIGNMENT_PADDING__ -D__VMWARE__ -Ivmkdrivers/src_9/drivers/net/sky2 -IBLD/build/version -IBLD/build/HEADERS/vmkdrivers-vmkernel/vmkernel64/release -Ivmkdrivers/src_9/include -Ivmkdrivers/src_9/include/vmklinux_9 -IBLD/build/HEADERS/CUR-9-vmkdrivers-asm-x64/vmkernel64/release -Ivmkdrivers/src_9/drivers/net -IBLD/build/HEADERS/vmkapi-current-all-public-bincomp/vmkernel64/release -include bora/vmkernel/distribute/push-hidden.h -include vmkdrivers/src_9/include/linux/autoconf.h -c -o BLD/build/vmkdriver-sky2-CUR/release/vmkernel64/SUBDIRS/vmkdrivers/src_9/drivers/net/sky2/sky2.o vmkdrivers/src_9/drivers/net/sky2/sky2.c

$CC -fwrapv -fno-working-directory -g -ggdb3 -O2 -fno-strict-aliasing -Wall -Werror -Wstrict-prototypes -fPIE -falign-functions=4 -falign-jumps=4 -falign-loops=4 -ffreestanding -fno-common -fno-omit-frame-pointer -fno-strength-reduce -march=x86-64 -mcmodel=small -minline-all-stringops -mno-red-zone -nostartfiles -nostdlib --sysroot=/nowhere -Wno-error -Wdeclaration-after-statement -Wno-unused-value -Wno-pointer-sign -Wno-strict-prototypes -Wno-declaration-after-statement -Wno-declaration-after-statement -DCONFIG_COMPAT -DCONFIG_PROC_FS -DCPU=x86-64 -DDEBUG_STUB -DESX3_NETWORKING_NOT_DONE_YET -DGPLED_CODE -DKBUILD_MODNAME=\"sky2\" -DLINUX_MODULE_AUX_HEAP_NAME=vmklnx_sky2 -DLINUX_MODULE_HEAP_INITIAL=1024*100 -DLINUX_MODULE_HEAP_MAX=1024*4096 -DLINUX_MODULE_HEAP_NAME=vmklnx_sky2 -DLINUX_MODULE_SKB_HEAP -DLINUX_MODULE_SKB_HEAP_INITIAL=512*1024 -DLINUX_MODULE_SKB_HEAP_MAX=22*1024*1024 -DLINUX_MODULE_VERSION=\"1.20\" -DMODULE -DNET_DRIVER -DVMKERNEL_MODULE -DVMK_DEVKIT_HAS_API_VMKAPI_BASE -DVMK_DEVKIT_HAS_API_VMKAPI_DEVICE -DVMK_DEVKIT_HAS_API_VMKAPI_ISCSI -DVMK_DEVKIT_HAS_API_VMKAPI_NET -DVMK_DEVKIT_HAS_API_VMKAPI_SCSI -DVMK_DEVKIT_IS_DDK -DVMK_DEVKIT_USES_BINARY_COMPATIBLE_APIS -DVMK_DEVKIT_USES_PUBLIC_APIS -DVMNIX -DVMX86_RELEASE -DVMX86_SERVER -DVMX86_VPROBES -D_LINUX -D__KERNEL__ -D__VMKERNEL_MODULE__ -D__VMKERNEL__ -D__VMKLNX__ -D__VMK_GCC_BUG_ALIGNMENT_PADDING__ -D__VMWARE__ -Ivmkdrivers/src_9/drivers/net/sky2 -IBLD/build/version -IBLD/build/HEADERS/vmkdrivers-vmkernel/vmkernel64/release -Ivmkdrivers/src_9/include -Ivmkdrivers/src_9/include/vmklinux_9 -IBLD/build/HEADERS/CUR-9-vmkdrivers-asm-x64/vmkernel64/release -Ivmkdrivers/src_9/drivers/net -IBLD/build/HEADERS/vmkapi-current-all-public-bincomp/vmkernel64/release -include bora/vmkernel/distribute/push-hidden.h -include vmkdrivers/src_9/include/linux/autoconf.h -c -o BLD/build/vmkdriver-sky2-CUR/release/vmkernel64/SUBDIRS/vmkdrivers/src_9/common/vmklinux_module.o vmkdrivers/src_9/common/vmklinux_module.c

$LD -r -o BLD/build/vmkdriver-sky2-CUR/release/vmkernel64/sky2 --whole-archive BLD/build/vmkdriver-sky2-CUR/release/vmkernel64/SUBDIRS/vmkdrivers/src_9/drivers/net/sky2/bitrev.o BLD/build/vmkdriver-sky2-CUR/release/vmkernel64/SUBDIRS/vmkdrivers/src_9/drivers/net/sky2/sky2.o BLD/build/vmkdriver-sky2-CUR/release/vmkernel64/SUBDIRS/vmkdrivers/src_9/common/vmklinux_module.o



… you have all the information you need on the general make-up of a driver for ESXI. You can see here that both source files (bitrev.c and sky2.c) have a corresponding invocation of gcc via the $CC call. Did you notice how there are 3 calls to CC despite us having 2 pieces of .c source? There is indeed a third piece of source being compiled and that's what makes ESXI driver modules special. The vmklinux_module.c source file is located elsewhere in the build structure but for every unique driver it must be compiled and added in to the resulting fully linked kernel module. This is why regular linux kernel modules can not work on ESXI- they are all missing the exported functions that the vmklinux_module.c source provides. The last thing we see in the output is an invocation of the GNU ld linker via the $LD call. If you look closely you can see that the linker is being instructed to take the compiled object code from bitrev.c, sky2.c, and vmklinux_module.c and join them together in to a final kernel module that will be placed at BLD/build/vmkdriver-sky2-CUR/release/vmkernel64/sky2

So the general formula for an ESXI driver is yoursource1.o + yoursource2.o + yoursourceN.c + vmklinux_module.o = yourmodule

We'll continue to construct our build script by reusing the sky2 stuff:

Code:
cat build-vmkdrivers.sh | grep sky2.c | sed 's/sky2/atl1c/g' | sed 's/atl1c.c/atl1c_main.c/' | sed 's/atl1c.o/atl1c_main.o/' >> build-atl1c.sh


This gets us a line that will build our atl1c_main.c file but there are quite a few others:

Code:
build@esx-build:~/vsphere/vmkdrivers-gpl$ ls -l vmkdrivers/src_9/drivers/net/atl1c/*.c
-rwxrw-r-x 1 build build   7092 Sep 14  2010 vmkdrivers/src_9/drivers/net/atl1c/at_common_main.c
-r-xr--r-x 1 build build  10893 Jun 24  2010 vmkdrivers/src_9/drivers/net/atl1c/atl1c_ethtool.c
-r-xr--r-x 1 build build  19417 Jun 24  2010 vmkdrivers/src_9/drivers/net/atl1c/atl1c_hw.c
-rwxrw-r-x 1 build build  91461 Sep 14  2010 vmkdrivers/src_9/drivers/net/atl1c/atl1c_main.c
-r-xr--r-x 1 build build   7041 Jun 24  2010 vmkdrivers/src_9/drivers/net/atl1c/atl1c_param.c
-r-xr--r-x 1 build build  15949 Jun 24  2010 vmkdrivers/src_9/drivers/net/atl1c/atl1e_ethtool.c
-r-xr--r-x 1 build build  24225 Jun 24  2010 vmkdrivers/src_9/drivers/net/atl1c/atl1e_hw.c
-r-xr--r-x 1 build build 101017 Jun 24  2010 vmkdrivers/src_9/drivers/net/atl1c/atl1e_main.c
-r-xr--r-x 1 build build   7981 Jun 24  2010 vmkdrivers/src_9/drivers/net/atl1c/atl1e_param.c
-r-xr--r-x 1 build build   5997 Jun 24  2010 vmkdrivers/src_9/drivers/net/atl1c/kcompat.c
-r-xr--r-x 1 build build  30563 Jun 24  2010 vmkdrivers/src_9/drivers/net/atl1c/kcompat_ethtool.c


So we'll need these sequence of commands to add in all the necessary GCC calls:

Code:
cat build-vmkdrivers.sh | grep bitrev.c | sed 's/sky2/atl1c/g' | sed 's/bitrev.o/at_common_main.o/' | sed 's/bitrev.c/at_common_main.c/' >> build-atl1c.sh
cat build-vmkdrivers.sh | grep bitrev.c | sed 's/sky2/atl1c/g' | sed 's/bitrev.o/atl1c_ethtool.o/' | sed 's/bitrev.c/atl1c_ethtool.c/' >> build-atl1c.sh
cat build-vmkdrivers.sh | grep bitrev.c | sed 's/sky2/atl1c/g' | sed 's/bitrev.o/atl1c_hw.o/' | sed 's/bitrev.c/atl1c_hw.c/' >> build-atl1c.sh
cat build-vmkdrivers.sh | grep bitrev.c | sed 's/sky2/atl1c/g' | sed 's/bitrev.o/atl1c_param.o/' | sed 's/bitrev.c/atl1c_param.c/' >> build-atl1c.sh
cat build-vmkdrivers.sh | grep bitrev.c | sed 's/sky2/atl1c/g' | sed 's/bitrev.o/atl1e_ethtool.o/' | sed 's/bitrev.c/atl1e_ethtool.c/' >> build-atl1c.sh
cat build-vmkdrivers.sh | grep bitrev.c | sed 's/sky2/atl1c/g' | sed 's/bitrev.o/atl1e_hw.o/' | sed 's/bitrev.c/atl1e_hw.c/' >> build-atl1c.sh
cat build-vmkdrivers.sh | grep bitrev.c | sed 's/sky2/atl1c/g' | sed 's/bitrev.o/atl1e_main.o/' | sed 's/bitrev.c/atl1e_main.c/' >> build-atl1c.sh
cat build-vmkdrivers.sh | grep bitrev.c | sed 's/sky2/atl1c/g' | sed 's/bitrev.o/atl1e_param.o/' | sed 's/bitrev.c/atl1e_param.c/' >> build-atl1c.sh
cat build-vmkdrivers.sh | grep bitrev.c | sed 's/sky2/atl1c/g' | sed 's/bitrev.o/kcompat.o/' | sed 's/bitrev.c/kcompat.c/' >> build-atl1c.sh
cat build-vmkdrivers.sh | grep bitrev.c | sed 's/sky2/atl1c/g' | sed 's/bitrev.o/kcompat_ethtool.o/' | sed 's/bitrev.c/kcompat_ethtool.c/' >> build-atl1c.sh
cat build-vmkdrivers.sh | grep sky2 | grep vmklinux_module\.c | sed 's/sky2/atl1c/g' >> build-atl1c.sh


If you're a shell script wizard you probably spot 10 different ways to accomplish this task more quickly. I'm not a shell wizard, so I work with what I know ;-)

Now we need to add a line that conducts the linking of our various source files:

Code:
build@esx-build:~/vsphere/vmkdrivers-gpl$ echo '$LD -v -r -o BLD/build/vmkdriver-atl1c-CUR/release/vmkernel64/atl1c --whole-archive BLD/build/vmkdriver-atl1c-CUR/release/vmkernel64/SUBDIRS/vmkdrivers/src_9/drivers/net/atl1c/atl1c_main.o BLD/build/vmkdriver-atl1c-CUR/release/vmkernel64/SUBDIRS/vmkdrivers/src_9/drivers/net/atl1c/at_common_main.o BLD/build/vmkdriver-atl1c-CUR/release/vmkernel64/SUBDIRS/vmkdrivers/src_9/drivers/net/atl1c/atl1c_ethtool.o BLD/build/vmkdriver-atl1c-CUR/release/vmkernel64/SUBDIRS/vmkdrivers/src_9/drivers/net/atl1c/atl1c_hw.o BLD/build/vmkdriver-atl1c-CUR/release/vmkernel64/SUBDIRS/vmkdrivers/src_9/drivers/net/atl1c/atl1c_param.o BLD/build/vmkdriver-atl1c-CUR/release/vmkernel64/SUBDIRS/vmkdrivers/src_9/drivers/net/atl1c/atl1e_ethtool.o BLD/build/vmkdriver-atl1c-CUR/release/vmkernel64/SUBDIRS/vmkdrivers/src_9/drivers/net/atl1c/atl1e_hw.o BLD/build/vmkdriver-atl1c-CUR/release/vmkernel64/SUBDIRS/vmkdrivers/src_9/drivers/net/atl1c/atl1e_main.o BLD/build/vmkdriver-atl1c-CUR/release/vmkernel64/SUBDIRS/vmkdrivers/src_9/drivers/net/atl1c/atl1e_param.o BLD/build/vmkdriver-atl1c-CUR/release/vmkernel64/SUBDIRS/vmkdrivers/src_9/drivers/net/atl1c/kcompat.o BLD/build/vmkdriver-atl1c-CUR/release/vmkernel64/SUBDIRS/vmkdrivers/src_9/drivers/net/atl1c/kcompat_ethtool.o BLD/build/vmkdriver-atl1c-CUR/release/vmkernel64/SUBDIRS/vmkdrivers/src_9/common/vmklinux_module.o' >> build-atl1c.sh


There's one other thing I'd highly recommend adding to the build script.

Code:
rm -rf BLD/build/vmkdriver-atl1c-CUR/


Put that right after the first line of the build script. Why do we need that? Later when you're trying to compile the code, you'll eventually get to a position where source1.c is compiling but source2.c is not working. You'll make a change to source1.c for some reason and then it'll end up causing a compile failure that you won't notice. Your final module will end up getting linked and working anyway because the previous version of soruce1.o object file hangs around from the last time it did compile ok. Trust me, it's much easier to delete all those old object files and know that when you do get a final linked module that it's been produced successfully from the very last edits you made.

Your finished build script should look like this:

Code:
build@esx-build:~/vsphere/vmkdrivers-gpl$ cat build-atl1c.sh
#!/bin/sh

rm -rf BLD/build/vmkdriver-atl1c-CUR/

# Use gcc version 4.1.2-9
# Below is the internal VMWare location.  Please change as required for your
# installed location.
CC=/home/build/toolchain/lin32/gcc-4.1.2-9/bin/x86_64-linux-gcc

# Use ld from binutils-2.17.50.0.15-modcall
# Below is the internal VMWare location.  Please change as required for your
# installed location.
LD=/home/build/toolchain/lin32/binutils-2.17.50.0.15-modcall/bin/x86_64-linux-ld

# Use GNU grep 2.5.1
GREP=grep
# Use GNU sed 4.5.1
SED=sed
# Use GNU xargs 4.2.27
XARGS=xargs
# Use mkdir from GNU coreutils 5.97
MKDIR=mkdir

# Create output directories
$GREP -v -e "SED" build-atl1c.sh \
| $GREP -o -e "-o [^ ]*\."            \
| $SED -e 's?-o \(.*\)/[^/]*\.?\1?'   \
| $GREP -v -e "\*"                    \
| $XARGS $MKDIR -p

$CC -fwrapv -fno-working-directory -g -ggdb3 -O2 -fno-strict-aliasing -Wall -Werror -Wstrict-prototypes -fPIE -falign-functions=4 -falign-jumps=4 -falign-loops=4 -ffreestanding -fno-common -fno-omit-frame-pointer -fno-strength-reduce -march=x86-64 -mcmodel=small -minline-all-stringops -mno-red-zone -nostartfiles -nostdlib --sysroot=/nowhere -Wno-error -Wdeclaration-after-statement -Wno-unused-value -Wno-pointer-sign -Wno-strict-prototypes -Wno-declaration-after-statement -Wno-declaration-after-statement -DCONFIG_COMPAT -DCONFIG_PROC_FS -DCPU=x86-64 -DDEBUG_STUB -DESX3_NETWORKING_NOT_DONE_YET -DGPLED_CODE -DKBUILD_MODNAME=\"atl1c\" -DLINUX_MODULE_AUX_HEAP_NAME=vmklnx_atl1c -DLINUX_MODULE_HEAP_INITIAL=1024*100 -DLINUX_MODULE_HEAP_MAX=1024*4096 -DLINUX_MODULE_HEAP_NAME=vmklnx_atl1c -DLINUX_MODULE_SKB_HEAP -DLINUX_MODULE_SKB_HEAP_INITIAL=512*1024 -DLINUX_MODULE_SKB_HEAP_MAX=22*1024*1024 -DLINUX_MODULE_VERSION=\"1.20\" -DMODULE -DNET_DRIVER -DVMKERNEL_MODULE -DVMK_DEVKIT_HAS_API_VMKAPI_BASE -DVMK_DEVKIT_HAS_API_VMKAPI_DEVICE -DVMK_DEVKIT_HAS_API_VMKAPI_ISCSI -DVMK_DEVKIT_HAS_API_VMKAPI_NET -DVMK_DEVKIT_HAS_API_VMKAPI_SCSI -DVMK_DEVKIT_IS_DDK -DVMK_DEVKIT_USES_BINARY_COMPATIBLE_APIS -DVMK_DEVKIT_USES_PUBLIC_APIS -DVMNIX -DVMX86_RELEASE -DVMX86_SERVER -DVMX86_VPROBES -D_LINUX -D__KERNEL__ -D__VMKERNEL_MODULE__ -D__VMKERNEL__ -D__VMKLNX__ -D__VMK_GCC_BUG_ALIGNMENT_PADDING__ -D__VMWARE__ -Ivmkdrivers/src_9/drivers/net/atl1c -IBLD/build/version -IBLD/build/HEADERS/vmkdrivers-vmkernel/vmkernel64/release -Ivmkdrivers/src_9/include -Ivmkdrivers/src_9/include/vmklinux_9 -IBLD/build/HEADERS/CUR-9-vmkdrivers-asm-x64/vmkernel64/release -Ivmkdrivers/src_9/drivers/net -IBLD/build/HEADERS/vmkapi-current-all-public-bincomp/vmkernel64/release -include bora/vmkernel/distribute/push-hidden.h -include vmkdrivers/src_9/include/linux/autoconf.h -c -o BLD/build/vmkdriver-atl1c-CUR/release/vmkernel64/SUBDIRS/vmkdrivers/src_9/drivers/net/atl1c/atl1c_main.o vmkdrivers/src_9/drivers/net/atl1c/atl1c_main.c

$CC -fwrapv -fno-working-directory -g -ggdb3 -O2 -fno-strict-aliasing -Wall -Werror -Wstrict-prototypes -fPIE -falign-functions=4 -falign-jumps=4 -falign-loops=4 -ffreestanding -fno-common -fno-omit-frame-pointer -fno-strength-reduce -march=x86-64 -mcmodel=small -minline-all-stringops -mno-red-zone -nostartfiles -nostdlib --sysroot=/nowhere -Wno-error -Wdeclaration-after-statement -Wno-unused-value -Wno-pointer-sign -Wno-strict-prototypes -Wno-declaration-after-statement -Wno-declaration-after-statement -DCONFIG_COMPAT -DCONFIG_PROC_FS -DCPU=x86-64 -DDEBUG_STUB -DESX3_NETWORKING_NOT_DONE_YET -DGPLED_CODE -DKBUILD_MODNAME=\"atl1c\" -DLINUX_MODULE_AUX_HEAP_NAME=vmklnx_atl1c -DLINUX_MODULE_HEAP_INITIAL=1024*100 -DLINUX_MODULE_HEAP_MAX=1024*4096 -DLINUX_MODULE_HEAP_NAME=vmklnx_atl1c -DLINUX_MODULE_SKB_HEAP -DLINUX_MODULE_SKB_HEAP_INITIAL=512*1024 -DLINUX_MODULE_SKB_HEAP_MAX=22*1024*1024 -DLINUX_MODULE_VERSION=\"1.20\" -DMODULE -DNET_DRIVER -DVMKERNEL_MODULE -DVMK_DEVKIT_HAS_API_VMKAPI_BASE -DVMK_DEVKIT_HAS_API_VMKAPI_DEVICE -DVMK_DEVKIT_HAS_API_VMKAPI_ISCSI -DVMK_DEVKIT_HAS_API_VMKAPI_NET -DVMK_DEVKIT_HAS_API_VMKAPI_SCSI -DVMK_DEVKIT_IS_DDK -DVMK_DEVKIT_USES_BINARY_COMPATIBLE_APIS -DVMK_DEVKIT_USES_PUBLIC_APIS -DVMNIX -DVMX86_RELEASE -DVMX86_SERVER -DVMX86_VPROBES -D_LINUX -D__KERNEL__ -D__VMKERNEL_MODULE__ -D__VMKERNEL__ -D__VMKLNX__ -D__VMK_GCC_BUG_ALIGNMENT_PADDING__ -D__VMWARE__ -Ivmkdrivers/src_9/drivers/net/atl1c -IBLD/build/version -IBLD/build/HEADERS/vmkdrivers-vmkernel/vmkernel64/release -Ivmkdrivers/src_9/include -Ivmkdrivers/src_9/include/vmklinux_9 -IBLD/build/HEADERS/CUR-9-vmkdrivers-asm-x64/vmkernel64/release -Ivmkdrivers/src_9/drivers/net -IBLD/build/HEADERS/vmkapi-current-all-public-bincomp/vmkernel64/release -include bora/vmkernel/distribute/push-hidden.h -include vmkdrivers/src_9/include/linux/autoconf.h -c -o BLD/build/vmkdriver-atl1c-CUR/release/vmkernel64/SUBDIRS/vmkdrivers/src_9/drivers/net/atl1c/at_common_main.o vmkdrivers/src_9/drivers/net/atl1c/at_common_main.c

$CC -fwrapv -fno-working-directory -g -ggdb3 -O2 -fno-strict-aliasing -Wall -Werror -Wstrict-prototypes -fPIE -falign-functions=4 -falign-jumps=4 -falign-loops=4 -ffreestanding -fno-common -fno-omit-frame-pointer -fno-strength-reduce -march=x86-64 -mcmodel=small -minline-all-stringops -mno-red-zone -nostartfiles -nostdlib --sysroot=/nowhere -Wno-error -Wdeclaration-after-statement -Wno-unused-value -Wno-pointer-sign -Wno-strict-prototypes -Wno-declaration-after-statement -Wno-declaration-after-statement -DCONFIG_COMPAT -DCONFIG_PROC_FS -DCPU=x86-64 -DDEBUG_STUB -DESX3_NETWORKING_NOT_DONE_YET -DGPLED_CODE -DKBUILD_MODNAME=\"atl1c\" -DLINUX_MODULE_AUX_HEAP_NAME=vmklnx_atl1c -DLINUX_MODULE_HEAP_INITIAL=1024*100 -DLINUX_MODULE_HEAP_MAX=1024*4096 -DLINUX_MODULE_HEAP_NAME=vmklnx_atl1c -DLINUX_MODULE_SKB_HEAP -DLINUX_MODULE_SKB_HEAP_INITIAL=512*1024 -DLINUX_MODULE_SKB_HEAP_MAX=22*1024*1024 -DLINUX_MODULE_VERSION=\"1.20\" -DMODULE -DNET_DRIVER -DVMKERNEL_MODULE -DVMK_DEVKIT_HAS_API_VMKAPI_BASE -DVMK_DEVKIT_HAS_API_VMKAPI_DEVICE -DVMK_DEVKIT_HAS_API_VMKAPI_ISCSI -DVMK_DEVKIT_HAS_API_VMKAPI_NET -DVMK_DEVKIT_HAS_API_VMKAPI_SCSI -DVMK_DEVKIT_IS_DDK -DVMK_DEVKIT_USES_BINARY_COMPATIBLE_APIS -DVMK_DEVKIT_USES_PUBLIC_APIS -DVMNIX -DVMX86_RELEASE -DVMX86_SERVER -DVMX86_VPROBES -D_LINUX -D__KERNEL__ -D__VMKERNEL_MODULE__ -D__VMKERNEL__ -D__VMKLNX__ -D__VMK_GCC_BUG_ALIGNMENT_PADDING__ -D__VMWARE__ -Ivmkdrivers/src_9/drivers/net/atl1c -IBLD/build/version -IBLD/build/HEADERS/vmkdrivers-vmkernel/vmkernel64/release -Ivmkdrivers/src_9/include -Ivmkdrivers/src_9/include/vmklinux_9 -IBLD/build/HEADERS/CUR-9-vmkdrivers-asm-x64/vmkernel64/release -Ivmkdrivers/src_9/drivers/net -IBLD/build/HEADERS/vmkapi-current-all-public-bincomp/vmkernel64/release -include bora/vmkernel/distribute/push-hidden.h -include vmkdrivers/src_9/include/linux/autoconf.h -c -o BLD/build/vmkdriver-atl1c-CUR/release/vmkernel64/SUBDIRS/vmkdrivers/src_9/drivers/net/atl1c/atl1c_ethtool.o vmkdrivers/src_9/drivers/net/atl1c/atl1c_ethtool.c

$CC -fwrapv -fno-working-directory -g -ggdb3 -O2 -fno-strict-aliasing -Wall -Werror -Wstrict-prototypes -fPIE -falign-functions=4 -falign-jumps=4 -falign-loops=4 -ffreestanding -fno-common -fno-omit-frame-pointer -fno-strength-reduce -march=x86-64 -mcmodel=small -minline-all-stringops -mno-red-zone -nostartfiles -nostdlib --sysroot=/nowhere -Wno-error -Wdeclaration-after-statement -Wno-unused-value -Wno-pointer-sign -Wno-strict-prototypes -Wno-declaration-after-statement -Wno-declaration-after-statement -DCONFIG_COMPAT -DCONFIG_PROC_FS -DCPU=x86-64 -DDEBUG_STUB -DESX3_NETWORKING_NOT_DONE_YET -DGPLED_CODE -DKBUILD_MODNAME=\"atl1c\" -DLINUX_MODULE_AUX_HEAP_NAME=vmklnx_atl1c -DLINUX_MODULE_HEAP_INITIAL=1024*100 -DLINUX_MODULE_HEAP_MAX=1024*4096 -DLINUX_MODULE_HEAP_NAME=vmklnx_atl1c -DLINUX_MODULE_SKB_HEAP -DLINUX_MODULE_SKB_HEAP_INITIAL=512*1024 -DLINUX_MODULE_SKB_HEAP_MAX=22*1024*1024 -DLINUX_MODULE_VERSION=\"1.20\" -DMODULE -DNET_DRIVER -DVMKERNEL_MODULE -DVMK_DEVKIT_HAS_API_VMKAPI_BASE -DVMK_DEVKIT_HAS_API_VMKAPI_DEVICE -DVMK_DEVKIT_HAS_API_VMKAPI_ISCSI -DVMK_DEVKIT_HAS_API_VMKAPI_NET -DVMK_DEVKIT_HAS_API_VMKAPI_SCSI -DVMK_DEVKIT_IS_DDK -DVMK_DEVKIT_USES_BINARY_COMPATIBLE_APIS -DVMK_DEVKIT_USES_PUBLIC_APIS -DVMNIX -DVMX86_RELEASE -DVMX86_SERVER -DVMX86_VPROBES -D_LINUX -D__KERNEL__ -D__VMKERNEL_MODULE__ -D__VMKERNEL__ -D__VMKLNX__ -D__VMK_GCC_BUG_ALIGNMENT_PADDING__ -D__VMWARE__ -Ivmkdrivers/src_9/drivers/net/atl1c -IBLD/build/version -IBLD/build/HEADERS/vmkdrivers-vmkernel/vmkernel64/release -Ivmkdrivers/src_9/include -Ivmkdrivers/src_9/include/vmklinux_9 -IBLD/build/HEADERS/CUR-9-vmkdrivers-asm-x64/vmkernel64/release -Ivmkdrivers/src_9/drivers/net -IBLD/build/HEADERS/vmkapi-current-all-public-bincomp/vmkernel64/release -include bora/vmkernel/distribute/push-hidden.h -include vmkdrivers/src_9/include/linux/autoconf.h -c -o BLD/build/vmkdriver-atl1c-CUR/release/vmkernel64/SUBDIRS/vmkdrivers/src_9/drivers/net/atl1c/atl1c_hw.o vmkdrivers/src_9/drivers/net/atl1c/atl1c_hw.c

$CC -fwrapv -fno-working-directory -g -ggdb3 -O2 -fno-strict-aliasing -Wall -Werror -Wstrict-prototypes -fPIE -falign-functions=4 -falign-jumps=4 -falign-loops=4 -ffreestanding -fno-common -fno-omit-frame-pointer -fno-strength-reduce -march=x86-64 -mcmodel=small -minline-all-stringops -mno-red-zone -nostartfiles -nostdlib --sysroot=/nowhere -Wno-error -Wdeclaration-after-statement -Wno-unused-value -Wno-pointer-sign -Wno-strict-prototypes -Wno-declaration-after-statement -Wno-declaration-after-statement -DCONFIG_COMPAT -DCONFIG_PROC_FS -DCPU=x86-64 -DDEBUG_STUB -DESX3_NETWORKING_NOT_DONE_YET -DGPLED_CODE -DKBUILD_MODNAME=\"atl1c\" -DLINUX_MODULE_AUX_HEAP_NAME=vmklnx_atl1c -DLINUX_MODULE_HEAP_INITIAL=1024*100 -DLINUX_MODULE_HEAP_MAX=1024*4096 -DLINUX_MODULE_HEAP_NAME=vmklnx_atl1c -DLINUX_MODULE_SKB_HEAP -DLINUX_MODULE_SKB_HEAP_INITIAL=512*1024 -DLINUX_MODULE_SKB_HEAP_MAX=22*1024*1024 -DLINUX_MODULE_VERSION=\"1.20\" -DMODULE -DNET_DRIVER -DVMKERNEL_MODULE -DVMK_DEVKIT_HAS_API_VMKAPI_BASE -DVMK_DEVKIT_HAS_API_VMKAPI_DEVICE -DVMK_DEVKIT_HAS_API_VMKAPI_ISCSI -DVMK_DEVKIT_HAS_API_VMKAPI_NET -DVMK_DEVKIT_HAS_API_VMKAPI_SCSI -DVMK_DEVKIT_IS_DDK -DVMK_DEVKIT_USES_BINARY_COMPATIBLE_APIS -DVMK_DEVKIT_USES_PUBLIC_APIS -DVMNIX -DVMX86_RELEASE -DVMX86_SERVER -DVMX86_VPROBES -D_LINUX -D__KERNEL__ -D__VMKERNEL_MODULE__ -D__VMKERNEL__ -D__VMKLNX__ -D__VMK_GCC_BUG_ALIGNMENT_PADDING__ -D__VMWARE__ -Ivmkdrivers/src_9/drivers/net/atl1c -IBLD/build/version -IBLD/build/HEADERS/vmkdrivers-vmkernel/vmkernel64/release -Ivmkdrivers/src_9/include -Ivmkdrivers/src_9/include/vmklinux_9 -IBLD/build/HEADERS/CUR-9-vmkdrivers-asm-x64/vmkernel64/release -Ivmkdrivers/src_9/drivers/net -IBLD/build/HEADERS/vmkapi-current-all-public-bincomp/vmkernel64/release -include bora/vmkernel/distribute/push-hidden.h -include vmkdrivers/src_9/include/linux/autoconf.h -c -o BLD/build/vmkdriver-atl1c-CUR/release/vmkernel64/SUBDIRS/vmkdrivers/src_9/drivers/net/atl1c/atl1c_param.o vmkdrivers/src_9/drivers/net/atl1c/atl1c_param.c

$CC -fwrapv -fno-working-directory -g -ggdb3 -O2 -fno-strict-aliasing -Wall -Werror -Wstrict-prototypes -fPIE -falign-functions=4 -falign-jumps=4 -falign-loops=4 -ffreestanding -fno-common -fno-omit-frame-pointer -fno-strength-reduce -march=x86-64 -mcmodel=small -minline-all-stringops -mno-red-zone -nostartfiles -nostdlib --sysroot=/nowhere -Wno-error -Wdeclaration-after-statement -Wno-unused-value -Wno-pointer-sign -Wno-strict-prototypes -Wno-declaration-after-statement -Wno-declaration-after-statement -DCONFIG_COMPAT -DCONFIG_PROC_FS -DCPU=x86-64 -DDEBUG_STUB -DESX3_NETWORKING_NOT_DONE_YET -DGPLED_CODE -DKBUILD_MODNAME=\"atl1c\" -DLINUX_MODULE_AUX_HEAP_NAME=vmklnx_atl1c -DLINUX_MODULE_HEAP_INITIAL=1024*100 -DLINUX_MODULE_HEAP_MAX=1024*4096 -DLINUX_MODULE_HEAP_NAME=vmklnx_atl1c -DLINUX_MODULE_SKB_HEAP -DLINUX_MODULE_SKB_HEAP_INITIAL=512*1024 -DLINUX_MODULE_SKB_HEAP_MAX=22*1024*1024 -DLINUX_MODULE_VERSION=\"1.20\" -DMODULE -DNET_DRIVER -DVMKERNEL_MODULE -DVMK_DEVKIT_HAS_API_VMKAPI_BASE -DVMK_DEVKIT_HAS_API_VMKAPI_DEVICE -DVMK_DEVKIT_HAS_API_VMKAPI_ISCSI -DVMK_DEVKIT_HAS_API_VMKAPI_NET -DVMK_DEVKIT_HAS_API_VMKAPI_SCSI -DVMK_DEVKIT_IS_DDK -DVMK_DEVKIT_USES_BINARY_COMPATIBLE_APIS -DVMK_DEVKIT_USES_PUBLIC_APIS -DVMNIX -DVMX86_RELEASE -DVMX86_SERVER -DVMX86_VPROBES -D_LINUX -D__KERNEL__ -D__VMKERNEL_MODULE__ -D__VMKERNEL__ -D__VMKLNX__ -D__VMK_GCC_BUG_ALIGNMENT_PADDING__ -D__VMWARE__ -Ivmkdrivers/src_9/drivers/net/atl1c -IBLD/build/version -IBLD/build/HEADERS/vmkdrivers-vmkernel/vmkernel64/release -Ivmkdrivers/src_9/include -Ivmkdrivers/src_9/include/vmklinux_9 -IBLD/build/HEADERS/CUR-9-vmkdrivers-asm-x64/vmkernel64/release -Ivmkdrivers/src_9/drivers/net -IBLD/build/HEADERS/vmkapi-current-all-public-bincomp/vmkernel64/release -include bora/vmkernel/distribute/push-hidden.h -include vmkdrivers/src_9/include/linux/autoconf.h -c -o BLD/build/vmkdriver-atl1c-CUR/release/vmkernel64/SUBDIRS/vmkdrivers/src_9/drivers/net/atl1c/atl1e_ethtool.o vmkdrivers/src_9/drivers/net/atl1c/atl1e_ethtool.c

$CC -fwrapv -fno-working-directory -g -ggdb3 -O2 -fno-strict-aliasing -Wall -Werror -Wstrict-prototypes -fPIE -falign-functions=4 -falign-jumps=4 -falign-loops=4 -ffreestanding -fno-common -fno-omit-frame-pointer -fno-strength-reduce -march=x86-64 -mcmodel=small -minline-all-stringops -mno-red-zone -nostartfiles -nostdlib --sysroot=/nowhere -Wno-error -Wdeclaration-after-statement -Wno-unused-value -Wno-pointer-sign -Wno-strict-prototypes -Wno-declaration-after-statement -Wno-declaration-after-statement -DCONFIG_COMPAT -DCONFIG_PROC_FS -DCPU=x86-64 -DDEBUG_STUB -DESX3_NETWORKING_NOT_DONE_YET -DGPLED_CODE -DKBUILD_MODNAME=\"atl1c\" -DLINUX_MODULE_AUX_HEAP_NAME=vmklnx_atl1c -DLINUX_MODULE_HEAP_INITIAL=1024*100 -DLINUX_MODULE_HEAP_MAX=1024*4096 -DLINUX_MODULE_HEAP_NAME=vmklnx_atl1c -DLINUX_MODULE_SKB_HEAP -DLINUX_MODULE_SKB_HEAP_INITIAL=512*1024 -DLINUX_MODULE_SKB_HEAP_MAX=22*1024*1024 -DLINUX_MODULE_VERSION=\"1.20\" -DMODULE -DNET_DRIVER -DVMKERNEL_MODULE -DVMK_DEVKIT_HAS_API_VMKAPI_BASE -DVMK_DEVKIT_HAS_API_VMKAPI_DEVICE -DVMK_DEVKIT_HAS_API_VMKAPI_ISCSI -DVMK_DEVKIT_HAS_API_VMKAPI_NET -DVMK_DEVKIT_HAS_API_VMKAPI_SCSI -DVMK_DEVKIT_IS_DDK -DVMK_DEVKIT_USES_BINARY_COMPATIBLE_APIS -DVMK_DEVKIT_USES_PUBLIC_APIS -DVMNIX -DVMX86_RELEASE -DVMX86_SERVER -DVMX86_VPROBES -D_LINUX -D__KERNEL__ -D__VMKERNEL_MODULE__ -D__VMKERNEL__ -D__VMKLNX__ -D__VMK_GCC_BUG_ALIGNMENT_PADDING__ -D__VMWARE__ -Ivmkdrivers/src_9/drivers/net/atl1c -IBLD/build/version -IBLD/build/HEADERS/vmkdrivers-vmkernel/vmkernel64/release -Ivmkdrivers/src_9/include -Ivmkdrivers/src_9/include/vmklinux_9 -IBLD/build/HEADERS/CUR-9-vmkdrivers-asm-x64/vmkernel64/release -Ivmkdrivers/src_9/drivers/net -IBLD/build/HEADERS/vmkapi-current-all-public-bincomp/vmkernel64/release -include bora/vmkernel/distribute/push-hidden.h -include vmkdrivers/src_9/include/linux/autoconf.h -c -o BLD/build/vmkdriver-atl1c-CUR/release/vmkernel64/SUBDIRS/vmkdrivers/src_9/drivers/net/atl1c/atl1e_hw.o vmkdrivers/src_9/drivers/net/atl1c/atl1e_hw.c

$CC -fwrapv -fno-working-directory -g -ggdb3 -O2 -fno-strict-aliasing -Wall -Werror -Wstrict-prototypes -fPIE -falign-functions=4 -falign-jumps=4 -falign-loops=4 -ffreestanding -fno-common -fno-omit-frame-pointer -fno-strength-reduce -march=x86-64 -mcmodel=small -minline-all-stringops -mno-red-zone -nostartfiles -nostdlib --sysroot=/nowhere -Wno-error -Wdeclaration-after-statement -Wno-unused-value -Wno-pointer-sign -Wno-strict-prototypes -Wno-declaration-after-statement -Wno-declaration-after-statement -DCONFIG_COMPAT -DCONFIG_PROC_FS -DCPU=x86-64 -DDEBUG_STUB -DESX3_NETWORKING_NOT_DONE_YET -DGPLED_CODE -DKBUILD_MODNAME=\"atl1c\" -DLINUX_MODULE_AUX_HEAP_NAME=vmklnx_atl1c -DLINUX_MODULE_HEAP_INITIAL=1024*100 -DLINUX_MODULE_HEAP_MAX=1024*4096 -DLINUX_MODULE_HEAP_NAME=vmklnx_atl1c -DLINUX_MODULE_SKB_HEAP -DLINUX_MODULE_SKB_HEAP_INITIAL=512*1024 -DLINUX_MODULE_SKB_HEAP_MAX=22*1024*1024 -DLINUX_MODULE_VERSION=\"1.20\" -DMODULE -DNET_DRIVER -DVMKERNEL_MODULE -DVMK_DEVKIT_HAS_API_VMKAPI_BASE -DVMK_DEVKIT_HAS_API_VMKAPI_DEVICE -DVMK_DEVKIT_HAS_API_VMKAPI_ISCSI -DVMK_DEVKIT_HAS_API_VMKAPI_NET -DVMK_DEVKIT_HAS_API_VMKAPI_SCSI -DVMK_DEVKIT_IS_DDK -DVMK_DEVKIT_USES_BINARY_COMPATIBLE_APIS -DVMK_DEVKIT_USES_PUBLIC_APIS -DVMNIX -DVMX86_RELEASE -DVMX86_SERVER -DVMX86_VPROBES -D_LINUX -D__KERNEL__ -D__VMKERNEL_MODULE__ -D__VMKERNEL__ -D__VMKLNX__ -D__VMK_GCC_BUG_ALIGNMENT_PADDING__ -D__VMWARE__ -Ivmkdrivers/src_9/drivers/net/atl1c -IBLD/build/version -IBLD/build/HEADERS/vmkdrivers-vmkernel/vmkernel64/release -Ivmkdrivers/src_9/include -Ivmkdrivers/src_9/include/vmklinux_9 -IBLD/build/HEADERS/CUR-9-vmkdrivers-asm-x64/vmkernel64/release -Ivmkdrivers/src_9/drivers/net -IBLD/build/HEADERS/vmkapi-current-all-public-bincomp/vmkernel64/release -include bora/vmkernel/distribute/push-hidden.h -include vmkdrivers/src_9/include/linux/autoconf.h -c -o BLD/build/vmkdriver-atl1c-CUR/release/vmkernel64/SUBDIRS/vmkdrivers/src_9/drivers/net/atl1c/atl1e_main.o vmkdrivers/src_9/drivers/net/atl1c/atl1e_main.c

$CC -fwrapv -fno-working-directory -g -ggdb3 -O2 -fno-strict-aliasing -Wall -Werror -Wstrict-prototypes -fPIE -falign-functions=4 -falign-jumps=4 -falign-loops=4 -ffreestanding -fno-common -fno-omit-frame-pointer -fno-strength-reduce -march=x86-64 -mcmodel=small -minline-all-stringops -mno-red-zone -nostartfiles -nostdlib --sysroot=/nowhere -Wno-error -Wdeclaration-after-statement -Wno-unused-value -Wno-pointer-sign -Wno-strict-prototypes -Wno-declaration-after-statement -Wno-declaration-after-statement -DCONFIG_COMPAT -DCONFIG_PROC_FS -DCPU=x86-64 -DDEBUG_STUB -DESX3_NETWORKING_NOT_DONE_YET -DGPLED_CODE -DKBUILD_MODNAME=\"atl1c\" -DLINUX_MODULE_AUX_HEAP_NAME=vmklnx_atl1c -DLINUX_MODULE_HEAP_INITIAL=1024*100 -DLINUX_MODULE_HEAP_MAX=1024*4096 -DLINUX_MODULE_HEAP_NAME=vmklnx_atl1c -DLINUX_MODULE_SKB_HEAP -DLINUX_MODULE_SKB_HEAP_INITIAL=512*1024 -DLINUX_MODULE_SKB_HEAP_MAX=22*1024*1024 -DLINUX_MODULE_VERSION=\"1.20\" -DMODULE -DNET_DRIVER -DVMKERNEL_MODULE -DVMK_DEVKIT_HAS_API_VMKAPI_BASE -DVMK_DEVKIT_HAS_API_VMKAPI_DEVICE -DVMK_DEVKIT_HAS_API_VMKAPI_ISCSI -DVMK_DEVKIT_HAS_API_VMKAPI_NET -DVMK_DEVKIT_HAS_API_VMKAPI_SCSI -DVMK_DEVKIT_IS_DDK -DVMK_DEVKIT_USES_BINARY_COMPATIBLE_APIS -DVMK_DEVKIT_USES_PUBLIC_APIS -DVMNIX -DVMX86_RELEASE -DVMX86_SERVER -DVMX86_VPROBES -D_LINUX -D__KERNEL__ -D__VMKERNEL_MODULE__ -D__VMKERNEL__ -D__VMKLNX__ -D__VMK_GCC_BUG_ALIGNMENT_PADDING__ -D__VMWARE__ -Ivmkdrivers/src_9/drivers/net/atl1c -IBLD/build/version -IBLD/build/HEADERS/vmkdrivers-vmkernel/vmkernel64/release -Ivmkdrivers/src_9/include -Ivmkdrivers/src_9/include/vmklinux_9 -IBLD/build/HEADERS/CUR-9-vmkdrivers-asm-x64/vmkernel64/release -Ivmkdrivers/src_9/drivers/net -IBLD/build/HEADERS/vmkapi-current-all-public-bincomp/vmkernel64/release -include bora/vmkernel/distribute/push-hidden.h -include vmkdrivers/src_9/include/linux/autoconf.h -c -o BLD/build/vmkdriver-atl1c-CUR/release/vmkernel64/SUBDIRS/vmkdrivers/src_9/drivers/net/atl1c/atl1e_param.o vmkdrivers/src_9/drivers/net/atl1c/atl1e_param.c

$CC -fwrapv -fno-working-directory -g -ggdb3 -O2 -fno-strict-aliasing -Wall -Werror -Wstrict-prototypes -fPIE -falign-functions=4 -falign-jumps=4 -falign-loops=4 -ffreestanding -fno-common -fno-omit-frame-pointer -fno-strength-reduce -march=x86-64 -mcmodel=small -minline-all-stringops -mno-red-zone -nostartfiles -nostdlib --sysroot=/nowhere -Wno-error -Wdeclaration-after-statement -Wno-unused-value -Wno-pointer-sign -Wno-strict-prototypes -Wno-declaration-after-statement -Wno-declaration-after-statement -DCONFIG_COMPAT -DCONFIG_PROC_FS -DCPU=x86-64 -DDEBUG_STUB -DESX3_NETWORKING_NOT_DONE_YET -DGPLED_CODE -DKBUILD_MODNAME=\"atl1c\" -DLINUX_MODULE_AUX_HEAP_NAME=vmklnx_atl1c -DLINUX_MODULE_HEAP_INITIAL=1024*100 -DLINUX_MODULE_HEAP_MAX=1024*4096 -DLINUX_MODULE_HEAP_NAME=vmklnx_atl1c -DLINUX_MODULE_SKB_HEAP -DLINUX_MODULE_SKB_HEAP_INITIAL=512*1024 -DLINUX_MODULE_SKB_HEAP_MAX=22*1024*1024 -DLINUX_MODULE_VERSION=\"1.20\" -DMODULE -DNET_DRIVER -DVMKERNEL_MODULE -DVMK_DEVKIT_HAS_API_VMKAPI_BASE -DVMK_DEVKIT_HAS_API_VMKAPI_DEVICE -DVMK_DEVKIT_HAS_API_VMKAPI_ISCSI -DVMK_DEVKIT_HAS_API_VMKAPI_NET -DVMK_DEVKIT_HAS_API_VMKAPI_SCSI -DVMK_DEVKIT_IS_DDK -DVMK_DEVKIT_USES_BINARY_COMPATIBLE_APIS -DVMK_DEVKIT_USES_PUBLIC_APIS -DVMNIX -DVMX86_RELEASE -DVMX86_SERVER -DVMX86_VPROBES -D_LINUX -D__KERNEL__ -D__VMKERNEL_MODULE__ -D__VMKERNEL__ -D__VMKLNX__ -D__VMK_GCC_BUG_ALIGNMENT_PADDING__ -D__VMWARE__ -Ivmkdrivers/src_9/drivers/net/atl1c -IBLD/build/version -IBLD/build/HEADERS/vmkdrivers-vmkernel/vmkernel64/release -Ivmkdrivers/src_9/include -Ivmkdrivers/src_9/include/vmklinux_9 -IBLD/build/HEADERS/CUR-9-vmkdrivers-asm-x64/vmkernel64/release -Ivmkdrivers/src_9/drivers/net -IBLD/build/HEADERS/vmkapi-current-all-public-bincomp/vmkernel64/release -include bora/vmkernel/distribute/push-hidden.h -include vmkdrivers/src_9/include/linux/autoconf.h -c -o BLD/build/vmkdriver-atl1c-CUR/release/vmkernel64/SUBDIRS/vmkdrivers/src_9/drivers/net/atl1c/kcompat.o vmkdrivers/src_9/drivers/net/atl1c/kcompat.c

$CC -fwrapv -fno-working-directory -g -ggdb3 -O2 -fno-strict-aliasing -Wall -Werror -Wstrict-prototypes -fPIE -falign-functions=4 -falign-jumps=4 -falign-loops=4 -ffreestanding -fno-common -fno-omit-frame-pointer -fno-strength-reduce -march=x86-64 -mcmodel=small -minline-all-stringops -mno-red-zone -nostartfiles -nostdlib --sysroot=/nowhere -Wno-error -Wdeclaration-after-statement -Wno-unused-value -Wno-pointer-sign -Wno-strict-prototypes -Wno-declaration-after-statement -Wno-declaration-after-statement -DCONFIG_COMPAT -DCONFIG_PROC_FS -DCPU=x86-64 -DDEBUG_STUB -DESX3_NETWORKING_NOT_DONE_YET -DGPLED_CODE -DKBUILD_MODNAME=\"atl1c\" -DLINUX_MODULE_AUX_HEAP_NAME=vmklnx_atl1c -DLINUX_MODULE_HEAP_INITIAL=1024*100 -DLINUX_MODULE_HEAP_MAX=1024*4096 -DLINUX_MODULE_HEAP_NAME=vmklnx_atl1c -DLINUX_MODULE_SKB_HEAP -DLINUX_MODULE_SKB_HEAP_INITIAL=512*1024 -DLINUX_MODULE_SKB_HEAP_MAX=22*1024*1024 -DLINUX_MODULE_VERSION=\"1.20\" -DMODULE -DNET_DRIVER -DVMKERNEL_MODULE -DVMK_DEVKIT_HAS_API_VMKAPI_BASE -DVMK_DEVKIT_HAS_API_VMKAPI_DEVICE -DVMK_DEVKIT_HAS_API_VMKAPI_ISCSI -DVMK_DEVKIT_HAS_API_VMKAPI_NET -DVMK_DEVKIT_HAS_API_VMKAPI_SCSI -DVMK_DEVKIT_IS_DDK -DVMK_DEVKIT_USES_BINARY_COMPATIBLE_APIS -DVMK_DEVKIT_USES_PUBLIC_APIS -DVMNIX -DVMX86_RELEASE -DVMX86_SERVER -DVMX86_VPROBES -D_LINUX -D__KERNEL__ -D__VMKERNEL_MODULE__ -D__VMKERNEL__ -D__VMKLNX__ -D__VMK_GCC_BUG_ALIGNMENT_PADDING__ -D__VMWARE__ -Ivmkdrivers/src_9/drivers/net/atl1c -IBLD/build/version -IBLD/build/HEADERS/vmkdrivers-vmkernel/vmkernel64/release -Ivmkdrivers/src_9/include -Ivmkdrivers/src_9/include/vmklinux_9 -IBLD/build/HEADERS/CUR-9-vmkdrivers-asm-x64/vmkernel64/release -Ivmkdrivers/src_9/drivers/net -IBLD/build/HEADERS/vmkapi-current-all-public-bincomp/vmkernel64/release -include bora/vmkernel/distribute/push-hidden.h -include vmkdrivers/src_9/include/linux/autoconf.h -c -o BLD/build/vmkdriver-atl1c-CUR/release/vmkernel64/SUBDIRS/vmkdrivers/src_9/drivers/net/atl1c/kcompat_ethtool.o vmkdrivers/src_9/drivers/net/atl1c/kcompat_ethtool.c

$CC -fwrapv -fno-working-directory -g -ggdb3 -O2 -fno-strict-aliasing -Wall -Werror -Wstrict-prototypes -fPIE -falign-functions=4 -falign-jumps=4 -falign-loops=4 -ffreestanding -fno-common -fno-omit-frame-pointer -fno-strength-reduce -march=x86-64 -mcmodel=small -minline-all-stringops -mno-red-zone -nostartfiles -nostdlib --sysroot=/nowhere -Wno-error -Wdeclaration-after-statement -Wno-unused-value -Wno-pointer-sign -Wno-strict-prototypes -Wno-declaration-after-statement -Wno-declaration-after-statement -DCONFIG_COMPAT -DCONFIG_PROC_FS -DCPU=x86-64 -DDEBUG_STUB -DESX3_NETWORKING_NOT_DONE_YET -DGPLED_CODE -DKBUILD_MODNAME=\"atl1c\" -DLINUX_MODULE_AUX_HEAP_NAME=vmklnx_atl1c -DLINUX_MODULE_HEAP_INITIAL=1024*100 -DLINUX_MODULE_HEAP_MAX=1024*4096 -DLINUX_MODULE_HEAP_NAME=vmklnx_atl1c -DLINUX_MODULE_SKB_HEAP -DLINUX_MODULE_SKB_HEAP_INITIAL=512*1024 -DLINUX_MODULE_SKB_HEAP_MAX=22*1024*1024 -DLINUX_MODULE_VERSION=\"1.20\" -DMODULE -DNET_DRIVER -DVMKERNEL_MODULE -DVMK_DEVKIT_HAS_API_VMKAPI_BASE -DVMK_DEVKIT_HAS_API_VMKAPI_DEVICE -DVMK_DEVKIT_HAS_API_VMKAPI_ISCSI -DVMK_DEVKIT_HAS_API_VMKAPI_NET -DVMK_DEVKIT_HAS_API_VMKAPI_SCSI -DVMK_DEVKIT_IS_DDK -DVMK_DEVKIT_USES_BINARY_COMPATIBLE_APIS -DVMK_DEVKIT_USES_PUBLIC_APIS -DVMNIX -DVMX86_RELEASE -DVMX86_SERVER -DVMX86_VPROBES -D_LINUX -D__KERNEL__ -D__VMKERNEL_MODULE__ -D__VMKERNEL__ -D__VMKLNX__ -D__VMK_GCC_BUG_ALIGNMENT_PADDING__ -D__VMWARE__ -Ivmkdrivers/src_9/drivers/net/atl1c -IBLD/build/version -IBLD/build/HEADERS/vmkdrivers-vmkernel/vmkernel64/release -Ivmkdrivers/src_9/include -Ivmkdrivers/src_9/include/vmklinux_9 -IBLD/build/HEADERS/CUR-9-vmkdrivers-asm-x64/vmkernel64/release -Ivmkdrivers/src_9/drivers/net -IBLD/build/HEADERS/vmkapi-current-all-public-bincomp/vmkernel64/release -include bora/vmkernel/distribute/push-hidden.h -include vmkdrivers/src_9/include/linux/autoconf.h -c -o BLD/build/vmkdriver-atl1c-CUR/release/vmkernel64/SUBDIRS/vmkdrivers/src_9/common/vmklinux_module.o vmkdrivers/src_9/common/vmklinux_module.c

$LD -v -r -o BLD/build/vmkdriver-atl1c-CUR/release/vmkernel64/atl1c --whole-archive BLD/build/vmkdriver-atl1c-CUR/release/vmkernel64/SUBDIRS/vmkdrivers/src_9/drivers/net/atl1c/atl1c_main.o BLD/build/vmkdriver-atl1c-CUR/release/vmkernel64/SUBDIRS/vmkdrivers/src_9/drivers/net/atl1c/at_common_main.o BLD/build/vmkdriver-atl1c-CUR/release/vmkernel64/SUBDIRS/vmkdrivers/src_9/drivers/net/atl1c/atl1c_ethtool.o BLD/build/vmkdriver-atl1c-CUR/release/vmkernel64/SUBDIRS/vmkdrivers/src_9/drivers/net/atl1c/atl1c_hw.o BLD/build/vmkdriver-atl1c-CUR/release/vmkernel64/SUBDIRS/vmkdrivers/src_9/drivers/net/atl1c/atl1c_param.o BLD/build/vmkdriver-atl1c-CUR/release/vmkernel64/SUBDIRS/vmkdrivers/src_9/drivers/net/atl1c/atl1e_ethtool.o BLD/build/vmkdriver-atl1c-CUR/release/vmkernel64/SUBDIRS/vmkdrivers/src_9/drivers/net/atl1c/atl1e_hw.o BLD/build/vmkdriver-atl1c-CUR/release/vmkernel64/SUBDIRS/vmkdrivers/src_9/drivers/net/atl1c/atl1e_main.o BLD/build/vmkdriver-atl1c-CUR/release/vmkernel64/SUBDIRS/vmkdrivers/src_9/drivers/net/atl1c/atl1e_param.o BLD/build/vmkdriver-atl1c-CUR/release/vmkernel64/SUBDIRS/vmkdrivers/src_9/drivers/net/atl1c/kcompat.o BLD/build/vmkdriver-atl1c-CUR/release/vmkernel64/SUBDIRS/vmkdrivers/src_9/drivers/net/atl1c/kcompat_ethtool.o BLD/build/vmkdriver-atl1c-CUR/release/vmkernel64/SUBDIRS/vmkdrivers/src_9/common/vmklinux_module.o



Getting excited to try and invoke build-atl1c.sh and see what happens? I want to leave you on a happy note, so I'm not going to tell you what happens if you do that… :-)

When time permits I will continue this write-up as best I can.


Last edited by trickstarter on Sun Mar 24, 2013 4:21 pm, edited 4 times in total.



Wed Mar 13, 2013 1:06 pm
Profile

Joined: Sun Mar 24, 2013 10:36 am
Posts: 20
Reply with quote
Post Re: ESXI 5.x Drivers Part 2: Preparing to compile
I just created an account to let you know how much I appreciate these posts! I am having a HELL of a time trying to compile sunhme source driver files into esxi 5.1 and your guide has been very helpful. I cannot wait until the next chapter ;)

Thanks again


Sun Mar 24, 2013 10:41 am
Profile

Joined: Mon Jan 28, 2013 5:09 pm
Posts: 100
Reply with quote
Post Re: ESXI 5.x Drivers Part 2: Preparing to compile
There was 1 mistake in these instructions and they have since been corrected, however if you already went through it and you are getting an erorr during linking about failing to find vmklinux_module.o, then please add in the following to the build script before the $LD call:

Code:
$CC -fwrapv -fno-working-directory -g -ggdb3 -O2 -fno-strict-aliasing -Wall -Werror -Wstrict-prototypes -fPIE -falign-functions=4 -falign-jumps=4 -falign-loops=4 -ffreestanding -fno-common -fno-omit-frame-pointer -fno-strength-reduce -march=x86-64 -mcmodel=small -minline-all-stringops -mno-red-zone -nostartfiles -nostdlib --sysroot=/nowhere -Wno-error -Wdeclaration-after-statement -Wno-unused-value -Wno-pointer-sign -Wno-strict-prototypes -Wno-declaration-after-statement -Wno-declaration-after-statement -DCONFIG_COMPAT -DCONFIG_PROC_FS -DCPU=x86-64 -DDEBUG_STUB -DESX3_NETWORKING_NOT_DONE_YET -DGPLED_CODE -DKBUILD_MODNAME=\"atl1c\" -DLINUX_MODULE_AUX_HEAP_NAME=vmklnx_atl1c -DLINUX_MODULE_HEAP_INITIAL=1024*100 -DLINUX_MODULE_HEAP_MAX=1024*4096 -DLINUX_MODULE_HEAP_NAME=vmklnx_atl1c -DLINUX_MODULE_SKB_HEAP -DLINUX_MODULE_SKB_HEAP_INITIAL=512*1024 -DLINUX_MODULE_SKB_HEAP_MAX=22*1024*1024 -DLINUX_MODULE_VERSION=\"1.20\" -DMODULE -DNET_DRIVER -DVMKERNEL_MODULE -DVMK_DEVKIT_HAS_API_VMKAPI_BASE -DVMK_DEVKIT_HAS_API_VMKAPI_DEVICE -DVMK_DEVKIT_HAS_API_VMKAPI_ISCSI -DVMK_DEVKIT_HAS_API_VMKAPI_NET -DVMK_DEVKIT_HAS_API_VMKAPI_SCSI -DVMK_DEVKIT_IS_DDK -DVMK_DEVKIT_USES_BINARY_COMPATIBLE_APIS -DVMK_DEVKIT_USES_PUBLIC_APIS -DVMNIX -DVMX86_RELEASE -DVMX86_SERVER -DVMX86_VPROBES -D_LINUX -D__KERNEL__ -D__VMKERNEL_MODULE__ -D__VMKERNEL__ -D__VMKLNX__ -D__VMK_GCC_BUG_ALIGNMENT_PADDING__ -D__VMWARE__ -Ivmkdrivers/src_9/drivers/net/atl1c -IBLD/build/version -IBLD/build/HEADERS/vmkdrivers-vmkernel/vmkernel64/release -Ivmkdrivers/src_9/include -Ivmkdrivers/src_9/include/vmklinux_9 -IBLD/build/HEADERS/CUR-9-vmkdrivers-asm-x64/vmkernel64/release -Ivmkdrivers/src_9/drivers/net -IBLD/build/HEADERS/vmkapi-current-all-public-bincomp/vmkernel64/release -include bora/vmkernel/distribute/push-hidden.h -include vmkdrivers/src_9/include/linux/autoconf.h -c -o BLD/build/vmkdriver-atl1c-CUR/release/vmkernel64/SUBDIRS/vmkdrivers/src_9/common/vmklinux_module.o vmkdrivers/src_9/common/vmklinux_module.c


Sun Mar 24, 2013 4:24 pm
Profile

Joined: Wed May 29, 2013 7:10 pm
Posts: 4
Reply with quote
Post Re: ESXI 5.x Drivers Part 2: Preparing to compile
This can be useful for those who prefer makefiles instead of the .sh. Here's the file I used to build a net-e100 driver for the intel 8255x family NICs.
It can be modified to suit other drivers, just unpack it under /home/build/vsphere/vmkdrivers-gpl and type:
Code:
make -f Makefile.net-e100

Hope it helps.


Attachments:
Makefile.net-e100.gz [2.32 KiB]
Downloaded 386 times
Fri Jun 14, 2013 8:39 am
Profile

Joined: Thu Aug 29, 2013 5:26 am
Posts: 2
Reply with quote
Post Re: ESXI 5.x Drivers Part 2: Preparing to compile
Hi

Thank you so much for this post. Unfortunately I couldn't make it work. Maybe you give me some pointers in the right direction? Please... Pretty please?

In short, i'm trying to get a Realtek 8111G adapter working in ESXi 5.X. It's in the 8168 family... With the drivers currently in use in esxi, the adapters are identified as r8168's, but they dont forward any traffic.

I've used the drivers found here: http://152.104.125.41/downloads/downloa ... wn=false#2

(Desc: LINUX driver for kernel 3.x and 2.6.x and 2.4.x Version: 8.036.00) (i've attached the file to this post)

Since there is already a folder called r8186 under /vmkdrivers/src_9/drivers/net/ i thought I could just replace the files with the new ones. r8168_n.c, r8168_asf.h etc. But when i run ./build-vmkdrivers.sh it gives me all sorts of errors.

Do you know what to do?


Attachments:
r8168-8.036.00.tar.bz2 [69.39 KiB]
Downloaded 230 times
Thu Aug 29, 2013 5:39 am
Profile

Joined: Thu Aug 29, 2013 5:26 am
Posts: 2
Reply with quote
Post Re: ESXI 5.x Drivers Part 2: Preparing to compile
Hi

Thank you so much for this post. Unfortunately I couldn't make it work. Maybe you give me some pointers in the right direction? Please... Pretty please?

In short, i'm trying to get a Realtek 8111G adapter working in ESXi 5.X. It's in the 8168 family... With the drivers currently in use in esxi, the adapters are identified as r8168's, but they dont forward any traffic.

I've used the drivers found here: http://152.104.125.41/downloads/downloa ... wn=false#2

(Desc: LINUX driver for kernel 3.x and 2.6.x and 2.4.x Version: 8.036.00) (i've attached the file to this post)

Since there is already a folder called r8186 under /vmkdrivers/src_9/drivers/net/ i thought I could just replace the files with the new ones. r8168_n.c, r8168_asf.h etc. But when i run ./build-vmkdrivers.sh it gives me all sorts of errors.

Do you know what to do?


Attachments:
r8168-8.036.00.tar.bz2 [69.39 KiB]
Downloaded 214 times
Thu Aug 29, 2013 5:57 am
Profile

Joined: Sat Aug 31, 2013 5:03 am
Posts: 1
Reply with quote
 Re: ESXI 5.x Drivers Part 2: Preparing to compile
Your 2 guides work perfect.

Unfortunately, compiling drivers myself for the e1000e fails.

Here are the actual sources from Intel:
http://sourceforge.net/projects/e1000/f ... le/2.4.14/

Building other drivers rushes like a charm, but it seems, this driver is only buildable from its own makefile...?

Anybody interested to have a look?
This driver solves a lot of ESXi problems in the new 5.x versions...
(an older version is still available, but not with it's corresponding sources, just binary...)


Greetings


Sat Aug 31, 2013 5:08 am
Profile

Joined: Tue Nov 11, 2014 6:50 am
Posts: 1
Reply with quote
Post Re: ESXI 5.x Drivers Part 2: Preparing to compile
Excellent post. I tried it as you explained and everything worked :).

However I tried to compile a customized version of the vmci driver (for ESX 5.1u2) but I realized that to compile as "VMKERNEL" it uses headers that are not available in the open source code provided by vmware. Do you know if there is a way to do that event if it is not officially supported?


Tue Nov 11, 2014 7:04 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 8 posts ] 

Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.