blob: 4f899d92b2e127cf3be887f9800a2e655f65f91a [file] [log] [blame]
Simon Glass83b9be62022-04-24 23:31:26 -06001.. SPDX-License-Identifier: GPL-2.0+:
2
Heinrich Schuchardt1b0c3162024-01-14 14:53:13 +01003.. index::
4 single: bootmeth (command)
5
Simon Glass83b9be62022-04-24 23:31:26 -06006bootmeth command
7================
8
Heinrich Schuchardt44b09b32024-03-16 11:09:36 +01009Synopsis
10--------
Simon Glass83b9be62022-04-24 23:31:26 -060011
12::
13
14 bootmeth list [-a] - list selected bootmeths (-a for all)
Martyn Welch93a0d162024-10-09 14:15:40 +010015 bootmeth order "[<bm> ...]" - select the order of bootmeths
16 bootmeth set <bootmeth> <property> <value> - set optional property
Simon Glass83b9be62022-04-24 23:31:26 -060017
18
19Description
20-----------
21
22The `bootmeth` command is used to manage bootmeths. It can list them and change
23the order in which they are used.
24
Simon Glass16047dc2024-07-17 09:30:52 +010025See :doc:`/develop/bootstd/index` for more information.
Simon Glass83b9be62022-04-24 23:31:26 -060026
27
28.. _bootmeth_order:
29
30bootmeth order
31~~~~~~~~~~~~~~
32
33Selects which bootmeths to use and the order in which they are invoked. When
34scanning bootdevs, each bootmeth is tried in turn to see if it can find a valid
35bootflow. You can use this command to adjust the order or even to omit some
36boomeths.
37
Simon Glassafaeb772022-07-30 15:52:35 -060038The argument is a quoted list of bootmeths to use, by name. If global bootmeths
39are included, they must be at the end, otherwise the scanning mechanism will not
40work correctly.
Simon Glass83b9be62022-04-24 23:31:26 -060041
42
43bootmeth list
44~~~~~~~~~~~~~
45
46This lists the selected bootmeths, or all of them, if the `-a` flag is used.
47The format looks like this:
48
49===== === ================== =================================
50Order Seq Name Description
51===== === ================== =================================
Mattijs Korpershoek50cab922024-05-24 15:28:21 +020052 0 0 extlinux Extlinux boot from a block device
Simon Glass83b9be62022-04-24 23:31:26 -060053 1 1 efi EFI boot from an .efi file
54 2 2 pxe PXE boot from a network device
55 3 3 sandbox Sandbox boot for testing
Simon Glassafaeb772022-07-30 15:52:35 -060056 glob 4 efi_mgr EFI bootmgr flow
Simon Glass83b9be62022-04-24 23:31:26 -060057===== === ================== =================================
58
59The fields are as follows:
60
61Order:
62 The order in which these bootmeths are invoked for each bootdev. If this
Simon Glassafaeb772022-07-30 15:52:35 -060063 shows as a hyphen, then the bootmeth is not in the current ordering. If it
64 shows as 'glob', then this is a global bootmeth and should be at the end.
Simon Glass83b9be62022-04-24 23:31:26 -060065
66Seq:
67 The sequence number of the bootmeth, i.e. the normal ordering if none is set
68
69Name:
70 Name of the bootmeth
71
72Description:
73 A friendly description for the bootmeth
74
75
76Example
77-------
78
79This shows listing bootmeths. All are present and in the normal order::
80
81 => bootmeth list
82 Order Seq Name Description
83 ----- --- ------------------ ------------------
Simon Glassb71d7f72023-05-10 16:34:46 -060084 0 0 distro Extlinux boot from a block device
Simon Glass83b9be62022-04-24 23:31:26 -060085 1 1 efi EFI boot from an .efi file
86 2 2 pxe PXE boot from a network device
87 3 3 sandbox Sandbox boot for testing
88 4 4 efi_mgr EFI bootmgr flow
89 ----- --- ------------------ ------------------
90 (5 bootmeths)
91
92Now the order is changed, to include only two of them::
93
94 => bootmeth order "sandbox distro"
95 => bootmeth list
96 Order Seq Name Description
97 ----- --- ------------------ ------------------
98 0 3 sandbox Sandbox boot for testing
Simon Glassb71d7f72023-05-10 16:34:46 -060099 1 0 distro Extlinux boot from a block device
Simon Glass83b9be62022-04-24 23:31:26 -0600100 ----- --- ------------------ ------------------
101 (2 bootmeths)
102
103The -a flag shows all bootmeths so you can clearly see which ones are used and
104which are not::
105
106 => bootmeth list -a
107 Order Seq Name Description
108 ----- --- ------------------ ------------------
Simon Glassb71d7f72023-05-10 16:34:46 -0600109 1 0 distro Extlinux boot from a block device
Simon Glass83b9be62022-04-24 23:31:26 -0600110 - 1 efi EFI boot from an .efi file
111 - 2 pxe PXE boot from a network device
112 0 3 sandbox Sandbox boot for testing
113 - 4 efi_mgr EFI bootmgr flow
114 ----- --- ------------------ ------------------
115 (5 bootmeths)
Martyn Welch93a0d162024-10-09 14:15:40 +0100116
117
118bootmeth set
119~~~~~~~~~~~~
120
121Allows setting of bootmeth specific configuration. This allows finer grain
122control over the boot process in specific instances.
123
124
125Supported Configuration Options
126-------------------------------
127
128The following configuration options are currently supported:
129
130======== =================== ====== ===============================
131Property Supported Bootmeths Values Description
132======== =================== ====== ===============================
133fallback extlinux 0 | 1 Enable or disable fallback path
134======== =================== ====== ===============================
135
136
137Bootmeth set Example
138--------------------
139
140With the bootcount functionality enabled, when the bootlimit is reached, the
141`altbootcmd` environment variable lists the command used for booting rather
142than `bootcmd`. We can set the fallback configuration to cause the fallback
143boot option to be preferred, to revert to a previous known working boot option
144after a failed update for example. So if `bootcmd` is set to::
145
146 bootflow scan -lb
147
148We would set "altbootcmd" to::
149
150 bootmeth set extlinux fallback 1; bootflow scan -lb