From: "Eric Bénard" <eric@eukrea.com>
To: David Vincent <freesilicon@gmail.com>
Cc: openembedded-core@lists.openembedded.org
Subject: Re: [PATCH] barebox: Add recipe
Date: Mon, 28 Jul 2014 13:58:53 +0200 [thread overview]
Message-ID: <20140728135853.35af7ee0@e6520eb> (raw)
In-Reply-To: <1406541304-18741-1-git-send-email-freesilicon@gmail.com>
Hi David,
Le Mon, 28 Jul 2014 11:55:04 +0200,
David Vincent <freesilicon@gmail.com> a écrit :
>
> barebox (formerly known as u-boot-v2) is a bootloader that inherits the
> best of U-Boot and the Linux kernel. This commit adds the possibility to
> use it as a virtual/bootloader instead of U-Boot.
>
> Signed-off-by: David Vincent <freesilicon@gmail.com>
> ---
> meta/recipes-bsp/barebox/barebox.inc | 73 +++++++++++++++++++++++++
> meta/recipes-bsp/barebox/barebox_2014.07.0.bb | 15 +++++
> 2 files changed, 88 insertions(+)
> create mode 100644 meta/recipes-bsp/barebox/barebox.inc
> create mode 100644 meta/recipes-bsp/barebox/barebox_2014.07.0.bb
>
> diff --git a/meta/recipes-bsp/barebox/barebox.inc b/meta/recipes-bsp/barebox/barebox.inc
> new file mode 100644
> index 0000000..68aeb68
> --- /dev/null
> +++ b/meta/recipes-bsp/barebox/barebox.inc
> @@ -0,0 +1,73 @@
> +SUMMARY = "The Barebox Bootloader"
> +DESCRIPTION = "Barebox (formerly known as u-boot-v2) is a bootloader that inherits the best of U-Boot and the Linux kernel: The size and look-and-feel of u-boot, with driver model and lots of design concepts from the kernel."
> +HOMEPAGE = "http://www.barebox.org"
> +SECTION = "bootloaders"
> +PROVIDES = "virtual/bootloader"
> +
> +inherit cml1 deploy kernel-arch
> +
> +EXTRA_OEMAKE = 'CROSS_COMPILE=${TARGET_PREFIX} CC="${TARGET_PREFIX}gcc ${TOOLCHAIN_OPTIONS}"'
> +
> +BAREBOX_BINARY ?= "barebox.bin"
> +BAREBOX_IMAGE ?= "barebox-${MACHINE}-${PV}-${PR}.bin"
> +BAREBOX_SYMLINK ?= "barebox-${MACHINE}.bin"
> +
> +do_configure () {
> + # Copy defconfig to .config if .config does not exist. This allows
> + # recipes to manage the .config themselves in do_configure_prepend().
> + if [ -f "${WORKDIR}/defconfig" ] && [ ! -f "${B}/.config" ]; then
> + cp "${WORKDIR}/defconfig" "${B}/.config"
> + fi
> +
> + # Use board default defconfig if .config does not exist. This allows
> + # recipes to manage the .config themselves in do_configure_prepend().
> + if [ ! -f "${B}/.config" ]; then
> + oe_runmake_call ${BAREBOX_TARGET}
> + fi
> +
> + cml1_do_configure
> +}
> +
> +do_compile () {
> + if [ "${@bb.utils.contains('DISTRO_FEATURES', 'ld-is-gold', 'ld-is-gold', '', d)}" = "ld-is-gold" ] ; then
> + sed -i 's/$(CROSS_COMPILE)ld$/$(CROSS_COMPILE)ld.bfd/g' ${S}/Makefile
> + fi
> +
I had to add that a few year ago : is that still needed ?
> + unset CFLAGS CPPFLAGS LDFLAGS
> + oe_runmake
> +}
> +
> +do_install () {
> + install -d ${D}/boot
> + install ${S}/barebox-flash-image ${D}/boot/${BAREBOX_IMAGE}
> + ln -sf ${BAREBOX_IMAGE} ${D}/boot/${BAREBOX_BINARY}
> +
> + # Install target tools if available
> + install -d ${D}${sbindir}
> +
> + if [ -e ${WORKDIR}/scripts/bareboxenv-target ]; then
> + install -m 0755 ${WORKDIR}/scripts/bareboxenv-target ${D}${sbindir}/bareboxenv
> + fi
> +
> + if [ -e ${WORKDIR}/scripts/bareboxcrc32-target ]; then
> + install -m 0755 ${WORKDIR}/scripts/bareboxcrc32-target ${D}${sbindir}/bareboxcrc32
> + fi
> +
> + if [ -e ${WORKDIR}/scripts/kernel-install-target ]; then
> + install -m 0755 ${WORKDIR}/scripts/kernel-install-target ${D}${sbindir}/kernel-install
> + fi
> +}
> +
> +FILES_${PN} = "/boot ${sbindir}"
Why not splitting the tools in their own package so that we can have
the tools on the target without having the binary in /boot ?
> +
> +do_deploy () {
> + install -d ${DEPLOYDIR}
> + install ${S}/barebox-flash-image ${DEPLOYDIR}/${BAREBOX_IMAGE}
> +
Why don't you use $BAREBOX_BINARY instead of hardcoding
barebox-flash-image which won't work on old versions of barebox where
barebox's binary is named barebox.bin ?
Best regards,
Eric
next prev parent reply other threads:[~2014-07-28 11:58 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-28 9:55 [PATCH] barebox: Add recipe David Vincent
2014-07-28 10:23 ` Richard Purdie
[not found] ` <CAKRNOGwGr3BM8FTMoqjNQ+p0tFKUj55RdyL+0wemf_7f1r1UcQ@mail.gmail.com>
2014-07-28 12:02 ` David Vincent
2014-07-30 11:46 ` Stefan Müller-Klieser
2014-07-30 16:56 ` Khem Raj
2014-07-28 11:58 ` Eric Bénard [this message]
2014-07-28 12:15 ` David Vincent
2014-07-28 14:42 ` Eric Bénard
2014-07-30 9:40 ` David Vincent
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=20140728135853.35af7ee0@e6520eb \
--to=eric@eukrea.com \
--cc=freesilicon@gmail.com \
--cc=openembedded-core@lists.openembedded.org \
/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