[PATCH 0/5] add createnv command to create environment partition
Sascha Hauer
s.hauer at pengutronix.de
Mon Jun 2 06:28:34 PDT 2025
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 at 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 | 9 +++
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 | 6 ++
15 files changed, 279 insertions(+), 19 deletions(-)
---
base-commit: c31204804b17f2c07608329a8df6d88e4196cb73
change-id: 20250602-createnv-11c4279116d4
Best regards,
--
Sascha Hauer <s.hauer at pengutronix.de>
More information about the barebox
mailing list