Difference between revisions of "Pi BoF"

From LCA2014 Delegate Wiki
Jump to: navigation, search
(Attendees)
(buildroot)
 
(4 intermediate revisions by 3 users not shown)
Line 20: Line 20:
 
* Gordon Stanton - (maybe with a Quad Core ARM dev board)
 
* Gordon Stanton - (maybe with a Quad Core ARM dev board)
 
* Msquared (I have a spare Pi setup to bring)
 
* Msquared (I have a spare Pi setup to bring)
 +
* cardre
 +
* Karl-Johan Karlsson, with a [http://shop.ciseco.co.uk/pi-lite-lots-of-leds-for-the-raspberry-pi-0805-red/ Pi-Lite red] LED array
 +
 +
== Links ==
 +
* I've got some [http://ogpc.com.au/wiki/ShuttlePi/Hardware Hardware Info]
 +
** [http://ogpc.com.au/wiki/ShuttlePi/Hardware/SD SD card info] (personal expirience only, alos see [http://elinux.org/RPi_SD_cards list of known good cards])
 +
* [http://www.raspberrypi.org/downloads NOOBS] download page. The simplest way to boot your Pi.
 +
* [http://scratch.mit.edu/ Scratch]. Sadly the latest version doesn't run on the Pi, but it's a great intro to programming including GPIO.
 +
* [https://github.com/yoyosamo/PiBell Wireless doorbell -> email] project. One of the Geeklings made this, with a little help...
 +
* [http://www.freetronics.com/collections/kits/products/experimenters-kit-for-arduino Arduino] + Pi = very simple and robust IO.
 +
 +
== buildroot ==
 +
 +
'''''UPDATE''''' [http://git.buildroot.net/buildroot/tree/board/raspberrypi/readme.txt 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
 +
output/images/:
 +
rootfs.tar  rpi-firmware  zImage
 +
 +
output/images/rpi-firmware:
 +
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.

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.

Attendees

Links

buildroot

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
output/images/:
rootfs.tar  rpi-firmware  zImage

output/images/rpi-firmware:
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.