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