blob: 1d2f9c4c32bca67717da433984ddd3f9e0e65866 [file] [log] [blame]
Simon Glass57695312021-10-14 12:48:10 -06001.. SPDX-License-Identifier: GPL-2.0+
Dennis Gilmoreb9776072015-01-22 11:34:20 -07002
3Generic Distro Configuration Concept
4====================================
5
6Linux distributions are faced with supporting a variety of boot mechanisms,
7environments or bootloaders (PC BIOS, EFI, U-Boot, Barebox, ...). This makes
8life complicated. Worse, bootloaders such as U-Boot have a configurable set
9of features, and each board chooses to enable a different set of features.
10Hence, distros typically need to have board-specific knowledge in order to
11set up a bootable system.
12
13This document defines a common set of U-Boot features that are required for
14a distro to support the board in a generic fashion. Any board wishing to
15allow distros to install and boot in an out-of-the-box fashion should enable
16all these features. Linux distros can then create a single set of boot
17support/install logic that targets these features. This will allow distros
18to install on many boards without the need for board-specific logic.
19
20In fact, some of these features can be implemented by any bootloader, thus
21decoupling distro install/boot logic from any knowledge of the bootloader.
22
23This model assumes that boards will load boot configuration files from a
24regular storage mechanism (eMMC, SD card, USB Disk, SATA disk, etc.) with
Masahiro Yamada7790de72015-07-07 18:47:17 +090025a standard partitioning scheme (MBR, GPT). Boards that cannot support this
Dennis Gilmoreb9776072015-01-22 11:34:20 -070026storage model are outside the scope of this document, and may still need
27board-specific installer/boot-configuration support in a distro.
28
29To some extent, this model assumes that a board has a separate boot flash
30that contains U-Boot, and that the user has somehow installed U-Boot to this
31flash before running the distro installer. Even on boards that do not conform
32to this aspect of the model, the extent of the board-specific support in the
33distro installer logic would be to install a board-specific U-Boot package to
Masahiro Yamada7790de72015-07-07 18:47:17 +090034the boot partition during installation. This distro-supplied U-Boot can still
35implement the same features as on any other board, and hence the distro's boot
36configuration file generation logic can still be board-agnostic.
Dennis Gilmoreb9776072015-01-22 11:34:20 -070037
38Locating Bootable Disks
39-----------------------
40
41Typical desktop/server PCs search all (or a user-defined subset of) attached
42storage devices for a bootable partition, then load the bootloader or boot
43configuration files from there. A U-Boot board port that enables the features
44mentioned in this document will search for boot configuration files in the
45same way.
46
47Thus, distros do not need to manipulate any kind of bootloader-specific
48configuration data to indicate which storage device the system should boot
49from.
50
51Distros simply need to install the boot configuration files (see next
52section) in an ext2/3/4 or FAT partition, mark the partition bootable (via
53the MBR bootable flag, or GPT legacy_bios_bootable attribute), and U-Boot (or
54any other bootloader) will find those boot files and execute them. This is
55conceptually identical to creating a grub2 configuration file on a desktop
56PC.
57
Masahiro Yamada7790de72015-07-07 18:47:17 +090058Note that in the absence of any partition that is explicitly marked bootable,
Dennis Gilmoreb9776072015-01-22 11:34:20 -070059U-Boot falls back to searching the first valid partition of a disk for boot
60configuration files. Other bootloaders are recommended to do the same, since
61I believe that partition table bootable flags aren't so commonly used outside
62the realm of x86 PCs.
63
64U-Boot can also search for boot configuration files from a TFTP server.
65
66Boot Configuration Files
67------------------------
68
69The standard format for boot configuration files is that of extlinux.conf, as
Tom Rinia4bc4812024-12-21 11:45:29 -060070handled by U-Boot's "syslinux" (disk) or "pxe boot" (network). This format is
71not formally standardized and documented in a single location. However, other
72implementations do document it and we attempt to be as compatible as possible.
Dennis Gilmoreb9776072015-01-22 11:34:20 -070073
Tom Rinia4bc4812024-12-21 11:45:29 -060074* The UAPI Group Specifications `Boot Loader Specification`_
Dennis Gilmoreb9776072015-01-22 11:34:20 -070075
Tom Rinia4bc4812024-12-21 11:45:29 -060076* The Syslinux Project documents both `PXELINUX`_ and `SYSLINUX`_ files and is
77 the originator of the format.
78
79That said, we have some differences to these documents, namely:
Dennis Gilmoreb9776072015-01-22 11:34:20 -070080
81* Prescribes a separate configuration per boot menu option, whereas U-Boot
82 lumps all options into a single extlinux.conf file. Hence, U-Boot searches
83 for /extlinux/extlinux.conf then /boot/extlinux/extlinux.conf on disk, or
84 pxelinux.cfg/default over the network.
85
86* Does not document the fdtdir option, which automatically selects the DTB to
87 pass to the kernel.
88
Svyatoslav Ryhel08b7849e2024-01-25 22:16:54 +020089* If no fdt/fdtdir is provided, the U-Boot will pass its own currently used
90 device tree.
91
92* If ``-`` is passed as fdt argument and ``CONFIG_SUPPORT_PASSING_ATAGS`` is
93 enabled, then no device tree will be used (legacy booting / pre-dtb kernel).
94
Edoardo Tomelleri6acf1b92022-09-21 15:26:33 +020095See also doc/README.pxe under 'pxe file format'.
96
Simon Glass57695312021-10-14 12:48:10 -060097One example extlinux.conf generated by the Fedora installer is::
Dennis Gilmoreb9776072015-01-22 11:34:20 -070098
Simon Glass57695312021-10-14 12:48:10 -060099 # extlinux.conf generated by anaconda
Dennis Gilmoreb9776072015-01-22 11:34:20 -0700100
Simon Glass57695312021-10-14 12:48:10 -0600101 ui menu.c32
Dennis Gilmoreb9776072015-01-22 11:34:20 -0700102
Simon Glass57695312021-10-14 12:48:10 -0600103 menu autoboot Welcome to Fedora. Automatic boot in # second{,s}. Press a key for options.
104 menu title Fedora Boot Options.
105 menu hidden
Dennis Gilmoreb9776072015-01-22 11:34:20 -0700106
Simon Glass57695312021-10-14 12:48:10 -0600107 timeout 50
108 #totaltimeout 9000
Dennis Gilmoreb9776072015-01-22 11:34:20 -0700109
Simon Glass57695312021-10-14 12:48:10 -0600110 default Fedora (3.17.0-0.rc4.git2.1.fc22.armv7hl+lpae) 22 (Rawhide)
Dennis Gilmoreb9776072015-01-22 11:34:20 -0700111
Simon Glass57695312021-10-14 12:48:10 -0600112 label Fedora (3.17.0-0.rc4.git2.1.fc22.armv7hl) 22 (Rawhide)
113 kernel /boot/vmlinuz-3.17.0-0.rc4.git2.1.fc22.armv7hl
114 append ro root=UUID=8eac677f-8ea8-4270-8479-d5ddbb797450 console=ttyS0,115200n8 LANG=en_US.UTF-8 drm.debug=0xf
115 fdtdir /boot/dtb-3.17.0-0.rc4.git2.1.fc22.armv7hl
116 initrd /boot/initramfs-3.17.0-0.rc4.git2.1.fc22.armv7hl.img
Dennis Gilmoreb9776072015-01-22 11:34:20 -0700117
Simon Glass57695312021-10-14 12:48:10 -0600118 label Fedora (3.17.0-0.rc4.git2.1.fc22.armv7hl+lpae) 22 (Rawhide)
119 kernel /boot/vmlinuz-3.17.0-0.rc4.git2.1.fc22.armv7hl+lpae
120 append ro root=UUID=8eac677f-8ea8-4270-8479-d5ddbb797450 console=ttyS0,115200n8 LANG=en_US.UTF-8 drm.debug=0xf
121 fdtdir /boot/dtb-3.17.0-0.rc4.git2.1.fc22.armv7hl+lpae
122 initrd /boot/initramfs-3.17.0-0.rc4.git2.1.fc22.armv7hl+lpae.img
Dennis Gilmoreb9776072015-01-22 11:34:20 -0700123
Simon Glass57695312021-10-14 12:48:10 -0600124 label Fedora-0-rescue-8f6ba7b039524e0eb957d2c9203f04bc (0-rescue-8f6ba7b039524e0eb957d2c9203f04bc)
125 kernel /boot/vmlinuz-0-rescue-8f6ba7b039524e0eb957d2c9203f04bc
126 initrd /boot/initramfs-0-rescue-8f6ba7b039524e0eb957d2c9203f04bc.img
127 append ro root=UUID=8eac677f-8ea8-4270-8479-d5ddbb797450 console=ttyS0,115200n8
128 fdtdir /boot/dtb-3.16.0-0.rc6.git1.1.fc22.armv7hl+lpae
Dennis Gilmoreb9776072015-01-22 11:34:20 -0700129
Edoardo Tomelleri6acf1b92022-09-21 15:26:33 +0200130
131One example of hand-crafted extlinux.conf::
132
133 menu title Select kernel
134 timeout 100
135
136 label Arch with uart devicetree overlay
137 kernel /arch/Image.gz
138 initrd /arch/initramfs-linux.img
139 fdt /dtbs/arch/board.dtb
140 fdtoverlays /dtbs/arch/overlay/uart0-gpio0-1.dtbo
141 append console=ttyS0,115200 console=tty1 rw root=UUID=fc0d0284-ca84-4194-bf8a-4b9da8d66908
142
143 label Arch with uart devicetree overlay but with Boot Loader Specification keys
144 kernel /arch/Image.gz
145 initrd /arch/initramfs-linux.img
146 devicetree /dtbs/arch/board.dtb
147 devicetree-overlay /dtbs/arch/overlay/uart0-gpio0-1.dtbo
148 append console=ttyS0,115200 console=tty1 rw root=UUID=fc0d0284-ca84-4194-bf8a-4b9da8d66908
Dennis Gilmoreb9776072015-01-22 11:34:20 -0700149
Simon Glass57695312021-10-14 12:48:10 -0600150Another hand-crafted network boot configuration file is::
Dennis Gilmoreb9776072015-01-22 11:34:20 -0700151
Simon Glass57695312021-10-14 12:48:10 -0600152 TIMEOUT 100
Dennis Gilmoreb9776072015-01-22 11:34:20 -0700153
Simon Glass57695312021-10-14 12:48:10 -0600154 MENU TITLE TFTP boot options
Dennis Gilmoreb9776072015-01-22 11:34:20 -0700155
Simon Glass57695312021-10-14 12:48:10 -0600156 LABEL jetson-tk1-emmc
157 MENU LABEL ../zImage root on Jetson TK1 eMMC
158 LINUX ../zImage
159 FDTDIR ../
160 APPEND console=ttyS0,115200n8 console=tty1 loglevel=8 rootwait rw earlyprintk root=PARTUUID=80a5a8e9-c744-491a-93c1-4f4194fd690b
Dennis Gilmoreb9776072015-01-22 11:34:20 -0700161
Simon Glass57695312021-10-14 12:48:10 -0600162 LABEL venice2-emmc
163 MENU LABEL ../zImage root on Venice2 eMMC
164 LINUX ../zImage
165 FDTDIR ../
166 APPEND console=ttyS0,115200n8 console=tty1 loglevel=8 rootwait rw earlyprintk root=PARTUUID=5f71e06f-be08-48ed-b1ef-ee4800cc860f
Dennis Gilmoreb9776072015-01-22 11:34:20 -0700167
Simon Glass57695312021-10-14 12:48:10 -0600168 LABEL sdcard
169 MENU LABEL ../zImage, root on 2GB sdcard
170 LINUX ../zImage
171 FDTDIR ../
172 APPEND console=ttyS0,115200n8 console=tty1 loglevel=8 rootwait rw earlyprintk root=PARTUUID=b2f82cda-2535-4779-b467-094a210fbae7
173
174 LABEL fedora-installer-fk
175 MENU LABEL Fedora installer w/ Fedora kernel
176 LINUX fedora-installer/vmlinuz
177 INITRD fedora-installer/initrd.img.orig
178 FDTDIR fedora-installer/dtb
179 APPEND loglevel=8 ip=dhcp inst.repo=http://10.0.0.2/mirrors/fedora/linux/development/rawhide/armhfp/os/ rd.shell cma=64M
Dennis Gilmoreb9776072015-01-22 11:34:20 -0700180
181U-Boot Implementation
182=====================
183
184Enabling the distro options
185---------------------------
186
Hans de Goedef99c5cb2016-06-20 23:16:28 +0200187In your board's defconfig, enable the DISTRO_DEFAULTS option by adding
188a line with "CONFIG_DISTRO_DEFAULTS=y". If you want to enable this
189from Kconfig itself, for e.g. all boards using a specific SoC then
Masahiro Yamada9afc6c52018-04-25 18:47:52 +0900190add a "imply DISTRO_DEFAULTS" to your SoC CONFIG option.
Hans de Goedef99c5cb2016-06-20 23:16:28 +0200191
Simon Glass83b9be62022-04-24 23:31:26 -0600192
193TO BE UPDATED:
194
Simon Glass57695312021-10-14 12:48:10 -0600195In your board configuration file, include the following::
Dennis Gilmoreb9776072015-01-22 11:34:20 -0700196
Simon Glass0e84d962024-09-29 19:49:50 -0600197 #ifndef CONFIG_XPL_BUILD
Simon Glass57695312021-10-14 12:48:10 -0600198 #include <config_distro_bootcmd.h>
199 #endif
Dennis Gilmoreb9776072015-01-22 11:34:20 -0700200
201The first of those headers primarily enables a core set of U-Boot features,
202such as support for MBR and GPT partitions, ext* and FAT filesystems, booting
203raw zImage and initrd (rather than FIT- or uImage-wrapped files), etc. Network
204boot support is also enabled here, which is useful in order to boot distro
205installers given that distros do not commonly distribute bootable install
206media for non-PC targets at present.
207
208Finally, a few options that are mostly relevant only when using U-Boot-
209specific boot.scr scripts are enabled. This enables distros to generate a
210U-Boot-specific boot.scr script rather than extlinux.conf as the boot
211configuration file. While doing so is fully supported, and
Adam Fordc8d34622018-02-06 07:49:32 -0600212CONFIG_DISTRO_DEFAULTS exposes enough parameterization to boot.scr to
Dennis Gilmoreb9776072015-01-22 11:34:20 -0700213allow for board-agnostic boot.scr content, this document recommends that
214distros generate extlinux.conf rather than boot.scr. extlinux.conf is intended
215to work across multiple bootloaders, whereas boot.scr will only work with
216U-Boot. TODO: document the contract between U-Boot and boot.scr re: which
217environment variables a generic boot.scr may rely upon.
218
219The second of those headers sets up the default environment so that $bootcmd
220is defined in a way that searches attached disks for boot configuration files,
221and executes them if found.
222
223Required Environment Variables
224------------------------------
225
226The U-Boot "syslinux" and "pxe boot" commands require a number of environment
227variables be set. Default values for these variables are often hard-coded into
Tom Rinic9edebe2022-12-04 10:03:50 -0500228CFG_EXTRA_ENV_SETTINGS in the board's U-Boot configuration file, so that
Dennis Gilmoreb9776072015-01-22 11:34:20 -0700229the user doesn't have to configure them.
230
231fdt_addr:
Dennis Gilmoreb9776072015-01-22 11:34:20 -0700232 Mandatory for any system that provides the DTB in HW (e.g. ROM) and wishes
233 to pass that DTB to Linux, rather than loading a DTB from the boot
234 filesystem. Prohibited for any other system.
235
236 If specified a DTB to boot the system must be available at the given
237 address.
238
239fdt_addr_r:
Dennis Gilmoreb9776072015-01-22 11:34:20 -0700240 Mandatory. The location in RAM where the DTB will be loaded or copied to when
241 processing the fdtdir/devicetreedir or fdt/devicetree options in
242 extlinux.conf.
243
244 This is mandatory even when fdt_addr is provided, since extlinux.conf must
245 always be able to provide a DTB which overrides any copy provided by the HW.
246
247 A size of 1MB for the FDT/DTB seems reasonable.
248
Edoardo Tomelleri6acf1b92022-09-21 15:26:33 +0200249fdtoverlay_addr_r:
250 Mandatory. The location in RAM where DTB overlays will be temporarily
251 stored and then applied in the load order to the fdt blob stored at the
252 address indicated in the fdt_addr_r environment variable.
253
Dennis Gilmore66cb0d02020-09-11 11:56:59 -0500254fdtfile:
Dennis Gilmore66cb0d02020-09-11 11:56:59 -0500255 Mandatory. the name of the DTB file for the specific board for instance
256 the espressobin v5 board the value is "marvell/armada-3720-espressobin.dtb"
257 while on a clearfog pro it is "armada-388-clearfog-pro.dtb" in the case of
258 a board providing its firmware based DTB this value can be used to override
259 the DTB with a different DTB. fdtfile will automatically be set for you if
260 it matches the format ${soc}-${board}.dtb which covers most 32 bit use cases.
261 AArch64 generally does not match as the Linux kernel put the dtb files under
Wolfgang Denk9d328a62021-09-27 17:42:38 +0200262 SoC vendor directories.
Dennis Gilmore66cb0d02020-09-11 11:56:59 -0500263
Dennis Gilmoreb9776072015-01-22 11:34:20 -0700264ramdisk_addr_r:
Dennis Gilmoreb9776072015-01-22 11:34:20 -0700265 Mandatory. The location in RAM where the initial ramdisk will be loaded to
266 when processing the initrd option in extlinux.conf.
267
Simon Glass57695312021-10-14 12:48:10 -0600268 It is recommended that this location be highest in RAM out of fdt_addr_r,
Dennis Gilmoreb9776072015-01-22 11:34:20 -0700269 kernel_addr_r, and ramdisk_addr_r, so that the RAM disk can vary in size
270 and use any available RAM.
271
272kernel_addr_r:
Dennis Gilmoreb9776072015-01-22 11:34:20 -0700273 Mandatory. The location in RAM where the kernel will be loaded to when
274 processing the kernel option in the extlinux.conf.
275
276 The kernel should be located within the first 128M of RAM in order for the
277 kernel CONFIG_AUTO_ZRELADDR option to work, which is likely enabled on any
278 distro kernel. Since the kernel will decompress itself to 0x8000 after the
Masahiro Yamada7790de72015-07-07 18:47:17 +0900279 start of RAM, kernel_addr_r should not overlap that area, or the kernel will
Dennis Gilmoreb9776072015-01-22 11:34:20 -0700280 have to copy itself somewhere else first before decompression.
281
282 A size of 16MB for the kernel is likely adequate.
283
Atish Patra99c469c2020-03-05 16:24:23 -0800284kernel_comp_addr_r:
285 Optional. This is only required if user wants to boot Linux from a compressed
Heinrich Schuchardtf3fb75d2021-02-17 08:06:05 +0100286 Image(.gz, .bz2, .lzma, .lzo) using the booti command. It represents the
287 location in RAM where the compressed Image will be decompressed temporarily.
288 Once the decompression is complete, the decompressed data will be moved to
289 kernel_addr_r for booting.
Atish Patra99c469c2020-03-05 16:24:23 -0800290
291kernel_comp_size:
292 Optional. This is only required if user wants to boot Linux from a compressed
293 Image using booti command. It represents the size of the compressed file. The
294 size has to at least the size of loaded image for decompression to succeed.
295
Vagrant Cascadianf4d4d1b2016-02-08 19:55:31 -0800296pxefile_addr_r:
Dennis Gilmoreb9776072015-01-22 11:34:20 -0700297 Mandatory. The location in RAM where extlinux.conf will be loaded to prior
298 to processing.
299
300 A size of 1MB for extlinux.conf is more than adequate.
301
302scriptaddr:
Dennis Gilmoreb9776072015-01-22 11:34:20 -0700303 Mandatory, if the boot script is boot.scr rather than extlinux.conf. The
304 location in RAM where boot.scr will be loaded to prior to execution.
305
306 A size of 1MB for extlinux.conf is more than adequate.
307
308For suggestions on memory locations for ARM systems, you must follow the
309guidelines specified in Documentation/arm/Booting in the Linux kernel tree.
310
311For a commented example of setting these values, please see the definition of
312MEM_LAYOUT_ENV_SETTINGS in include/configs/tegra124-common.h.
313
314Boot Target Configuration
315-------------------------
316
Simon Glass57695312021-10-14 12:48:10 -0600317The `config_distro_bootcmd.h` file defines $bootcmd and many helper command
318variables that automatically search attached disks for boot configuration files
319and execute them. Boards must provide configure <config_distro_bootcmd.h> so
320that it supports the correct set of possible boot device types. To provide this
Dennis Gilmoreb9776072015-01-22 11:34:20 -0700321configuration, simply define macro BOOT_TARGET_DEVICES prior to including
Simon Glass57695312021-10-14 12:48:10 -0600322<config_distro_bootcmd.h>. For example::
Dennis Gilmoreb9776072015-01-22 11:34:20 -0700323
Simon Glass0e84d962024-09-29 19:49:50 -0600324 #ifndef CONFIG_XPL_BUILD
Simon Glass57695312021-10-14 12:48:10 -0600325 #define BOOT_TARGET_DEVICES(func) \
326 func(MMC, mmc, 1) \
327 func(MMC, mmc, 0) \
328 func(USB, usb, 0) \
329 func(PXE, pxe, na) \
330 func(DHCP, dhcp, na)
331 #include <config_distro_bootcmd.h>
332 #endif
Dennis Gilmoreb9776072015-01-22 11:34:20 -0700333
334Each entry in the macro defines a single boot device (e.g. a specific eMMC
335device or SD card) or type of boot device (e.g. USB disk). The parameters to
336the func macro (passed in by the internal implementation of the header) are:
337
Pali Rohár7ab22002022-04-06 11:35:46 +0200338- Upper-case disk type (DHCP, HOST, IDE, MMC, NVME, PXE, SATA, SCSI, UBIFS, USB,
339 VIRTIO).
Dennis Gilmoreb9776072015-01-22 11:34:20 -0700340- Lower-case disk type (same options as above).
341- ID of the specific disk (MMC only) or ignored for other types.
342
343User Configuration
344==================
345
346Once the user has installed U-Boot, it is expected that the environment will
347be reset to the default values in order to enable $bootcmd and friends, as set
348up by <config_distro_bootcmd.h>. After this, various environment variables may
349be altered to influence the boot process:
350
351boot_targets:
Dennis Gilmoreb9776072015-01-22 11:34:20 -0700352 The list of boot locations searched.
353
354 Example: mmc0, mmc1, usb, pxe
355
356 Entries may be removed or re-ordered in this list to affect the boot order.
357
358boot_prefixes:
Dennis Gilmoreb9776072015-01-22 11:34:20 -0700359 For disk-based booting, the list of directories within a partition that are
360 searched for boot configuration files (extlinux.conf, boot.scr).
361
362 Example: / /boot/
363
364 Entries may be removed or re-ordered in this list to affect the set of
365 directories which are searched.
366
367boot_scripts:
Dennis Gilmoreb9776072015-01-22 11:34:20 -0700368 The name of U-Boot style boot.scr files that $bootcmd searches for.
369
370 Example: boot.scr.uimg boot.scr
371
372 (Typically we expect extlinux.conf to be used, but execution of boot.scr is
373 maintained for backwards-compatibility.)
374
375 Entries may be removed or re-ordered in this list to affect the set of
376 filenames which are supported.
377
378scan_dev_for_extlinux:
Dennis Gilmoreb9776072015-01-22 11:34:20 -0700379 If you want to disable extlinux.conf on all disks, set the value to something
380 innocuous, e.g. setenv scan_dev_for_extlinux true.
381
382scan_dev_for_scripts:
Dennis Gilmoreb9776072015-01-22 11:34:20 -0700383 If you want to disable boot.scr on all disks, set the value to something
384 innocuous, e.g. setenv scan_dev_for_scripts true.
Karsten Merker3b2401b2015-03-21 14:15:38 +0100385
Stephen Warren4c739fb2016-01-26 11:10:12 -0700386boot_net_usb_start:
Stephen Warren4c739fb2016-01-26 11:10:12 -0700387 If you want to prevent USB enumeration by distro boot commands which execute
388 network operations, set the value to something innocuous, e.g. setenv
389 boot_net_usb_start true. This would be useful if you know your Ethernet
390 device is not attached to USB, and you wish to increase boot speed by
391 avoiding unnecessary actions.
Karsten Merker3b2401b2015-03-21 14:15:38 +0100392
Stephen Warren3a74c642016-01-26 11:10:13 -0700393boot_net_pci_enum:
Stephen Warren3a74c642016-01-26 11:10:13 -0700394 If you want to prevent PCI enumeration by distro boot commands which execute
395 network operations, set the value to something innocuous, e.g. setenv
396 boot_net_pci_enum true. This would be useful if you know your Ethernet
397 device is not attached to PCI, and you wish to increase boot speed by
398 avoiding unnecessary actions.
399
Karsten Merker3b2401b2015-03-21 14:15:38 +0100400Interactively booting from a specific device at the u-boot prompt
401=================================================================
402
403For interactively booting from a user-selected device at the u-boot command
404prompt, the environment provides predefined bootcmd_<target> variables for
405every target defined in boot_targets, which can be run be the user.
406
407If the target is a storage device, the format of the target is always
408<device type><device number>, e.g. mmc0. Specifying the device number is
409mandatory for storage devices, even if only support for a single instance
410of the storage device is actually implemented.
411
412For network targets (dhcp, pxe), only the device type gets specified;
413they do not have a device number.
414
415Examples:
416
417 - run bootcmd_usb0
418 boots from the first USB mass storage device
419
420 - run bootcmd_mmc1
421 boots from the second MMC device
422
423 - run bootcmd_pxe
424 boots by tftp using a pxelinux.cfg
425
426The list of possible targets consists of:
427
428- network targets
Simon Glass57695312021-10-14 12:48:10 -0600429
Karsten Merker3b2401b2015-03-21 14:15:38 +0100430 * dhcp
431 * pxe
432
433- storage targets (to which a device number must be appended)
Simon Glass57695312021-10-14 12:48:10 -0600434
Karsten Merker3b2401b2015-03-21 14:15:38 +0100435 * mmc
436 * sata
437 * scsi
438 * ide
439 * usb
Lukas Auere8c4df42018-11-22 11:26:33 +0100440 * virtio
Karsten Merker3b2401b2015-03-21 14:15:38 +0100441
442Other *boot* variables than the ones defined above are only for internal use
443of the boot environment and are not guaranteed to exist or work in the same
444way in future u-boot versions. In particular the <device type>_boot
445variables (e.g. mmc_boot, usb_boot) are a strictly internal implementation
446detail and must not be used as a public interface.
Simon Glass57695312021-10-14 12:48:10 -0600447
Tom Rinia4bc4812024-12-21 11:45:29 -0600448.. _`Boot Loader Specification`: https://uapi-group.org/specifications/specs/boot_loader_specification/
449.. _`PXELINUX`: https://wiki.syslinux.org/wiki/index.php?title=PXELINUX
450.. _`SYSLINUX`: https://wiki.syslinux.org/wiki/index.php?title=SYSLINUX
Simon Glass57695312021-10-14 12:48:10 -0600451
452.. sectionauthor:: (C) Copyright 2014 Red Hat Inc.
453.. sectionauthor:: Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved.
454.. sectionauthor:: Copyright (C) 2015 K. Merker <merker@debian.org>