host.rst 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. .. SPDX-License-Identifier: GPL-2.0+
  2. host command
  3. ============
  4. Synopis
  5. -------
  6. ::
  7. host bind [-r] <label> [<filename>]
  8. host unbind <label|seq>
  9. host info [<label|seq>]
  10. host dev [<label|seq>]
  11. Description
  12. -----------
  13. The host command provides a way to attach disk images on the host to U-Boot
  14. sandbox. This can be useful for testing U-Boot's filesystem implementations.
  15. Common arguments:
  16. <label|seq>
  17. This is used to specify a host device. It can either be a label (a string)
  18. or the sequence number of the device. An invalid value causes the command
  19. to fail.
  20. host bind
  21. ~~~~~~~~~
  22. This creates a new host device and binds a file to it.
  23. Arguments:
  24. label
  25. Label to use to identify this binding. This can be any string.
  26. filename:
  27. Host filename to bind to
  28. Flags:
  29. -r
  30. Mark the device as removable
  31. host unbind
  32. ~~~~~~~~~~~
  33. This unbinds a host device that was previously bound. The sequence numbers of
  34. other devices remain unchanged.
  35. host info
  36. ~~~~~~~~~
  37. Provides information about a particular host binding, or all of them.
  38. host dev
  39. ~~~~~~~~
  40. Allowing selecting a particular device, or (with no arguments) seeing which one
  41. is selected.
  42. Example
  43. -------
  44. Initially there are no devices::
  45. => host info
  46. dev blocks label path
  47. Bind a device::
  48. => host bind -r test2 2MB.ext2.img
  49. => host bind fat 1MB.fat32.img
  50. => host info
  51. dev blocks label path
  52. 0 4096 test2 2MB.ext2.img
  53. 1 2048 fat 1MB.fat32.img
  54. Select a device by label or sequence number::
  55. => host dev fat
  56. Current host device: 1: fat
  57. => host dev 0
  58. Current host device: 0: test2
  59. Write a file::
  60. => ext4write host 0 0 /dump 1e00
  61. File System is consistent
  62. 7680 bytes written in 3 ms (2.4 MiB/s)
  63. => ext4ls host 0
  64. <DIR> 4096 .
  65. <DIR> 4096 ..
  66. <DIR> 16384 lost+found
  67. 4096 testing
  68. 7680 dump
  69. Unbind a device::
  70. => host unbind test2
  71. => host info
  72. dev blocks label path
  73. 1 2048 fat 1MB.fat32.img
  74. Return value
  75. ------------
  76. The return value $? indicates whether the command succeeded.