blob: a70a432b6f2b27ce04b4816312eefb86fb254c3f [file] [log] [blame]
Simon Glass2851cc92022-10-29 19:47:18 -06001.. SPDX-License-Identifier: GPL-2.0+
2
Heinrich Schuchardt60971e62024-01-14 14:53:13 +01003.. index::
4 single: host (command)
5
Simon Glass2851cc92022-10-29 19:47:18 -06006host command
7============
8
Heinrich Schuchardt98b5ea12024-03-16 11:09:36 +01009Synopsis
10--------
Simon Glass2851cc92022-10-29 19:47:18 -060011
12::
13
14 host bind [-r] <label> [<filename>]
15 host unbind <label|seq>
16 host info [<label|seq>]
17 host dev [<label|seq>]
18
19Description
20-----------
21
22The host command provides a way to attach disk images on the host to U-Boot
23sandbox. This can be useful for testing U-Boot's filesystem implementations.
24
25Common arguments:
26
27<label|seq>
28 This is used to specify a host device. It can either be a label (a string)
29 or the sequence number of the device. An invalid value causes the command
30 to fail.
31
32
33host bind
34~~~~~~~~~
35
36This creates a new host device and binds a file to it.
37
38Arguments:
39
40label
41 Label to use to identify this binding. This can be any string.
42
43filename:
44 Host filename to bind to
45
46Flags:
47
48-r
49 Mark the device as removable
50
51
52host unbind
53~~~~~~~~~~~
54
55This unbinds a host device that was previously bound. The sequence numbers of
56other devices remain unchanged.
57
58
59host info
60~~~~~~~~~
61
62Provides information about a particular host binding, or all of them.
63
64
65host dev
66~~~~~~~~
67
68Allowing selecting a particular device, or (with no arguments) seeing which one
69is selected.
70
71
72Example
73-------
74
75Initially there are no devices::
76
77 => host info
78 dev blocks label path
79
80Bind a device::
81
82 => host bind -r test2 2MB.ext2.img
83 => host bind fat 1MB.fat32.img
84 => host info
85 dev blocks label path
86 0 4096 test2 2MB.ext2.img
87 1 2048 fat 1MB.fat32.img
88
89Select a device by label or sequence number::
90
91 => host dev fat
92 Current host device: 1: fat
93 => host dev 0
94 Current host device: 0: test2
95
96Write a file::
97
98 => ext4write host 0 0 /dump 1e00
99 File System is consistent
100 7680 bytes written in 3 ms (2.4 MiB/s)
101 => ext4ls host 0
102 <DIR> 4096 .
103 <DIR> 4096 ..
104 <DIR> 16384 lost+found
105 4096 testing
106 7680 dump
107
108Unbind a device::
109
110 => host unbind test2
111 => host info
112 dev blocks label path
113 1 2048 fat 1MB.fat32.img
114
115
116Return value
117------------
118
119The return value $? indicates whether the command succeeded.