"Das U-Boot" Source Tree
1.. SPDX-License-Identifier: GPL-2.0+:
2
3.. index::
4 single: bootmeth (command)
5
6bootmeth command
7================
8
9Synopsis
10--------
11
12::
13
14 bootmeth list [-a] - list selected bootmeths (-a for all)
15 bootmeth order "[<bm> ...]" - select the order of bootmeths
16 bootmeth set <bootmeth> <property> <value> - set optional property
17
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
25See :doc:`/develop/bootstd/index` for more information.
26
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
38The 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.
41
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===== === ================== =================================
52 0 0 extlinux Extlinux boot from a block device
53 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
56 glob 4 efi_mgr EFI bootmgr flow
57===== === ================== =================================
58
59The fields are as follows:
60
61Order:
62 The order in which these bootmeths are invoked for each bootdev. If this
63 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.
65
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 ----- --- ------------------ ------------------
84 0 0 distro Extlinux boot from a block device
85 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
99 1 0 distro Extlinux boot from a block device
100 ----- --- ------------------ ------------------
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 ----- --- ------------------ ------------------
109 1 0 distro Extlinux boot from a block device
110 - 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)
116
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