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