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