Difference between revisions of "Pi BoF"

From LCA2014 Delegate Wiki
Jump to: navigation, search

Latest revision as of 13:20, 10 January 2014

Tuesday 17:40 to 18:40 at ENG:LT1

In case you've been living under a rock, the Raspberry Pi is a credit-card sized computer that plugs into your TV and a keyboard.

I'll bring along some of my Geekology Raspberry Pi's, the USB TV tuner and whatever else I can cram into my luggage.

Drop by to have a look.




UPDATE Here are some much better instructions!

Quick-and-dirty instructions on how to make your own minimal RasPi SD-card using buildroot

Get buildroot:

$ git clone http://git.buildroot.net/git/buildroot.git

Set up the Raspberry Pi defaults and (optionally) modify (change defalt hostname, add ssh, etc.):

$ make help
$ make raspberrypi_defconfig
$ make xconfig

Build (this step takes a while):

$ make

You now have the output files:

$ ls output/images/ -R
rootfs.tar  rpi-firmware  zImage

bootcode.bin  cmdline.txt  config.txt  fixup.dat  start.elf

Partition and format an SD card:

$ sudo sudo fdisk -l /dev/mmcblk0

Disk /dev/mmcblk0: 31.9 GB, 31914983424 bytes
4 heads, 16 sectors/track, 973968 cylinders, total 62333952 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000c475a

        Device Boot      Start         End      Blocks   Id  System
/dev/mmcblk0p1   *        2048     2832031     1414992    e  W95 FAT16 (LBA)
/dev/mmcblk0p2         2832384    62328831    29748224   83  Linux

You can use gparted or the usual commandline tools to create/format/label these partitions.

Populate the /root partition:

$ sudo tar --extract --verbose --preserve --file ~sprinkmeier/GIT/buildroot/output/images/rootfs.tar --directory /media/buildROOT/

The tarball MUST be extracted as root to allow the proper ownership/permissions to be set up.

Copy the boot files into the FAT partition:

$ ls /media/EF65-BDC7/
bootcode.bin  cmdline.txt  config.txt  fixup.dat  start.elf  zImage
$ ls /media/buildROOT/
bin  etc   lib    linuxrc     media  opt   root  sbin  tmp  var
dev  home  lib32  lost+found  mnt    proc  run   sys   usr

As you can see you only need a few MB:

$ df
/dev/mmcblk0p2                     28G  179M   27G   1% /media/buildROOT
/dev/mmcblk0p1                    1.4G  5.3M  1.4G   1% /media/EF65-BDC7

The SD card should now be ready to boot.