Skip to contentSkip to conversation

Add package raspberrypi-firmware.

PATCH Superseded Marek Belisko 6 participants 16 messages Sep 17, 2012 – Sep 19, 2012 Broadcom BCM2711/BCM2835 Arm architecture

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Add package raspberrypi-firmware.

Add support for raspberrypi bootloader and VideoCore.

Added changes from Arnout comments:
(http://lists.busybox.net/pipermail/buildroot/2012-September/058565.html)
- add rasberrypi-firmware as separate package
- change Config.in handling to have separate bootloader and VideoCore packages (handled in same mk file)
- various other fixes

New features:
- add possibility to choose ARM - GPU memory split by user
- download package in tar.gz instead git method

---
 package/Config.in                                  |    1 +
 package/raspberrypi-firmware/Config.in             |   53 ++++++++++++++++++++
 .../raspberrypi-firmware/raspberrypi-firmware.mk   |   48 ++++++++++++++++++
 3 files changed, 102 insertions(+)
 create mode 100644 package/raspberrypi-firmware/Config.in
 create mode 100644 package/raspberrypi-firmware/raspberrypi-firmware.mk
package/Config.in +1 -0
index 58dd5e8..36635cd 100644
@@ -232,6 +232,7 @@ source "package/owl-linux/Config.in"
 source "package/parted/Config.in"
 source "package/pciutils/Config.in"
 source "package/picocom/Config.in"
+source "package/raspberrypi-firmware/Config.in"
 source "package/read-edid/Config.in"
 source "package/rng-tools/Config.in"
 source "package/sane-backends/Config.in"
package/raspberrypi-firmware/Config.in new file +53 -0

53 lines not on this page · raw message

package/raspberrypi-firmware/raspberrypi-firmware.mk new file +48 -0

48 lines not on this page · raw message

Signature · 1 line
1.7.9.5
#1 lore raw

PATCH 1/1 Add package raspberrypi-firmware.

Dear Marek Belisko,

package/raspberrypi-firmware/Config.in line 16

Quoted 2 lines · Marek Belisko
package/raspberrypi-firmware/Config.in new file +2 -0
+prompt "Memory & GPU split"
+	default BR2_PACKAGE_BOOTLOADER_ARM192

When a package is named BR2_PACKAGE_FOO, then all its sub-options *must* have name that starts with BR2_PACKAGE_FOO_

Thomas

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

PATCH 1/1 Add package raspberrypi-firmware.

In reply to Marek Belisko

Marek, All,

Quoted 1 line · On Monday 17 September 2012 22:34:17 Marek Belisko wrote:

Add support for raspberrypi bootloader and VideoCore.

See my comments below.

Quoted 39 lines

Added changes from Arnout comments:
(http://lists.busybox.net/pipermail/buildroot/2012-September/058565.html)
- add rasberrypi-firmware as separate package
- change Config.in handling to have separate bootloader and VideoCore packages (handled in same mk file)
- various other fixes

New features:
- add possibility to choose ARM - GPU memory split by user
- download package in tar.gz instead git method

---
 package/Config.in                                  |    1 +
 package/raspberrypi-firmware/Config.in             |   53 ++++++++++++++++++++
 .../raspberrypi-firmware/raspberrypi-firmware.mk   |   48 ++++++++++++++++++
 3 files changed, 102 insertions(+)
 create mode 100644 package/raspberrypi-firmware/Config.in
 create mode 100644 package/raspberrypi-firmware/raspberrypi-firmware.mk
package/Config.in +1 -0
index 58dd5e8..36635cd 100644
@@ -232,6 +232,7 @@ source "package/owl-linux/Config.in"
 source "package/parted/Config.in"
 source "package/pciutils/Config.in"
 source "package/picocom/Config.in"
+source "package/raspberrypi-firmware/Config.in"
 source "package/read-edid/Config.in"
 source "package/rng-tools/Config.in"
 source "package/sane-backends/Config.in"
package/raspberrypi-firmware/Config.in new file +0 -0
new file mode 100644
index 0000000..55abd68

package/raspberrypi-firmware/Config.in line 5

Quoted 5 lines
package/raspberrypi-firmware/Config.in new file +5 -0
@@ -0,0 +1,53 @@
+config BR2_PACKAGE_RASPBERRYPI_FIRMWARE
+	bool
+
+config BR2_PACKAGE_RASPBERRYPI_BOOTLOADER
+        bool "Raspberry Pi bootloader files"

Space-damage: config option should be indented one tab, not 8 spaces, and help entries are indented one tab plus two spaces, not 10 spaces.

package/raspberrypi-firmware/Config.in line 6

Quoted 1 line
package/raspberrypi-firmware/Config.in new file +1 -0
+	select BR2_PACKAGE_RASPBERRYPI_FIRMWARE

I am not too fond of this hack... :-(

The issue with this 'package' is that it's two things:
- a package that installs the videocore library;
- a package that installs the bootloader files.

So, I would really like to see the bootloader entries in the bootloader sub-menu, and the library part in the "packages on target" sub-menu.

I'll look at this shortly (having recently received my rPi), and hope to be able to come back later tonight with an alternate proposal.

The big issue is that there is no provision in BR to handle this situation, as it is currently expected that an upstream package only provides a single package in BR.

So, NACK from me in the state it is currently.

Regards,
Yann E. MORIN.

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#3 lore raw

PATCH 1/1 Add package raspberrypi-firmware.

Marek, All,

Quoted 2 lines · On Monday 17 September 2012 23:01:54 Yann E. MORIN wrote:
Quoted 1 line · On Monday 17 September 2012 22:34:17 Marek Belisko wrote:

Add support for raspberrypi bootloader and VideoCore.

[--SNIP--]

Quoted 5 lines

I am not too fond of this hack... :-(

The issue with this 'package' is that it's two things:
- a package that installs the videocore library;
- a package that installs the bootloader files.

Ah, my bad, I should have paid more attention to the README. The bootloader files are for the GPU, not the CPU. Well, that's another issue, then.

Still, I am not very fond of the 'select' hack. Why not do something like the following (untested so far, will give it a spin shortly):

---8<--- Config.in --8<---
config BR2_PACKAGE_RASPBERRYPI_FIRMWARE
bool "Raspberry Pi firmware blobs"
depends on ARM # (and even the proper CPU?)
help
Install the firmware blobs for the GPU, and the userland VideoCore library to use accelerated graphics on the Raspberry Pi.

http://github/babla/...

if BR2_PACKAGE_RASPBERRYPI_FIRMWARE

choice
bool "CPU/GPU memory split"
default BR2_PACKAGE_RASPBERRYPI_FIRMWARE_ARM192

config BR2_PACKAGE_RASPBERRYPI_FIRMWARE_ARM128

	bool "128MiB/128MiB"

config BR2_PACKAGE_RASPBERRYPI_FIRMWARE_ARM192

	bool "192MiB/64MiB"

# And so on (your help entries are fine!)

enchoice

config BR2_PACKAGE_RASPBERRYPI_FIRMWARE_GPU_BOOT_FILE
string
default "arm128" if BR2_PACKAGE_RASPBERRYPI_FIRMWARE_ARM128 default "arm192" if BR2_PACKAGE_RASPBERRYPI_FIRMWARE_ARM192
...

endif
---8<--- Config.in --8<---

What would be the interest to install the GPU boot files, but not install the VideoCore libraries? Or the other way around, what would be the intrest to install the VidoeCore library without the GPU boot files?

So my proposal install both one GPU boot file and the VideoCore libraries, or nothing@all.

---8<--- raspberrypi-firmware.mk --8<---
RASPBERRYPI_FIRMWARE_VERSION = d29291e
RASPBERRYPI_FIRMWARE_SOURCE = raspberrypi-firmware-$(RASPBERRYPI_FIRMWARE_VERSION).tar.gz RASPBERRYPI_FIRMWARE_SITE = http://github.com/raspberrypi/firmware/tarball/master
RASPBERRYPI_FIRMWARE_INSTALL_STAGING = YES

define RASPBERRYPI_FIRMWARE_INSTALL_STAGING_CMDS

	cp -a $(@D)/hardfp/opt/vc/* $(STAGING_DIR)/usr

endef

define RASPBERRYPI_FIRMWARE_INSTALL_TARGET_CMDS

	mkdir -p $(TARGET_DIR)/boot
	cp $(@D)/boot/$(qstrip $(BR2_PACKAGE_RASPBERRYPI_FIRMWARE_GPU_BOOT_FILE))_start.elf \
	        $(TARGET_DIR)/boot/start.elf
	cp $(@D)/boot/bootcode.bin $(TARGET_DIR)/boot/bootcode.bin
	cp $(@D)/boot/loader.bin $(TARGET_DIR)/boot/loader.bin
	cp -a $(@D)/hardfp/opt/vc/bin/* $(TARGET_DIR)/usr/bin
	cp -a $(@D)/hardfp/opt/vc/lib/* $(TARGET_DIR)/usr/lib
	cp -a $(@D)/hardfp/opt/vc/sbin/* $(TARGET_DIR)/usr/sbin

endef

$(eval $(generic-package))
---8<--- raspberrypi-firmware.mk --8<---

Also, to be noted in your original patch, you wrote:

---8<---
ifeq ($(BR2_PACKAGE_RASPBERRYPI_BOOTLOADER),y)
BOOT_FILE := #empty
ifeq ($(BR2_PACKAGE_BOOTLOADER_ARM128),y)
BOOT_FILE += arm128_start.elf
else ifeq ($(BR2_PACKAGE_BOOTLOADER_ARM192),y)
BOOT_FILE += arm192_start.elf
else ifeq ($(BR2_PACKAGE_BOOTLOADER_ARM224),y)
BOOT_FILE += arm224_start.elf
else ifeq ($(BR2_PACKAGE_BOOTLOADER_ARM240),y)
BOOT_FILE += arm240_start.elf
endif
---8<---

But all the ARMxxx options are in a choice, so they are mutually exclusive. In the proposal, above, I kept it as a choice, although it may make sense to install more than one GPU bootloader.

Regards,
Yann E. MORIN.

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#4 lore raw

PATCH 1/1 Add package raspberrypi-firmware.

Dear Yann E. MORIN,

Quoted 3 lines · Yann E. MORIN

What would be the interest to install the GPU boot files, but not install the VideoCore libraries? Or the other way around, what would be the intrest to install the VidoeCore library without the GPU boot files?

The GPU boot files are needed to actually boot the ARM processor. So technically speaking, they are some kind of first-stage bootloader for the ARM processor, even if they get executed on the GPU.

So, if you want to use the RasberryPi, you *must* install those GPU boot files. However, if you're not using the RasberryPi for a 3D graphical application, you don't necessarily need the VideoCore library files. So I think it makes sense to be able to install the GPU boot files separately from the VideoCore library.

The underlying problem here is a fundamental weakness in Buildroot
design: the absence of separation between source packages and binary packages. We have the same situation quite often for other things. For example the "curl" package. It provides both a library "libcurl", and a program "curl" that relies on that library. Should this package be under "Libraries -> Networking" or under "Networking applications" ? Ditto for many, many of our packages.

Thomas

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

PATCH 1/1 Add package raspberrypi-firmware.

Thomas, Marek, All,

Quoted 9 lines · On Tuesday 18 September 2012 07:09:34 Thomas Petazzoni wrote:
Quoted 3 lines · Yann E. MORIN

What would be the interest to install the GPU boot files, but not install the VideoCore libraries? Or the other way around, what would be the intrest to install the VidoeCore library without the GPU boot files?

The GPU boot files are needed to actually boot the ARM processor. So technically speaking, they are some kind of first-stage bootloader for the ARM processor, even if they get executed on the GPU.

Quoted 5 lines

So, if you want to use the RasberryPi, you *must* install those GPU boot files. However, if you're not using the RasberryPi for a 3D graphical application, you don't necessarily need the VideoCore library files. So I think it makes sense to be able to install the GPU boot files separately from the VideoCore library.

Ah, OK, that's one more thing I learned, so I won;t have to discover the hard way when plugging my RPI first (later tonight! :-) )

So, basically, the initial interest for this package is to provide the bootloader files, hence I believe the package should go in the bootloader sub-menu.

Then we can add a VideoCoreIV package in one of the "packages on target" sub-menu ("libs -> hardware handling" sounds the most adequate AFAICS).

Quoted 7 lines

The underlying problem here is a fundamental weakness in Buildroot
design: the absence of separation between source packages and binary packages. We have the same situation quite often for other things. For example the "curl" package. It provides both a library "libcurl", and a program "curl" that relies on that library. Should this package be under "Libraries -> Networking" or under "Networking applications" ? Ditto for many, many of our packages.

Ok, so I'll prepare that patch of mine to add this package, so we can compare with Marek's solution.

Regards,
Yann E. MORIN.

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 223 225 172 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
#6 lore raw

PATCH 1/1 Add package raspberrypi-firmware.

Dear Yann E. MORIN,

Quoted 6 lines · Yann E. MORIN

So, basically, the initial interest for this package is to provide the bootloader files, hence I believe the package should go in the bootloader sub-menu.

Then we can add a VideoCoreIV package in one of the "packages on target" sub-menu ("libs -> hardware handling" sounds the most adequate AFAICS).

And so this package would "depends on" a bootloader?

Marek made it clear at the beginning: even though this rasberrypi-firmware package contains a bootloader, he decided to put it in package/ because it also contains userspace libraries. And Marek wanted to avoid having two separate packages, because it would be that you would download the same original tarball (or Git repository) twice, have two packages to upgrade when bumping the version, etc.

Note that we however already have a relatively similar situation with
u-boot: we have boot/uboot for the bootloader and package/u-boot-tools for the host and target utilities.

It is clearly a lack of separation between source package and binary packages that is causing problem here. We should normally have one source package: rasberrypi-firmware, that provides two binary packages:
rasberrypi-bootloader and rasberrypi-videocore-libs.

Best regards,

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

[Buildroot] Two packages with the same source [was: [PATCH] Add package raspberrypi-firmware.]

Quoted 20 lines · Thomas Petazzoni

Dear Yann E. MORIN,

Quoted 6 lines · Yann E. MORIN

So, basically, the initial interest for this package is to provide the bootloader files, hence I believe the package should go in the bootloader sub-menu.

Then we can add a VideoCoreIV package in one of the "packages on target" sub-menu ("libs -> hardware handling" sounds the most adequate AFAICS).

And so this package would "depends on" a bootloader?

Marek made it clear at the beginning: even though this rasberrypi-firmware package contains a bootloader, he decided to put it in package/ because it also contains userspace libraries. And Marek wanted to avoid having two separate packages, because it would be that you would download the same original tarball (or Git repository) twice, have two packages to upgrade when bumping the version, etc.

Quoted 3 lines

Note that we however already have a relatively similar situation with
u-boot: we have boot/uboot for the bootloader and package/u-boot-tools for the host and target utilities.

And also e.g. for the kernel headers - which basically means Gustavo's
patches are doubled :-)

Quoted 4 lines

It is clearly a lack of separation between source package and binary packages that is causing problem here. We should normally have one source package: rasberrypi-firmware, that provides two binary packages:
rasberrypi-bootloader and rasberrypi-videocore-libs.

I've been thinking a bit about this problem as well. As an intermediate
solution, I considered the concept of a "source dependency". You'd basically do something like:

UBOOT_TOOLS_SOURCE_PACKAGE = UBOOT

and the generic-package infrastructure will re-use uboot's download step. This would replace the _VERSION, _SOURCE and _SITE symbols for uboot-tools.

Unfortunately, for uboot-tools and kernel-headers it's a bit more complex,
because you have to select a version for uboot and kernel so you can't easily add an automatic dependency on it.

Note that I would still extract, patch and build the packages twice,
because the procedure may be different (just like for host-packages).

Regards,
Arnout

Signature · 6 lines
Arnout Vandecappelle                               arnout at mind be
Senior Embedded Software Architect                 +32-16-286540
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
#8 lore raw

PATCH 1/1 Add package raspberrypi-firmware.

In reply to Marek Belisko

On 09/17/12 22:34, Marek Belisko wrote:
[snip]

package/raspberrypi-firmware/raspberrypi-firmware.mk line 2

Quoted 8 lines
package/raspberrypi-firmware/raspberrypi-firmware.mk new file +2 -0
new file mode 100644
index 0000000..1ebf67c
@@ -0,0 +1,48 @@
+RASPBERRYPI_FIRMWARE_VERSION = d29291e
+RASPBERRYPI_FIRMWARE_SOURCE = raspberrypi-firmware-$(RASPBERRYPI_FIRMWARE_VERSION).tar.gz

That's the default, so it can be left out.

package/raspberrypi-firmware/raspberrypi-firmware.mk line 9

Quoted 7 lines
package/raspberrypi-firmware/raspberrypi-firmware.mk new file +7 -0
+RASPBERRYPI_FIRMWARE_SITE = http://github.com/raspberrypi/firmware/tarball/master
+
+ifeq ($(BR2_PACKAGE_RASPBERRYPI_VIDEOCORE),y)
+RASPBERRYPI_FIRMWARE_INSTALL_STAGING = YES
+
+define RASPBERRYPI_FIRMWARE_INSTALL_STAGING_CMDS
+	cp -r $(@D)/hardfp/opt $(STAGING_DIR)/

The same reasoning as for the target applies here as well: we want
the cross-compiler to find the headers and libraries without requiring special -I and -L directives. So copy them to /usr/include and /usr/lib.

package/raspberrypi-firmware/raspberrypi-firmware.mk line 13

Quoted 4 lines
package/raspberrypi-firmware/raspberrypi-firmware.mk new file +4 -0
+endef
+
+define RASPBERRYPI_FIRMWARE_INSTALL_TARGET_VIDEOCORE
+	cp -r $(@D)/hardfp/opt/vc/bin $(TARGET_DIR)/usr/bin

Doesn't this create /usr/bin/bin ? To be safe, use -T .

Quoted 11 lines
package/raspberrypi-firmware/raspberrypi-firmware.mk new file +11 -0
+	cp -r $(@D)/hardfp/opt/vc/lib $(TARGET_DIR)/usr/lib
+	cp -r $(@D)/hardfp/opt/vc/sbin $(TARGET_DIR)/usr/sbin
+endef
+endif
+
+ifeq ($(BR2_PACKAGE_RASPBERRYPI_BOOTLOADER),y)
+BOOT_FILE := #empty
+ifeq ($(BR2_PACKAGE_BOOTLOADER_ARM128),y)
+BOOT_FILE += arm128_start.elf
+else ifeq ($(BR2_PACKAGE_BOOTLOADER_ARM192),y)
+BOOT_FILE += arm192_start.elf

package/raspberrypi-firmware/raspberrypi-firmware.mk line 34

Quoted 10 lines
package/raspberrypi-firmware/raspberrypi-firmware.mk new file +10 -0
+else ifeq ($(BR2_PACKAGE_BOOTLOADER_ARM224),y)
+BOOT_FILE += arm224_start.elf
+else ifeq ($(BR2_PACKAGE_BOOTLOADER_ARM240),y)
+BOOT_FILE += arm240_start.elf
+endif
+
+define RASPBERRYPI_FIRMWARE_INSTALL_TARGET_BOOTLOADER
+	if [ ! -d "$(TARGET_DIR)/boot" ]; then \
+		mkdir $(TARGET_DIR)/boot; \
+	fi; \

Just "mkdir -p $(TARGET_DIR)/boot". Or even better, replace the cp
below with

	install -D -m 0644 <fromfile> <tofile>

package/raspberrypi-firmware/raspberrypi-firmware.mk line 35

Quoted 1 line
package/raspberrypi-firmware/raspberrypi-firmware.mk new file +1 -0
+	cp $(@D)/boot/$(subst $(space),$(comma),$(strip $(BOOT_FILE))) \

I guess this must be a leftover from some earlier magic, because
BOOT_FILE can contain only a single entry, and even if there are several bootfiles, replacing spaces by commas won't help.

If you want to support the installation of several bootfiles, you
should use

	for bootfile in $(BOOT_FILE) bootcode.bin loader.bin; do \
		install -D -m $(@D)/boot/$$bootfile $(TARGET_DIR)/boot/$$bootfile; \
	done

Regards,
Arnout

Quoted 13 lines
package/raspberrypi-firmware/raspberrypi-firmware.mk new file +13 -0
+		$(TARGET_DIR)/boot/start.elf
+	cp $(@D)/boot/bootcode.bin $(TARGET_DIR)/boot/bootcode.bin
+	cp $(@D)/boot/loader.bin $(TARGET_DIR)/boot/loader.bin
+endef
+endif
+
+define RASPBERRYPI_FIRMWARE_INSTALL_TARGET_CMDS
+	$(RASPBERRYPI_FIRMWARE_INSTALL_TARGET_BOOTLOADER)
+	$(RASPBERRYPI_FIRMWARE_INSTALL_TARGET_VIDEOCORE)
+endef
+
+$(eval $(generic-package))
+
Signature · 6 lines
Arnout Vandecappelle                               arnout at mind be
Senior Embedded Software Architect                 +32-16-286540
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 1/1 Add package raspberrypi-firmware.

Quoted 20 lines · Arnout Vandecappelle

+ifeq ($(BR2_PACKAGE_RASPBERRYPI_**BOOTLOADER),y)

Quoted 6 lines
package/raspberrypi-firmware/raspberrypi-firmware.mk new file +5 -0
+BOOT_FILE := #empty
+ifeq ($(BR2_PACKAGE_BOOTLOADER_**ARM128),y)
+BOOT_FILE += arm128_start.elf
+else ifeq ($(BR2_PACKAGE_BOOTLOADER_**ARM192),y)
+BOOT_FILE += arm192_start.elf

package/raspberrypi-firmware/raspberrypi-firmware.mk line 34

Quoted 10 lines
package/raspberrypi-firmware/raspberrypi-firmware.mk new file +10 -0
+else ifeq ($(BR2_PACKAGE_BOOTLOADER_**ARM224),y)
+BOOT_FILE += arm224_start.elf
+else ifeq ($(BR2_PACKAGE_BOOTLOADER_**ARM240),y)
+BOOT_FILE += arm240_start.elf
+endif
+
+define RASPBERRYPI_FIRMWARE_INSTALL_**TARGET_BOOTLOADER
+       if [ ! -d "$(TARGET_DIR)/boot" ]; then \
+               mkdir $(TARGET_DIR)/boot; \
+       fi; \

Just "mkdir -p $(TARGET_DIR)/boot". Or even better, replace the cp
below with

Quoted 4 lines
        install -D -m 0644 <fromfile> <tofile>

Wait... this implies that /boot/ is on the rootfs... ext2... and rbpi
demands that the "boot" partition will be vfat.. right? What am I missing? -------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20120919/d64eba75/attachment.html>

#10 lore raw

PATCH 1/1 Add package raspberrypi-firmware.

Quoted 27 lines · Diego Iastrubni
Quoted 21 lines · Arnout Vandecappelle
Quoted 7 lines
package/raspberrypi-firmware/raspberrypi-firmware.mk new file +6 -0
+ifeq ($(BR2_PACKAGE_RASPBERRYPI_BOOTLOADER),y)
+BOOT_FILE := #empty
+ifeq ($(BR2_PACKAGE_BOOTLOADER_ARM128),y)
+BOOT_FILE += arm128_start.elf
+else ifeq ($(BR2_PACKAGE_BOOTLOADER_ARM192),y)
+BOOT_FILE += arm192_start.elf

package/raspberrypi-firmware/raspberrypi-firmware.mk line 34

Quoted 10 lines
package/raspberrypi-firmware/raspberrypi-firmware.mk new file +10 -0
+else ifeq ($(BR2_PACKAGE_BOOTLOADER_ARM224),y)
+BOOT_FILE += arm224_start.elf
+else ifeq ($(BR2_PACKAGE_BOOTLOADER_ARM240),y)
+BOOT_FILE += arm240_start.elf
+endif
+
+define RASPBERRYPI_FIRMWARE_INSTALL_TARGET_BOOTLOADER
+       if [ ! -d "$(TARGET_DIR)/boot" ]; then \
+               mkdir $(TARGET_DIR)/boot; \
+       fi; \

Just "mkdir -p $(TARGET_DIR)/boot". Or even better, replace the cp
below with

Quoted 3 lines
        install -D -m 0644 <fromfile> <tofile>
Quoted 2 lines

Wait... this implies that /boot/ is on the rootfs... ext2... and rbpi demands that the "boot" partition will be vfat.. right? What am I missing?

My mistake, this shouldn't got to $(TARGET_DIR) but to $(IMAGES_DIR) which will then can be copied by user to FAT partition of SD card necessary for booting.
There is no need to have it in rootfs/boot.

Cheers,

marek

Quoted 5 lines

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

Signature · 10 lines
as simple and primitive as possible
-------------------------------------------------
Marek Belisko - OPEN-NANDRA
Freelance Developer

Ruska Nova Ves 219 | Presov, 08005 Slovak Republic
Tel: +421 915 052 184
skype: marekwhite
twitter: #opennandra
web: http://open-nandra.com
#11 lore raw

PATCH 1/1 Add package raspberrypi-firmware.

Quoted 16 lines · Belisko Marek
Quoted 15 lines · Diego Iastrubni
Quoted 12 lines · Arnout Vandecappelle

package/raspberrypi-firmware/raspberrypi-firmware.mk line 34

Quoted 5 lines
package/raspberrypi-firmware/raspberrypi-firmware.mk new file +4 -0
+define RASPBERRYPI_FIRMWARE_INSTALL_TARGET_BOOTLOADER
+       if [ ! -d "$(TARGET_DIR)/boot" ]; then \
+               mkdir $(TARGET_DIR)/boot; \
+       fi; \

Just "mkdir -p $(TARGET_DIR)/boot". Or even better, replace the cp
below with

         install -D -m 0644<fromfile>  <tofile>
Quoted 6 lines
Quoted 2 lines

Wait... this implies that /boot/ is on the rootfs... ext2... and rbpi demands that the "boot" partition will be vfat.. right? What am I missing?

My mistake, this shouldn't got to $(TARGET_DIR) but to $(IMAGES_DIR) which will then can be copied by user to FAT partition of SD card necessary for booting.
There is no need to have it in rootfs/boot.

Shouldn't all images be in that boot directory, then? Or rather, doesn't
it make more sense to place the bootfiles directly in the images dir?

Regards,
Arnout

Signature · 6 lines
Arnout Vandecappelle                               arnout at mind be
Senior Embedded Software Architect                 +32-16-286540
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
#12 lore raw

PATCH 1/1 Add package raspberrypi-firmware.

Hi,

Quoted 26 lines · Arnout Vandecappelle
Quoted 25 lines · Belisko Marek
Quoted 21 lines · Diego Iastrubni
Quoted 9 lines · Arnout Vandecappelle

package/raspberrypi-firmware/raspberrypi-firmware.mk line 34

Quoted 6 lines
package/raspberrypi-firmware/raspberrypi-firmware.mk new file +4 -0
+define RASPBERRYPI_FIRMWARE_INSTALL_TARGET_BOOTLOADER
+       if [ ! -d "$(TARGET_DIR)/boot" ]; then \
+               mkdir $(TARGET_DIR)/boot; \
+       fi; \
Quoted 5 lines

Just "mkdir -p $(TARGET_DIR)/boot". Or even better, replace the cp
below with

         install -D -m 0644<fromfile>  <tofile>

Wait... this implies that /boot/ is on the rootfs... ext2... and rbpi demands that the "boot" partition will be vfat.. right? What am I missing?

Quoted 8 lines
Quoted 4 lines

My mistake, this shouldn't got to $(TARGET_DIR) but to $(IMAGES_DIR) which will then can be copied by user to FAT partition of SD card necessary for booting.
There is no need to have it in rootfs/boot.

Shouldn't all images be in that boot directory, then? Or rather, doesn't
it make more sense to place the bootfiles directly in the images dir?

Idea behind /boot directory was to copy raspberrypi booloader files + config file +
kernel cmdline file + kernel bzImage to that directory and compress it to output/images/boot.tar.gz (probably in post-build.sh script) directory to make it
more user friendly (avoid manually copy files from different parts of buildroot).

Quoted 11 lines

Regards,
Arnout

--

Arnout Vandecappelle                               arnout at mind be
Senior Embedded Software Architect                 +32-16-286540
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

Cheers,

marek

Signature · 10 lines
as simple and primitive as possible
-------------------------------------------------
Marek Belisko - OPEN-NANDRA
Freelance Developer

Ruska Nova Ves 219 | Presov, 08005 Slovak Republic
Tel: +421 915 052 184
skype: marekwhite
twitter: #opennandra
web: http://open-nandra.com
#13 lore raw

PATCH 1/1 Add package raspberrypi-firmware.

Quoted 9 lines · Belisko Marek
Quoted 2 lines
Quoted 2 lines

Shouldn't all images be in that boot directory, then? Or rather, doesn't
it make more sense to place the bootfiles directly in the images dir?

Idea behind /boot directory was to copy raspberrypi booloader files + config file +
kernel cmdline file + kernel bzImage to that directory and compress it to output/images/boot.tar.gz (probably in post-build.sh script) directory to make it
more user friendly (avoid manually copy files from different parts of buildroot).

But would the images/ dir contain anything besides the boot.tar.gz? If not,
it makes more sense to put all the required images in the images dir. It's easier to copy the files from there than to untar them.

Ah, of course, there's the rootfs files... But OTOH, you'd also have to handle
bzImage explicitly in some way, so it's just as easy to copy everything except rootfs.* from the images directory.

Regards,
Arnout

Signature · 6 lines
Arnout Vandecappelle                               arnout at mind be
Senior Embedded Software Architect                 +32-16-286540
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
#14 lore raw

PATCH 1/1 Add package raspberrypi-firmware.

Quoted 20 lines · Arnout Vandecappelle
Quoted 5 lines · Belisko Marek
Quoted 4 lines
Quoted 4 lines

Shouldn't all images be in that boot directory, then? Or rather,
doesn't
it make more sense to place the bootfiles directly in the images dir?

Quoted 7 lines

Idea behind /boot directory was to copy raspberrypi booloader files + config file +
kernel cmdline file + kernel bzImage to that directory and compress it to output/images/boot.tar.gz (probably in post-build.sh script) directory to make it
more user friendly (avoid manually copy files from different parts of buildroot).

But would the images/ dir contain anything besides the boot.tar.gz? If
not,
it makes more sense to put all the required images in the images dir. It's easier to copy the files from there than to untar them.

Quoted 5 lines

Ah, of course, there's the rootfs files... But OTOH, you'd also have to
handle
bzImage explicitly in some way, so it's just as easy to copy everything except
rootfs.* from the images directory.

I would prefer to keep boot.tar.gz format. Imagine somebody who build RPI config and in images directory he will have 6 files. How he should know without reading
elinux.org or rpi webpage what and which should be copied where ? With boot.tar.gz we can keep it in
consistent format and if the name will be boot.tar.gz then average user will understand
this should go to boot SD card partition. But this is just my opinion.

Quoted 11 lines

Regards,
Arnout
--

Arnout Vandecappelle                               arnout at mind be
Senior Embedded Software Architect                 +32-16-286540
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

Cheers,

mbe

Signature · 10 lines
as simple and primitive as possible
-------------------------------------------------
Marek Belisko - OPEN-NANDRA
Freelance Developer

Ruska Nova Ves 219 | Presov, 08005 Slovak Republic
Tel: +421 915 052 184
skype: marekwhite
twitter: #opennandra
web: http://open-nandra.com
#15 lore raw

PATCH 1/1 Add package raspberrypi-firmware.

Quoted 8 lines · Belisko Marek

I would prefer to keep boot.tar.gz format. Imagine somebody who build RPI config and in images directory he will have 6 files. How he should know without reading
elinux.org or rpi webpage what and which should be copied where ? With boot.tar.gz we can keep it in
consistent format and if the name will be boot.tar.gz then average user will understand
this should go to boot SD card partition. But this is just my opinion.

Compare to any other defconfig: it will produce a number of files in the images
directory. For instance, a typical TI OMAP will have MLO, u-boot.img, uImage and rootfs.ext2. The first three should go into the FAT partition, the last on into an ext2 partition. For RPi it's the same thing, except that the number of images is a bit larger.

That said, it's a good idea to have a readme.txt in the board directory to
explain how to put everything into a bootable image.

Regards,
Arnout

Signature · 6 lines
Arnout Vandecappelle                               arnout at mind be
Senior Embedded Software Architect                 +32-16-286540
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