Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
To: buildroot@busybox.net
Subject: [Buildroot] Location of bootloader files [was: Re: [PATCH 1/2] at91bootstrap3: bump to v3.6.2]
Date: Tue, 17 Jun 2014 09:35:02 +0200	[thread overview]
Message-ID: <20140617093502.7f5e68a9@free-electrons.com> (raw)
In-Reply-To: <539F680B.10405@mind.be>

Arnout, Yann,

On Mon, 16 Jun 2014 23:56:27 +0200, Arnout Vandecappelle wrote:

> > Some of the bootloaders install their files in a sub-directory of
> > $(BINARIES_DIR) (for example rpi-userland, syslinux...), while others
> > (such as this one) install their files directly in $(BINARIES_DIR), and
> > still others install their files in $(TARGET_DIR)/boot (eg. grub.)
> > 
> > Sometime ago, I proposed a patch to install the rpi-userland files in
> > $(TARGET_DIR)/boot, but that was refused, on the principle that the boot
> > partition should not necesarily be exposed/mounted on the running
> > system. That's however what grub1 does.
> 
>  I think for most bootloaders, it just doesn't make sense to install them inside
> the target rootfs, because the (ROM) bootloader anyway can't access these files
> there. Grub is special because the actual bootloader is created by a separate
> installer. For the other bootloaders, there is IMHO no point at all to install
> the bootloader in the target filesystem.

Fully agreed. Most ARM SoCs capable of loading the bootloader for
MMC/eMMC require the bootloader to be stored in a FAT (often FAT16)
filesystem. And such a filesystem cannot be used to store the root
filesystem. So you necessarily need to have at least two partitions:
one FAT partition with the bootloader, and one ext2/3/4 partition (or
any other filesystem) for the root filesystem. So as Arnout says, there
absolutely no point in having the bootloaders installed *inside* the
root filesystem.

There are also some other SoCs where the bootloaders are not even
inside a root filesystem: you have to write the bootloader image, raw,
somewhere at the beginning of the MMC/eMMC storage (not exactly at the
beginning, as it would overwrite the partition table, but somewhere
after the first sector, but before the start of the first partition). I
*think* i.MX28 might be in this category, but it's mainly my colleague
Maxime Ripard who did some i.MX28 stuff, so I might remember incorrect
here.

So really, Grub is the exception here, not the rule.

> >   - if installing files in $(BINARIES_DIR), should we instate a policy
> >     to install them in a sub-dir? What shall that sub-dir be named?
> >     Currently, when followed, the behaviour is to install in a sub-dir
> >     named after the bootloader (eg. $(BINARIES_DIR)/rpi-userland).
> >     Should we stick to that, or just name that directory
> >     $(BINARIES_DIR)/boot ?
> 
>  I don't think $(BINARIES_DIR)/boot is a good place, because that should contain
> everything except the boot loader :-). Also, if you want to do that, you
> probably also want to put the kernel and DTB there. And then there's nothing
> left in $(BINARIES_DIR)...

I'm also unsure we should do something other than what we do currently.
The user generally ends up with very few files in $(BINARIES_DIR), so
it's pretty obvious what to do. The readme.txt for each board gives
some additional details. We could always decide to have certain
packages install a README.<bootloader> file in $(BINARIES_DIR) with
some references/details on how to use the binaries installed here, but
I'm not even sure that's really necessary.

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

  reply	other threads:[~2014-06-17  7:35 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-15 13:33 [Buildroot] [PATCH 1/2] at91bootstrap3: bump to v3.6.2 Thomas Petazzoni
2014-06-15 13:33 ` [Buildroot] [PATCH 2/2] configs: add defconfig for the Atmel SAMA5D3 Xplained board Thomas Petazzoni
2014-06-15 16:58 ` [Buildroot] [PATCH 1/2] at91bootstrap3: bump to v3.6.2 Yann E. MORIN
2014-06-16 21:56   ` [Buildroot] Location of bootloader files [was: Re: [PATCH 1/2] at91bootstrap3: bump to v3.6.2] Arnout Vandecappelle
2014-06-17  7:35     ` Thomas Petazzoni [this message]
     [not found] ` <539EA363.8090604@atmel.com>
2014-06-16  8:28   ` [Buildroot] [PATCH 1/2] at91bootstrap3: bump to v3.6.2 Alexandre Belloni

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=20140617093502.7f5e68a9@free-electrons.com \
    --to=thomas.petazzoni@free-electrons.com \
    --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