Simon Glass | 83b9be6 | 2022-04-24 23:31:26 -0600 | [diff] [blame] | 1 | .. SPDX-License-Identifier: GPL-2.0+: |
| 2 | |
Heinrich Schuchardt | 1b0c316 | 2024-01-14 14:53:13 +0100 | [diff] [blame] | 3 | .. index:: |
| 4 | single: bootmeth (command) |
| 5 | |
Simon Glass | 83b9be6 | 2022-04-24 23:31:26 -0600 | [diff] [blame] | 6 | bootmeth command |
| 7 | ================ |
| 8 | |
Heinrich Schuchardt | 44b09b3 | 2024-03-16 11:09:36 +0100 | [diff] [blame] | 9 | Synopsis |
| 10 | -------- |
Simon Glass | 83b9be6 | 2022-04-24 23:31:26 -0600 | [diff] [blame] | 11 | |
| 12 | :: |
| 13 | |
| 14 | bootmeth list [-a] - list selected bootmeths (-a for all) |
Martyn Welch | 93a0d16 | 2024-10-09 14:15:40 +0100 | [diff] [blame] | 15 | bootmeth order "[<bm> ...]" - select the order of bootmeths |
| 16 | bootmeth set <bootmeth> <property> <value> - set optional property |
Simon Glass | 83b9be6 | 2022-04-24 23:31:26 -0600 | [diff] [blame] | 17 | |
| 18 | |
| 19 | Description |
| 20 | ----------- |
| 21 | |
| 22 | The `bootmeth` command is used to manage bootmeths. It can list them and change |
| 23 | the order in which they are used. |
| 24 | |
Simon Glass | 16047dc | 2024-07-17 09:30:52 +0100 | [diff] [blame] | 25 | See :doc:`/develop/bootstd/index` for more information. |
Simon Glass | 83b9be6 | 2022-04-24 23:31:26 -0600 | [diff] [blame] | 26 | |
| 27 | |
| 28 | .. _bootmeth_order: |
| 29 | |
| 30 | bootmeth order |
| 31 | ~~~~~~~~~~~~~~ |
| 32 | |
| 33 | Selects which bootmeths to use and the order in which they are invoked. When |
| 34 | scanning bootdevs, each bootmeth is tried in turn to see if it can find a valid |
| 35 | bootflow. You can use this command to adjust the order or even to omit some |
| 36 | boomeths. |
| 37 | |
Simon Glass | afaeb77 | 2022-07-30 15:52:35 -0600 | [diff] [blame] | 38 | The argument is a quoted list of bootmeths to use, by name. If global bootmeths |
| 39 | are included, they must be at the end, otherwise the scanning mechanism will not |
| 40 | work correctly. |
Simon Glass | 83b9be6 | 2022-04-24 23:31:26 -0600 | [diff] [blame] | 41 | |
| 42 | |
| 43 | bootmeth list |
| 44 | ~~~~~~~~~~~~~ |
| 45 | |
| 46 | This lists the selected bootmeths, or all of them, if the `-a` flag is used. |
| 47 | The format looks like this: |
| 48 | |
| 49 | ===== === ================== ================================= |
| 50 | Order Seq Name Description |
| 51 | ===== === ================== ================================= |
Mattijs Korpershoek | 50cab92 | 2024-05-24 15:28:21 +0200 | [diff] [blame] | 52 | 0 0 extlinux Extlinux boot from a block device |
Simon Glass | 83b9be6 | 2022-04-24 23:31:26 -0600 | [diff] [blame] | 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 |
Simon Glass | afaeb77 | 2022-07-30 15:52:35 -0600 | [diff] [blame] | 56 | glob 4 efi_mgr EFI bootmgr flow |
Simon Glass | 83b9be6 | 2022-04-24 23:31:26 -0600 | [diff] [blame] | 57 | ===== === ================== ================================= |
| 58 | |
| 59 | The fields are as follows: |
| 60 | |
| 61 | Order: |
| 62 | The order in which these bootmeths are invoked for each bootdev. If this |
Simon Glass | afaeb77 | 2022-07-30 15:52:35 -0600 | [diff] [blame] | 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. |
Simon Glass | 83b9be6 | 2022-04-24 23:31:26 -0600 | [diff] [blame] | 65 | |
| 66 | Seq: |
| 67 | The sequence number of the bootmeth, i.e. the normal ordering if none is set |
| 68 | |
| 69 | Name: |
| 70 | Name of the bootmeth |
| 71 | |
| 72 | Description: |
| 73 | A friendly description for the bootmeth |
| 74 | |
| 75 | |
| 76 | Example |
| 77 | ------- |
| 78 | |
| 79 | This shows listing bootmeths. All are present and in the normal order:: |
| 80 | |
| 81 | => bootmeth list |
| 82 | Order Seq Name Description |
| 83 | ----- --- ------------------ ------------------ |
Simon Glass | b71d7f7 | 2023-05-10 16:34:46 -0600 | [diff] [blame] | 84 | 0 0 distro Extlinux boot from a block device |
Simon Glass | 83b9be6 | 2022-04-24 23:31:26 -0600 | [diff] [blame] | 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 | |
| 92 | Now 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 Glass | b71d7f7 | 2023-05-10 16:34:46 -0600 | [diff] [blame] | 99 | 1 0 distro Extlinux boot from a block device |
Simon Glass | 83b9be6 | 2022-04-24 23:31:26 -0600 | [diff] [blame] | 100 | ----- --- ------------------ ------------------ |
| 101 | (2 bootmeths) |
| 102 | |
| 103 | The -a flag shows all bootmeths so you can clearly see which ones are used and |
| 104 | which are not:: |
| 105 | |
| 106 | => bootmeth list -a |
| 107 | Order Seq Name Description |
| 108 | ----- --- ------------------ ------------------ |
Simon Glass | b71d7f7 | 2023-05-10 16:34:46 -0600 | [diff] [blame] | 109 | 1 0 distro Extlinux boot from a block device |
Simon Glass | 83b9be6 | 2022-04-24 23:31:26 -0600 | [diff] [blame] | 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) |
Martyn Welch | 93a0d16 | 2024-10-09 14:15:40 +0100 | [diff] [blame] | 116 | |
| 117 | |
| 118 | bootmeth set |
| 119 | ~~~~~~~~~~~~ |
| 120 | |
| 121 | Allows setting of bootmeth specific configuration. This allows finer grain |
| 122 | control over the boot process in specific instances. |
| 123 | |
| 124 | |
| 125 | Supported Configuration Options |
| 126 | ------------------------------- |
| 127 | |
| 128 | The following configuration options are currently supported: |
| 129 | |
| 130 | ======== =================== ====== =============================== |
| 131 | Property Supported Bootmeths Values Description |
| 132 | ======== =================== ====== =============================== |
| 133 | fallback extlinux 0 | 1 Enable or disable fallback path |
| 134 | ======== =================== ====== =============================== |
| 135 | |
| 136 | |
| 137 | Bootmeth set Example |
| 138 | -------------------- |
| 139 | |
| 140 | With the bootcount functionality enabled, when the bootlimit is reached, the |
| 141 | `altbootcmd` environment variable lists the command used for booting rather |
| 142 | than `bootcmd`. We can set the fallback configuration to cause the fallback |
| 143 | boot option to be preferred, to revert to a previous known working boot option |
| 144 | after a failed update for example. So if `bootcmd` is set to:: |
| 145 | |
| 146 | bootflow scan -lb |
| 147 | |
| 148 | We would set "altbootcmd" to:: |
| 149 | |
| 150 | bootmeth set extlinux fallback 1; bootflow scan -lb |