amzn / amzn-drivers

Official AWS drivers repository for Elastic Network Adapter (ENA) and Elastic Fabric Adapter (EFA)
457 stars 176 forks source link

cannot build drivers #67

Closed cristiansavaro closed 6 years ago

cristiansavaro commented 6 years ago

I am trying to build the drivers for oracle 3.10.0-862.el7.x86_64 kernel. Here is the error i get for 1.5.0 , 1.5.1 and 1.5.2 :

+ echo 'Building for kernel: 3.10.0-862.el7.x86_64 flavors: '\''default'\'''
Building for kernel: 3.10.0-862.el7.x86_64 flavors: 'default'
+ echo 'Build var: kmodtool = /root/amzn-drivers/kernel/linux/rpm/kmodtool'
Build var: kmodtool = /root/amzn-drivers/kernel/linux/rpm/kmodtool
+ echo 'Build var: kverrel = 3.10.0-862.el7.x86_64'
Build var: kverrel = 3.10.0-862.el7.x86_64
+ for flavor in default
+ rm -rf obj/default
+ cp -r source obj/default
+ symvers=source/Module.symvers-x86_64
+ '[' -e source/Module.symvers-x86_64 ']'
++ '[' default = default ']'
+ make -C /usr/src/kernels/3.10.0-862.el7.x86_64 M=/root/amzn-drivers/kernel/linux/rpm/build/ena-1.5.1/obj/default/kernel/linux/ena 'NOSTDINC_FLAGS=-I /root/amzn-drivers/kernel/linux/rpm/build/ena-1.5.1/obj/default/include'
make[1]: Entering directory `/usr/src/kernels/3.10.0-862.el7.x86_64'
  LD      /root/amzn-drivers/kernel/linux/rpm/build/ena-1.5.1/obj/default/kernel/linux/ena/built-in.o
  CC [M]  /root/amzn-drivers/kernel/linux/rpm/build/ena-1.5.1/obj/default/kernel/linux/ena/ena_netdev.o
In file included from /root/amzn-drivers/kernel/linux/rpm/build/ena-1.5.1/obj/default/kernel/linux/ena/ena_netdev.h:44:0,
                 from /root/amzn-drivers/kernel/linux/rpm/build/ena-1.5.1/obj/default/kernel/linux/ena/ena_netdev.c:53:
/root/amzn-drivers/kernel/linux/rpm/build/ena-1.5.1/obj/default/kernel/linux/ena/kcompat.h:414:6: error: nested redefinition of 'enum pkt_hash_types'
 enum pkt_hash_types {
      ^
compilation terminated due to -Wfatal-errors.
make[2]: *** [/root/amzn-drivers/kernel/linux/rpm/build/ena-1.5.1/obj/default/kernel/linux/ena/ena_netdev.o] Error 1
make[1]: *** [_module_/root/amzn-drivers/kernel/linux/rpm/build/ena-1.5.1/obj/default/kernel/linux/ena] Error 2
make[1]: Leaving directory `/usr/src/kernels/3.10.0-862.el7.x86_64'
error: Bad exit status from /var/tmp/rpm-tmp.i4sc4a (%build)
akiyano commented 6 years ago

Hi @cristiansavaro,

This is the same as https://github.com/amzn/amzn-drivers/issues/64 Please use the same patch I provided there:
0001-Compilation-temporary-fix-for-RHEL7.5-compilation-er.patch.txt A fix will be included in the next release.

Regards, Arthur

cristiansavaro commented 6 years ago

@akiyano thanks. i will try this patch today.

cristiansavaro commented 6 years ago

the patch is successful but the error persists.

akiyano commented 6 years ago

Hi @cristiansavaro ,

I've tested this patch on the kernel version you have. I suggest we continue this discussion offline. Please contact me via email - akiyano@amazon.com

Best regards, Arthur

cristiansavaro commented 6 years ago

After discussing offline with @akiyano i was able to put together a script that handles the patching, the build process and auto-loading of the module at boot time, using the above mentioned patch :

yum -y install gcc make rpm-build git
yum -y install kernel-devel-$(uname -r)
cd /root
git clone https://github.com/amzn/amzn-drivers
curl -s https://path_to_patch/RHEL7.5-compilation.patch > /root/RHEL7.5-compilation.patch
cd /root/amzn-drivers
patch -p1 < ../RHEL7.5-compilation.patch
git tag -d ena_linux_1.5.2
git config --global user.email "your@email"
git config --global user.name "Your Name"
git add kernel/linux/ena/ena_netdev.c kernel/linux/ena/kcompat.h
git commit -m "added RHEL7.5-compilation.patch"
git tag ena_linux_1.5.2
cd /root/amzn-drivers/kernel/linux/rpm
make rpm
rpm -Uvh /root/amzn-drivers/kernel/linux/rpm/x86_64/kmod-ena*.rpm --force --nodeps
echo "ena" > /etc/modules-load.d/ena.conf
akiyano commented 6 years ago

Patching is no longer necessary, the fix is included in version 1.5.3.

petronazeh commented 6 years ago

guys i have note 3 n9005 htle i installed nethunter on aryamod rom modified stock touch wiz and i have mt7601 wifi adapter it shows lsusb that the adapter connected but when i set it up shows nothing so i must install drivers and compile my 3.4.111 nethuner kerenal so how i can run that adapter on my note

akiyano commented 6 years ago

Hi @petronazeh,

Here we deal with issues with the ENA driver. You are asking a question that is unrelated to us. We can't help you with that.

Arthur