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