mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: BAREBOX <barebox@lists.infradead.org>
Subject: [PATCH v2 0/5] add createnv command to create environment partition
Date: Fri, 20 Jun 2025 11:46:58 +0200	[thread overview]
Message-ID: <20250620-createnv-v2-0-7fd3cc286b9a@pengutronix.de> (raw)

We want to move away from describing the barebox environment explicitly
in the device tree and instead motivate usage of GPT partitions for the
envrionment. This series creates a createnv command to facilitate this.
It creates an environment partition on the specified device and if
necessary also a GPT partition table. In the simplest case a "createnv"
without arguments will create a partition on the device barebox itself
booted from. Both the device and the size of the partition can be
specified on the command line.

As the first GPT partition as well as the GPT partition entries might
conflict with a barebox written on the device on certain SoCs this
series also includes patches to move the first partition up to the 8MiB
boundary leaving space for a barebox binary written onto the raw device.
On Some SoCs (i.MX7 and earlier) the GPT partition entries also collide
with the barebox binary, so these are moved up to just below the 8MiB
boundary.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
---
Changes in v2:
- Move MCI_STARTUP_NONE to first entry to make it the default (Ahmad)
- make 8MiB offset for first usable LBA configurable (Marco)
- Link to v1: https://lore.barebox.org/20250602-createnv-v1-0-c3239ff875d5@pengutronix.de

---
Sascha Hauer (5):
      partitions: efi: calculate instead of hardcode gpt header fields
      partitions: Start partitions at 8MiB offset
      cdev: fix cdev_open_by_name() misuse
      commands: create createnv command
      mci: add option to detect non-removable cards during startup

 commands/Kconfig        |  18 +++++
 commands/Makefile       |   1 +
 commands/createnv.c     | 179 ++++++++++++++++++++++++++++++++++++++++++++++++
 commands/devlookup.c    |   4 +-
 commands/findmnt.c      |   2 +-
 commands/parted.c       |   2 +-
 common/partitions.c     |  45 ++++++++++++
 common/partitions/efi.c |  21 ++++--
 drivers/mci/Kconfig     |  21 +++++-
 drivers/mci/mci-core.c  |   6 +-
 fs/devfs-core.c         |  17 ++++-
 fs/fs.c                 |   6 +-
 include/driver.h        |   5 ++
 include/mci.h           |   1 +
 include/partitions.h    |   2 +
 15 files changed, 311 insertions(+), 19 deletions(-)
---
base-commit: b7a40f473de4de2307eabfa6a7a25be895ea1365
change-id: 20250602-createnv-11c4279116d4

Best regards,
-- 
Sascha Hauer <s.hauer@pengutronix.de>




             reply	other threads:[~2025-06-20 10:47 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-20  9:46 Sascha Hauer [this message]
2025-06-20  9:46 ` [PATCH v2 1/5] partitions: efi: calculate instead of hardcode gpt header fields Sascha Hauer
2025-06-20  9:47 ` [PATCH v2 2/5] partitions: Start partitions at 8MiB offset Sascha Hauer
2025-06-20  9:47 ` [PATCH v2 3/5] cdev: fix cdev_open_by_name() misuse Sascha Hauer
2025-06-20  9:47 ` [PATCH v2 4/5] commands: create createnv command Sascha Hauer
2025-06-20  9:47 ` [PATCH v2 5/5] mci: add option to detect non-removable cards during startup Sascha Hauer

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=20250620-createnv-v2-0-7fd3cc286b9a@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.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