kickstart.rst 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234
  1. .. SPDX-License-Identifier: CC-BY-SA-2.0-UK
  2. *******************************************
  3. OpenEmbedded Kickstart (``.wks``) Reference
  4. *******************************************
  5. .. _openembedded-kickstart-wks-reference:
  6. Introduction
  7. ============
  8. The current Wic implementation supports only the basic kickstart
  9. partitioning commands: ``partition`` (or ``part`` for short) and
  10. ``bootloader``.
  11. .. note::
  12. Future updates will implement more commands and options. If you use
  13. anything that is not specifically supported, results can be
  14. unpredictable.
  15. This chapter provides a reference on the available kickstart commands.
  16. The information lists the commands, their syntax, and meanings.
  17. Kickstart commands are based on the Fedora kickstart versions but with
  18. modifications to reflect Wic capabilities. You can see the original
  19. documentation for those commands at the following link:
  20. https://pykickstart.readthedocs.io/en/latest/kickstart-docs.html
  21. Command: part or partition
  22. ==========================
  23. Either of these commands creates a partition on the system and uses the
  24. following syntax::
  25. part [mntpoint]
  26. partition [mntpoint]
  27. If you do not
  28. provide mntpoint, Wic creates a partition but does not mount it.
  29. The ``mntpoint`` is where the partition is mounted and must be in one of
  30. the following forms:
  31. - ``/path``: For example, "/", "/usr", or "/home"
  32. - ``swap``: The created partition is used as swap space
  33. Specifying a mntpoint causes the partition to automatically be mounted.
  34. Wic achieves this by adding entries to the filesystem table (fstab)
  35. during image generation. In order for Wic to generate a valid fstab, you
  36. must also provide one of the ``--ondrive``, ``--ondisk``, or
  37. ``--use-uuid`` partition options as part of the command.
  38. .. note::
  39. The mount program must understand the PARTUUID syntax you use with
  40. ``--use-uuid`` and non-root *mountpoint*, including swap. The default
  41. configuration of BusyBox in OpenEmbedded supports this, but this may
  42. be disabled in custom configurations.
  43. Here is an example that uses "/" as the mountpoint. The command uses
  44. ``--ondisk`` to force the partition onto the ``sdb`` disk::
  45. part / --source rootfs --ondisk sdb --fstype=ext3 --label platform --align 1024
  46. Here is a list that describes other supported options you can use with
  47. the ``part`` and ``partition`` commands:
  48. - ``--size``: The minimum partition size. Specify as an integer value
  49. optionally followed by one of the units "k" / "K" for kibibyte,
  50. "M" for mebibyte and "G" for gibibyte. The default unit if none is
  51. given is "M". You do not need this option if you use ``--source``.
  52. - ``--fixed-size``: The exact partition size. Specify as an integer
  53. value optionally followed by one of the units "k" / "K" for kibibyte,
  54. "M" for mebibyte and "G" for gibibyte. The default unit if none is
  55. given is "M". Cannot be specify together with ``--size``. An error
  56. occurs when assembling the disk image if the partition data is larger
  57. than ``--fixed-size``.
  58. - ``--source``: This option is a Wic-specific option that names the
  59. source of the data that populates the partition. The most common
  60. value for this option is "rootfs", but you can use any value that
  61. maps to a valid source plugin. For information on the source plugins,
  62. see the ":ref:`dev-manual/wic:using the wic plugin interface`"
  63. section in the Yocto Project Development Tasks Manual.
  64. If you use ``--source rootfs``, Wic creates a partition as large as
  65. needed and fills it with the contents of the root filesystem pointed
  66. to by the ``-r`` command-line option or the equivalent root filesystem derived
  67. from the ``-e`` command-line option. The filesystem type used to
  68. create the partition is driven by the value of the ``--fstype``
  69. option specified for the partition. See the entry on ``--fstype``
  70. that follows for more information.
  71. If you use ``--source plugin-name``, Wic creates a partition as large
  72. as needed and fills it with the contents of the partition that is
  73. generated by the specified plugin name using the data pointed to by
  74. the ``-r`` command-line option or the equivalent root filesystem derived from
  75. the ``-e`` command-line option. Exactly what those contents are and
  76. filesystem type used are dependent on the given plugin
  77. implementation.
  78. If you do not use the ``--source`` option, the ``wic`` command
  79. creates an empty partition. Consequently, you must use the ``--size``
  80. option to specify the size of the empty partition.
  81. - ``--ondisk`` or ``--ondrive``: Forces the partition to be created
  82. on a particular disk.
  83. - ``--fstype``: Sets the file system type for the partition. Valid
  84. values are:
  85. - ``btrfs``
  86. - ``erofs``
  87. - ``ext2``
  88. - ``ext3``
  89. - ``ext4``
  90. - ``squashfs``
  91. - ``swap``
  92. - ``vfat``
  93. - ``--fsoptions``: Specifies a free-form string of options to be used
  94. when mounting the filesystem. This string is copied into the
  95. ``/etc/fstab`` file of the installed system and should be enclosed in
  96. quotes. If not specified, the default string is "defaults".
  97. - ``--label label``: Specifies the label to give to the filesystem to
  98. be made on the partition. If the given label is already in use by
  99. another filesystem, a new label is created for the partition.
  100. - ``--active``: Marks the partition as active.
  101. - ``--align (in KBytes)``: This option is a Wic-specific option that
  102. says to start partitions on boundaries given x KBytes.
  103. - ``--offset``: This option is a Wic-specific option that
  104. says to place a partition at exactly the specified offset. If the
  105. partition cannot be placed at the specified offset, the image build
  106. will fail. Specify as an integer value optionally followed by one of
  107. the units "s" / "S" for 512 byte sector, "k" / "K" for kibibyte, "M"
  108. for mebibyte and "G" for gibibyte. The default unit if none is given
  109. is "k".
  110. - ``--no-table``: This option is a Wic-specific option. Using the
  111. option reserves space for the partition and causes it to become
  112. populated. However, the partition is not added to the partition
  113. table.
  114. - ``--exclude-path``: This option is a Wic-specific option that
  115. excludes the given relative path from the resulting image. This
  116. option is only effective with the rootfs source plugin.
  117. - ``--extra-space``: This option is a Wic-specific option that adds
  118. extra space after the space filled by the content of the partition.
  119. The final size can exceed the size specified by the ``--size``
  120. option. The default value is 10M. Specify as an integer value
  121. optionally followed by one of the units "k" / "K" for kibibyte, "M"
  122. for mebibyte and "G" for gibibyte. The default unit if none is given
  123. is "M".
  124. - ``--overhead-factor``: This option is a Wic-specific option that
  125. multiplies the size of the partition by the option's value. You must
  126. supply a value greater than or equal to "1". The default value is
  127. "1.3".
  128. - ``--part-name``: This option is a Wic-specific option that
  129. specifies a name for GPT partitions.
  130. - ``--part-type``: This option is a Wic-specific option that
  131. specifies the partition type globally unique identifier (GUID) for
  132. GPT partitions. You can find the list of partition type GUIDs at
  133. :wikipedia:`GUID_Partition_Table#Partition_type_GUIDs`.
  134. - ``--use-uuid``: This option is a Wic-specific option that causes
  135. Wic to generate a random GUID for the partition. The generated
  136. identifier is used in the bootloader configuration to specify the
  137. root partition.
  138. - ``--uuid``: This option is a Wic-specific option that specifies the
  139. partition UUID.
  140. - ``--fsuuid``: This option is a Wic-specific option that specifies
  141. the filesystem UUID. You can generate or modify
  142. :term:`WKS_FILE` with this option if a preconfigured
  143. filesystem UUID is added to the kernel command line in the bootloader
  144. configuration before you run Wic.
  145. - ``--system-id``: This option is a Wic-specific option that
  146. specifies the partition system ID, which is a one byte long,
  147. hexadecimal parameter with or without the 0x prefix.
  148. - ``--mkfs-extraopts``: This option specifies additional options to
  149. pass to the ``mkfs`` utility. Some default options for certain
  150. filesystems do not take effect. See Wic's help on kickstart (i.e.
  151. ``wic help kickstart``).
  152. Command: bootloader
  153. ===================
  154. This command specifies how the bootloader should be configured and
  155. supports the following options:
  156. .. note::
  157. Bootloader functionality and boot partitions are implemented by the
  158. various source plugins that implement bootloader functionality. The bootloader
  159. command essentially provides a means of modifying bootloader
  160. configuration.
  161. - ``--append``: Specifies kernel parameters. These parameters will be
  162. added to the syslinux :term:`APPEND` or ``grub`` kernel command line.
  163. - ``--configfile``: Specifies a user-defined configuration file for
  164. the bootloader. You can provide a full pathname for the file or a
  165. file located in the ``canned-wks`` folder. This option overrides
  166. all other bootloader options.
  167. - ``--ptable``: Specifies the partition table format. Valid values are:
  168. - ``msdos``
  169. - ``gpt``
  170. - ``--timeout``: Specifies the number of seconds before the
  171. bootloader times out and boots the default option.