prudo1 · GitHub

added 4 commits

August 13, 2024 14:34
The indent_size gives the number of spaces an indentation should have.
When combined with indent_style=tab and tab_width=X the leading X spaces
are replaced by a tab. If tab_width is omitted it is set to the value of
indent_size. For the current settings this means that every level of
indentation is indented by a single space which gets replaced by a tab.
The tab again is displayed by a single space, if you set your editor to
follow the editconfig. This is not only barely readable but also impacts
line breaks for over long lines. Thus set indent_size=8 to better match
the way over long lines are broken at the moment.
Signed-off-by: Philipp Rudo <prudo@redhat.com>
With the introduction of the Makefile it is now easy to move files into
different sub-directories. Thus create a sub-directory for each of the
dracut modules and move their files there. This not only cleans up the
main directory but also simplifies the Makefile and prevents bugs like
the one fixed in  5109f11  ("Makefile: Fix early-kdump file names").
One nice site effect by using 'cp' instead of 'install' is that file
permissions from the repo are preserved. So instead of manually setting
the file permissions for each call to 'install' we can now simply change
(and commit) the file permissions in the repo. Like it is done for
99kdumpbase/monitor_dd_progress.sh and 99zz-fadumpinit/module-setup.sh
in this commit.
Also adjust the .editorconfig to the new structure.
Signed-off-by: Philipp Rudo <prudo@redhat.com>
Commit generated using
    $ shfmt -s -w dracut/
Signed-off-by: Philipp Rudo <prudo@redhat.com>
Bash allows to redirect/pipe the stdout and stderr together using
'&>' and '|&'. Make use of this to simplify the code a little bit.
Signed-off-by: Philipp Rudo <prudo@redhat.com>

@prudo1 prudo1 changed the title Features/erofs/main Add suport for erofs in the kdump initrd

Aug 20, 2024

coiby

Fix the shellcheck warnings for 99kdumpbase. With this
    $ shellcheck -x dracut/99kdumpbase/*.sh
now returns without finding.
Signed-off-by: Philipp Rudo <prudo@redhat.com>
Fix the shellcheck warnings for 99earlykdump. With this
    $ shellcheck -x dracut/99earlykdump/*.sh
now returns without finding.
Signed-off-by: Philipp Rudo <prudo@redhat.com>
Fix the shellcheck warnings for 99zz-fadumpinit. With this
    $ shellcheck -x dracut/99zz-fadumpinit/*.sh
now returns without finding.
Signed-off-by: Philipp Rudo <prudo@redhat.com>
Fix the shellcheck warnings for kdumpctl. With this
    $ $ shellcheck -x kdumpctl
now returns without finding.
While at it make use of the special SCRIPTDIR value for source-path.
Signed-off-by: Philipp Rudo <prudo@redhat.com>
Fix the shellcheck warnings for mkdumprd. With this
    $ shellcheck -x mkdumprd
now returns without finding.
Signed-off-by: Philipp Rudo <prudo@redhat.com>
Fix the shellcheck warnings for mkfadumprd. With this
    $ shellcheck -x mkfadumprd
now returns without finding.
Signed-off-by: Philipp Rudo <prudo@redhat.com>
There are currently three functions to add arguments to dracut. None of
these improve readability or add any other benefit. So remove the
functions and clean up the code a little bit.
Signed-off-by: Philipp Rudo <prudo@redhat.com>
Add the drivers directly and drop the extra_modules variable.
Signed-off-by: Philipp Rudo <prudo@redhat.com>
The lvmthinpool-moitor module was added with dracut 057 but the minimal
required dracut version in the Fedora spec file is dracut >=058. So we
can safely assume that the module is always present.
Signed-off-by: Philipp Rudo <prudo@redhat.com>
The option --squash-compressor was introduced with dracut 057 but the
minimal required dracut version in the Fedora spec file is dracut >=058.
So we can safely assume that the option is always present.
Signed-off-by: Philipp Rudo <prudo@redhat.com>
The handling of compression in the initrd currently is a total mess.
There are multiple problems:
1) It is handled in two different locations, mkdumprd and
99kdumpbase, making the code unnecessarily complex.
2) While mkdumprd only adds the --squash-compressor option when there is
no compression requested in kdump.conf:dracut_args, 99kdumpbase
unconditionally adds the 99squash module. But once 99squash is added
dracut ignores all compression options passed on the command line and
produces an uncompressed initrd (assuming the compression is done in
the squashfs image). So adding a compression option to dracut_args
will neither compress the initrd nor the squashfs image.
3) To depend on 99squash, 99kdumpbase only checks whether the required
kernel modules are present but doesn't check whether the
squashfs-tools are installed. This can lead to failures when building
the initrd as 99squash fails to install. At the moment this only
works as the dracut-squash rpm depends on the squashfs-tools. But
once support for erofs is added this might no longer be the case.
4) In case 99squash cannot be used mkdumprd compresses the initrd with
zstd. But that doesn't really makes sense. For one compressing the
initrd only reduces the on-disk size but not the memory usage during
runtime of the initrd. Plus in case no compression is specified
dracut will automatically compress the initrd. For that it checks for
the 'best' available compression algorithm with zstd being the
default.
Clean this mess up be moving everything to mkdumprd, only addding
99squash when there is no compression given in the dracut_args, drop
setting the --compress option and, only include 99squash when the
squashfs-tools are installed.
Note: Only checking the squashfs-tools is sufficient as it doesn't make
sense to have them installed, when the kernel doesn't support squashfs.
There might be a use case to build images that then get used on an other
machine where the kernel supports it. But as the initrd is build with
--hostonly that is no use case we need to consider for kdump.
Signed-off-by: Philipp Rudo <prudo@redhat.com>

@prudo1

liutgnu

With dracut 104 support for erofs in 99squash was added. For that the
squashfs specific code was split from 99squash module into
95squash-squashfs and a new 95squash-erofs was added. The modules are
structured the way, that you can either add 99squash, which then picks
the 'best' back end, or one of the 95squash-{squashfs,erofs} if you want
to make sure which back end is used.
Unfortunately erofs doesn't support the same compression algorithms
squashfs supports.  So explicitly set which image type we want so we can
set the correct --squash-compressor option.
Keep support for the old 99squash for the time being so newer versions
of kdump-utils can work with dracut <= 103.
Signed-off-by: Philipp Rudo <prudo@redhat.com>

@prudo1

@prudo1

@coiby

This was referenced

Aug 30, 2024

Merged

Merged

Merged

Open

Open

Read the original on github.com ↗