Repository navigation
Buildroot
Hello in subsection of Buildroot!
There is none. You just clone official git repository into some arbitrary location. Best in your home folder.
In order to use Buildroot, some software has to be already installed on the host system (see list in Buildroot documentation). On Ubuntu Linux you only need to install package
libncurses5-devandgitusingapt-get.
You clone buildroot with git command:
$ git clone git://git.buildroot.net/buildroot
First you cd into buildroot directory and in order to use it configuration utility has to be build
$ make menuconfig
Config utility can now be used to set target properties. When target is configured as it should be, .config file will be saved into buildroot directory. This file serves as main file where your settings are stored. You can also save configuration in your own file, which can be opened with make <your-file-name>
Now to build image files, just run
$ make
from buildroot directory and go for a cup of coffee ....
To be able to use your RaspberryPi board with the images generated by Buildroot, you have to choose whether you will use:
- Volatile rootfs in RAM (the rootfs is an initramfs) or
- Persistent rootfs on the SDCard
Also, a good source of information is http://elinux.org/R-Pi_Hub
The raspberrypi_defconfig configuration is a minimal configuration with all that is required to bring the Raspberry Pi. You should base your work on this defconfig:
$ make raspberrypi_defconfig
If you want to use a persistent rootfs, skip to "Build the rootfs", below.
For a volatile rootfs, you have to slightly adjust the configuration:
$ make menuconfig
- Select "Filesystem images"
- Select "initial RAM filesystem linked into linux kernel"
You may also deselect "tar the root filesystem".
Note: you will need to have access to the network, since Buildroot will download the packages' sources.
You may now build your rootfs with:
$ make
(This may take a while; consider getting yourself a coffee ;-) )
After building, you should obtain this tree:
output/images/
+-- rootfs.tar
+-- rpi-firmware
| +-- bootcode.bin
| +-- config.txt
| +-- fixup_cd.dat
| +-- fixup.dat
| +-- start_cd.elf
| `-- start.elf
`-- zImage
Note for Volatile: rootfs.tar will only be there if you kept "tar the root filesystem" option selected in "Filesystem images".
For more information, visit http://elinux.org/RPi_Advanced_Setup#Advanced_SD_card_setup
In summary, your SDCard must have first partition in fat32 and marked bootable.
Create the required partitions:
- for a persistent rootfs, 10MiB is enough memory for the boot fat32 partition, and a second partition is required for the root filesystem
- for a volatile rootfs, 50MiB is required for the boot fat32 partition
Note: You can create any number of partitions you desire, the only requirement is that the first partition must be using fat32 and be bootable.
Mount the partitions (adjust 'sdX' to match your SDcard device):
$ sudo mount /dev/sdX1 /mnt/mountpointboot
$ sudo mount /dev/sdX2 /mnt/mountpointroot (only for persistent rootfs)
At the root of the boot partition, the RaspberryPi must find the following files:
- bootcode.bin
- config.txt
- fixup.dat
- start.elf
- zImage
For example:
$ cp output/images/rpi-firmware/* /mnt/mountpointboot
$ cp output/images/zImage /mnt/mountpointboot
Note: The kernel image file name is defined in config.txt like this: kernel=zImage
you use a volatile rootfs, Skip to "Finish", below. For a persistent rootfs, there are further steps to do.
Extract (as root!) the contents of the rootfs.tar archive into the second partition you created above:
$ sudo tar xf rootfs.tar -C /mnt/mountpointroot
Unmount all the partitions:
$ sudo umount /mnt/mountpointboot
$ sudo umount /mnt/mountpointroot (only for persistent rootfs)
And eject your SDcard from your computer SDcard reader.
Insert the SDcard into your Raspberry Pi, and power it up. Your new system should come up, now.