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