Skip to content

Commit 9bef710

Browse files
aafeijoo-susejohannbg
authored andcommitted
fix(dracut.sh): format usage and add missing options
Set common format to each option and add missing options: --no-machineid
1 parent a6c497d commit 9bef710

File tree

1 file changed

+103
-84
lines changed

1 file changed

+103
-84
lines changed

dracut.sh

+103-84
Original file line numberDiff line numberDiff line change
@@ -79,57 +79,69 @@ Creates initial ramdisk images for preloading modules
7979
8080
--kver [VERSION] Set kernel version to [VERSION].
8181
-f, --force Overwrite existing initramfs file.
82+
[OUTPUT_FILE] --rebuild
83+
Append the current arguments to those with which the
84+
input initramfs image was built. This option helps in
85+
incrementally building the initramfs for testing.
86+
If optional [OUTPUT_FILE] is not provided, the input
87+
initramfs provided to rebuild will be used as output
88+
file.
8289
-a, --add [LIST] Add a space-separated list of dracut modules.
83-
--rebuild Append arguments to those of existing image and rebuild
90+
--force-add [LIST] Force to add a space-separated list of dracut modules
91+
to the default set of modules, when -H is specified.
92+
-o, --omit [LIST] Omit a space-separated list of dracut modules.
8493
-m, --modules [LIST] Specify a space-separated list of dracut modules to
8594
call when building the initramfs. Modules are located
8695
in /usr/lib/dracut/modules.d.
87-
-o, --omit [LIST] Omit a space-separated list of dracut modules.
88-
--force-add [LIST] Force to add a space-separated list of dracut modules
89-
to the default set of modules, when -H is specified.
90-
-d, --drivers [LIST] Specify a space-separated list of kernel modules to
91-
exclusively include in the initramfs.
96+
This option forces dracut to only include the specified
97+
dracut modules.
98+
In most cases the --add option is what you want to use.
9299
--add-drivers [LIST] Specify a space-separated list of kernel
93100
modules to add to the initramfs.
94-
--force-drivers [LIST] Specify a space-separated list of kernel
101+
--force-drivers [LIST]
102+
Specify a space-separated list of kernel
95103
modules to add to the initramfs and make sure they
96104
are tried to be loaded via modprobe same as passing
97105
rd.driver.pre=DRIVER kernel parameter.
98106
--omit-drivers [LIST] Specify a space-separated list of kernel
99107
modules not to add to the initramfs.
108+
-d, --drivers [LIST] Specify a space-separated list of kernel modules to
109+
exclusively include in the initramfs.
100110
--filesystems [LIST] Specify a space-separated list of kernel filesystem
101111
modules to exclusively include in the generic
102112
initramfs.
103-
-k, --kmoddir [DIR] Specify the directory, where to look for kernel
104-
modules
105-
--fwdir [DIR] Specify additional directories, where to look for
106-
firmwares, separated by :
113+
-k, --kmoddir [DIR] Specify the directory where to look for kernel
114+
modules.
115+
--fwdir [DIR] Specify additional colon-separated list of directories
116+
where to look for firmware files.
107117
--libdirs [LIST] Specify a space-separated list of directories
108118
where to look for libraries.
109-
--kernel-only Only install kernel drivers and firmware files
110-
--no-kernel Do not install kernel drivers and firmware files
111-
--print-cmdline Print the kernel command line for the given disk layout
112-
--early-microcode Combine early microcode with ramdisk
113-
--no-early-microcode Do not combine early microcode with ramdisk
114-
--kernel-cmdline [PARAMETERS] Specify default kernel command line parameters
115-
--strip Strip binaries in the initramfs
119+
--kernel-only Only install kernel drivers and firmware files.
120+
--no-kernel Do not install kernel drivers and firmware files.
121+
--print-cmdline Print the kernel command line for the given disk layout.
122+
--early-microcode Combine early microcode with ramdisk.
123+
--no-early-microcode Do not combine early microcode with ramdisk.
124+
--kernel-cmdline [PARAMETERS]
125+
Specify default kernel command line parameters.
126+
--strip Strip binaries in the initramfs.
116127
--aggresive-strip Strip more than just debug symbol and sections,
117-
for a smaller initramfs build.
118-
--nostrip Do not strip binaries in the initramfs
119-
--hardlink Hardlink files in the initramfs
120-
--nohardlink Do not hardlink files in the initramfs
121-
--prefix [DIR] Prefix initramfs files with [DIR]
122-
--noprefix Do not prefix initramfs files
123-
--mdadmconf Include local /etc/mdadm.conf
124-
--nomdadmconf Do not include local /etc/mdadm.conf
125-
--lvmconf Include local /etc/lvm/lvm.conf
126-
--nolvmconf Do not include local /etc/lvm/lvm.conf
128+
for a smaller initramfs build. The --strip option must
129+
also be specified.
130+
--nostrip Do not strip binaries in the initramfs.
131+
--hardlink Hardlink files in the initramfs.
132+
--nohardlink Do not hardlink files in the initramfs.
133+
--prefix [DIR] Prefix initramfs files with [DIR].
134+
--noprefix Do not prefix initramfs files.
135+
--mdadmconf Include local /etc/mdadm.conf file.
136+
--nomdadmconf Do not include local /etc/mdadm.conf file.
137+
--lvmconf Include local /etc/lvm/lvm.conf file.
138+
--nolvmconf Do not include local /etc/lvm/lvm.conf file.
127139
--fscks [LIST] Add a space-separated list of fsck helpers.
128140
--nofscks Inhibit installation of any fsck helpers.
129141
--ro-mnt Mount / and /usr read-only by default.
130-
-h, --help This message
131-
--debug Output debug information of the build process
132-
--profile Output profile information of the build process
142+
-h, --help This message.
143+
--debug Output debug information of the build process.
144+
--profile Output profile information of the build process.
133145
-L, --stdlog [0-6] Specify logging level (to standard error)
134146
0 - suppress any messages
135147
1 - only fatal errors
@@ -138,8 +150,8 @@ Creates initial ramdisk images for preloading modules
138150
4 - info
139151
5 - debug info (here starts lots of output)
140152
6 - trace info (and even more)
141-
-v, --verbose Increase verbosity level
142-
-q, --quiet Decrease verbosity level
153+
-v, --verbose Increase verbosity level.
154+
-q, --quiet Decrease verbosity level.
143155
-c, --conf [FILE] Specify configuration file to use.
144156
Default: /etc/dracut.conf
145157
--confdir [DIR] Specify configuration directory to use *.conf files
@@ -151,57 +163,60 @@ Creates initial ramdisk images for preloading modules
151163
directory instead of the system-wide installed in
152164
/usr/lib/dracut/modules.d.
153165
Useful when running dracut from a git checkout.
154-
-H, --hostonly Host-Only mode: Install only what is needed for
155-
booting the local host instead of a generic host.
156-
-N, --no-hostonly Disables Host-Only mode
157-
--hostonly-mode <mode>
158-
Specify the hostonly mode to use. <mode> could be
159-
one of "sloppy" or "strict". "sloppy" mode is used
160-
by default.
161-
In "sloppy" hostonly mode, extra drivers and modules
162-
will be installed, so minor hardware change won't make
163-
the image unbootable (eg. changed keyboard), and the
164-
image is still portable among similar hosts.
165-
With "strict" mode enabled, anything not necessary
166-
for booting the local host in its current state will
167-
not be included, and modules may do some extra job
168-
to save more space. Minor change of hardware or
169-
environment could make the image unbootable.
170-
DO NOT use "strict" mode unless you know what you
171-
are doing.
166+
-H, --hostonly Host-only mode: Install only what is needed for
167+
booting the local host instead of a generic host.
168+
-N, --no-hostonly Disables host-only mode.
169+
--hostonly-mode [MODE]
170+
Specify the host-only mode to use. [MODE] could be
171+
one of "sloppy" or "strict". "sloppy" mode is used
172+
by default.
173+
In "sloppy" host-only mode, extra drivers and modules
174+
will be installed, so minor hardware change won't make
175+
the image unbootable (e.g. changed keyboard), and the
176+
image is still portable among similar hosts.
177+
With "strict" mode enabled, anything not necessary
178+
for booting the local host in its current state will
179+
not be included, and modules may do some extra job
180+
to save more space. Minor change of hardware or
181+
environment could make the image unbootable.
182+
DO NOT use "strict" mode unless you know what you
183+
are doing.
172184
--hostonly-cmdline Store kernel command line arguments needed
173-
in the initramfs
185+
in the initramfs.
174186
--no-hostonly-cmdline Do not store kernel command line arguments needed
175-
in the initramfs
187+
in the initramfs.
176188
--no-hostonly-default-device
177189
Do not generate implicit host devices like root,
178-
swap, fstab, etc. Use "--mount" or "--add-device"
179-
to explicitly add devices as needed.
190+
swap, fstab, etc. Use "--mount" or "--add-device"
191+
to explicitly add devices as needed.
180192
--hostonly-i18n Install only needed keyboard and font files according
181-
to the host configuration (default).
193+
to the host configuration (default).
182194
--no-hostonly-i18n Install all keyboard and font files available.
183195
--hostonly-nics [LIST]
184-
Only enable listed NICs in the initramfs.
196+
Only enable listed NICs in the initramfs. The list can
197+
be empty, so other modules can install only the
198+
necessary network drivers.
185199
--persistent-policy [POLICY]
186200
Use [POLICY] to address disks and partitions.
187-
POLICY can be any directory name found in /dev/disk.
188-
E.g. "by-uuid", "by-label"
201+
POLICY can be any directory name found in /dev/disk.
202+
E.g. "by-uuid", "by-label"
189203
--fstab Use /etc/fstab to determine the root device.
190-
--add-fstab [FILE] Add file to the initramfs fstab
204+
--add-fstab [FILE] Add file to the initramfs fstab.
191205
--mount "[DEV] [MP] [FSTYPE] [FSOPTS]"
192206
Mount device [DEV] on mountpoint [MP] with filesystem
193-
[FSTYPE] and options [FSOPTS] in the initramfs
207+
[FSTYPE] and options [FSOPTS] in the initramfs.
194208
--mount "[MP]" Same as above, but [DEV], [FSTYPE] and [FSOPTS] are
195-
determined by looking at the current mounts.
196-
--add-device "[DEV]" Bring up [DEV] in initramfs
209+
determined by looking at the current mounts.
210+
--add-device "[DEV]" Bring up [DEV] in initramfs.
197211
-i, --include [SOURCE] [TARGET]
198212
Include the files in the SOURCE directory into the
199213
Target directory in the final initramfs.
200214
If SOURCE is a file, it will be installed to TARGET
201215
in the final initramfs.
202216
-I, --install [LIST] Install the space separated list of files into the
203217
initramfs.
204-
--install-optional [LIST] Install the space separated list of files into the
218+
--install-optional [LIST]
219+
Install the space separated list of files into the
205220
initramfs, if they exist.
206221
--gzip Compress the generated initramfs using gzip.
207222
This will be done by default, unless another
@@ -224,37 +239,41 @@ Creates initial ramdisk images for preloading modules
224239
--zstd Compress the generated initramfs using Zstandard.
225240
Make sure that your kernel has zstd support compiled
226241
in, otherwise you will not be able to boot.
227-
--compress [COMPRESSION] Compress the generated initramfs with the
242+
--compress [COMPRESSION]
243+
Compress the generated initramfs with the
228244
passed compression program. Make sure your kernel
229245
knows how to decompress the generated initramfs,
230246
otherwise you will not be able to boot.
231-
--no-compress Do not compress the generated initramfs. This will
247+
--no-compress Do not compress the generated initramfs. This will
232248
override any other compression options.
233-
--squash-compressor [COMPRESSION] Specify the compressor and compressor
234-
specific options used by mksquashfs if squash module
235-
is called when building the initramfs.
249+
--squash-compressor [COMPRESSION]
250+
Specify the compressor and compressor specific options
251+
used by mksquashfs if squash module is called when
252+
building the initramfs.
236253
--enhanced-cpio Attempt to reflink cpio file data using dracut-cpio.
237254
--list-modules List all available dracut modules.
238255
-M, --show-modules Print included module's name to standard output during
239256
build.
240-
--keep Keep the temporary initramfs for debugging purposes
241-
--printsize Print out the module install size
242-
--sshkey [SSHKEY] Add ssh key to initramfs (use with ssh-client module)
243-
--logfile [FILE] Logfile to use (overrides configuration setting)
244-
--reproducible Create reproducible images
245-
--no-reproducible Do not create reproducible images
246-
--loginstall [DIR] Log all files installed from the host to [DIR]
257+
--keep Keep the temporary initramfs for debugging purposes.
258+
--printsize Print out the module install size.
259+
--sshkey [SSHKEY] Add SSH key to initramfs (use with ssh-client module).
260+
--logfile [FILE] Logfile to use (overrides configuration setting).
261+
--reproducible Create reproducible images.
262+
--no-reproducible Do not create reproducible images.
263+
--loginstall [DIR] Log all files installed from the host to [DIR].
247264
--uefi Create an UEFI executable with the kernel cmdline and
248-
kernel combined
249-
--no-uefi Disables UEFI mode
250-
--uefi-stub [FILE] Use the UEFI stub [FILE] to create an UEFI executable
265+
kernel combined.
266+
--no-uefi Disables UEFI mode.
267+
--no-machineid Affects the default output filename of the UEFI
268+
executable, discarding the <MACHINE_ID> part.
269+
--uefi-stub [FILE] Use the UEFI stub [FILE] to create an UEFI executable.
251270
--uefi-splash-image [FILE]
252271
Use [FILE] as a splash image when creating an UEFI
253-
executable
254-
--kernel-image [FILE] location of the kernel image
272+
executable. Requires bitmap (.bmp) image format.
273+
--kernel-image [FILE] Location of the kernel image.
255274
--regenerate-all Regenerate all initramfs images at the default location
256-
for the kernel versions found on the system
257-
--version Display version
275+
for the kernel versions found on the system.
276+
--version Display version.
258277
259278
If [LIST] has multiple arguments, then you have to put these in quotes.
260279
@@ -2184,7 +2203,7 @@ if [[ $do_strip == yes ]]; then
21842203
fi
21852204
done
21862205
2187-
if [[ $aggresive_strip ]]; then
2206+
if [[ $aggresive_strip == yes ]]; then
21882207
# `eu-strip` and `strip` both strips all unneeded parts by default
21892208
strip_args=(-p)
21902209
else

0 commit comments

Comments
 (0)