stuff i had to do to get Raspberry Pi debian image working

with debian6-17-02-2012.zip

  • dd on Mac OS produced a non booting image with both the debian and archlinux .img files
  • fiddled a lot with the partition table on linux, could not manually generate a filesystem on linux which worked
  • gave up, used dd on Linux
  -> booted
  • HDMI output does not work with my Samsung 933HD
  • Used S-Video output to my plain old CRT TV
  • added a new config.txt on the FAT filesystem to put s-video output in PAL mode [sdtv_mode=2]
  -> no network
  • for some reason it remaps eth0 to a random ethX on boot most of the time
  • edited /etc/network/interfaces
    • it's not always eth7 that it gets remapped to, ended up with a config that tries to init eth{0-9}
pi@raspberrypi:~$ cat /etc/network/interfaces
# Used by ifup(8) and ifdown(8). See the interfaces(5) manpage or
# /usr/share/doc/ifupdown/examples for more information.

auto lo eth0
auto eth7
iface eth7 inet dhcp
iface lo inet loopback
iface eth0 inet dhcp

$ sudo /etc/init.d/networking restart
 -> yay, network!

Once you install Emacs (obviously a necessity) you have only 114M free if you used a 2G SD card.  Use a bigger one.  OK, I confess I uninstalled emacs.  'joe' is installed so at least that helps.

Java
  • Sun non-free debian package does not support ARM.  The ARM Sun embedded stuff is VERY non-free -> don't want to use that
  • sudo apt-get install icedtea-6-jre-cacao
    • leaves you 364K on the rootfs

Using a bigger SD card
  • Use Linux dd to put the image on an 8Gb card
  • still not done as the root partition is only 1.8 Gb and has the swap partition following it
dps@piccolo:~/Downloads/debian6-17-02-2012$ sudo fdisk /dev/sdb

WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
         switch off the mode (command 'c') and change display units to
         sectors (command 'u').

Command (m for help): p

Disk /dev/sdb: 8017 MB, 8017412096 bytes
4 heads, 32 sectors/track, 122336 cylinders
Units = cylinders of 128 * 512 = 65536 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0000cded

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1              17        1216       76800    c  W95 FAT32 (LBA)
/dev/sdb2            1233       26672     1628160   83  Linux
/dev/sdb3           26689       29744      195584   82  Linux swap / Solaris

  • delete the swap partition (fdisk, d, 3)
  • delete the ext4 partition (Linux) (fdisk, d, 2)
  • re-add a bigger ext4 partition (fdisk, n, 2, p, 1233, 119281 [122336 - (29744 - 26689)]
  • re-add a swap partition (fdisk, n, 3, p, 119286, default; t, 3, 82)
Command (m for help): p

Disk /dev/sdb: 8017 MB, 8017412096 bytes
4 heads, 32 sectors/track, 122336 cylinders
Units = cylinders of 128 * 512 = 65536 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0000cded

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1              17        1216       76800    c  W95 FAT32 (LBA)
/dev/sdb2            1233      119281     7555136   83  Linux
/dev/sdb3          119286      122336      195264   82  Linux swap / Solaris

  • Then  resizefs /dev/sdb2
dps@piccolo:~/Downloads/debian6-17-02-2012$ sudo resize2fs /dev/sdb2
resize2fs 1.41.11 (14-Mar-2010)
Filesystem at /dev/sdb2 is mounted on /media/79c26528-4a85-43e6-bae0-e9c0d17adbbd; on-line resizing required
old desc_blocks = 1, new_desc_blocks = 1
Performing an on-line resize of /dev/sdb2 to 1572880 (4k) blocks.
The filesystem on /dev/sdb2 is now 1572880 blocks long.

dps@piccolo:~/Downloads/debian6-17-02-2012$ df -h
/dev/sdb2             6.0G  1.3G  4.4G  22% /media/79c26528-4a85-43e6-bae0-e9c0d17adbbd


Now you have a useful SD card to install new packages on!


Getting Arduino on Rasp Pi  Still working on this... 
You may not care about this, but I did

sudo apt-get install arduino

Gets you the Arduino IDE and all its dependencies (incl open-jdk, gcc-avr etc) but when Arduino UNO is connected, you don't get a USB TTY port.  This is because the required kernel support is not present.

pi@raspberrypi:~$ sudo modprobe fdio_sio
FATAL: Module fdio_sio not found.
- installed module-assistant

...and looks like need to build the usb_serial, ftdi_sio and cdc-acm module(s) from source
...need to figure out how to cross compile!
http://elinux.org/RPi_Kernel_Compilation

I did all the rest in cross-compilation.

Got the RaspPi kernel source... Salient bits from http://elinux.org/RPi_Kernel_Compilation
cp arch/arm/configs/bcmrpi_cutdown_defconfig .config
make ARCH=arm CROSS_COMPILE=/usr/bin/arm-linux-gnueabi- oldconfig
make ARCH=arm CROSS_COMPILE=/usr/bin/arm-linux-gnueabi- -k -j 3 modules

I've put compiled versions of all the Linux Kernel modules built for RaspPi at http://blog.davidsingleton.org/static/rpi_kernel_modules.zip

But..
pi@raspberrypi:/lib/modules/3.1.9+/kernel/drivers/usb/serial$ sudo insmod ftdi_sio.ko 
insmod: error inserting 'ftdi_sio.ko': -1 Invalid module format
pi@raspberrypi:/lib/modules/3.1.9+/kernel/drivers/usb/serial$ dmesg | tail
...
ftdi_sio: disagrees about version of symbol module_layout

Which suggests I need to use my own built version of the kernel itself...
FAIL - I can't get my own kernel to boot, so reverted back to making matching .ko s

Note, even the usbserial.ko module which is IN the kernel_emergency.img in this distribution fails to load in this kernel with 
insmod: error inserting 'usbserial.ko': -1 Invalid module format
usbserial: disagrees about version of symbol module_layout

So, in /proc/config.gz is the original config... rebuilding

and, with the original config...
pi@raspberrypi:~/mods$ sudo insmod -f drivers/usb/serial/usbserial.ko 
insmod: error inserting 'drivers/usb/serial/usbserial.ko': -1 Invalid module format
pi@raspberrypi:~/mods$ dmesg | tail -n 1
usbserial: no symbol version for module_layout


Completely rebuilt kernel (first) and then modules:
pi@raspberrypi:~/mods$ sudo insmod drivers/usb/serial/usbserial.ko 
pi@raspberrypi:~/mods$ sudo insmod drivers/usb/serial/ftdi_sio.ko 

whoop whoop!

pi@raspberrypi:~/mods$ cat /proc/modules 
ftdi_sio 26320 0 - Live 0xbf024000
usbserial 19956 1 ftdi_sio, Live 0xbf01c000
fuse 49028 1 - Live 0xbf00d000
evdev 6404 5 - Live 0xbf008000
hid_apple 3952 0 - Live 0xbf000000

Comments