Skip to contentSkip to conversation

configs: add RaspberryPi defconfig

PATCH Superseded Maxime Hadjinlian 5 participants 11 messages Jan 11, 2013 Broadcom BCM2711/BCM2835 Arm architecture

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 configs: add RaspberryPi defconfig

This is a default configuration for the RaspberryPi, tested and functionnal.

The kernel used is the one developped by the RaspberryPi foundation as it's not fully supported currently in mainline kernel.
The configuration used for the kernel is the default bcmrpi.

Note that the kernel generated is a zImage but to work you should :
- Rename it to kernel.img
- Add 'kernel=zImage' in config.txt (without quotes).

For more info, please find board/raspberrypi/README.txt

---
 board/raspberrypi/README.txt |   35 +++++++++++++++++++++++++++++++++++
 configs/rpi_defconfig        |   19 +++++++++++++++++++
 2 files changed, 54 insertions(+)
 create mode 100644 board/raspberrypi/README.txt
 create mode 100644 configs/rpi_defconfig
board/raspberrypi/README.txt new file +35 -0
new file mode 100644
index 0000000..5ddc5c5
@@ -0,0 +1,35 @@
+## RaspberryPi
+
+When you use the rpi_defconfig to build a rootfs for your RaspberryPi, a few
+items are created in output/images :
+
+	output/images/
+	??? rootfs.tar
+	??? rpi-firmware
+	??? ??? bootcode.bin
+	??? ??? config.txt
+	??? ??? fixup_cd.dat
+	??? ??? fixup.dat
+	??? ??? start_cd.elf
+	??? ??? start.elf
+	??? zImage
+
+In order to have a working SDCard, you should have at least two partitions :
+
+    - First partition :
+	This will be the boot partition (It must be formated in fat32 and have
+        bootable flags).
+	It should contains the *content* of output/images/rpi-firmware/.
+        It will also contain the kernel binary.
+        For the kernel to be found, you have two choices :
+	    1 - Rename zImage to kernel.img since it's the default kernel file
+                name here.
+            2 - Add 'kernel=zImage' to config.txt (without the quotes).
+
+    - Second partition :
+        This will contains the rootfs and should be formated in ext4.
+	If you chose another filesystem, you should modify the cmdline in
+        config.txt.
+        Then simply extract rootfs.tar to this partition.
+
+Finally, a good source of information is http://elinux.org/R-Pi_Hub
configs/rpi_defconfig new file +19 -0
new file mode 100644
index 0000000..8c73d0e
@@ -0,0 +1,19 @@
+BR2_arm=y
+BR2_arm1176jzf_s=y
+
+BR2_TOOLCHAIN_BUILDROOT_LARGEFILE=y
+BR2_TOOLCHAIN_BUILDROOT_CXX=y
+
+BR2_TARGET_GENERIC_GETTY_PORT="tty1"
+
+BR2_PACKAGE_RPI_FIRMWARE=y
+BR2_PACKAGE_RPI_USERLAND=y
+BR2_PACKAGE_LIBCOFI=y
+
+BR2_LINUX_KERNEL=y
+BR2_LINUX_KERNEL_CUSTOM_GIT=y
+BR2_LINUX_KERNEL_CUSTOM_GIT_REPO_URL="git://github.com/raspberrypi/linux.git"
+BR2_LINUX_KERNEL_CUSTOM_GIT_VERSION="31a951046155b27361127d9cf85a1f58719fe9b3"
+BR2_LINUX_KERNEL_USE_DEFCONFIG=y
+BR2_LINUX_KERNEL_DEFCONFIG="bcmrpi"
+BR2_LINUX_KERNEL_ZIMAGE=y

--
1.7.10.4

#1 lore raw

PATCH v2 1/1 configs: add RaspberryPi defconfig

Maxime, All,

On Friday 11 January 2013 14:17:30 Maxime Hadjinlian wrote:
[--SNIP--]

Quoted 11 lines
board/raspberrypi/README.txt new file +5 -0
new file mode 100644
index 0000000..5ddc5c5
@@ -0,0 +1,35 @@
+## RaspberryPi
+
+When you use the rpi_defconfig to build a rootfs for your RaspberryPi, a few
+items are created in output/images :
+

board/raspberrypi/README.txt line 15

Quoted 10 lines
board/raspberrypi/README.txt new file +10 -0
+	output/images/
+	??? rootfs.tar
+	??? rpi-firmware
+	?   ??? bootcode.bin
+	?   ??? config.txt
+	?   ??? fixup_cd.dat
+	?   ??? fixup.dat
+	?   ??? start_cd.elf
+	?   ??? start.elf
+	??? zImage

Please, use only ascii chars (0x00..0x7F):

	output/images/
	+-- rootfs.tar
	+-- rpi-firmware
	|   +-- bootcode.bin
        [...]
        |   `-- start.elf
        `-- zImage

board/raspberrypi/README.txt line 27

Quoted 11 lines
board/raspberrypi/README.txt new file +11 -0
+In order to have a working SDCard, you should have at least two partitions :
+
+    - First partition :
+	This will be the boot partition (It must be formated in fat32 and have
+        bootable flags).
+	It should contains the *content* of output/images/rpi-firmware/.
+        It will also contain the kernel binary.
+        For the kernel to be found, you have two choices :
+	    1 - Rename zImage to kernel.img since it's the default kernel file
+                name here.
+            2 - Add 'kernel=zImage' to config.txt (without the quotes).

kernel='kernel.img' maybe?
If not, explain what this kernel= settings means.

Otherwise, looks good to me. ;-)

Regards,
Yann E. MORIN.

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +0/33 662376056 | Software  Designer | \ / CAMPAIGN     |   ^                |
| --==< O_o >==-- '------------.-------:  X  AGAINST      |  /e\  There is no  |
| http://ymorin.is-a-geek.org/ | (*_*) | / \ HTML MAIL    |  """  conspiracy.  |
'------------------------------'-------'------------------'--------------------'
#2 lore raw

PATCH v2 1/1 configs: add RaspberryPi defconfig

Quoted 27 lines · Yann E. MORIN

Maxime, All,

On Friday 11 January 2013 14:17:30 Maxime Hadjinlian wrote:
[--SNIP--]

Quoted 11 lines
board/raspberrypi/README.txt new file +5 -0
new file mode 100644
index 0000000..5ddc5c5
@@ -0,0 +1,35 @@
+## RaspberryPi
+
+When you use the rpi_defconfig to build a rootfs for your RaspberryPi, a few
+items are created in output/images :
+

board/raspberrypi/README.txt line 15

Quoted 10 lines
board/raspberrypi/README.txt new file +10 -0
+     output/images/
+     ??? rootfs.tar
+     ??? rpi-firmware
+     ?   ??? bootcode.bin
+     ?   ??? config.txt
+     ?   ??? fixup_cd.dat
+     ?   ??? fixup.dat
+     ?   ??? start_cd.elf
+     ?   ??? start.elf
+     ??? zImage

Please, use only ascii chars (0x00..0x7F):

Quoted 7 lines
        output/images/
        +-- rootfs.tar
        +-- rpi-firmware
        |   +-- bootcode.bin
        [...]
        |   `-- start.elf
        `-- zImage

Will do.

Quoted 14 lines

board/raspberrypi/README.txt line 27

Quoted 12 lines
board/raspberrypi/README.txt new file +11 -0
+In order to have a working SDCard, you should have at least two partitions :
+
+    - First partition :
+     This will be the boot partition (It must be formated in fat32 and have
+        bootable flags).
+     It should contains the *content* of output/images/rpi-firmware/.
+        It will also contain the kernel binary.
+        For the kernel to be found, you have two choices :
+         1 - Rename zImage to kernel.img since it's the default kernel file
+                name here.
+            2 - Add 'kernel=zImage' to config.txt (without the quotes).

kernel='kernel.img' maybe?

Nop, as said, you have two choices for the kernel binary to be found. Either, you rename the file so it match the default name, kernel.img. Or, you change in the config.txt the file name the kernel should have.

Quoted 3 lines

If not, explain what this kernel= settings means.

Otherwise, looks good to me. ;-)

Thanks

Quoted 11 lines

Regards,
Yann E. MORIN.

--
.-----------------.--------------------.------------------.--------------------.

|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +0/33 662376056 | Software  Designer | \ / CAMPAIGN     |   ^                |
| --==< O_o >==-- '------------.-------:  X  AGAINST      |  /e\  There is no  |
| http://ymorin.is-a-geek.org/ | (*_*) | / \ HTML MAIL    |  """  conspiracy.  |

'------------------------------'-------'------------------'--------------------'

#3 lore raw

PATCH v2 1/1 configs: add RaspberryPi defconfig

In reply to Maxime Hadjinlian
Quoted 1 line · Maxime Hadjinlian

- Add 'kernel=zImage' in config.txt (without quotes).

Perhaps consider making that the default in package/rpi-firmware/config.txt

So that one can create a working Raspberry Pi image by just copying the files from target to a FAT formatted SD card without having to edit or rename anything.

Yours sincerely,

Floris Bos

#4 lore raw

PATCH v2 1/1 configs: add RaspberryPi defconfig

Quoted 6 lines · Floris Bos
Quoted 2 lines · Maxime Hadjinlian

- Add 'kernel=zImage' in config.txt (without quotes).

Perhaps consider making that the default in package/rpi-firmware/config.txt

I though about this but since kernel.img is the default for the RaspberryPi, I wanted to keep the config.txt as vanilla as possible. Since it's pretty easy to rename the zImage into kernel.img with a postbuild script, the end users has a choice.

Quoted 4 lines

So that one can create a working Raspberry Pi image by just copying the files from target to a FAT formatted SD card without having to edit or rename anything.

You're absolutely right.
I'm not sure what to do here, I'll follow what the mailing will say.

Quoted 9 lines

Yours sincerely,

Floris Bos
_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

#5 lore raw

PATCH v2 1/1 configs: add RaspberryPi defconfig

In reply to Floris Bos

Dear Floris Bos,

Quoted 8 lines · Floris Bos
Quoted 1 line · Maxime Hadjinlian

- Add 'kernel=zImage' in config.txt (without quotes).

Perhaps consider making that the default in package/rpi-firmware/config.txt

So that one can create a working Raspberry Pi image by just copying the files from target to a FAT formatted SD card without having to edit or rename anything.

I agree. Let's have a default config.txt that matches the file name of the kernel image we generate.

Thanks,

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
#6 lore raw

PATCH v2 1/1 configs: add RaspberryPi defconfig

In reply to Maxime Hadjinlian

Dear Maxime Hadjinlian,

board/raspberrypi/README.txt line 4

Quoted 7 lines · Maxime Hadjinlian
board/raspberrypi/README.txt new file +4 -0
@@ -0,0 +1,35 @@
+## RaspberryPi
+
+When you use the rpi_defconfig to build a rootfs for your RaspberryPi, a few
+items are created in output/images :

It does not build only a rootfs, so:

When you use the rpi_defconfig to build an embedded Linux system for your Rasberry Pi, the following elements will be generated in output/images:

Quoted 18 lines
board/raspberrypi/README.txt new file +18 -0
+	output/images/
+	??? rootfs.tar
+	??? rpi-firmware
+	??? ??? bootcode.bin
+	??? ??? config.txt
+	??? ??? fixup_cd.dat
+	??? ??? fixup.dat
+	??? ??? start_cd.elf
+	??? ??? start.elf
+	??? zImage
+
+In order to have a working SDCard, you should have at least two partitions :
+
+    - First partition :
+	This will be the boot partition (It must be formated in fat32 and have
+        bootable flags).
+	It should contains the *content* of output/images/rpi-firmware/.
+        It will also contain the kernel binary.

board/raspberrypi/README.txt line 33

Quoted 10 lines
board/raspberrypi/README.txt new file +10 -0
+        For the kernel to be found, you have two choices :
+	    1 - Rename zImage to kernel.img since it's the default kernel file
+                name here.
+            2 - Add 'kernel=zImage' to config.txt (without the quotes).
+
+    - Second partition :
+        This will contains the rootfs and should be formated in ext4.
+	If you chose another filesystem, you should modify the cmdline in
+        config.txt.
+        Then simply extract rootfs.tar to this partition.

The indentation is really strange here. What about something like:

==
In order to boot your Rasberry Pi, you'll need to prepare your SD card with at least two partitions:

* The first partition is the boot partition.

It should be FAT32-formatted and have the bootable flags.

It should contain the contents of the output/images/rpi-firmware/
directory: it contains bootloaders and the kernel image for the Rasberry Pi.

* The second partition is the root filesystem partition.

It should be ext4 formatted (if you choose another filesystem, remember to adjust the kernel command line in the config.txt file).

Simply extract (as root!) the contents of the rootfs.tar archive into this partition.
==

I removed the discussion about kernel=zImage, because I think it should be the default in our rpi-firmware package.

Thanks,

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
#7 lore raw

PATCH v2 1/1 configs: add RaspberryPi defconfig

In reply to Maxime Hadjinlian
Quoted 1 line · Maxime Hadjinlian

In order to have a working SDCard, you should have at least two partitions :

Might also be worth mentioning that for use cases that do not require file changes to persist across reboots you can go the initramfs route, and let the bootloader load the entire rootfs to memory at boot.

- "make menuconfig" -> select "Filesystem images" -> "initramfs for intial ramdisk of linux kernel"
- After build simply copy the files from target to a FAT formatted SD card.

No need to mess with extra partitions that way, and you are less affected by the glitches the Pi's SD card kernel module has from time to time.

Yours sincerely,

Floris Bos

#8 lore raw

PATCH v2 1/1 configs: add RaspberryPi defconfig

Quoted 8 lines · Floris Bos
Quoted 2 lines · Maxime Hadjinlian

In order to have a working SDCard, you should have at least two partitions :

Might also be worth mentioning that for use cases that do not require file changes to persist across reboots you can go the initramfs route, and let the bootloader load the entire rootfs to memory at boot.

Quoted 6 lines

- "make menuconfig" -> select "Filesystem images" -> "initramfs for intial ramdisk of linux kernel"
- After build simply copy the files from target to a FAT formatted SD card.

No need to mess with extra partitions that way, and you are less affected by the glitches the Pi's SD card kernel module has from time to time.

Does the RPi bootloader support initrd loading? In that case, maybe
it's better to default to rootfs.cpio.gz (or .lzma) and adapt the config.txt accordingly. That way, creating a bootable is a lot simpler:
just chuck the entire images directory on a FAT-formatted SD card...

Regards,
Arnout

Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F
#9 lore raw

PATCH v2 1/1 configs: add RaspberryPi defconfig

Quoted 18 lines · Arnout Vandecappelle
Quoted 8 lines · Floris Bos
Quoted 2 lines · Maxime Hadjinlian

In order to have a working SDCard, you should have at least two partitions :

Might also be worth mentioning that for use cases that do not require file changes to persist across reboots you can go the initramfs route, and let the bootloader load the entire rootfs to memory at boot.

Quoted 8 lines

- "make menuconfig" -> select "Filesystem images" -> "initramfs for intial ramdisk of linux kernel"
- After build simply copy the files from target to a FAT formatted SD card.

No need to mess with extra partitions that way, and you are less affected
by the glitches the Pi's SD card kernel module has from time to time.

Quoted 5 lines

Does the RPi bootloader support initrd loading? In that case, maybe
it's better to default to rootfs.cpio.gz (or .lzma) and adapt the config.txt accordingly. That way, creating a bootable is a lot
simpler: just chuck the entire images directory on a FAT-formatted SD card...

The bootloader does support loading separate initrd files through a config.txt option.
But the standard bcmrpi_defconfig Raspberry kernel does not, because CONFIG_BLK_DEV_INITRD isn't enabled in the default configuration.

If you cannot use the standard kernel, and have to compile your own anyway, it is easier to use the buildroot "initramfs" option, and have the initramfs integrated into zImage.

Yours sincerely,

Floris Bos

#10 lore raw

PATCH v2 1/1 configs: add RaspberryPi defconfig

Quoted 4 lines · Floris Bos

The bootloader does support loading separate initrd files through a config.txt option.
But the standard bcmrpi_defconfig Raspberry kernel does not, because CONFIG_BLK_DEV_INITRD isn't enabled in the default configuration.

Bummer.

Quoted 3 lines

If you cannot use the standard kernel, and have to compile your own anyway, it is easier to use the buildroot "initramfs" option, and have the initramfs integrated into zImage.

It's just that that increases compile time, with little real benefit
over a separate initramfs.

Regards,
Arnout

Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F