[PATCH v2 17/19] Mark DISTRO_DEFAULTS as deprecated
Simon Glass
sjg at chromium.org
Thu Aug 31 05:53:11 CEST 2023
Standard boot has been in place for a while now. Quite a few problems
have been found and fixed. It seems like a good time to mark the
script-based approach as deprecated and encourage people to use standard
boot.
Update the DISTRO_DEFAULTS Kconfig to encourage people to move to
standard boot, which is able to boot Linux distributions automatically.
Add a short migration guide to make this easier.
Signed-off-by: Simon Glass <sjg at chromium.org>
---
Changes in v2:
- Mention in the DISTRO_DEFAULTS option that it is script-based
- Expand and rewrite the commit message
- Use the word 'Mark' instead of 'Make' to improve the English
boot/Kconfig | 7 ++++++-
doc/develop/bootstd.rst | 23 +++++++++++++++++++++++
2 files changed, 29 insertions(+), 1 deletion(-)
diff --git a/boot/Kconfig b/boot/Kconfig
index 458512a4ade2..a7dea0a0623b 100644
--- a/boot/Kconfig
+++ b/boot/Kconfig
@@ -784,7 +784,7 @@ config SYS_BOOT_RAMDISK_HIGH
endmenu # Boot images
config DISTRO_DEFAULTS
- bool "Select defaults suitable for booting general purpose Linux distributions"
+ bool "(deprecated) 'Script-based booting of Linux distributions"
select BOOT_DEFAULTS
select AUTO_COMPLETE
select CMDLINE_EDITING
@@ -792,6 +792,11 @@ config DISTRO_DEFAULTS
select HUSH_PARSER
select SYS_LONGHELP
help
+ Note: These scripts have been replaced by Standard Boot. Do not use
+ them on new boards. See 'Migrating from distro_boot' at
+ doc/develop/bootstd.rst
+
+
Select this to enable various options and commands which are suitable
for building u-boot for booting general purpose Linux distributions.
diff --git a/doc/develop/bootstd.rst b/doc/develop/bootstd.rst
index c01e0971dc84..ddcd05f931ad 100644
--- a/doc/develop/bootstd.rst
+++ b/doc/develop/bootstd.rst
@@ -458,6 +458,28 @@ ready File was loaded and is ready for use. In this state the bootflow is
======= =======================================================================
+Migrating from distro_boot
+--------------------------
+
+To migrate from distro_boot:
+
+#. Update your board header files to remove the BOOTENV and BOOT_TARGET_xxx
+ defines. Standard boot finds available boot devices automatically.
+
+#. Remove the "boot_targets" variable unless you need it. Standard boot uses a
+ default order from fastest to slowest, which generally matches the order used
+ by boards.
+
+#. Make sure that CONFIG_BOOTSTD_DEFAULTS is enabled by your board, so it can
+ boot common Linux distributions.
+
+An example patch is at migrate_patch_.
+
+If you are using custom boot scripts for your board, consider creating your
+own bootmeth to hold the logic. There are various examples at
+`boot/bootmeth_...`.
+
+
Theory of operation
-------------------
@@ -769,3 +791,4 @@ Other ideas:
.. _BootLoaderSpec: http://www.freedesktop.org/wiki/Specifications/BootLoaderSpec/
.. _distro_boot: https://github.com/u-boot/u-boot/blob/master/boot/distro.c
.. _bootflow_h: https://github.com/u-boot/u-boot/blob/master/include/bootflow.h
+.. _migrate_patch: https://patchwork.ozlabs.org/project/uboot/patch/20230727215433.578830-2-sjg@chromium.org/
--
2.42.0.rc2.253.gd59a3bf2b4-goog
More information about the U-Boot
mailing list