Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Arnout Vandecappelle <arnout@mind.be>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH] Add package raspberrypi-firmware.
Date: Wed, 19 Sep 2012 00:01:58 +0200	[thread overview]
Message-ID: <5058EF56.3070208@mind.be> (raw)
In-Reply-To: <1347914057-20287-1-git-send-email-marek.belisko@open-nandra.com>

On 09/17/12 22:34, Marek Belisko wrote:
[snip]
> diff --git a/package/raspberrypi-firmware/raspberrypi-firmware.mk b/package/raspberrypi-firmware/raspberrypi-firmware.mk
> new file mode 100644
> index 0000000..1ebf67c
> --- /dev/null
> +++ b/package/raspberrypi-firmware/raspberrypi-firmware.mk
> @@ -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.

> +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.

> +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 .

> +	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
> +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>

> +	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

> +		$(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))
> +

-- 
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

  parent reply	other threads:[~2012-09-18 22:01 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-17 20:34 [Buildroot] [PATCH] Add package raspberrypi-firmware Marek Belisko
2012-09-17 20:43 ` Thomas Petazzoni
2012-09-17 21:01 ` Yann E. MORIN
2012-09-17 21:50   ` Yann E. MORIN
2012-09-18  5:09     ` Thomas Petazzoni
2012-09-18 17:47       ` Yann E. MORIN
2012-09-18 18:06         ` Thomas Petazzoni
2012-09-18 21:53           ` [Buildroot] Two packages with the same source [was: [PATCH] Add package raspberrypi-firmware.] Arnout Vandecappelle
2012-09-18 22:01 ` Arnout Vandecappelle [this message]
2012-09-19  7:59   ` [Buildroot] [PATCH] Add package raspberrypi-firmware Diego Iastrubni
2012-09-19  8:09     ` Belisko Marek
2012-09-19 19:49       ` Arnout Vandecappelle
2012-09-19 20:08         ` Belisko Marek
2012-09-19 21:28           ` Arnout Vandecappelle
2012-09-19 21:50             ` Belisko Marek
2012-09-19 23:10               ` Arnout Vandecappelle

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5058EF56.3070208@mind.be \
    --to=arnout@mind.be \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox