# [SOLVED] - No iwl3945-ucode ebuild?

## bwaldow

Hello,

I am installing latest Gentoo to an IBM/Lenovo T61 Core2Duo.  The wired adapter works, but the wireless adapter does not.

```
merom ~ # lspci

00:00.0 Host bridge: Intel Corporation Mobile PM965/GM965/GL960 Memory Controller Hub (rev 0c)

00:02.0 VGA compatible controller: Intel Corporation Mobile GM965/GL960 Integrated Graphics Controller (primary) (rev 0c)

00:02.1 Display controller: Intel Corporation Mobile GM965/GL960 Integrated Graphics Controller (secondary) (rev 0c)

00:19.0 Ethernet controller: Intel Corporation 82566MM Gigabit Network Connection (rev 03)

00:1a.0 USB controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #4 (rev 03)

00:1a.1 USB controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #5 (rev 03)

00:1a.7 USB controller: Intel Corporation 82801H (ICH8 Family) USB2 EHCI Controller #2 (rev 03)

00:1b.0 Audio device: Intel Corporation 82801H (ICH8 Family) HD Audio Controller (rev 03)

00:1c.0 PCI bridge: Intel Corporation 82801H (ICH8 Family) PCI Express Port 1 (rev 03)

00:1c.1 PCI bridge: Intel Corporation 82801H (ICH8 Family) PCI Express Port 2 (rev 03)

00:1c.2 PCI bridge: Intel Corporation 82801H (ICH8 Family) PCI Express Port 3 (rev 03)

00:1c.3 PCI bridge: Intel Corporation 82801H (ICH8 Family) PCI Express Port 4 (rev 03)

00:1c.4 PCI bridge: Intel Corporation 82801H (ICH8 Family) PCI Express Port 5 (rev 03)

00:1d.0 USB controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #1 (rev 03)

00:1d.1 USB controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #2 (rev 03)

00:1d.2 USB controller: Intel Corporation 82801H (ICH8 Family) USB UHCI Controller #3 (rev 03)

00:1d.7 USB controller: Intel Corporation 82801H (ICH8 Family) USB2 EHCI Controller #1 (rev 03)

00:1e.0 PCI bridge: Intel Corporation 82801 Mobile PCI Bridge (rev f3)

00:1f.0 ISA bridge: Intel Corporation 82801HEM (ICH8M-E) LPC Interface Controller (rev 03)

00:1f.1 IDE interface: Intel Corporation 82801HM/HEM (ICH8M/ICH8M-E) IDE Controller (rev 03)

00:1f.2 SATA controller: Intel Corporation 82801HM/HEM (ICH8M/ICH8M-E) SATA Controller [AHCI mode] (rev 03)

00:1f.3 SMBus: Intel Corporation 82801H (ICH8 Family) SMBus Controller (rev 03)

03:00.0 Network controller: Intel Corporation PRO/Wireless 3945ABG [Golan] Network Connection (rev 02)

15:00.0 CardBus bridge: Ricoh Co Ltd RL5c476 II (rev b6)
```

The 3945 adapter is configured as a module in the kernel:

```
merom ~ # grep 3945 /usr/src/linux/.config

CONFIG_IWL3945=m

# iwl3945 / iwl4965 Debugging Options
```

The module appears to load properly:

```
merom ~ # lsmod

Module                  Size  Used by

snd_hda_codec_analog    84299  1 

iwl3945                98143  0 

iwlegacy              116020  1 iwl3945

mac80211              334825  2 iwl3945,iwlegacy

cfg80211              195766  3 iwl3945,iwlegacy,mac80211

snd_hda_intel          27073  0 

snd_hda_codec          89179  2 snd_hda_intel,snd_hda_codec_analog

snd_pcm                83733  2 snd_hda_codec,snd_hda_intel

snd_page_alloc          7909  2 snd_pcm,snd_hda_intel

snd_timer              20094  1 snd_pcm

thinkpad_acpi          77478  0 

snd                    63898  6 snd_timer,snd_pcm,snd_hda_codec,snd_hda_intel,thinkpad_acpi,snd_hda_codec_analog

rfkill                 17519  2 cfg80211,thinkpad_acpi
```

Dmesg shows the firmware is not loading (not surprising - read on, please):

```
merom ~ # dmesg | grep 3945

[    2.267135] iwl3945: Intel(R) PRO/Wireless 3945ABG/BG Network Connection driver for Linux, in-tree:ds

[    2.267135] iwl3945: Copyright(c) 2003-2011 Intel Corporation

[    2.330090] iwl3945 0000:03:00.0: Tunable channels: 11 802.11bg, 13 802.11a channels

[    2.330095] iwl3945 0000:03:00.0: Detected Intel Wireless WiFi Link 3945ABG

[    2.330245] iwl3945 0000:03:00.0: irq 49 for MSI/MSI-X

[    2.330812] ieee80211 phy0: Selected rate control algorithm 'iwl-3945-rs'

[    4.456066] iwl3945 0000:03:00.0: iwlwifi-3945-2.ucode firmware file req failed: -2

[    4.456335] iwl3945 0000:03:00.0: iwlwifi-3945-1.ucode firmware file req failed: -2

[    4.456344] iwl3945 0000:03:00.0: Could not read microcode: -2
```

Note the firmware and the module in the kernel are both prefixed with 'iwl'.  Portage has no firmware for an 'iwl3945':

```
merom ~ # find /usr/portage/ | grep iwl | grep ebuild

/usr/portage/sys-firmware/iwl2000-ucode/iwl2000-ucode-18.168.6.1.ebuild

/usr/portage/sys-firmware/iwl5000-ucode/iwl5000-ucode-8.83.5.1-r1.ebuild

/usr/portage/sys-firmware/iwl5000-ucode/iwl5000-ucode-8.24.2.12.ebuild

/usr/portage/sys-firmware/iwl1000-ucode/iwl1000-ucode-128.50.3.1.ebuild

/usr/portage/sys-firmware/iwl1000-ucode/iwl1000-ucode-39.31.5.1.ebuild

/usr/portage/sys-firmware/iwl6000-ucode/iwl6000-ucode-9.221.4.1.ebuild

/usr/portage/sys-firmware/iwl6050-ucode/iwl6050-ucode-41.28.5.1.ebuild

/usr/portage/sys-firmware/iwl6050-ucode/iwl6050-ucode-9.201.4.1.ebuild

/usr/portage/sys-firmware/iwl6030-ucode/iwl6030-ucode-17.168.5.2.ebuild

/usr/portage/sys-firmware/iwl6030-ucode/iwl6030-ucode-18.168.6.1.ebuild

/usr/portage/sys-firmware/iwl5150-ucode/iwl5150-ucode-8.24.2.2.ebuild

/usr/portage/sys-firmware/iwl6005-ucode/iwl6005-ucode-18.168.6.1.ebuild

/usr/portage/sys-firmware/iwl6005-ucode/iwl6005-ucode-17.168.5.3.ebuild

/usr/portage/sys-firmware/iwl2030-ucode/iwl2030-ucode-18.168.6.1.ebuild
```

The only 3945 listed is 'ipw':

```
merom ~ # find /usr/portage/ | grep 3945 | grep ebuild

/usr/portage/net-wireless/ipw3945-ucode/ipw3945-ucode-1.13.ebuild

/usr/portage/net-wireless/ipw3945-ucode/ipw3945-ucode-1.14.2.ebuild

/usr/portage/net-wireless/ipw3945/ipw3945-1.2.2-r1.ebuild

/usr/portage/net-wireless/ipw3945d/ipw3945d-1.7.22-r4.ebuild

/usr/portage/net-wireless/ipw3945d/ipw3945d-1.7.18.ebuild

/usr/portage/net-wireless/ipw3945d/ipw3945d-1.7.22-r5.ebuild

/usr/portage/net-wireless/ipw3945d/ipw3945d-1.7.22-r6.ebuild
```

I sync'ed today, and started the install only yesterday with the latest CD and sources.  Why can't I find the microcode ebuild for the 3945 adapter?

I do note that I can see and download the firmware from network repositories:

```
merom ~ # ls iwlwifi-3945-ucode-2.14.1.5.tgz 

iwlwifi-3945-ucode-2.14.1.5.tgz
```

... but there is no ebuild after 'emerge --sync'.  What is wrong with my understanding?

Thanks in advance.

make.conf:

```
merom ~ # cat /etc/portage/make.conf

CFLAGS="-O2 -pipe -march=core2"

CXXFLAGS="${CFLAGS}"

MAKEOPTS="-j3"

# WARNING: Changing your CHOST is not something that should be done lightly.

# Please consult http://www.gentoo.org/doc/en/change-chost.xml before changing.

CHOST="x86_64-pc-linux-gnu"

PORTAGE_TMPDIR="/tmp"

# These are the USE flags that were used in addition to what is provided by the

# profile used for building.

USE="X bindist mmx sse sse2 \

     keymap \

     -gnome -kde -minimal -qt4 dbus jpeg lock session startup-notification thunar udev \

     alsa \

     "

INPUT_DEVICES="evdev synaptics"

VIDEO_CARDS="intel"

GENTOO_MIRRORS="ftp://mirror.mcs.anl.gov/pub/gentoo/ ftp://ftp.gtlib.gatech.edu/pub/gentoo http://gentoo.osuosl.org/"

###GENTOO_MIRRORS="ftp://ftp.iinet.net.au/linux/Gentoo/ ftp://ftp.swin.edu.au/gentoo http://gentoo.osuosl.org/"

###GENTOO_MIRRORS="ftp://ftp.swin.edu.au/gentoo http://gentoo.osuosl.org/"

SYNC="rsync://rsync.au.gentoo.org/gentoo-portage"
```

PS I have experience from half a decade ago with Gentoo, but I'm not current.  If you need information, please don't assume I know how to get it (the way you want it reported).  As well as telling me you need more information, also point me to the place the shows me the 'Gentoo way' for providing it - I would appreciate that.

Cheers,

BretLast edited by bwaldow on Mon Apr 01, 2013 2:24 am; edited 1 time in total

----------

## DONAHUE

```
emerge linux-firmware
```

 particular package will be installed as /lib/firmware/iwlwifi-3945-2.ucode

----------

## bwaldow

 *DONAHUE wrote:*   

> 
> 
> ```
> emerge linux-firmware
> ```
> ...

 

Cheers,

Bret

----------

## Fitzcarraldo

If you want to avoid pulling in all the firmware files for all devices, and only actually have the relevant firmware file on your machine, see 

How to install the linux-firmware package in Gentoo.

----------

## miket

 *Fitzcarraldo wrote:*   

> If you want to avoid pulling in all the firmware files for all devices, and only actually have the relevant firmware file on your machine, see 
> 
> How to install the linux-firmware package in Gentoo.

 

I was really unhappy at the prospect of having to install tons of firmware blobs I didn't need--especially considering that the compressed tarball is about 15 megabytes long.  I saw no guidance about how to deal with linux-headers now that we've lost the separate header packages.  Finally I came upon this solution, but it still didn't solve one basic issue:  how do you determine which files you want to install without having first to install the whole shooting match first?  (Before you are able to access that list of files that Fitzcarraldo tells you how to get, you have to install the package first.  He installs then reinstalls with the saved configuration, but I wanted to go there directly.)

Well, I found a way around the dummy installation:  make your savedconfig list directly from the tarball.  First get the tarball:

```
emerge -f linux-firmware
```

Now make your initial file.  Note that I use the first line of the tar listing (the directory name) to get the length to strip off.  As you can see, the version of linux-firmware I got was 20130421.  Tab completion is your friend.

```
mkdir -p /etc/portage/savedconfig/sys-kernel

tar tJf /usr/portage/distfiles/linux-firmware-20130421.tar.xz | \

awk 'NR==1 {plen=length($0)+1} NR>1 { print "#" substr($0, plen)}' > /etc/portage/savedconfig/sys-kernel/linux-firmware-20130421
```

Note that this is really pretty much a one-liner.

Now add the savedconfig USE flag to sys-kernel/linux-firmware in your package.use, uncomment lines of /etc/portage/savedconfig/sys-kernel/linux-firmware-nnnnnnnn to suit and emerge linux-firmware.  Take a look at what Fitzcarraldo has to say about maintaining your installation, but know that you can get away with installing the package only once.

----------

