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: bootflow (command) |
| 5 | |
Simon Glass | 83b9be6 | 2022-04-24 23:31:26 -0600 | [diff] [blame] | 6 | bootflow command |
| 7 | ================ |
| 8 | |
| 9 | Synopis |
| 10 | ------- |
| 11 | |
| 12 | :: |
| 13 | |
Simon Glass | 736612e | 2023-01-17 10:48:19 -0700 | [diff] [blame] | 14 | bootflow scan [-abelGH] [bootdev] |
Simon Glass | 83b9be6 | 2022-04-24 23:31:26 -0600 | [diff] [blame] | 15 | bootflow list [-e] |
| 16 | bootflow select [<num|name>] |
Simon Glass | 5495aaf | 2023-07-30 11:17:00 -0600 | [diff] [blame] | 17 | bootflow info [-ds] |
Simon Glass | 6d8f95b | 2023-08-10 19:33:18 -0600 | [diff] [blame] | 18 | bootflow read |
Simon Glass | 83b9be6 | 2022-04-24 23:31:26 -0600 | [diff] [blame] | 19 | bootflow boot |
Simon Glass | cd91e99 | 2023-07-12 09:04:42 -0600 | [diff] [blame] | 20 | bootflow cmdline [set|get|clear|delete|auto] <param> [<value>] |
Simon Glass | 6d5083b | 2023-10-01 19:14:38 -0600 | [diff] [blame] | 21 | bootfloe menu [-t] |
Simon Glass | 83b9be6 | 2022-04-24 23:31:26 -0600 | [diff] [blame] | 22 | |
| 23 | Description |
| 24 | ----------- |
| 25 | |
| 26 | The `bootflow` command is used to manage bootflows. It can scan bootdevs to |
| 27 | locate bootflows, list them and boot them. |
| 28 | |
| 29 | See :doc:`../../develop/bootstd` for more information. |
| 30 | |
Simon Glass | 6d5083b | 2023-10-01 19:14:38 -0600 | [diff] [blame] | 31 | Note that `CONFIG_BOOTSTD_FULL` (which enables `CONFIG_CMD_BOOTFLOW_FULL) must |
| 32 | be enabled to obtain full functionality with this command. Otherwise, it only |
| 33 | supports `bootflow scan` which scans and boots the first available bootflow. |
Simon Glass | 83b9be6 | 2022-04-24 23:31:26 -0600 | [diff] [blame] | 34 | |
| 35 | bootflow scan |
| 36 | ~~~~~~~~~~~~~ |
| 37 | |
| 38 | Scans for available bootflows, optionally booting the first valid one it finds. |
| 39 | This operates in two modes: |
| 40 | |
| 41 | - If no bootdev is selected (see `bootdev select`) it scans bootflows one |
| 42 | by one, extracting all the bootdevs from each |
| 43 | - If a bootdev is selected, it just scans that one bootflow |
| 44 | |
| 45 | Flags are: |
| 46 | |
| 47 | -a |
| 48 | Collect all bootflows, even those that cannot be loaded. Normally if a file |
| 49 | is not where it is expected, then the bootflow fails and so is dropped |
| 50 | during the scan. With this option you can see why each bootflow would be |
| 51 | dropped. |
| 52 | |
| 53 | -b |
| 54 | Boot each valid bootflow as it is scanned. Typically only the first bootflow |
| 55 | matters, since by then the system boots in the OS and U-Boot is no-longer |
| 56 | running. `bootflow scan -b` is a quick way to boot the first available OS. |
| 57 | A valid bootflow is one that made it all the way to the `loaded` state. |
Simon Glass | 9bf2786 | 2023-10-01 19:15:25 -0600 | [diff] [blame] | 58 | Note that if `-m` is provided as well, booting is delayed until the user |
| 59 | selects a bootflow. |
Simon Glass | 83b9be6 | 2022-04-24 23:31:26 -0600 | [diff] [blame] | 60 | |
| 61 | -e |
| 62 | Used with -l to also show errors for each bootflow. The shows detailed error |
| 63 | information for each bootflow that failed to make it to the `loaded` state. |
| 64 | |
| 65 | -l |
| 66 | List bootflows while scanning. This is helpful when you want to see what |
| 67 | is happening during scanning. Use it with the `-b` flag to see which |
| 68 | bootdev and bootflows are being tried. |
| 69 | |
Simon Glass | 736612e | 2023-01-17 10:48:19 -0700 | [diff] [blame] | 70 | -G |
| 71 | Skip global bootmeths when scanning. By default these are tried first, but |
| 72 | this flag disables them. |
| 73 | |
| 74 | -H |
| 75 | Don't use bootdev hunters. By default these are used before each boot |
| 76 | priority or label is tried, to see if more bootdevs can be discovered, but |
| 77 | this flag disables that process. |
| 78 | |
Simon Glass | 9bf2786 | 2023-10-01 19:15:25 -0600 | [diff] [blame] | 79 | -m |
| 80 | Show a menu of available bootflows for the user to select. When used with |
| 81 | -b it then boots the one that was selected, if any. |
Simon Glass | 736612e | 2023-01-17 10:48:19 -0700 | [diff] [blame] | 82 | |
Simon Glass | 83b9be6 | 2022-04-24 23:31:26 -0600 | [diff] [blame] | 83 | The optional argument specifies a particular bootdev to scan. This can either be |
| 84 | the name of a bootdev or its sequence number (both shown with `bootdev list`). |
| 85 | Alternatively a convenience label can be used, like `mmc0`, which is the type of |
| 86 | device and an optional sequence number. Specifically, the label is the uclass of |
| 87 | the bootdev's parent followed by the sequence number of that parent. Sequence |
| 88 | numbers are typically set by aliases, so if you have 'mmc0' in your devicetree |
| 89 | alias section, then `mmc0` refers to the bootdev attached to that device. |
| 90 | |
| 91 | |
| 92 | bootflow list |
| 93 | ~~~~~~~~~~~~~ |
| 94 | |
| 95 | Lists the previously scanned bootflows. You must use `bootflow scan` before this |
| 96 | to see anything. |
| 97 | |
| 98 | If you scanned with -a and have bootflows with errors, -e can be used to show |
| 99 | those errors. |
| 100 | |
| 101 | The list looks something like this: |
| 102 | |
| 103 | === ====== ====== ======== ==== =============================== ================ |
| 104 | Seq Method State Uclass Part Name Filename |
| 105 | === ====== ====== ======== ==== =============================== ================ |
| 106 | 0 distro ready mmc 2 mmc\@7e202000.bootdev.part_2 /boot/extlinux/extlinux.conf |
| 107 | 1 pxe ready ethernet 0 smsc95xx_eth.bootdev.0 rpi.pxe/extlinux/extlinux.conf |
| 108 | === ====== ====== ======== ==== =============================== ================ |
| 109 | |
| 110 | The fields are as follows: |
| 111 | |
| 112 | Seq: |
| 113 | Sequence number in the scan, used to reference the bootflow later |
| 114 | |
| 115 | Method: |
| 116 | The boot method (bootmeth) used to find the bootflow. Several methods are |
| 117 | included in U-Boot. |
| 118 | |
| 119 | State: |
| 120 | Current state of the bootflow, indicating how far the bootdev got in |
| 121 | obtaining a valid one. See :ref:`BootflowStates` for a list of states. |
| 122 | |
| 123 | Uclass: |
| 124 | Name of the media device's Uclass. This indicates the type of the parent |
| 125 | device (e.g. MMC, Ethernet). |
| 126 | |
| 127 | Part: |
| 128 | Partition number being accesseed, numbered from 1. Normally a device will |
| 129 | have a partition table with a small number of partitions. For devices |
| 130 | without partition tables (e.g. network) this field is 0. |
| 131 | |
| 132 | Name: |
| 133 | Name of the bootflow. This is generated from the bootdev appended with |
| 134 | the partition information |
| 135 | |
| 136 | Filename: |
| 137 | Name of the bootflow file. This indicates where the file is on the |
| 138 | filesystem or network device. |
| 139 | |
| 140 | |
| 141 | bootflow select |
| 142 | ~~~~~~~~~~~~~~~ |
| 143 | |
| 144 | Use this to select a particular bootflow. You can select it by the sequence |
| 145 | number or name, as shown in `bootflow list`. |
| 146 | |
| 147 | Once a bootflow is selected, you can use `bootflow info` and `bootflow boot`. |
| 148 | |
| 149 | If no bootflow name or number is provided, then any existing bootflow is |
| 150 | unselected. |
| 151 | |
| 152 | |
| 153 | bootflow info |
| 154 | ~~~~~~~~~~~~~ |
| 155 | |
| 156 | This shows information on the current bootflow, with the format looking like |
| 157 | this: |
| 158 | |
| 159 | ========= =============================== |
| 160 | Name mmc\@7e202000.bootdev.part_2 |
| 161 | Device mmc\@7e202000.bootdev |
| 162 | Block dev mmc\@7e202000.blk |
| 163 | Type distro |
Simon Glass | b71d7f7 | 2023-05-10 16:34:46 -0600 | [diff] [blame] | 164 | Method: extlinux |
Simon Glass | 83b9be6 | 2022-04-24 23:31:26 -0600 | [diff] [blame] | 165 | State ready |
| 166 | Partition 2 |
| 167 | Subdir (none) |
| 168 | Filename /extlinux/extlinux.conf |
| 169 | Buffer 3db7ad48 |
| 170 | Size 232 (562 bytes) |
Simon Glass | 736612e | 2023-01-17 10:48:19 -0700 | [diff] [blame] | 171 | FDT: <NULL> |
Simon Glass | 83b9be6 | 2022-04-24 23:31:26 -0600 | [diff] [blame] | 172 | Error 0 |
| 173 | ========= =============================== |
| 174 | |
| 175 | Most of the information is the same as `bootflow list` above. The new fields |
| 176 | are: |
| 177 | |
| 178 | Device |
| 179 | Name of the bootdev |
| 180 | |
| 181 | Block dev |
| 182 | Name of the block device, if any. Network devices don't have a block device. |
| 183 | |
| 184 | Subdir |
| 185 | Subdirectory used for retrieving files. For network bootdevs this is the |
| 186 | directory of the 'bootfile' parameter passed from DHCP. All file retrievals |
| 187 | when booting are relative to this. |
| 188 | |
| 189 | Buffer |
| 190 | Buffer containing the bootflow file. You can use the :doc:`md` to look at |
| 191 | it, or dump it with `bootflow info -d`. |
| 192 | |
| 193 | Size |
| 194 | Size of the bootflow file |
| 195 | |
Simon Glass | 736612e | 2023-01-17 10:48:19 -0700 | [diff] [blame] | 196 | FDT: |
| 197 | Filename of the device tree, if supported. The EFI bootmeth uses this to |
| 198 | remember the filename to load. If `<NULL>` then there is none. |
| 199 | |
Simon Glass | 83b9be6 | 2022-04-24 23:31:26 -0600 | [diff] [blame] | 200 | Error |
| 201 | Error number returned from scanning for the bootflow. This is 0 if the |
| 202 | bootflow is in the 'loaded' state, or a negative error value on error. You |
| 203 | can look up Linux error codes to find the meaning of the number. |
| 204 | |
| 205 | Use the `-d` flag to dump out the contents of the bootfile file. |
| 206 | |
Simon Glass | 5495aaf | 2023-07-30 11:17:00 -0600 | [diff] [blame] | 207 | The `-s` flag shows any x86 setup block, instead of the above. |
| 208 | |
Simon Glass | 83b9be6 | 2022-04-24 23:31:26 -0600 | [diff] [blame] | 209 | |
Simon Glass | 6d8f95b | 2023-08-10 19:33:18 -0600 | [diff] [blame] | 210 | bootflow read |
| 211 | ~~~~~~~~~~~~~ |
| 212 | |
| 213 | This reads any files related to the bootflow. Some bootflows with large files |
| 214 | avoid doing this when the bootflow is scanned, since it uses a lot of memory |
| 215 | and takes extra time. The files are then automatically read when `bootflow boot` |
| 216 | is used. |
| 217 | |
| 218 | This command reads these files immediately. Typically this fills in the bootflow |
| 219 | `buf` property, which can be used to examine the bootflow. |
| 220 | |
| 221 | Note that reading the files does not result in any extra parsing, nor loading of |
| 222 | images in the files. This is purely used to read in the data ready for |
| 223 | booting, or examination. |
| 224 | |
Simon Glass | 83b9be6 | 2022-04-24 23:31:26 -0600 | [diff] [blame] | 225 | |
| 226 | bootflow boot |
| 227 | ~~~~~~~~~~~~~ |
| 228 | |
Simon Glass | 6d8f95b | 2023-08-10 19:33:18 -0600 | [diff] [blame] | 229 | This boots the current bootflow, reading any required files first. |
Simon Glass | 83b9be6 | 2022-04-24 23:31:26 -0600 | [diff] [blame] | 230 | |
Simon Glass | 55a2da3 | 2023-07-12 09:04:39 -0600 | [diff] [blame] | 231 | |
| 232 | bootflow cmdline |
| 233 | ~~~~~~~~~~~~~~~~ |
| 234 | |
| 235 | Some bootmeths can obtain the OS command line since it is stored with the OS. |
| 236 | In that case, you can use `bootflow cmdline` to adjust this. The command line |
| 237 | is assumed to be in the format used by Linux, i.e. a space-separated set of |
| 238 | parameters with optional values, e.g. "noinitrd console=/dev/tty0". |
| 239 | |
| 240 | To change or add a parameter, use:: |
| 241 | |
| 242 | bootflow cmdline set <param> <value> |
| 243 | |
| 244 | To clear a parameter value to empty you can use "" for the value, or use:: |
| 245 | |
| 246 | bootflow cmdline clear <param> |
| 247 | |
| 248 | To delete a parameter entirely, use:: |
| 249 | |
| 250 | bootflow cmdline delete <param> |
Simon Glass | 83b9be6 | 2022-04-24 23:31:26 -0600 | [diff] [blame] | 251 | |
Simon Glass | cd91e99 | 2023-07-12 09:04:42 -0600 | [diff] [blame] | 252 | Automatic parameters are available in a very few cases. You can use these to |
| 253 | add parmeters where the value is known by U-Boot. For example:: |
| 254 | |
| 255 | bootflow cmdline auto earlycon |
| 256 | bootflow cmdline auto console |
| 257 | |
| 258 | can be used to set the early console (or console) to a suitable value so that |
| 259 | output appears on the serial port. This is only supported by the 16550 serial |
| 260 | driver so far. |
| 261 | |
Simon Glass | 6d5083b | 2023-10-01 19:14:38 -0600 | [diff] [blame] | 262 | bootflow menu |
| 263 | ~~~~~~~~~~~~~ |
| 264 | |
| 265 | This shows a menu with available bootflows. The user can select a particular |
| 266 | bootflow, which then becomes the current one. |
| 267 | |
| 268 | The `-t` flag requests a text menu. Otherwise, if a display is available, a |
| 269 | graphical menu is shown. |
| 270 | |
| 271 | |
Simon Glass | 83b9be6 | 2022-04-24 23:31:26 -0600 | [diff] [blame] | 272 | Example |
| 273 | ------- |
| 274 | |
| 275 | Here is an example of scanning for bootflows, then listing them:: |
| 276 | |
| 277 | U-Boot> bootflow scan -l |
| 278 | Scanning for bootflows in all bootdevs |
| 279 | Seq Type State Uclass Part Name Filename |
| 280 | --- ----------- ------ -------- ---- ------------------------ ---------------- |
| 281 | Scanning bootdev 'mmc@7e202000.bootdev': |
| 282 | 0 distro ready mmc 2 mmc@7e202000.bootdev.p /extlinux/extlinux.conf |
| 283 | Scanning bootdev 'sdhci@7e300000.bootdev': |
| 284 | Card did not respond to voltage select! : -110 |
| 285 | Scanning bootdev 'smsc95xx_eth.bootdev': |
| 286 | Waiting for Ethernet connection... done. |
| 287 | BOOTP broadcast 1 |
| 288 | DHCP client bound to address 192.168.4.30 (4 ms) |
| 289 | Using smsc95xx_eth device |
| 290 | TFTP from server 192.168.4.1; our IP address is 192.168.4.30 |
| 291 | Filename 'rpi.pxe/'. |
| 292 | Load address: 0x200000 |
| 293 | Loading: * |
| 294 | TFTP error: 'Is a directory' (0) |
| 295 | Starting again |
| 296 | |
| 297 | missing environment variable: pxeuuid |
| 298 | Retrieving file: rpi.pxe/pxelinux.cfg/01-b8-27-eb-a6-61-e1 |
| 299 | Waiting for Ethernet connection... done. |
| 300 | Using smsc95xx_eth device |
| 301 | TFTP from server 192.168.4.1; our IP address is 192.168.4.30 |
| 302 | Filename 'rpi.pxe/pxelinux.cfg/01-b8-27-eb-a6-61-e1'. |
| 303 | Load address: 0x2500000 |
| 304 | Loading: ################################################## 566 Bytes |
| 305 | 45.9 KiB/s |
| 306 | done |
| 307 | Bytes transferred = 566 (236 hex) |
| 308 | 1 distro ready ethernet 0 smsc95xx_eth.bootdev.0 rpi.pxe/extlinux/extlinux.conf |
| 309 | No more bootdevs |
| 310 | --- ----------- ------ -------- ---- ------------------------ ---------------- |
| 311 | (2 bootflows, 2 valid) |
| 312 | U-Boot> bootflow l |
| 313 | Showing all bootflows |
| 314 | Seq Type State Uclass Part Name Filename |
| 315 | --- ----------- ------ -------- ---- ------------------------ ---------------- |
| 316 | 0 distro ready mmc 2 mmc@7e202000.bootdev.p /extlinux/extlinux.conf |
| 317 | 1 pxe ready ethernet 0 smsc95xx_eth.bootdev.0 rpi.pxe/extlinux/extlinux.conf |
| 318 | --- ----------- ------ -------- ---- ------------------------ ---------------- |
| 319 | (2 bootflows, 2 valid) |
| 320 | |
| 321 | |
| 322 | The second one is then selected by name (we could instead use `bootflow sel 0`), |
| 323 | displayed and booted:: |
| 324 | |
| 325 | U-Boot> bootflow info |
| 326 | No bootflow selected |
| 327 | U-Boot> bootflow sel mmc@7e202000.bootdev.part_2 |
| 328 | U-Boot> bootflow info |
| 329 | Name: mmc@7e202000.bootdev.part_2 |
| 330 | Device: mmc@7e202000.bootdev |
| 331 | Block dev: mmc@7e202000.blk |
Simon Glass | 83b9be6 | 2022-04-24 23:31:26 -0600 | [diff] [blame] | 332 | Method: distro |
| 333 | State: ready |
| 334 | Partition: 2 |
| 335 | Subdir: (none) |
| 336 | Filename: extlinux/extlinux.conf |
| 337 | Buffer: 3db7ae88 |
| 338 | Size: 232 (562 bytes) |
Simon Glass | 3392752 | 2023-07-12 09:04:34 -0600 | [diff] [blame] | 339 | OS: Fedora-Workstation-armhfp-31-1.9 (5.3.7-301.fc31.armv7hl) |
| 340 | Cmdline: (none) |
| 341 | Logo: (none) |
| 342 | FDT: <NULL> |
Simon Glass | 83b9be6 | 2022-04-24 23:31:26 -0600 | [diff] [blame] | 343 | Error: 0 |
| 344 | U-Boot> bootflow boot |
| 345 | ** Booting bootflow 'smsc95xx_eth.bootdev.0' |
| 346 | Ignoring unknown command: ui |
| 347 | Ignoring malformed menu command: autoboot |
| 348 | Ignoring malformed menu command: hidden |
| 349 | Ignoring unknown command: totaltimeout |
| 350 | 1: Fedora-Workstation-armhfp-31-1.9 (5.3.7-301.fc31.armv7hl) |
| 351 | Retrieving file: rpi.pxe/initramfs-5.3.7-301.fc31.armv7hl.img |
| 352 | get 2700000 rpi.pxe/initramfs-5.3.7-301.fc31.armv7hl.img |
| 353 | Waiting for Ethernet connection... done. |
| 354 | Using smsc95xx_eth device |
| 355 | TFTP from server 192.168.4.1; our IP address is 192.168.4.30 |
| 356 | Filename 'rpi.pxe/initramfs-5.3.7-301.fc31.armv7hl.img'. |
| 357 | Load address: 0x2700000 |
| 358 | Loading: ###################################T ############### 57.7 MiB |
| 359 | 1.9 MiB/s |
| 360 | done |
| 361 | Bytes transferred = 60498594 (39b22a2 hex) |
| 362 | Retrieving file: rpi.pxe//vmlinuz-5.3.7-301.fc31.armv7hl |
| 363 | get 80000 rpi.pxe//vmlinuz-5.3.7-301.fc31.armv7hl |
| 364 | Waiting for Ethernet connection... done. |
| 365 | Using smsc95xx_eth device |
| 366 | TFTP from server 192.168.4.1; our IP address is 192.168.4.30 |
| 367 | Filename 'rpi.pxe//vmlinuz-5.3.7-301.fc31.armv7hl'. |
| 368 | Load address: 0x80000 |
| 369 | Loading: ################################################## 7.2 MiB |
| 370 | 2.3 MiB/s |
| 371 | done |
| 372 | Bytes transferred = 7508480 (729200 hex) |
| 373 | append: ro root=UUID=9732b35b-4cd5-458b-9b91-80f7047e0b8a rhgb quiet LANG=en_US.UTF-8 cma=192MB cma=256MB |
| 374 | Retrieving file: rpi.pxe//dtb-5.3.7-301.fc31.armv7hl/bcm2837-rpi-3-b.dtb |
| 375 | get 2600000 rpi.pxe//dtb-5.3.7-301.fc31.armv7hl/bcm2837-rpi-3-b.dtb |
| 376 | Waiting for Ethernet connection... done. |
| 377 | Using smsc95xx_eth device |
| 378 | TFTP from server 192.168.4.1; our IP address is 192.168.4.30 |
| 379 | Filename 'rpi.pxe//dtb-5.3.7-301.fc31.armv7hl/bcm2837-rpi-3-b.dtb'. |
| 380 | Load address: 0x2600000 |
| 381 | Loading: ################################################## 13.8 KiB |
| 382 | 764.6 KiB/s |
| 383 | done |
| 384 | Bytes transferred = 14102 (3716 hex) |
| 385 | Kernel image @ 0x080000 [ 0x000000 - 0x729200 ] |
| 386 | ## Flattened Device Tree blob at 02600000 |
| 387 | Booting using the fdt blob at 0x2600000 |
| 388 | Using Device Tree in place at 02600000, end 02606715 |
| 389 | |
| 390 | Starting kernel ... |
| 391 | |
| 392 | [ OK ] Started Show Plymouth Boot Screen. |
| 393 | [ OK ] Started Forward Password R…s to Plymouth Directory Watch. |
| 394 | [ OK ] Reached target Local Encrypted Volumes. |
| 395 | [ OK ] Reached target Paths. |
| 396 | .... |
| 397 | |
| 398 | |
| 399 | Here we scan for bootflows and boot the first one found:: |
| 400 | |
| 401 | U-Boot> bootflow scan -bl |
| 402 | Scanning for bootflows in all bootdevs |
| 403 | Seq Method State Uclass Part Name Filename |
| 404 | --- ----------- ------ -------- ---- ---------------------- ---------------- |
| 405 | Scanning bootdev 'mmc@7e202000.bootdev': |
| 406 | 0 distro ready mmc 2 mmc@7e202000.bootdev.p /extlinux/extlinux.conf |
| 407 | ** Booting bootflow 'mmc@7e202000.bootdev.part_2' |
| 408 | Ignoring unknown command: ui |
| 409 | Ignoring malformed menu command: autoboot |
| 410 | Ignoring malformed menu command: hidden |
| 411 | Ignoring unknown command: totaltimeout |
| 412 | 1: Fedora-KDE-armhfp-31-1.9 (5.3.7-301.fc31.armv7hl) |
| 413 | Retrieving file: /initramfs-5.3.7-301.fc31.armv7hl.img |
| 414 | getfile 2700000 /initramfs-5.3.7-301.fc31.armv7hl.img |
| 415 | Retrieving file: /vmlinuz-5.3.7-301.fc31.armv7hl |
| 416 | getfile 80000 /vmlinuz-5.3.7-301.fc31.armv7hl |
| 417 | append: ro root=UUID=b8781f09-e2dd-4cb8-979b-7df5eeaaabea rhgb LANG=en_US.UTF-8 cma=192MB console=tty0 console=ttyS1,115200 |
| 418 | Retrieving file: /dtb-5.3.7-301.fc31.armv7hl/bcm2837-rpi-3-b.dtb |
| 419 | getfile 2600000 /dtb-5.3.7-301.fc31.armv7hl/bcm2837-rpi-3-b.dtb |
| 420 | Kernel image @ 0x080000 [ 0x000000 - 0x729200 ] |
| 421 | ## Flattened Device Tree blob at 02600000 |
| 422 | Booting using the fdt blob at 0x2600000 |
| 423 | Using Device Tree in place at 02600000, end 02606715 |
| 424 | |
| 425 | Starting kernel ... |
| 426 | |
| 427 | [ 0.000000] Booting Linux on physical CPU 0x0 |
| 428 | |
| 429 | |
| 430 | Here is am example using the -e flag to see all errors:: |
| 431 | |
| 432 | U-Boot> bootflow scan -a |
| 433 | Card did not respond to voltage select! : -110 |
| 434 | Waiting for Ethernet connection... done. |
| 435 | BOOTP broadcast 1 |
| 436 | DHCP client bound to address 192.168.4.30 (4 ms) |
| 437 | Using smsc95xx_eth device |
| 438 | TFTP from server 192.168.4.1; our IP address is 192.168.4.30 |
| 439 | Filename 'rpi.pxe/'. |
| 440 | Load address: 0x200000 |
| 441 | Loading: * |
| 442 | TFTP error: 'Is a directory' (0) |
| 443 | Starting again |
| 444 | |
| 445 | missing environment variable: pxeuuid |
| 446 | Retrieving file: rpi.pxe/pxelinux.cfg/01-b8-27-eb-a6-61-e1 |
| 447 | Waiting for Ethernet connection... done. |
| 448 | Using smsc95xx_eth device |
| 449 | TFTP from server 192.168.4.1; our IP address is 192.168.4.30 |
| 450 | Filename 'rpi.pxe/pxelinux.cfg/01-b8-27-eb-a6-61-e1'. |
| 451 | Load address: 0x2500000 |
| 452 | Loading: ################################################## 566 Bytes |
| 453 | 49.8 KiB/s |
| 454 | done |
| 455 | Bytes transferred = 566 (236 hex) |
| 456 | U-Boot> bootflow l -e |
| 457 | Showing all bootflows |
| 458 | Seq Type State Uclass Part Name Filename |
| 459 | --- ----------- ------ -------- ---- --------------------- ---------------- |
| 460 | 0 distro fs mmc 1 mmc@7e202000.bootdev.p /extlinux/extlinux.conf |
| 461 | ** File not found, err=-2 |
| 462 | 1 distro ready mmc 2 mmc@7e202000.bootdev.p /extlinux/extlinux.conf |
| 463 | 2 distro fs mmc 3 mmc@7e202000.bootdev.p /extlinux/extlinux.conf |
| 464 | ** File not found, err=-1 |
| 465 | 3 distro media mmc 0 mmc@7e202000.bootdev.p <NULL> |
| 466 | ** No partition found, err=-2 |
| 467 | 4 distro media mmc 0 mmc@7e202000.bootdev.p <NULL> |
| 468 | ** No partition found, err=-2 |
| 469 | 5 distro media mmc 0 mmc@7e202000.bootdev.p <NULL> |
| 470 | ** No partition found, err=-2 |
| 471 | 6 distro media mmc 0 mmc@7e202000.bootdev.p <NULL> |
| 472 | ** No partition found, err=-2 |
| 473 | 7 distro media mmc 0 mmc@7e202000.bootdev.p <NULL> |
| 474 | ** No partition found, err=-2 |
| 475 | 8 distro media mmc 0 mmc@7e202000.bootdev.p <NULL> |
| 476 | ** No partition found, err=-2 |
| 477 | 9 distro media mmc 0 mmc@7e202000.bootdev.p <NULL> |
| 478 | ** No partition found, err=-2 |
| 479 | a distro media mmc 0 mmc@7e202000.bootdev.p <NULL> |
| 480 | ** No partition found, err=-2 |
| 481 | b distro media mmc 0 mmc@7e202000.bootdev.p <NULL> |
| 482 | ** No partition found, err=-2 |
| 483 | c distro media mmc 0 mmc@7e202000.bootdev.p <NULL> |
| 484 | ** No partition found, err=-2 |
| 485 | d distro media mmc 0 mmc@7e202000.bootdev.p <NULL> |
| 486 | ** No partition found, err=-2 |
| 487 | e distro media mmc 0 mmc@7e202000.bootdev.p <NULL> |
| 488 | ** No partition found, err=-2 |
| 489 | f distro media mmc 0 mmc@7e202000.bootdev.p <NULL> |
| 490 | ** No partition found, err=-2 |
| 491 | 10 distro media mmc 0 mmc@7e202000.bootdev.p <NULL> |
| 492 | ** No partition found, err=-2 |
| 493 | 11 distro media mmc 0 mmc@7e202000.bootdev.p <NULL> |
| 494 | ** No partition found, err=-2 |
| 495 | 12 distro media mmc 0 mmc@7e202000.bootdev.p <NULL> |
| 496 | ** No partition found, err=-2 |
| 497 | 13 distro media mmc 0 mmc@7e202000.bootdev.p <NULL> |
| 498 | ** No partition found, err=-2 |
| 499 | 14 distro ready ethernet 0 smsc95xx_eth.bootdev.0 rpi.pxe/extlinux/extlinux.conf |
| 500 | --- ----------- ------ -------- ---- --------------------- ---------------- |
| 501 | (21 bootflows, 2 valid) |
| 502 | U-Boot> |
| 503 | |
Simon Glass | cd91e99 | 2023-07-12 09:04:42 -0600 | [diff] [blame] | 504 | Here is an example of booting ChromeOS, adjusting the console beforehand. Note that |
| 505 | the cmdline is word-wrapped here and some parts of the command line are elided:: |
| 506 | |
| 507 | => bootfl list |
| 508 | Showing all bootflows |
| 509 | Seq Method State Uclass Part Name Filename |
| 510 | --- ----------- ------ -------- ---- ------------------------ ---------------- |
| 511 | 0 cros ready nvme 0 5.10.153-20434-g98da1eb2c <NULL> |
| 512 | 1 efi ready nvme c nvme#0.blk#1.bootdev.part efi/boot/bootia32.efi |
| 513 | 2 efi ready usb_mass_ 2 usb_mass_storage.lun0.boo efi/boot/bootia32.efi |
| 514 | --- ----------- ------ -------- ---- ------------------------ ---------------- |
| 515 | (3 bootflows, 3 valid) |
| 516 | => bootfl sel 0 |
| 517 | => bootfl inf |
| 518 | Name: 5.10.153-20434-g98da1eb2cf9d (chrome-bot@chromeos-release-builder-us-central1-b-x32-12-xijx) #1 SMP PREEMPT Tue Jan 24 19:38:23 PST 2023 |
| 519 | Device: nvme#0.blk#1.bootdev |
| 520 | Block dev: nvme#0.blk#1 |
| 521 | Method: cros |
| 522 | State: ready |
| 523 | Partition: 0 |
| 524 | Subdir: (none) |
| 525 | Filename: <NULL> |
| 526 | Buffer: 737a1400 |
| 527 | Size: c47000 (12873728 bytes) |
| 528 | OS: ChromeOS |
| 529 | Cmdline: console= loglevel=7 init=/sbin/init cros_secure drm.trace=0x106 |
| 530 | root=/dev/dm-0 rootwait ro dm_verity.error_behavior=3 |
| 531 | dm_verity.max_bios=-1 dm_verity.dev_wait=1 |
| 532 | dm="1 vroot none ro 1,0 6348800 |
| 533 | verity payload=PARTUUID=799c935b-ae62-d143-8493-816fa936eef7/PARTNROFF=1 |
| 534 | hashtree=PARTUUID=799c935b-ae62-d143-8493-816fa936eef7/PARTNROFF=1 |
| 535 | hashstart=6348800 alg=sha256 |
| 536 | root_hexdigest=78cc462cd45aecbcd49ca476587b4dee59aa1b00ba5ece58e2c29ec9acd914ab |
| 537 | salt=8dec4dc80a75dd834a9b3175c674405e15b16a253fdfe05c79394ae5fd76f66a" |
| 538 | noinitrd vt.global_cursor_default=0 |
Jaewon Jung | fc36ad8 | 2023-09-08 17:00:01 +0900 | [diff] [blame] | 539 | kern_guid=799c935b-ae62-d143-8493-816fa936eef7 add_efi_memmap |
| 540 | noresume i915.modeset=1 ramoops.ecc=1 tpm_tis.force=0 |
Simon Glass | cd91e99 | 2023-07-12 09:04:42 -0600 | [diff] [blame] | 541 | intel_pmc_core.warn_on_s0ix_failures=1 i915.enable_guc=3 i915.enable_dc=4 |
| 542 | xdomain=0 swiotlb=65536 intel_iommu=on i915.enable_psr=1 |
| 543 | usb-storage.quirks=13fe:6500:u |
| 544 | X86 setup: 742e3400 |
| 545 | Logo: (none) |
| 546 | FDT: <NULL> |
| 547 | Error: 0 |
| 548 | => bootflow cmdline auto earlycon |
| 549 | => bootflow cmd auto console |
| 550 | => print bootargs |
| 551 | bootargs=console=ttyS0,115200n8 loglevel=7 ... |
| 552 | usb-storage.quirks=13fe:6500:u earlycon=uart8250,mmio32,0xfe03e000,115200n8 |
| 553 | => bootflow cmd del console |
| 554 | => print bootargs |
| 555 | bootargs=loglevel=7 ... earlycon=uart8250,mmio32,0xfe03e000,115200n8 |
| 556 | => bootfl boot |
| 557 | ** Booting bootflow '5.10.153-20434-g98da1eb2cf9d (chrome-bot@chromeos-release-builder-us-central1-b-x32-12-xijx) #1 SMP PREEMPT Tue Jan 24 19:38:23 PST 2023' with cros |
| 558 | Kernel command line: "loglevel=7 ... earlycon=uart8250,mmio32,0xfe03e000,115200n8" |
| 559 | |
| 560 | Starting kernel ... |
| 561 | |
| 562 | [ 0.000000] Linux version 5.10.153-20434-g98da1eb2cf9d (chrome-bot@chromeos-release-builder-us-central1-b-x32-12-xijx) (Chromium OS 15.0_pre465103_p20220825-r4 clang version 15.0.0 (/var/tmp/portage/sys-devel/llvm-15.0_pre465103_p20220825-r4/work/llvm-15.0_pre465103_p20220825/clang db1978b67431ca3462ad8935bf662c15750b8252), LLD 15.0.0) #1 SMP PREEMPT Tue Jan 24 19:38:23 PST 2023 |
| 563 | [ 0.000000] Command line: loglevel=7 ... usb-storage.quirks=13fe:6500:u earlycon=uart8250,mmio32,0xfe03e000,115200n8 |
| 564 | [ 0.000000] x86/split lock detection: warning about user-space split_locks |
| 565 | |
Simon Glass | 5495aaf | 2023-07-30 11:17:00 -0600 | [diff] [blame] | 566 | This shows looking at x86 setup information:: |
| 567 | |
| 568 | => bootfl sel 0 |
| 569 | => bootfl i -s |
| 570 | Setup located at 77b56010: |
| 571 | |
| 572 | ACPI RSDP addr : 0 |
| 573 | E820: 2 entries |
| 574 | Addr Size Type |
| 575 | 0 1000 RAM |
| 576 | fffff000 1000 Reserved |
| 577 | Setup sectors : 1e |
| 578 | Root flags : 1 |
| 579 | Sys size : 63420 |
| 580 | RAM size : 0 |
| 581 | Video mode : ffff |
| 582 | Root dev : 0 |
| 583 | Boot flag : 0 |
| 584 | Jump : 66eb |
| 585 | Header : 53726448 |
| 586 | Kernel V2 |
| 587 | Version : 20d |
| 588 | Real mode switch : 0 |
| 589 | Start sys seg : 1000 |
| 590 | Kernel version : 38cc |
| 591 | @00003acc: |
| 592 | Type of loader : ff |
| 593 | unknown |
| 594 | Load flags : 1 |
| 595 | : loaded-high |
| 596 | Setup move size : 8000 |
| 597 | Code32 start : 100000 |
| 598 | Ramdisk image : 0 |
| 599 | Ramdisk size : 0 |
| 600 | Bootsect kludge : 0 |
| 601 | Heap end ptr : 5160 |
| 602 | Ext loader ver : 0 |
| 603 | Ext loader type : 0 |
| 604 | Command line ptr : 735000 |
| 605 | Initrd addr max : 7fffffff |
| 606 | Kernel alignment : 200000 |
| 607 | Relocatable kernel : 1 |
| 608 | Min alignment : 15 |
| 609 | : 200000 |
| 610 | Xload flags : 3 |
| 611 | : 64-bit-entry can-load-above-4gb |
| 612 | Cmdline size : 7ff |
| 613 | Hardware subarch : 0 |
| 614 | HW subarch data : 0 |
| 615 | Payload offset : 26e |
| 616 | Payload length : 612045 |
| 617 | Setup data : 0 |
| 618 | Pref address : 1000000 |
| 619 | Init size : 1383000 |
| 620 | Handover offset : 0 |
Simon Glass | cd91e99 | 2023-07-12 09:04:42 -0600 | [diff] [blame] | 621 | |
Simon Glass | 6d8f95b | 2023-08-10 19:33:18 -0600 | [diff] [blame] | 622 | This shows reading a bootflow to examine the kernel:: |
| 623 | |
| 624 | => bootfl i 0 |
| 625 | Name: |
| 626 | Device: emmc@1c,0.bootdev |
| 627 | Block dev: emmc@1c,0.blk |
| 628 | Method: cros |
| 629 | State: ready |
| 630 | Partition: 2 |
| 631 | Subdir: (none) |
| 632 | Filename: <NULL> |
| 633 | Buffer: 0 |
| 634 | Size: 63ee00 (6548992 bytes) |
| 635 | OS: ChromeOS |
| 636 | Cmdline: console= loglevel=7 init=/sbin/init cros_secure oops=panic panic=-1 root=PARTUUID=35c775e7-3735-d745-93e5-d9e0238f7ed0/PARTNROFF=1 rootwait rw dm_verity.error_behavior=3 dm_verity.max_bios=-1 dm_verity.dev_wait=0 dm="1 vroot none rw 1,0 3788800 verity payload=ROOT_DEV hashtree=HASH_DEV hashstart=3788800 alg=sha1 root_hexdigest=55052b629d3ac889f25a9583ea12cdcd3ea15ff8 salt=a2d4d9e574069f4fed5e3961b99054b7a4905414b60a25d89974a7334021165c" noinitrd vt.global_cursor_default=0 kern_guid=35c775e7-3735-d745-93e5-d9e0238f7ed0 add_efi_memmap boot=local noresume noswap i915.modeset=1 tpm_tis.force=1 tpm_tis.interrupts=0 nmi_watchdog=panic,lapic disablevmx=off |
| 637 | X86 setup: 77b56010 |
| 638 | Logo: (none) |
| 639 | FDT: <NULL> |
| 640 | Error: 0 |
| 641 | |
| 642 | Note that `Buffer` is 0 so it has not be read yet. Using `bootflow read`:: |
| 643 | |
| 644 | => bootfl read |
| 645 | => bootfl info |
| 646 | Name: |
| 647 | Device: emmc@1c,0.bootdev |
| 648 | Block dev: emmc@1c,0.blk |
| 649 | Method: cros |
| 650 | State: ready |
| 651 | Partition: 2 |
| 652 | Subdir: (none) |
| 653 | Filename: <NULL> |
| 654 | Buffer: 77b7e400 |
| 655 | Size: 63ee00 (6548992 bytes) |
| 656 | OS: ChromeOS |
| 657 | Cmdline: console= loglevel=7 init=/sbin/init cros_secure oops=panic panic=-1 root=PARTUUID=35c775e7-3735-d745-93e5-d9e0238f7ed0/PARTNROFF=1 rootwait rw dm_verity.error_behavior=3 dm_verity.max_bios=-1 dm_verity.dev_wait=0 dm="1 vroot none rw 1,0 3788800 verity payload=ROOT_DEV hashtree=HASH_DEV hashstart=3788800 alg=sha1 root_hexdigest=55052b629d3ac889f25a9583ea12cdcd3ea15ff8 salt=a2d4d9e574069f4fed5e3961b99054b7a4905414b60a25d89974a7334021165c" noinitrd vt.global_cursor_default=0 kern_guid=35c775e7-3735-d745-93e5-d9e0238f7ed0 add_efi_memmap boot=local noresume noswap i915.modeset=1 tpm_tis.force=1 tpm_tis.interrupts=0 nmi_watchdog=panic,lapic disablevmx=off |
| 658 | X86 setup: 781b4400 |
| 659 | Logo: (none) |
| 660 | FDT: <NULL> |
| 661 | Error: 0 |
| 662 | |
| 663 | Now the buffer can be accessed:: |
| 664 | |
| 665 | => md 77b7e400 |
| 666 | 77b7e400: 1186f6fc 40000002 b8fa0c75 00000018 .......@u....... |
| 667 | 77b7e410: c08ed88e a68dd08e 000001e8 000000e8 ................ |
| 668 | 77b7e420: ed815d00 00000021 62c280b8 89e80100 .]..!......b.... |
| 669 | 77b7e430: 22f7e8c4 c0850061 22ec850f eb890061 ..."a......"a... |
| 670 | 77b7e440: 0230868b 01480000 21d0f7c3 00fb81c3 ..0...H....!.... |
| 671 | 77b7e450: 7d010000 0000bb05 c3810100 00d4f000 ...}............ |
| 672 | 77b7e460: 8130858d 85890061 00618132 3095010f ..0.a...2.a....0 |
| 673 | 77b7e470: 0f006181 c883e020 e0220f20 e000bb8d .a.. ... ."..... |
| 674 | 77b7e480: c0310062 001800b9 8dabf300 62e000bb b.1............b |
| 675 | 77b7e490: 07878d00 89000010 00bb8d07 8d0062f0 .............b.. |
| 676 | 77b7e4a0: 00100787 0004b900 07890000 00100005 ................ |
| 677 | 77b7e4b0: 08c78300 8df37549 630000bb 0183b800 ....Iu.....c.... |
| 678 | 77b7e4c0: 00b90000 89000008 00000507 c7830020 ............ ... |
| 679 | 77b7e4d0: f3754908 e000838d 220f0062 0080b9d8 .Iu.....b..".... |
| 680 | 77b7e4e0: 320fc000 08e8ba0f c031300f b8d0000f ...2.....01..... |
| 681 | 77b7e4f0: 00000020 6ad8000f 00858d10 50000002 ......j.......P |
Simon Glass | 83b9be6 | 2022-04-24 23:31:26 -0600 | [diff] [blame] | 682 | |
Simon Glass | 6d5083b | 2023-10-01 19:14:38 -0600 | [diff] [blame] | 683 | This shows using a text menu to boot an OS:: |
| 684 | |
| 685 | => bootflow scan |
| 686 | => bootfl list |
| 687 | => bootfl menu -t |
| 688 | U-Boot : Boot Menu |
| 689 | |
| 690 | UP and DOWN to choose, ENTER to select |
| 691 | |
| 692 | > 0 mmc1 mmc1.bootdev.whole |
| 693 | 1 mmc1 Fedora-Workstation-armhfp-31-1.9 (5.3.7-301.fc31.armv7hl) |
| 694 | 2 mmc1 mmc1.bootdev.part_1 |
| 695 | 3 mmc4 mmc4.bootdev.whole |
| 696 | 4 mmc4 Armbian |
| 697 | 5 mmc4 mmc4.bootdev.part_1 |
| 698 | 6 mmc5 mmc5.bootdev.whole |
| 699 | 7 mmc5 ChromeOS |
| 700 | 8 mmc5 ChromeOS |
| 701 | U-Boot : Boot Menu |
| 702 | |
| 703 | UP and DOWN to choose, ENTER to select |
| 704 | |
| 705 | 0 mmc1 mmc1.bootdev.whole |
| 706 | > 1 mmc1 Fedora-Workstation-armhfp-31-1.9 (5.3.7-301.fc31.armv7hl) |
| 707 | 2 mmc1 mmc1.bootdev.part_1 |
| 708 | 3 mmc4 mmc4.bootdev.whole |
| 709 | 4 mmc4 Armbian |
| 710 | 5 mmc4 mmc4.bootdev.part_1 |
| 711 | 6 mmc5 mmc5.bootdev.whole |
| 712 | 7 mmc5 ChromeOS |
| 713 | 8 mmc5 ChromeOS |
| 714 | U-Boot : Boot Menu |
| 715 | |
| 716 | Selected: Fedora-Workstation-armhfp-31-1.9 (5.3.7-301.fc31.armv7hl) |
| 717 | => bootfl boot |
| 718 | ** Booting bootflow 'mmc1.bootdev.part_1' with extlinux |
| 719 | Ignoring unknown command: ui |
| 720 | Ignoring malformed menu command: autoboot |
| 721 | Ignoring malformed menu command: hidden |
| 722 | Ignoring unknown command: totaltimeout |
| 723 | Fedora-Workstation-armhfp-31-1.9 Boot Options. |
| 724 | 1: Fedora-Workstation-armhfp-31-1.9 (5.3.7-301.fc31.armv7hl) |
| 725 | Enter choice: 1 |
| 726 | 1: Fedora-Workstation-armhfp-31-1.9 (5.3.7-301.fc31.armv7hl) |
| 727 | Retrieving file: /vmlinuz-5.3.7-301.fc31.armv7hl |
| 728 | Retrieving file: /initramfs-5.3.7-301.fc31.armv7hl.img |
| 729 | append: ro root=UUID=9732b35b-4cd5-458b-9b91-80f7047e0b8a rhgb quiet LANG=en_US.UTF-8 cma=192MB cma=256MB |
| 730 | Retrieving file: /dtb-5.3.7-301.fc31.armv7hl/sandbox.dtb |
| 731 | ... |
| 732 | |
Simon Glass | 83b9be6 | 2022-04-24 23:31:26 -0600 | [diff] [blame] | 733 | |
| 734 | Return value |
| 735 | ------------ |
| 736 | |
| 737 | On success `bootflow boot` normally boots into the Operating System and does not |
| 738 | return to U-Boot. If something about the U-Boot processing fails, then the |
| 739 | return value $? is 1. If the boot succeeds but for some reason the Operating |
| 740 | System returns, then $? is 0, indicating success. |
| 741 | |
Simon Glass | 6d5083b | 2023-10-01 19:14:38 -0600 | [diff] [blame] | 742 | For `bootflow menu` the return value is $? is 0 (true) if an option was choses, |
| 743 | else 1. |
| 744 | |
Simon Glass | 83b9be6 | 2022-04-24 23:31:26 -0600 | [diff] [blame] | 745 | For other subcommands, the return value $? is always 0 (true). |
| 746 | |
| 747 | |
| 748 | .. BootflowStates_: |