Wednesday, 16 May 2012

Raspberry Pi Progress

In my last post I had issues with getting the kernel headers installed. I took another look today and spotted that there were suspiciously few items in the github clone on my SD card. It turned out that my SD card was full!


When creating the SD card I failed to spot the optional step to resize the root partition. I wasn't entirely convinced by the steps on the wiki as it talks about deleting the swap partition and doesn't appear to recreate it. After a bit of browsing I used the following process.

Resizing the root partition

Firstly, to be able to run gparted (next step) you need to set the root password:

sudo passwd root

Next I moved the swap partition to the end of the SD card:

Launch gparted from within the GUI (under the Preferences menu), select the swap partition, Partition -> Resize/Move. It is possible to just drag the swap partition to the end of the SD card and apply the changes. After a system reboot there is plenty of empty space beyond the end of the root partition.

Now I can resize the root partition using the instructions in the wiki:

Here is my fdisk output before I made any changes:


sudo fdisk -cu /dev/mmcblk0
  • p to see the current start of the main partition
  • d, 2 to delete the main partition
  • n, p, 2 to create a new primary partition
You need to enter the start of the partition. This MUST be the same start point as the old partition which was displayed in the first step. You also need to enter the end of the partition. This should be one less than the start of the swap partition.
  • w write the new partition table
Now you need to reboot:

sudo shutdown -r now

After the reboot you need to resize the actual partition. The resize2fs will resize your main partition to the new size from the changed partition table.

sudo resize2fs /dev/mmcblk0p2

Done! Here is my fdisk output after I made these changes:

Building Kernel Headers

With plenty of disk space available I was able to follow the instructions in my last post to build the kernel headers.

sudo apt-get install git
git clone --depth 1 https://github.com/raspberrypi/linux.git
sudo mv linux /lib/modules/3.1.9+/build
cd /lib/modules/3.1.9+/build
make mrproper
gzip -dc /proc/config.gz > .config
make modules_prepare

Building ar5523 driver

With the kernel headers in place I as able to get further with the driver build.


However this still failed a little further on with a different error message.


make[3]: Entering directory `/lib/modules/3.1.9+/build'

  WARNING: Symbol version dump /lib/modules/3.1.9+/build/Module.symvers
           is missing; modules will have no dependencies and modversions.

  CC [M]  /usr/src/modules/ar5523/ar5523.o
/usr/src/modules/ar5523/ar5523.c:873: warning: ‘struct ieee80211_if_init_conf’ declared inside parameter list
/usr/src/modules/ar5523/ar5523.c:873: warning: its scope is only this definition or declaration, which is probably not what you want
/usr/src/modules/ar5523/ar5523.c: In function ‘ar5523_add_interface’:
/usr/src/modules/ar5523/ar5523.c:885: error: dereferencing pointer to incomplete type
/usr/src/modules/ar5523/ar5523.c:888: error: dereferencing pointer to incomplete type
/usr/src/modules/ar5523/ar5523.c: At top level:
/usr/src/modules/ar5523/ar5523.c:898: warning: ‘struct ieee80211_if_init_conf’ declared inside parameter list
/usr/src/modules/ar5523/ar5523.c:1035: warning: initialization from incompatible pointer type
/usr/src/modules/ar5523/ar5523.c:1037: warning: initialization from incompatible pointer type
/usr/src/modules/ar5523/ar5523.c:1038: warning: initialization from incompatible pointer type
/usr/src/modules/ar5523/ar5523.c: In function ‘ar5523_free_tx_cmds’:
/usr/src/modules/ar5523/ar5523.c:1120: error: implicit declaration of function ‘usb_buffer_free’
/usr/src/modules/ar5523/ar5523.c: In function ‘ar5523_alloc_tx_cmds’:
/usr/src/modules/ar5523/ar5523.c:1140: error: implicit declaration of function ‘usb_buffer_alloc’
/usr/src/modules/ar5523/ar5523.c:1142: warning: assignment makes pointer from integer without a cast
/usr/src/modules/ar5523/ar5523.c: In function ‘ar5523_alloc_rx_cmds’:
/usr/src/modules/ar5523/ar5523.c:1195: warning: assignment makes pointer from integer without a cast

Setting up SSH

I extracted the error message in the last step by enabling ssh so that I could use WinSCP to transfer the error log back to my Windows PC:

sudo service ssh start