All of lore.kernel.org
 help / color / mirror / Atom feed
From: Trevor Woerner <twoerner@gmail.com>
To: yocto@lists.yoctoproject.org
Cc: Quentin Schulz <quentin.schulz@theobroma-systems.com>
Subject: Re: [yocto] [meta-rockchip][PATCH v4 4/5] remove /boot partition
Date: Mon, 26 Feb 2024 10:31:38 -0500	[thread overview]
Message-ID: <20240226153138.GD32880@localhost> (raw)
In-Reply-To: <17B63E2DD347D0FA.14827@lists.yoctoproject.org>

On Thu 2024-02-22 @ 12:04:14 PM, Trevor Woerner via lists.yoctoproject.org wrote:
> In order to boot successfully, most Rockchip SoCs require a specific
> partitioning scheme which was defined many years (and many SoCs) ago. That
> partitioning scheme places the SPL and U-Boot at specific offsets at the
> start of the boot block device:
> 
>         https://opensource.rock-chips.com/wiki_Partitions
> 
> The Rockchip partitioning scheme goes on to also define the locations
> of a number of additional partitions, including the "boot" and "root"
> partitions.
> 
> Since both the SPL and U-Boot have already been placed on the block device,
> the "boot" partition only contains the extlinux config file and the
> kernel+dtb/fitImage; it doesn't contain any bootloader artifacts (other
> than the extlinux config).
> 
> The location of the SPL partition is a hard dependency since the BOOTROM
> etched inside the Rockchip SoCs is programmed to load and run a validated
> binary it finds at this location. The locations of the "boot" and "root"
> partitions are not so rigid since it is U-Boot which interacts with them.
> U-Boot is very flexible with how it finds boot components, and in its
> support for various devices, filesystems, sizes, etc.
> 
> Both oe-core's U-Boot metadata and wic's bootimg-partition script contain
> logic to generate the extlinux pieces required for a bootloader to boot
> a Linux system. If both are enabled, the wic pieces silently clobber the
> U-Boot pieces. However, the mechanisms contained in the U-Boot metadata are
> much more flexible, from a user's point of view, than the mechanisms in
> wic's bootimg-partition.
> 
> If a user wishes to setup some sort of A/B redundant update mechanism, they
> must have redundant root partitions (in order to update their filesystem
> contents) but they also need to have redundant boot partitions if they
> wish to update the kernel as part of their update mechanism. Pairing
> redundant kernel partitions with redundant filesystem partitions becomes
> unnecessarily complicated. Therefore it makes sense to combine the kernel
> and the filesystem into the same partition so that both the kernel and
> filesystem are updated, or rolled back, in lock-step as one unit. Specific
> kernel versions and configurations often have dependencies on user-space
> components and versions.
> 
> The /boot location is not going away. This patch simply transfers
> responsibility for its creation to the more flexible U-Boot mechanism
> and includes the kernel as part of the same partition as the root
> filesystem. Not only does it add flexibility, it also makes update schemes
> more straightforward. Although having a separate /boot partition is a
> "requirement" of the Rockchip partitioning scheme, it is not an actual
> hard requirement when using a flexible, open-source bootloader (such as
> U-Boot) instead of using Rockchip's proprietary miniloader, preloader, and
> trust.img.
> 
> Build-tested for all boards.
> Run-tested on:
> 	nanopi-m4-2gb, nanopi-m4b, nanopi-r2s, nanopi-r4s, roc-rk3328-cc,
> 	rock-3a, rock-5a, rock-5b, rock-pi-4b, rock-pi-e, rock-pi-s,
> 	rock64
> 
> Reviewed-by: Quentin Schulz <quentin.schulz@theobroma-systems.com>
> Signed-off-by: Trevor Woerner <twoerner@gmail.com>
> ---
> changes in v4:
> - updated for latest rockchip.wks
> - remove offset for /boot partition (let wic calculate this)
> 
> changes in v3:
> - add back the comment explaining the need for NONFITDT
> - change the inclusion of the u-boot-extlinux package from RRECOMMENDS
>   to RDEPENDS
> - clarify the commit message to remove the un-true statement that sizes
>   are hard requirements
> - add back the "--ptable gpt" line to rockchip.wks
> 
> changes in v2:
> - add UBOOT_EXTLINUX_FDT and tweak UBOOT_EXTLINUX_FDTDIR to modify their
>   behaviour based on whether or not KERNEL_IMAGETYPE is fitImage
> - remove extraneous WKS_FILE_DEPENDS
> - remove "--ptable gpt" from wks
> - move newly added "earlycon" to UBOOT_EXTLINUX_CONSOLE
> - re-word the commit message to better explain the behaviour of the
>   Rockchip BootROM
> ---
>  conf/machine/include/rockchip-defaults.inc |  2 ++
>  conf/machine/include/rockchip-extlinux.inc | 24 ++++++++++++++++++++++
>  conf/machine/include/rockchip-wic.inc      | 20 ++----------------
>  wic/rockchip.wks                           | 12 +++++------
>  4 files changed, 33 insertions(+), 25 deletions(-)
>  create mode 100644 conf/machine/include/rockchip-extlinux.inc

Applied to meta-rockchip, master branch.


  parent reply	other threads:[~2024-02-26 15:31 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-22 17:04 [meta-rockchip][PATCH v4 1/5] rockchip.wks: specify offsets in sectors Trevor Woerner
2024-02-22 17:04 ` [meta-rockchip][PATCH v4 2/5] rockchip.wks: specify fstype Trevor Woerner
2024-02-22 17:04 ` [meta-rockchip][PATCH v4 3/5] rockchip.wks: add most Rockchip partitions Trevor Woerner
2024-02-22 17:04 ` [meta-rockchip][PATCH v4 4/5] remove /boot partition Trevor Woerner
2024-02-22 17:04 ` [meta-rockchip][PATCH v4 5/5] rockchip.wks: wks file cleanup Trevor Woerner
     [not found] ` <17B63E2C73497FDA.14827@lists.yoctoproject.org>
2024-02-26 15:30   ` [yocto] [meta-rockchip][PATCH v4 2/5] rockchip.wks: specify fstype Trevor Woerner
     [not found] ` <17B63E2D2D80E632.27859@lists.yoctoproject.org>
2024-02-26 15:31   ` [yocto] [meta-rockchip][PATCH v4 3/5] rockchip.wks: add most Rockchip partitions Trevor Woerner
     [not found] ` <17B63E2DD347D0FA.14827@lists.yoctoproject.org>
2024-02-26 15:31   ` Trevor Woerner [this message]
     [not found] ` <17B63E2E80BDA052.14827@lists.yoctoproject.org>
2024-02-26 15:32   ` [yocto] [meta-rockchip][PATCH v4 5/5] rockchip.wks: wks file cleanup Trevor Woerner

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=20240226153138.GD32880@localhost \
    --to=twoerner@gmail.com \
    --cc=quentin.schulz@theobroma-systems.com \
    --cc=yocto@lists.yoctoproject.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.