2

My WiFi was working perfectly in Ubuntu 16.04.4. I rebooted my laptop and after logging in, nm-applet did not show any WiFi AP. WiFi modem is up and running. But My nm-applet did not show anything.

But even then my WiFi is not working.

$ iwconfig gives

lo        no wireless extensions.

enp3s0    no wireless extensions.

My Kernel version: 4.4.0-116-generic


$ls /lib/modules/4.4.0-116-generic/updates/dkms/ gives

wl.ko

$ lspci -vvnn | grep -A 9 Network gives

02:00.0 Network controller [0280]: Broadcom Limited BCM43142 802.11b/g/n [14e4:4365] (rev 01)
    DeviceName: NAMI
    Subsystem: Hewlett-Packard Company BCM43142 802.11b/g/n [103c:804a]
    Control: I/O- Mem+ BusMaster- SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
    Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
    Interrupt: pin A routed to IRQ 3
    Region 0: Memory at f0c00000 (64-bit, non-prefetchable) [size=32K]
    Capabilities: <access denied>
    Kernel modules: bcma, wl

$ lshw -C network spits

*-network UNCLAIMED
   description: Network controller
   product: BCM43142 802.11b/g/n
   vendor: Broadcom Limited
   physical id: 0
   bus info: pci@0000:02:00.0
   version: 01
   width: 64 bits
   clock: 33MHz
   capabilities: pm msi pciexpress cap_list
   configuration: latency=0
   resources: memory:f0c00000-f0c07fff
*-network
   description: Ethernet interface
   product: RTL810xE PCI Express Fast Ethernet controller
   vendor: Realtek Semiconductor Co., Ltd.
   physical id: 0
   bus info: pci@0000:03:00.0
   logical name: enp3s0
   version: 07
   serial: fc:3f:db:d5:e7:d7
   size: 100Mbit/s
   capacity: 100Mbit/s
   width: 64 bits
   clock: 33MHz
   capabilities: pm msi pciexpress msix vpd bus_master cap_list ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd autonegotiation
   configuration: autonegotiation=on broadcast=yes driver=r8169 driverversion=2.3LK-NAPI duplex=full firmware=rtl8106e-1_0.0.1 06/29/12 ip=192.168.1.8 latency=0 link=yes multicast=yes port=MII speed=100Mbit/s
   resources: irq:32 ioport:2000(size=256) memory:f0b00000-f0b00fff memory:f0800000-f0803fff


$ sudo apt --reinstall bcmwl-kernel-source

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libqscintilla2-12v5 libqscintilla2-l10n libqt4-opengl linux-headers-4.4.0-119
  octave-info thermald
Use 'sudo apt autoremove' to remove them.
The following packages will be upgraded:
  bcmwl-kernel-source
1 upgraded, 0 newly installed, 0 to remove and 16 not upgraded.
Need to get 0 B/1,544 kB of archives.
After this operation, 51.2 kB of additional disk space will be used.
(Reading database ... 374783 files and directories currently installed.)
Preparing to unpack .../bcmwl-kernel-source_6.30.223.271+bdcom-0ubuntu1~1.2_amd64.deb ...
Removing all DKMS Modules
Done.
Unpacking bcmwl-kernel-source (6.30.223.271+bdcom-0ubuntu1~1.2) over (6.30.223.248+bdcom-0ubuntu8) ...
Setting up bcmwl-kernel-source (6.30.223.271+bdcom-0ubuntu1~1.2) ...
Loading new bcmwl-6.30.223.271+bdcom DKMS files...
Building only for 4.4.0-116-generic
Building for architecture x86_64
Building initial module for 4.4.0-116-generic
Done.

wl:
Running module version sanity check.
 - Original module
   - No original module exists within this kernel
 - Installation
   - Installing to /lib/modules/4.4.0-116-generic/updates/dkms/

depmod....

DKMS: install completed.
modprobe: ERROR: could not insert 'wl': Exec format error
update-initramfs: deferring update (trigger activated)
Processing triggers for shim-signed (1.33.1~16.04.1+13-0ubuntu2) ...
Secure Boot not enabled on this system.
Processing triggers for initramfs-tools (0.122ubuntu8.11) ...
update-initramfs: Generating /boot/initrd.img-4.4.0-116-generic

1 Answers1

1

I found the solution from this post. As mentioned in the post this is just a workaround not a solution for the problem. According to the post, there is a bug in loading the retpoline module magic. So what we do here is just load it no matter RETPOLINE Is available or not. This fixed the issue for me. Thank you chili555, for your assistance.

vim /usr/src/linux-headers-*/include/linux/vermagic.h

STEP 1 : Find the #ifdef RETPOLINE and comment it ( \\#ifdef RETPOLINE ) and add a line #if 1 below the commented line. The final file shoule look like the one given below and save the file.

#include <generated/utsrelease.h>

/* Simply sanity version stamp for modules. */
#ifdef CONFIG_SMP
#define MODULE_VERMAGIC_SMP "SMP "
#else
#define MODULE_VERMAGIC_SMP ""
#endif
#ifdef CONFIG_PREEMPT
#define MODULE_VERMAGIC_PREEMPT "preempt "
#else
#define MODULE_VERMAGIC_PREEMPT ""
#endif
#ifdef CONFIG_MODULE_UNLOAD
#define MODULE_VERMAGIC_MODULE_UNLOAD "mod_unload "
#else
#define MODULE_VERMAGIC_MODULE_UNLOAD ""
#endif
#ifdef CONFIG_MODVERSIONS
#define MODULE_VERMAGIC_MODVERSIONS "modversions "
#else
#define MODULE_VERMAGIC_MODVERSIONS ""
#endif
#ifndef MODULE_ARCH_VERMAGIC
#define MODULE_ARCH_VERMAGIC ""
#endif
//#ifdef RETPOLINE
#if 1
#define MODULE_VERMAGIC_RETPOLINE "retpoline "
#else
#define MODULE_VERMAGIC_RETPOLINE ""
#endif

#define VERMAGIC_STRING                     \
    UTS_RELEASE " "                         \
    MODULE_VERMAGIC_SMP MODULE_VERMAGIC_PREEMPT                 \
    MODULE_VERMAGIC_MODULE_UNLOAD MODULE_VERMAGIC_MODVERSIONS             \
    MODULE_ARCH_VERMAGIC                    \
    MODULE_VERMAGIC_RETPOLINE

STEP 2: Now reconfigure the bcmwl-kernel-source package sudo dpkg-reconfigure bcmwl-kernel-source.
STEP 3: Now restart the network manager sudo service network-manager restart.
STEP 4: Enjoy your WiFi :)