mirror of
https://github.com/motioneye-project/motioneyeos.git
synced 2025-07-29 06:06:32 +00:00
rpi: improve documentation
Signed-off-by: Mathieu Benoit <mathieu.benoit@savoirfairelinux.com> [yann.morin.1998@free.fr: further improvements for readability and completeness] Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
This commit is contained in:
parent
856294dedf
commit
7f02c73f8d
@ -4,124 +4,125 @@ Intro
|
|||||||
=====
|
=====
|
||||||
|
|
||||||
To be able to use your RaspberryPi board with the images generated by
|
To be able to use your RaspberryPi board with the images generated by
|
||||||
Buildroot, you have a prior choice to make, will you use:
|
Buildroot, you have to choose whether you will use:
|
||||||
- Volatile rootfs in RAM (The rootfs is an initramfs) or
|
|
||||||
- Persistent rootfs on the SDCard
|
* 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
|
Also, a good source of information is http://elinux.org/R-Pi_Hub
|
||||||
|
|
||||||
Volatile rootfs
|
How to build it
|
||||||
===============
|
===============
|
||||||
|
|
||||||
How to build it
|
Configure Buildroot
|
||||||
---------------
|
-------------------
|
||||||
|
|
||||||
You need to use the rpi_defconfig, to do so:
|
The rpi_defconfig configuration is a minimal configuration with all that
|
||||||
* make rpi_defconfig
|
is required to bring the Raspberry Pi. You should base your work on this
|
||||||
|
defconfig:
|
||||||
|
|
||||||
Then, you need to select the kind of images you want:
|
$ make rpi_defconfig
|
||||||
* make menuconfig
|
|
||||||
* Select "Filesystem images"
|
|
||||||
* Select "initial RAM filesystem linked into linux kernel"
|
|
||||||
|
|
||||||
What is generated
|
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".
|
||||||
|
|
||||||
|
Build the rootfs
|
||||||
|
----------------
|
||||||
|
|
||||||
|
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 ;-) )
|
||||||
|
|
||||||
|
Result of the build
|
||||||
|
-------------------
|
||||||
|
|
||||||
After building, you should obtain this tree:
|
After building, you should obtain this tree:
|
||||||
|
|
||||||
output/images/
|
output/images/
|
||||||
+-- rootfs.tar
|
+-- rootfs.tar
|
||||||
+-- rpi-firmware
|
+-- rpi-firmware
|
||||||
| +-- bootcode.bin
|
| +-- bootcode.bin
|
||||||
| +-- config.txt
|
| +-- config.txt
|
||||||
| +-- fixup_cd.dat
|
| +-- fixup_cd.dat
|
||||||
| +-- fixup.dat
|
| +-- fixup.dat
|
||||||
| +-- start_cd.elf
|
| +-- start_cd.elf
|
||||||
| `-- start.elf
|
| `-- start.elf
|
||||||
`-- zImage
|
`-- zImage
|
||||||
|
|
||||||
Note : rootfs.tar will only be there if you kept "tar the root filesystem"
|
Note for Volatile: rootfs.tar will only be there if you kept
|
||||||
option selected in "Filesystem images".
|
"tar the root filesystem" option selected in "Filesystem images".
|
||||||
|
|
||||||
Where should the binaries be copied on the SDCard
|
Prepare you SDCard
|
||||||
-------------------------------------------------
|
==================
|
||||||
|
|
||||||
Your SDCard must have its first partition using fat32 and marked bootable.
|
For more information, visit
|
||||||
|
http://elinux.org/RPi_Advanced_Setup#Advanced_SD_card_setup
|
||||||
|
|
||||||
At the root of the partition, the RaspberryPi must find the following files:
|
In summary, your SDCard must have first partition in fat32 and marked bootable.
|
||||||
|
|
||||||
* bootcode.bin
|
Create the required partitions:
|
||||||
* config.txt
|
- for a persistent rootfs, 10MiB is enough memory for the boot fat32
|
||||||
* fixup_cd.dat
|
partition, and a second partition is required for the root filesystem
|
||||||
* fixup.dat
|
- for a volatile rootfs, 50MiB is required for the boot fat32 partition
|
||||||
* start_cd.elf
|
|
||||||
* start.elf
|
|
||||||
* zImage
|
|
||||||
|
|
||||||
So you should copy the entire content of output/images/rpi-firmware along with
|
|
||||||
zImage.
|
|
||||||
|
|
||||||
Note: You can create any number of partitions you desire, the only requirement
|
Note: You can create any number of partitions you desire, the only requirement
|
||||||
is that the first partition must be using fat32 and bootable.
|
is that the first partition must be using fat32 and be bootable.
|
||||||
|
|
||||||
Persistent rootfs
|
Mount the partitions (adjust 'sdX' to match your SDcard device):
|
||||||
=================
|
|
||||||
|
|
||||||
How to build it
|
$ sudo mount /dev/sdX1 /mnt/mountpointboot
|
||||||
---------------
|
$ sudo mount /dev/sdX2 /mnt/mountpointroot (only for persistent rootfs)
|
||||||
|
|
||||||
You only need to use the rpi_defconfig, to do so:
|
Install the binaries to the SDCard
|
||||||
* make rpi_defconfig
|
----------------------------------
|
||||||
|
|
||||||
What is generated
|
At the root of the boot partition, the RaspberryPi must find the following
|
||||||
-----------------
|
files:
|
||||||
|
|
||||||
After building, you should obtain this tree:
|
* bootcode.bin
|
||||||
|
* config.txt
|
||||||
|
* fixup.dat
|
||||||
|
* start.elf
|
||||||
|
* zImage
|
||||||
|
|
||||||
output/images/
|
For example:
|
||||||
+-- rootfs.tar
|
|
||||||
+-- rpi-firmware
|
|
||||||
| +-- bootcode.bin
|
|
||||||
| +-- config.txt
|
|
||||||
| +-- fixup_cd.dat
|
|
||||||
| +-- fixup.dat
|
|
||||||
| +-- start_cd.elf
|
|
||||||
| `-- start.elf
|
|
||||||
`-- zImage
|
|
||||||
|
|
||||||
Where should the binaries be copied on the SDCard
|
$ cp output/images/rpi-firmware/* /mnt/mountpointboot
|
||||||
-------------------------------------------------
|
$ cp output/images/zImage /mnt/mountpointboot/zImage.img
|
||||||
|
|
||||||
Your SDCard must have its first partition using fat32 and marked bootable.
|
Note: The default name is kernel.img.
|
||||||
It should also have another partition which will contain your rootfs, it should
|
Actually, the name is zImage and it's define in the file config.txt like:
|
||||||
be partitioned as ext4.
|
kernel=zImage
|
||||||
|
|
||||||
Boot partition
|
If you use a volatile rootfs, Skip to "Finish", below. For a persistent
|
||||||
~~~~~~~~~~~~~~
|
rootfs, there are further steps to do.
|
||||||
|
|
||||||
The first partition will contain everything used to boot the RaspberryPi.
|
Extract (as root!) the contents of the rootfs.tar archive into the second
|
||||||
You must copy theses files at the root of partition:
|
partition you created above:
|
||||||
|
|
||||||
* bootcode.bin
|
$ sudo tar xf rootfs.tar -C /mnt/mountpointroot
|
||||||
* config.txt
|
|
||||||
* fixup_cd.dat
|
|
||||||
* fixup.dat
|
|
||||||
* start_cd.elf
|
|
||||||
* start.elf
|
|
||||||
* zImage
|
|
||||||
|
|
||||||
So you should copy the entire content of output/images/rpi-firmware along with
|
Finish
|
||||||
zImage.
|
======
|
||||||
|
|
||||||
Rootfs partition
|
Unmount all the partitions:
|
||||||
~~~~~~~~~~~~~~~~
|
|
||||||
|
|
||||||
The second partition will contain your rootfs.
|
$ sudo umount /mnt/mountpointboot
|
||||||
Simply extract (as root!) the contents of the rootfs.tar archive
|
$ sudo umount /mnt/mountpointroot (only for persistent rootfs)
|
||||||
into this partition.
|
|
||||||
|
|
||||||
For example: (Assuming mountpoint is a directory and exist)
|
And eject your SDcard from your computer SDcard reader.
|
||||||
|
|
||||||
$ sudo mount /dev/sdXY /mnt/mountpoint
|
|
||||||
$ sudo tar xf rootfs.tar -C /mnt/mountpoint
|
|
||||||
|
|
||||||
|
Insert the SDcard into your Raspberry Pi, and power it up. Your new system
|
||||||
|
should come up, now.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user