Thursday, 31 May 2012

Raspberry Pi Kernel Image

At the end of my last post I needed a Debian Linux Image package. I posted on the forums but didn't get anywhere. A bit of googling turned up a couple of useful pages which talked about how to build a Debian Linux image package. Based on these pages I ran the following commands.
cd /lib/modules/3.1.9+/build
time make-kpkg kernel_image
This ended with an error:
arm-Linux-gnueabi-ld: not found
I ran the following command and spotted that there were some existing symlinks for other gnueabi tools:
ls -l  /usr/bin/arm-linux-gnueabi*
I therefore tried adding a symlink for ld. A couple of hours later the build failed and in the end (after several more multi hour builds) I needed all of these links:
sudo ln -s /usr/bin/ld /usr/bin/arm-linux-gnueabi-ld
sudo ln -s /usr/bin/ar /usr/bin/arm-linux-gnueabi-ar
sudo ln -s /usr/bin/nm /usr/bin/arm-linux-gnueabi-nm
sudo ln -s /usr/bin/objcopy /usr/bin/arm-linux-gnueabi-objcopy
sudo ln -s /usr/bin/objdump /usr/bin/arm-linux-gnueabi-objdump
sudo ln -s /usr/bin/strip /usr/bin/arm-linux-gnueabi-strip
With these links in place I cleaned the build point and rebuilt the kernel.
time fakeroot make-kpkg clean
gzip -dc /proc/config.gz > .config
time fakeroot make-kpkg kernel_image
Sadly after 6 hours of building the Debian package failed to be created due to permissions issues. Cue restarting with sudo.
time sudo fakeroot make-kpkg clean
gzip -dc /proc/config.gz > .config
time sudo fakeroot make-kpkg kernel_image
Attempting to install the resulting Debian package prompted a warning that I already had a kernel in /lib/modules/3.1.9+. I moved the existing kernel out of the way and installed the new kernel package. I then copied the kernel headers back into place.
sudo mv /lib/modules/3.1.9+ /lib/modules/3.1.9+.old
sudo dpkg -i linux-image-3.1.9+_3.1.9+-10.00.Custom_armel.deb
sudo cp -r /lib/modules/3.1.9+.old/build /lib/modules/3.1.9+/build
With all of this in place I could finally try again to build and install my ar5523 module.
cd ~/ar5523
sudo m-a a-i ar5523
sudo cp ../uath-ar5523.bin /usr/local/lib/firmware/
sudo modprobe ar5523
sudo shutdown -r now
After all this I plugged in my WG111T and sadly it didn't work! The following errors show up in dmesg while the WG111T is plugged in:
usb 1-1.3.4: new high speed USB device number 49 using dwc_otg
usb 1-1.3.4: New USB device found, idVendor=1385, idProduct=4250
usb 1-1.3.4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
usb 1-1.3.4: Product: WG111T
usb 1-1.3.4: Manufacturer: Atheros Communications Inc
usb 1-1.3.4: SerialNumber: 1.0
usb 1-1.3.4: MAC/BBP AR5523, RF AR2112
ieee80211 phy0: Selected rate control algorithm 'minstrel_ht'
DEBUG:handle_hc_chhltd_intr_dma:: XactErr without NYET/NAK/ACK

DEBUG:handle_hc_chhltd_intr_dma:: XactErr without NYET/NAK/ACK

DEBUG:handle_hc_chhltd_intr_dma:: XactErr without NYET/NAK/ACK

usb 1-1.3.4: timeout waiting for command reply
usb 1-1.3.4: could not send read command 07h
DEBUG:handle_hc_chhltd_intr_dma:: XactErr without NYET/NAK/ACK

DEBUG:handle_hc_chhltd_intr_dma:: XactErr without NYET/NAK/ACK

DEBUG:handle_hc_chhltd_intr_dma:: XactErr without NYET/NAK/ACK

usb 1-1.3.4: timeout waiting for command reply
usb 1-1.3.4: could not send read command 07h
DEBUG:handle_hc_chhltd_intr_dma:: XactErr without NYET/NAK/ACK

DEBUG:handle_hc_chhltd_intr_dma:: XactErr without NYET/NAK/ACK

usb 1-1.3.4: timeout waiting for command reply
usb 1-1.3.4: could not send read command 07h
DEBUG:handle_hc_chhltd_intr_dma:: XactErr with NYET/NAK/ACK

DEBUG:handle_hc_chhltd_intr_dma:: XactErr without NYET/NAK/ACK

DEBUG:handle_hc_chhltd_intr_dma:: XactErr without NYET/NAK/ACK

DEBUG:handle_hc_chhltd_intr_dma:: XactErr without NYET/NAK/ACK

DEBUG:handle_hc_chhltd_intr_dma:: XactErr without NYET/NAK/ACK

DEBUG:handle_hc_chhltd_intr_dma:: XactErr without NYET/NAK/ACK

DEBUG:handle_hc_chhltd_intr_dma:: XactErr without NYET/NAK/ACK

DEBUG:handle_hc_chhltd_intr_dma:: XactErr without NYET/NAK/ACK

DEBUG:handle_hc_chhltd_intr_dma:: XactErr without NYET/NAK/ACK

DEBUG:handle_hc_chhltd_intr_dma:: XactErr without NYET/NAK/ACK

DEBUG:handle_hc_chhltd_intr_dma:: XactErr without NYET/NAK/ACK

DEBUG:handle_hc_chhltd_intr_dma:: XactErr without NYET/NAK/ACK

DEBUG:handle_hc_chhltd_intr_dma:: XactErr without NYET/NAK/ACK