Architecture specific change in rpms/qbittorrent.git
by githook-noreply@fedoraproject.org
The package rpms/qbittorrent.git has added or updated architecture specific content in its
spec file (ExclusiveArch/ExcludeArch or %ifarch/%ifnarch) in commit(s):
https://src.fedoraproject.org/cgit/rpms/qbittorrent.git/commit/?id=efcbe3....
Change:
+ExcludeArch: %{ix86}
Thanks.
Full change:
============
commit 64f0486e7ab0b7d9853e00b9d1b4cad4db43b6bf
Author: Leigh Scott <leigh123linux(a)gmail.com>
Date: Tue May 24 18:26:13 2022 +0100
Update to 4.4.3
diff --git a/.gitignore b/.gitignore
index 2e55c40..aa7ec7c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -7,3 +7,4 @@
/qbittorrent-4.4.0.tar.xz.asc
/qbittorrent-4.4.1.tar.xz.asc
/qbittorrent-4.4.2.tar.xz.asc
+/qbittorrent-4.4.3.tar.xz.asc
diff --git a/qbittorrent.spec b/qbittorrent.spec
index 39ac1bf..de15b5b 100644
--- a/qbittorrent.spec
+++ b/qbittorrent.spec
@@ -7,8 +7,8 @@
Name: qbittorrent
Summary: A Bittorrent Client
Epoch: 1
-Version: 4.4.2
-Release: 2%{?dist}
+Version: 4.4.3
+Release: 1%{?dist}
License: GPLv2+
URL: https://www.qbittorrent.org
@@ -144,6 +144,9 @@ appstream-util validate-relax --nonet %{buildroot}%{_metainfodir}/org.qbittorren
%{_mandir}/man1/qbittorrent-nox.1*
%changelog
+* Tue May 24 2022 Leigh Scott <leigh123linux(a)gmail.com> - 1:4.4.3-1
+- Update to 4.4.3
+
* Sun Apr 24 2022 Leigh Scott <leigh123linux(a)gmail.com> - 1:4.4.2-2
- Add qtsvg requires
diff --git a/sources b/sources
index f2934d5..6304208 100644
--- a/sources
+++ b/sources
@@ -1,2 +1,2 @@
-SHA512 (qbittorrent-4.4.2.tar.xz.asc) = 037a31659c8cb8678c9bc9efeb34455f140c5034a81b9d455460e42c8d3144f5b4496511ffda153066b34c9a3bfc3825f6a86f3500430f00cb14a7af6376e2b0
-SHA512 (qbittorrent-4.4.2.tar.xz) = 7f38f9d00535486e68cd0f7f46d0ca8855c8703f946ed144ebf9fbe7e9acdeb789228d0ebe0b8a5ec0d304d1efecfa59499eadff83d0cbd944ecb10b7206d79b
+SHA512 (qbittorrent-4.4.3.tar.xz) = f88dc36a03da7728b48aa08957cc06524752243ac0ae7bc7445c2b06ecd886e3c9d834756ca44e57bdee0fc661ee9b018c3720a8ee6921e708fcc77f69882daa
+SHA512 (qbittorrent-4.4.3.tar.xz.asc) = cb9c81be0655eab490c7b0beb7d1e35cd3b4fc28ebff4aeeec5fa5639c9950b8c440bc7bade0fd11786bbec412e21a67f5df6c8078eaf208f4e27b6ce612a016
commit efcbe3d8ebbdc29de613fc2645088864aedaed9d
Author: Leigh Scott <leigh123linux(a)gmail.com>
Date: Thu May 5 15:09:54 2022 +0100
Exclude i686 build
diff --git a/qbittorrent.spec b/qbittorrent.spec
index 1fa7ba9..39ac1bf 100644
--- a/qbittorrent.spec
+++ b/qbittorrent.spec
@@ -18,6 +18,7 @@ Source2: https://github.com/qbittorrent/qBittorrent/raw/master/5B7CC9A2.asc
Source3: qbittorrent-nox.README
Source4: qbittorrent-nox
+ExcludeArch: %{ix86}
BuildRequires: cmake
BuildRequires: gcc-c++
1 year, 11 months
Architecture specific change in rpms/python-dask.git
by githook-noreply@fedoraproject.org
The package rpms/python-dask.git has added or updated architecture specific content in its
spec file (ExclusiveArch/ExcludeArch or %ifarch/%ifnarch) in commit(s):
https://src.fedoraproject.org/cgit/rpms/python-dask.git/commit/?id=e5d169...
https://src.fedoraproject.org/cgit/rpms/python-dask.git/commit/?id=7e84e0....
Change:
+%ifnarch %{arm32} %{ix86}
+%ifarch ppc64le
Thanks.
Full change:
============
commit 7bcad28c0f621cf42029679d27fc2f41ce27db60
Author: Benjamin A. Beasley <code(a)musicinmybrain.net>
Date: Sat May 21 08:27:46 2022 -0400
Add “pandas[test]” to “test” extra
This is important because the python-pandas package will now install
pandas.tests only with python3-pandas+tests, and Dask’s tests import
from Pandas’s test suite.
diff --git a/9110.patch b/9110.patch
new file mode 100644
index 0000000..247d698
--- /dev/null
+++ b/9110.patch
@@ -0,0 +1,27 @@
+From 96112f76bb28608f100920732825e45917ee0e5d Mon Sep 17 00:00:00 2001
+From: "Benjamin A. Beasley" <code(a)musicinmybrain.net>
+Date: Sat, 21 May 2022 08:09:39 -0400
+Subject: [PATCH] =?UTF-8?q?Add=20=E2=80=9Cpandas[test]=E2=80=9D=20to=20?=
+ =?UTF-8?q?=E2=80=9Ctest=E2=80=9D=20extra?=
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Since the tests use “pandas.test” (the actual Pandas test suite), not
+only “pandas.testing”, it makes sense to rely on Pandas’s test extra.
+---
+ setup.py | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/setup.py b/setup.py
+index d52adf72d29..c3ae3ff62d9 100755
+--- a/setup.py
++++ b/setup.py
+@@ -25,6 +25,7 @@
+ extras_require["complete"] = sorted({v for req in extras_require.values() for v in req})
+ # after complete is set, add in test
+ extras_require["test"] = [
++ "pandas[test]",
+ "pytest",
+ "pytest-rerunfailures",
+ "pytest-xdist",
diff --git a/python-dask.spec b/python-dask.spec
index 742e06e..859176c 100644
--- a/python-dask.spec
+++ b/python-dask.spec
@@ -40,6 +40,9 @@ Patch: 0001-Skip-test_encoding_gh601-on-big-endian-machines.patch
# This patch has been trivially rebased to apply to the PyPI sdist, which uses
# tabs rather than spaces in setup.cfg.
Patch: dask-2022.5.0-pr-9113.patch
+# Add “pandas[test]” to “test” extra
+# https://github.com/dask/dask/pull/9110
+Patch: %{url}/pull/9110.patch
%description
Dask is a flexible parallel computing library for analytics.
commit e5d1690c6b3ff3a04341f19ea027733c9baa36bc
Author: Benjamin A. Beasley <code(a)musicinmybrain.net>
Date: Tue May 17 10:39:38 2022 -0400
Use an arched base package with noarch binary RPMs
- Conditionalize fastavro BR, which is not available on 32-bit
- Run tests on all arches to reliably track arch-dependent bugs
- Add necessary arch-dependent skips for failing tests
diff --git a/python-dask.spec b/python-dask.spec
index a430587..742e06e 100644
--- a/python-dask.spec
+++ b/python-dask.spec
@@ -5,6 +5,10 @@
# Force bootstrap for package review.
%bcond_without bootstrap
+# We have an arched package to detect arch-dependent issues in dependencies,
+# but all of the installable RPMs are noarch and there is no compiled code.
+%global debug_package %{nil}
+
Name: python-%{srcname}
Version: 2022.5.0
%global tag 2022.05.0
@@ -37,8 +41,6 @@ Patch: 0001-Skip-test_encoding_gh601-on-big-endian-machines.patch
# tabs rather than spaces in setup.cfg.
Patch: dask-2022.5.0-pr-9113.patch
-BuildArch: noarch
-
%description
Dask is a flexible parallel computing library for analytics.
@@ -46,6 +48,8 @@ Dask is a flexible parallel computing library for analytics.
%package -n python3-%{srcname}
Summary: %{summary}
+BuildArch: noarch
+
BuildRequires: python3-devel
BuildRequires: python3dist(graphviz)
BuildRequires: python3dist(ipython)
@@ -54,7 +58,11 @@ BuildRequires: python3dist(scikit-image)
BuildRequires: python3dist(xarray)
%endif
# Optional test requirements.
+# Fastavro does not support 32 bit architectures and is ExcludeArch:
+# https://bugzilla.redhat.com/show_bug.cgi?id=1943932
+%ifnarch %{arm32} %{ix86}
BuildRequires: python3dist(fastavro)
+%endif
BuildRequires: python3dist(h5py)
BuildRequires: python3dist(psutil)
BuildRequires: python3dist(requests)
@@ -101,6 +109,8 @@ Dask is a flexible parallel computing library for analytics.
%package -n python-%{srcname}-doc
Summary: dask documentation
+BuildArch: noarch
+
BuildRequires: python3dist(dask_sphinx_theme) >= 1.3.5
BuildRequires: python3dist(numpydoc)
BuildRequires: python3dist(sphinx) >= 4
@@ -216,6 +226,8 @@ pytest_args=(
# Ignore https://github.com/numpy/numpy/issues/20225 and Pandas issues
-W ignore::DeprecationWarning
+
+ -k "${k-}"
)
%{pytest} "${pytest_args[@]}"
commit 7e84e06e4fce1deef3b148ff9cbe32006be0ea44
Author: Benjamin A. Beasley <code(a)musicinmybrain.net>
Date: Mon May 9 08:42:18 2022 -0400
Update to 2022.5.0 (close RHBZ#2065859)
- Drop the “diagnostics” extras metapackage because no recent enough
Bokeh version is available.
- Switch to the PyPI sdist as source (with workarounds)
- Ensure NUMPY_LICENSE.txt is packaged
- Add Provides: bundled(numpy)
diff --git a/.gitignore b/.gitignore
index 9257dd0..e2286ab 100644
--- a/.gitignore
+++ b/.gitignore
@@ -55,3 +55,5 @@
/dask-2022.01.1.tar.gz
/dask-2022.02.0.tar.gz
/dask-2022.02.1.tar.gz
+/dask-2022.05.0.tar.gz
+/dask-2022.5.0.tar.gz
diff --git a/0001-Skip-test_encoding_gh601-on-big-endian-machines.patch b/0001-Skip-test_encoding_gh601-on-big-endian-machines.patch
index ad031eb..dc65d0e 100644
--- a/0001-Skip-test_encoding_gh601-on-big-endian-machines.patch
+++ b/0001-Skip-test_encoding_gh601-on-big-endian-machines.patch
@@ -1,26 +1,15 @@
-From 5d9cdaa75e0547d8d5edf8c995f29279688f7e11 Mon Sep 17 00:00:00 2001
-From: Elliott Sales de Andrade <quantum.analyst(a)gmail.com>
-Date: Sun, 7 Mar 2021 04:07:32 -0500
-Subject: [PATCH 1/2] Skip test_encoding_gh601 on big-endian machines.
-
-Signed-off-by: Elliott Sales de Andrade <quantum.analyst(a)gmail.com>
----
- dask/dataframe/io/tests/test_csv.py | 2 ++
- 1 file changed, 2 insertions(+)
-
-diff --git a/dask/dataframe/io/tests/test_csv.py b/dask/dataframe/io/tests/test_csv.py
-index 48780ef8..f63d0e80 100644
---- a/dask/dataframe/io/tests/test_csv.py
-+++ b/dask/dataframe/io/tests/test_csv.py
-@@ -1,6 +1,7 @@
- import gzip
+diff -Naur dask-2022.05.0-original/dask/dataframe/io/tests/test_csv.py dask-2022.05.0/dask/dataframe/io/tests/test_csv.py
+--- dask-2022.05.0-original/dask/dataframe/io/tests/test_csv.py 2022-05-02 14:23:56.000000000 -0400
++++ dask-2022.05.0/dask/dataframe/io/tests/test_csv.py 2022-05-09 08:45:28.765627808 -0400
+@@ -2,6 +2,7 @@
import os
+ import warnings
from io import BytesIO
+import sys
from unittest import mock
import pytest
-@@ -1099,6 +1100,7 @@ def test_read_csv_with_datetime_index_partitions_n():
+@@ -1116,6 +1117,7 @@
xfail_pandas_100 = pytest.mark.xfail(reason="https://github.com/dask/dask/issues/5787")
@@ -28,6 +17,3 @@ index 48780ef8..f63d0e80 100644
@pytest.mark.parametrize(
"encoding",
[
---
-2.31.1
-
diff --git a/0002-fix-index_col-duplication-if-index_col-is-type-str.patch b/0002-fix-index_col-duplication-if-index_col-is-type-str.patch
deleted file mode 100644
index 481e482..0000000
--- a/0002-fix-index_col-duplication-if-index_col-is-type-str.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-From 41306c1829a22f0e8654f8d75dc23ce766c26ea8 Mon Sep 17 00:00:00 2001
-From: McToel <theo.doellmann(a)gmx.de>
-Date: Sun, 16 May 2021 11:11:06 +0200
-Subject: [PATCH 2/2] fix index_col duplication if index_col is type str
-
-Signed-off-by: Elliott Sales de Andrade <quantum.analyst(a)gmail.com>
----
- dask/dataframe/io/sql.py | 6 ++----
- 1 file changed, 2 insertions(+), 4 deletions(-)
-
-diff --git a/dask/dataframe/io/sql.py b/dask/dataframe/io/sql.py
-index 6573a325..9c15360c 100644
---- a/dask/dataframe/io/sql.py
-+++ b/dask/dataframe/io/sql.py
-@@ -125,10 +125,8 @@ def read_sql_table(
- if columns
- else list(table.columns)
- )
-- if index_col not in columns:
-- columns.append(
-- table.columns[index_col] if isinstance(index_col, str) else index_col
-- )
-+ if index not in columns:
-+ columns.append(index)
-
- if isinstance(index_col, str):
- kwargs["index_col"] = index_col
---
-2.31.1
-
diff --git a/NUMPY_LICENSE.txt b/NUMPY_LICENSE.txt
new file mode 100644
index 0000000..b4139af
--- /dev/null
+++ b/NUMPY_LICENSE.txt
@@ -0,0 +1,30 @@
+Copyright (c) 2005-2015, NumPy Developers.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+ * Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided
+ with the distribution.
+
+ * Neither the name of the NumPy Developers nor the names of any
+ contributors may be used to endorse or promote products derived
+ from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/_version.py b/_version.py
deleted file mode 100644
index 0181b0a..0000000
--- a/_version.py
+++ /dev/null
@@ -1,20 +0,0 @@
-
-# This file was generated by 'versioneer.py' (0.16) from
-# revision-control system data, or from the parent directory name of an
-# unpacked source archive. Distribution tarballs contain a pre-generated copy
-# of this file.
-
-import json
-
-version_json = '''
-{
- "dirty": false,
- "error": null,
- "full-revisionid": "@commit@",
- "version": "@version@"
-}
-''' # END VERSION_JSON
-
-
-def get_versions():
- return json.loads(version_json)
diff --git a/conftest.py b/conftest.py
new file mode 100644
index 0000000..594bcfc
--- /dev/null
+++ b/conftest.py
@@ -0,0 +1,70 @@
+import pytest
+
+import dask
+
+# The doctests in these files fail due to either:
+# - Non-required dependencies not being installed
+# - Imported doctests due to pulling the docstrings from other packages
+# (e.g. `numpy`). No need to run these doctests.
+collect_ignore = [
+ "dask/bytes/hdfs3.py",
+ "dask/bytes/pyarrow.py",
+ "dask/bytes/s3.py",
+ "dask/array/ghost.py",
+ "dask/array/fft.py",
+ "dask/dataframe/io/io.py",
+ "dask/dataframe/io/parquet/arrow.py",
+ "dask/dot.py",
+ "dask/ml.py",
+]
+
+collect_ignore_glob = []
+try:
+ import numpy # noqa: F401
+except ImportError:
+ collect_ignore_glob.append("dask/array/*")
+
+try:
+ import pandas # noqa: F401
+except ImportError:
+ collect_ignore_glob.append("dask/dataframe/*")
+
+try:
+ import scipy # noqa: F401
+except ImportError:
+ collect_ignore.append("dask/array/stats.py")
+
+try:
+ import pyarrow # noqa: F401
+except ImportError:
+ collect_ignore.append("dask/dataframe/io/orc/arrow.py")
+
+try:
+ import tiledb # noqa: F401
+except ImportError:
+ collect_ignore.append("dask/array/tiledb_io.py")
+
+try:
+ import sqlalchemy # noqa: F401
+except ImportError:
+ collect_ignore.append("dask/dataframe/io/sql.py")
+
+
+def pytest_addoption(parser):
+ parser.addoption("--runslow", action="store_true", help="run slow tests")
+
+
+def pytest_runtest_setup(item):
+ if "slow" in item.keywords and not item.config.getoption("--runslow"):
+ pytest.skip("need --runslow option to run")
+
+
+pytest.register_assert_rewrite(
+ "dask.array.utils", "dask.dataframe.utils", "dask.bag.utils"
+)
+
+
+(a)pytest.fixture(params=["disk", "tasks"])
+def shuffle_method(request):
+ with dask.config.set(shuffle=request.param):
+ yield request.param
diff --git a/dask-2022.5.0-pr-9113.patch b/dask-2022.5.0-pr-9113.patch
new file mode 100644
index 0000000..1d698cf
--- /dev/null
+++ b/dask-2022.5.0-pr-9113.patch
@@ -0,0 +1,14 @@
+diff -Naur dask-2022.5.0-original/setup.cfg dask-2022.5.0/setup.cfg
+--- dask-2022.5.0-original/setup.cfg 2022-05-02 14:24:38.606312800 -0400
++++ dask-2022.5.0/setup.cfg 2022-05-22 09:06:51.480496179 -0400
+@@ -55,7 +55,9 @@
+ xfail_strict = true
+
+ [metadata]
+-license_files = LICENSE.txt
++license_files =
++ LICENSE.txt
++ dask/array/NUMPY_LICENSE.txt
+
+ [mypy]
+ python_version = 3.9
diff --git a/python-dask.spec b/python-dask.spec
index 5e7c6f2..a430587 100644
--- a/python-dask.spec
+++ b/python-dask.spec
@@ -6,19 +6,36 @@
%bcond_without bootstrap
Name: python-%{srcname}
-Version: 2022.2.1
-%global tag 2022.02.1
-%global commit 217561b4266c170f452471fed64123940066c4b8
+Version: 2022.5.0
+%global tag 2022.05.0
Release: %autorelease
Summary: Parallel PyData with Task Scheduling
License: BSD
URL: https://github.com/dask/dask/
-Source0: https://github.com/dask/dask/archive/%{tag}/%{srcname}-%{tag}.tar.gz
-# Grab this from the sdist until we switch back to it.
-Source1: _version.py
+Source0: %{pypi_source %{srcname}}
+# These are missing from the PyPI sdist. Until our PR#9113 and PR#9115 are
+# accepted and included in a release, we grab them from the release tag in the
+# GitHub repository.
+Source1: https://github.com/dask/dask/raw/%{tag}/dask/array/NUMPY_LICENSE.txt
+# PyPI sdist tarball is missing 'conftest.py'
+# https://github.com/dask/dask/issues/8475
+# Include conftest.py in sdists
+# https://github.com/dask/dask/pull/9115
+Source2: https://github.com/dask/dask/raw/%{tag}/conftest.py
# https://github.com/dask/dask/issues/6725
-Patch0001: 0001-Skip-test_encoding_gh601-on-big-endian-machines.patch
+Patch: 0001-Skip-test_encoding_gh601-on-big-endian-machines.patch
+# Add NUMPY_LICENSE.txt to license_files in setup.cfg
+# https://github.com/dask/dask/pull/9113
+#
+# Fixes:
+#
+# dask/array/NUMPY_LICENSE.txt not included in PyPI distributions
+# https://github.com/dask/dask/issues/9112
+#
+# This patch has been trivially rebased to apply to the PyPI sdist, which uses
+# tabs rather than spaces in setup.cfg.
+Patch: dask-2022.5.0-pr-9113.patch
BuildArch: noarch
@@ -48,16 +65,33 @@ Recommends: python3-%{srcname}+array = %{version}-%{release}
Recommends: python3-%{srcname}+bag = %{version}-%{release}
Recommends: python3-%{srcname}+dataframe = %{version}-%{release}
Recommends: python3-%{srcname}+delayed = %{version}-%{release}
-Recommends: python3-%{srcname}+diagnostics = %{version}-%{release}
%if %{without bootstrap}
Recommends: python3-%{srcname}+distributed = %{version}-%{release}
%endif
+# No recent enough Bokeh is packaged
+Obsoletes: python3-%{srcname}+diagnostics < 2022.5.0-1
+
+# There is nothing that can be unbundled; there are some some snippets forked
+# or copied from unspecified versions of numpy, under a BSD license similar to
+# that of dask itself.
+#
+# - dask/array/numpy_compat.py:
+# _Recurser, moveaxis, rollaxis, sliding_window_view
+# - dask/array/backends.py:
+# _tensordot
+# - dask/array/core.py:
+# block
+# - dask/array/einsumfuncs.py:
+# parse_einsum_input
+# - dask/array/routines.py:
+# cov, _average
+Provides: bundled(numpy)
%description -n python3-%{srcname}
Dask is a flexible parallel computing library for analytics.
-%pyproject_extras_subpkg -n python3-%{srcname} array bag dataframe delayed diagnostics
+%pyproject_extras_subpkg -n python3-%{srcname} array bag dataframe delayed
%if %{without bootstrap}
%pyproject_extras_subpkg distributed
%endif
@@ -77,12 +111,13 @@ Documentation for dask.
%prep
-%autosetup -n %{srcname}-%{tag} -p1
-sed -e 's/@version@/%{tag}/' -e 's/@commit@/%{commit}/' %SOURCE1 > %{srcname}/_version.py
+%autosetup -n %{srcname}-%{version} -p1
+cp -p '%{SOURCE1}' dask/array/
+cp -p '%{SOURCE2}' ./
%generate_buildrequires
-%pyproject_buildrequires -r -x test,array,bag,dataframe,delayed,diagnostics
+%pyproject_buildrequires -r -x test,array,bag,dataframe,delayed
%if %{without bootstrap}
%pyproject_buildrequires -x distributed
%endif
@@ -111,6 +146,66 @@ rm -rf html/.{doctrees,buildinfo}
%global have_arm 1
%endif
+%ifarch %{ix86}
+# read_sql_query with meta converts dtypes from 32 to 64.
+# https://github.com/dask/dask/issues/8620
+
+# > tm.assert_frame_equal(
+# a, b, check_names=check_names, check_dtype=check_dtype, **kwargs
+# E AssertionError: Attributes of DataFrame.iloc[:, 1] (column name="age") are different
+# E
+# E Attribute "dtype" are different
+# E [left]: int32
+# E [right]: int64
+# dask/dataframe/utils.py:555: AssertionError
+k="${k-}${k+ and }not test_query_with_meta"
+%endif
+
+%ifarch ppc64le
+# TODO: Should this be reported upstream? Is it a dask issue, or a numpy one?
+# Possibly related to
+# https://fedoraproject.org/wiki/Changes/PPC64LE_Float128_Transition?
+
+# > assert allclose(a, b, equal_nan=equal_nan, **kwargs), msg
+# E AssertionError: found values in 'a' and 'b' which differ by more than the allowed amount
+# E assert False
+# E + where False = allclose(array([0.12586355-0.09957204j, 0.20256483+0.04098342j,\n 0.05781123-0.03588671j, 0.01135963-0.03334219j,\n 0.03747771+0.07495994j, 0.2106574 -0.0363521j ,\n 0.16352091+0.03782915j, 0.1381678 -0.06815128j,\n 0.03781295-0.04011523j, 0.01493269+0.07780643j]), array([0.12559072-0.07164038j, 0.20256483+0.05438578j,\n 0.05781123-0.03588671j, 0.01135963-0.03334219j,\n 0.03747771+0.07495994j, 0.2106574 -0.0363521j ,\n 0.16352091+0.03782915j, 0.1381678 -0.06815128j,\n 0.03781295-0.04011523j, 0.01493269+0.07780643j]), equal_nan=True, **{})
+# dask/array/utils.py:361: AssertionError
+k="${k-}${k+ and }not test_lstsq[100-10-10-True]"
+# > assert allclose(a, b, equal_nan=equal_nan, **kwargs), msg
+# E AssertionError: found values in 'a' and 'b' which differ by more than the allowed amount
+# E assert False
+# E + where False = allclose(array([ 0.20168675+0.08857556j, 0.144233 -0.19173091j,\n -0.03367557-0.08053959j, 0.04108325-0.24648308j,\n -0.01844576+0.00841932j, 0.29652375+0.05682199j,\n 0.05551828+0.20156798j, -0.08409592+0.02354949j,\n 0.09848743-0.00748637j, 0.22889193-0.07372773j]), array([ 0.20067551+0.2642591j , 0.144233 -0.18573336j,\n -0.03367557-0.08053959j, 0.04108325-0.24648308j,\n -0.01844576+0.00841932j, 0.29652375+0.05682199j,\n 0.05551828+0.20156798j, -0.08409592+0.02354949j,\n 0.09848743-0.00748637j, 0.22889193-0.07372773j]), equal_nan=True, **{})
+# dask/array/utils.py:361: AssertionError
+k="${k-}${k+ and }not test_lstsq[20-10-5-True]"
+
+# test_vdot fails with NumPy 1.19.0
+# https://github.com/dask/dask/issues/6406
+#
+# vdot returns incorrect results on ppc64le
+# https://github.com/numpy/numpy/issues/17087
+
+# > assert allclose(a, b, equal_nan=equal_nan, **kwargs), msg
+# E AssertionError: found values in 'a' and 'b' which differ by more than the allowed amount
+# E assert False
+# E + where False = allclose((0.38772781971416226-0.6851997484294434j), (0.38772781971416226-0.306563166009585j), equal_nan=True, **{})
+# dask/array/utils.py:361: AssertionError
+k="${k-}${k+ and }not test_vdot[shape0-chunks0]"
+# > assert allclose(a, b, equal_nan=equal_nan, **kwargs), msg
+# E AssertionError: found values in 'a' and 'b' which differ by more than the allowed amount
+# E assert False
+# E + where False = allclose((0.38772781971416226-0.6851997484294434j), (0.38772781971416226-0.306563166009585j), equal_nan=True, **{})
+# dask/array/utils.py:361: AssertionError
+k="${k-}${k+ and }not test_vdot[shape1-chunks1]"
+%endif
+
+# This test compares against files in .github/. It does not work on the PyPI
+# sdist, and is only relevant to upstream CI anyway.
+#
+# test_development_guidelines_matches_ci fails from sdist
+# https://github.com/dask/dask/issues/8499
+k="${k-}${k+ and }not test_development_guidelines_matches_ci"
+
pytest_args=(
-m 'not network'
@@ -127,12 +222,12 @@ pytest_args=(
%files -n python3-%{srcname} -f %{pyproject_files}
%doc README.rst
-%license LICENSE.txt
+%license LICENSE.txt dask/array/NUMPY_LICENSE.txt
%if %{without bootstrap}
%files -n python-%{srcname}-doc
%doc html
-%license LICENSE.txt
+%license LICENSE.txt dask/array/NUMPY_LICENSE.txt
%endif
diff --git a/sources b/sources
index 59ff640..31bce64 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-SHA512 (dask-2022.02.1.tar.gz) = 6f66b5a904ea7ab0137465f622d1606a218b4ddc8b91939759098c66c7b749c674c750bf0caa6b53c7cf9d192312c0991d8e6144cebf9745eb9dfd4583b8b66c
+SHA512 (dask-2022.5.0.tar.gz) = 40d119f5cee86c5ae6756501ed9f73a6fde0954cae961cca0ddf947e36df227163f87d7176d04388ab9ffe8ba18efbfb908adcf45de0064041a412b7596209a8
1 year, 11 months
Architecture specific change in rpms/python-dask.git
by githook-noreply@fedoraproject.org
The package rpms/python-dask.git has added or updated architecture specific content in its
spec file (ExclusiveArch/ExcludeArch or %ifarch/%ifnarch) in commit(s):
https://src.fedoraproject.org/cgit/rpms/python-dask.git/commit/?id=e5d169...
https://src.fedoraproject.org/cgit/rpms/python-dask.git/commit/?id=7e84e0....
Change:
+%ifnarch %{arm32} %{ix86}
+%ifarch ppc64le
Thanks.
Full change:
============
commit 7bcad28c0f621cf42029679d27fc2f41ce27db60
Author: Benjamin A. Beasley <code(a)musicinmybrain.net>
Date: Sat May 21 08:27:46 2022 -0400
Add “pandas[test]” to “test” extra
This is important because the python-pandas package will now install
pandas.tests only with python3-pandas+tests, and Dask’s tests import
from Pandas’s test suite.
diff --git a/9110.patch b/9110.patch
new file mode 100644
index 0000000..247d698
--- /dev/null
+++ b/9110.patch
@@ -0,0 +1,27 @@
+From 96112f76bb28608f100920732825e45917ee0e5d Mon Sep 17 00:00:00 2001
+From: "Benjamin A. Beasley" <code(a)musicinmybrain.net>
+Date: Sat, 21 May 2022 08:09:39 -0400
+Subject: [PATCH] =?UTF-8?q?Add=20=E2=80=9Cpandas[test]=E2=80=9D=20to=20?=
+ =?UTF-8?q?=E2=80=9Ctest=E2=80=9D=20extra?=
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Since the tests use “pandas.test” (the actual Pandas test suite), not
+only “pandas.testing”, it makes sense to rely on Pandas’s test extra.
+---
+ setup.py | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/setup.py b/setup.py
+index d52adf72d29..c3ae3ff62d9 100755
+--- a/setup.py
++++ b/setup.py
+@@ -25,6 +25,7 @@
+ extras_require["complete"] = sorted({v for req in extras_require.values() for v in req})
+ # after complete is set, add in test
+ extras_require["test"] = [
++ "pandas[test]",
+ "pytest",
+ "pytest-rerunfailures",
+ "pytest-xdist",
diff --git a/python-dask.spec b/python-dask.spec
index 742e06e..859176c 100644
--- a/python-dask.spec
+++ b/python-dask.spec
@@ -40,6 +40,9 @@ Patch: 0001-Skip-test_encoding_gh601-on-big-endian-machines.patch
# This patch has been trivially rebased to apply to the PyPI sdist, which uses
# tabs rather than spaces in setup.cfg.
Patch: dask-2022.5.0-pr-9113.patch
+# Add “pandas[test]” to “test” extra
+# https://github.com/dask/dask/pull/9110
+Patch: %{url}/pull/9110.patch
%description
Dask is a flexible parallel computing library for analytics.
commit e5d1690c6b3ff3a04341f19ea027733c9baa36bc
Author: Benjamin A. Beasley <code(a)musicinmybrain.net>
Date: Tue May 17 10:39:38 2022 -0400
Use an arched base package with noarch binary RPMs
- Conditionalize fastavro BR, which is not available on 32-bit
- Run tests on all arches to reliably track arch-dependent bugs
- Add necessary arch-dependent skips for failing tests
diff --git a/python-dask.spec b/python-dask.spec
index a430587..742e06e 100644
--- a/python-dask.spec
+++ b/python-dask.spec
@@ -5,6 +5,10 @@
# Force bootstrap for package review.
%bcond_without bootstrap
+# We have an arched package to detect arch-dependent issues in dependencies,
+# but all of the installable RPMs are noarch and there is no compiled code.
+%global debug_package %{nil}
+
Name: python-%{srcname}
Version: 2022.5.0
%global tag 2022.05.0
@@ -37,8 +41,6 @@ Patch: 0001-Skip-test_encoding_gh601-on-big-endian-machines.patch
# tabs rather than spaces in setup.cfg.
Patch: dask-2022.5.0-pr-9113.patch
-BuildArch: noarch
-
%description
Dask is a flexible parallel computing library for analytics.
@@ -46,6 +48,8 @@ Dask is a flexible parallel computing library for analytics.
%package -n python3-%{srcname}
Summary: %{summary}
+BuildArch: noarch
+
BuildRequires: python3-devel
BuildRequires: python3dist(graphviz)
BuildRequires: python3dist(ipython)
@@ -54,7 +58,11 @@ BuildRequires: python3dist(scikit-image)
BuildRequires: python3dist(xarray)
%endif
# Optional test requirements.
+# Fastavro does not support 32 bit architectures and is ExcludeArch:
+# https://bugzilla.redhat.com/show_bug.cgi?id=1943932
+%ifnarch %{arm32} %{ix86}
BuildRequires: python3dist(fastavro)
+%endif
BuildRequires: python3dist(h5py)
BuildRequires: python3dist(psutil)
BuildRequires: python3dist(requests)
@@ -101,6 +109,8 @@ Dask is a flexible parallel computing library for analytics.
%package -n python-%{srcname}-doc
Summary: dask documentation
+BuildArch: noarch
+
BuildRequires: python3dist(dask_sphinx_theme) >= 1.3.5
BuildRequires: python3dist(numpydoc)
BuildRequires: python3dist(sphinx) >= 4
@@ -216,6 +226,8 @@ pytest_args=(
# Ignore https://github.com/numpy/numpy/issues/20225 and Pandas issues
-W ignore::DeprecationWarning
+
+ -k "${k-}"
)
%{pytest} "${pytest_args[@]}"
commit 7e84e06e4fce1deef3b148ff9cbe32006be0ea44
Author: Benjamin A. Beasley <code(a)musicinmybrain.net>
Date: Mon May 9 08:42:18 2022 -0400
Update to 2022.5.0 (close RHBZ#2065859)
- Drop the “diagnostics” extras metapackage because no recent enough
Bokeh version is available.
- Switch to the PyPI sdist as source (with workarounds)
- Ensure NUMPY_LICENSE.txt is packaged
- Add Provides: bundled(numpy)
diff --git a/.gitignore b/.gitignore
index 9257dd0..e2286ab 100644
--- a/.gitignore
+++ b/.gitignore
@@ -55,3 +55,5 @@
/dask-2022.01.1.tar.gz
/dask-2022.02.0.tar.gz
/dask-2022.02.1.tar.gz
+/dask-2022.05.0.tar.gz
+/dask-2022.5.0.tar.gz
diff --git a/0001-Skip-test_encoding_gh601-on-big-endian-machines.patch b/0001-Skip-test_encoding_gh601-on-big-endian-machines.patch
index ad031eb..dc65d0e 100644
--- a/0001-Skip-test_encoding_gh601-on-big-endian-machines.patch
+++ b/0001-Skip-test_encoding_gh601-on-big-endian-machines.patch
@@ -1,26 +1,15 @@
-From 5d9cdaa75e0547d8d5edf8c995f29279688f7e11 Mon Sep 17 00:00:00 2001
-From: Elliott Sales de Andrade <quantum.analyst(a)gmail.com>
-Date: Sun, 7 Mar 2021 04:07:32 -0500
-Subject: [PATCH 1/2] Skip test_encoding_gh601 on big-endian machines.
-
-Signed-off-by: Elliott Sales de Andrade <quantum.analyst(a)gmail.com>
----
- dask/dataframe/io/tests/test_csv.py | 2 ++
- 1 file changed, 2 insertions(+)
-
-diff --git a/dask/dataframe/io/tests/test_csv.py b/dask/dataframe/io/tests/test_csv.py
-index 48780ef8..f63d0e80 100644
---- a/dask/dataframe/io/tests/test_csv.py
-+++ b/dask/dataframe/io/tests/test_csv.py
-@@ -1,6 +1,7 @@
- import gzip
+diff -Naur dask-2022.05.0-original/dask/dataframe/io/tests/test_csv.py dask-2022.05.0/dask/dataframe/io/tests/test_csv.py
+--- dask-2022.05.0-original/dask/dataframe/io/tests/test_csv.py 2022-05-02 14:23:56.000000000 -0400
++++ dask-2022.05.0/dask/dataframe/io/tests/test_csv.py 2022-05-09 08:45:28.765627808 -0400
+@@ -2,6 +2,7 @@
import os
+ import warnings
from io import BytesIO
+import sys
from unittest import mock
import pytest
-@@ -1099,6 +1100,7 @@ def test_read_csv_with_datetime_index_partitions_n():
+@@ -1116,6 +1117,7 @@
xfail_pandas_100 = pytest.mark.xfail(reason="https://github.com/dask/dask/issues/5787")
@@ -28,6 +17,3 @@ index 48780ef8..f63d0e80 100644
@pytest.mark.parametrize(
"encoding",
[
---
-2.31.1
-
diff --git a/0002-fix-index_col-duplication-if-index_col-is-type-str.patch b/0002-fix-index_col-duplication-if-index_col-is-type-str.patch
deleted file mode 100644
index 481e482..0000000
--- a/0002-fix-index_col-duplication-if-index_col-is-type-str.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-From 41306c1829a22f0e8654f8d75dc23ce766c26ea8 Mon Sep 17 00:00:00 2001
-From: McToel <theo.doellmann(a)gmx.de>
-Date: Sun, 16 May 2021 11:11:06 +0200
-Subject: [PATCH 2/2] fix index_col duplication if index_col is type str
-
-Signed-off-by: Elliott Sales de Andrade <quantum.analyst(a)gmail.com>
----
- dask/dataframe/io/sql.py | 6 ++----
- 1 file changed, 2 insertions(+), 4 deletions(-)
-
-diff --git a/dask/dataframe/io/sql.py b/dask/dataframe/io/sql.py
-index 6573a325..9c15360c 100644
---- a/dask/dataframe/io/sql.py
-+++ b/dask/dataframe/io/sql.py
-@@ -125,10 +125,8 @@ def read_sql_table(
- if columns
- else list(table.columns)
- )
-- if index_col not in columns:
-- columns.append(
-- table.columns[index_col] if isinstance(index_col, str) else index_col
-- )
-+ if index not in columns:
-+ columns.append(index)
-
- if isinstance(index_col, str):
- kwargs["index_col"] = index_col
---
-2.31.1
-
diff --git a/NUMPY_LICENSE.txt b/NUMPY_LICENSE.txt
new file mode 100644
index 0000000..b4139af
--- /dev/null
+++ b/NUMPY_LICENSE.txt
@@ -0,0 +1,30 @@
+Copyright (c) 2005-2015, NumPy Developers.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+ * Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided
+ with the distribution.
+
+ * Neither the name of the NumPy Developers nor the names of any
+ contributors may be used to endorse or promote products derived
+ from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/_version.py b/_version.py
deleted file mode 100644
index 0181b0a..0000000
--- a/_version.py
+++ /dev/null
@@ -1,20 +0,0 @@
-
-# This file was generated by 'versioneer.py' (0.16) from
-# revision-control system data, or from the parent directory name of an
-# unpacked source archive. Distribution tarballs contain a pre-generated copy
-# of this file.
-
-import json
-
-version_json = '''
-{
- "dirty": false,
- "error": null,
- "full-revisionid": "@commit@",
- "version": "@version@"
-}
-''' # END VERSION_JSON
-
-
-def get_versions():
- return json.loads(version_json)
diff --git a/conftest.py b/conftest.py
new file mode 100644
index 0000000..594bcfc
--- /dev/null
+++ b/conftest.py
@@ -0,0 +1,70 @@
+import pytest
+
+import dask
+
+# The doctests in these files fail due to either:
+# - Non-required dependencies not being installed
+# - Imported doctests due to pulling the docstrings from other packages
+# (e.g. `numpy`). No need to run these doctests.
+collect_ignore = [
+ "dask/bytes/hdfs3.py",
+ "dask/bytes/pyarrow.py",
+ "dask/bytes/s3.py",
+ "dask/array/ghost.py",
+ "dask/array/fft.py",
+ "dask/dataframe/io/io.py",
+ "dask/dataframe/io/parquet/arrow.py",
+ "dask/dot.py",
+ "dask/ml.py",
+]
+
+collect_ignore_glob = []
+try:
+ import numpy # noqa: F401
+except ImportError:
+ collect_ignore_glob.append("dask/array/*")
+
+try:
+ import pandas # noqa: F401
+except ImportError:
+ collect_ignore_glob.append("dask/dataframe/*")
+
+try:
+ import scipy # noqa: F401
+except ImportError:
+ collect_ignore.append("dask/array/stats.py")
+
+try:
+ import pyarrow # noqa: F401
+except ImportError:
+ collect_ignore.append("dask/dataframe/io/orc/arrow.py")
+
+try:
+ import tiledb # noqa: F401
+except ImportError:
+ collect_ignore.append("dask/array/tiledb_io.py")
+
+try:
+ import sqlalchemy # noqa: F401
+except ImportError:
+ collect_ignore.append("dask/dataframe/io/sql.py")
+
+
+def pytest_addoption(parser):
+ parser.addoption("--runslow", action="store_true", help="run slow tests")
+
+
+def pytest_runtest_setup(item):
+ if "slow" in item.keywords and not item.config.getoption("--runslow"):
+ pytest.skip("need --runslow option to run")
+
+
+pytest.register_assert_rewrite(
+ "dask.array.utils", "dask.dataframe.utils", "dask.bag.utils"
+)
+
+
+(a)pytest.fixture(params=["disk", "tasks"])
+def shuffle_method(request):
+ with dask.config.set(shuffle=request.param):
+ yield request.param
diff --git a/dask-2022.5.0-pr-9113.patch b/dask-2022.5.0-pr-9113.patch
new file mode 100644
index 0000000..1d698cf
--- /dev/null
+++ b/dask-2022.5.0-pr-9113.patch
@@ -0,0 +1,14 @@
+diff -Naur dask-2022.5.0-original/setup.cfg dask-2022.5.0/setup.cfg
+--- dask-2022.5.0-original/setup.cfg 2022-05-02 14:24:38.606312800 -0400
++++ dask-2022.5.0/setup.cfg 2022-05-22 09:06:51.480496179 -0400
+@@ -55,7 +55,9 @@
+ xfail_strict = true
+
+ [metadata]
+-license_files = LICENSE.txt
++license_files =
++ LICENSE.txt
++ dask/array/NUMPY_LICENSE.txt
+
+ [mypy]
+ python_version = 3.9
diff --git a/python-dask.spec b/python-dask.spec
index 5e7c6f2..a430587 100644
--- a/python-dask.spec
+++ b/python-dask.spec
@@ -6,19 +6,36 @@
%bcond_without bootstrap
Name: python-%{srcname}
-Version: 2022.2.1
-%global tag 2022.02.1
-%global commit 217561b4266c170f452471fed64123940066c4b8
+Version: 2022.5.0
+%global tag 2022.05.0
Release: %autorelease
Summary: Parallel PyData with Task Scheduling
License: BSD
URL: https://github.com/dask/dask/
-Source0: https://github.com/dask/dask/archive/%{tag}/%{srcname}-%{tag}.tar.gz
-# Grab this from the sdist until we switch back to it.
-Source1: _version.py
+Source0: %{pypi_source %{srcname}}
+# These are missing from the PyPI sdist. Until our PR#9113 and PR#9115 are
+# accepted and included in a release, we grab them from the release tag in the
+# GitHub repository.
+Source1: https://github.com/dask/dask/raw/%{tag}/dask/array/NUMPY_LICENSE.txt
+# PyPI sdist tarball is missing 'conftest.py'
+# https://github.com/dask/dask/issues/8475
+# Include conftest.py in sdists
+# https://github.com/dask/dask/pull/9115
+Source2: https://github.com/dask/dask/raw/%{tag}/conftest.py
# https://github.com/dask/dask/issues/6725
-Patch0001: 0001-Skip-test_encoding_gh601-on-big-endian-machines.patch
+Patch: 0001-Skip-test_encoding_gh601-on-big-endian-machines.patch
+# Add NUMPY_LICENSE.txt to license_files in setup.cfg
+# https://github.com/dask/dask/pull/9113
+#
+# Fixes:
+#
+# dask/array/NUMPY_LICENSE.txt not included in PyPI distributions
+# https://github.com/dask/dask/issues/9112
+#
+# This patch has been trivially rebased to apply to the PyPI sdist, which uses
+# tabs rather than spaces in setup.cfg.
+Patch: dask-2022.5.0-pr-9113.patch
BuildArch: noarch
@@ -48,16 +65,33 @@ Recommends: python3-%{srcname}+array = %{version}-%{release}
Recommends: python3-%{srcname}+bag = %{version}-%{release}
Recommends: python3-%{srcname}+dataframe = %{version}-%{release}
Recommends: python3-%{srcname}+delayed = %{version}-%{release}
-Recommends: python3-%{srcname}+diagnostics = %{version}-%{release}
%if %{without bootstrap}
Recommends: python3-%{srcname}+distributed = %{version}-%{release}
%endif
+# No recent enough Bokeh is packaged
+Obsoletes: python3-%{srcname}+diagnostics < 2022.5.0-1
+
+# There is nothing that can be unbundled; there are some some snippets forked
+# or copied from unspecified versions of numpy, under a BSD license similar to
+# that of dask itself.
+#
+# - dask/array/numpy_compat.py:
+# _Recurser, moveaxis, rollaxis, sliding_window_view
+# - dask/array/backends.py:
+# _tensordot
+# - dask/array/core.py:
+# block
+# - dask/array/einsumfuncs.py:
+# parse_einsum_input
+# - dask/array/routines.py:
+# cov, _average
+Provides: bundled(numpy)
%description -n python3-%{srcname}
Dask is a flexible parallel computing library for analytics.
-%pyproject_extras_subpkg -n python3-%{srcname} array bag dataframe delayed diagnostics
+%pyproject_extras_subpkg -n python3-%{srcname} array bag dataframe delayed
%if %{without bootstrap}
%pyproject_extras_subpkg distributed
%endif
@@ -77,12 +111,13 @@ Documentation for dask.
%prep
-%autosetup -n %{srcname}-%{tag} -p1
-sed -e 's/@version@/%{tag}/' -e 's/@commit@/%{commit}/' %SOURCE1 > %{srcname}/_version.py
+%autosetup -n %{srcname}-%{version} -p1
+cp -p '%{SOURCE1}' dask/array/
+cp -p '%{SOURCE2}' ./
%generate_buildrequires
-%pyproject_buildrequires -r -x test,array,bag,dataframe,delayed,diagnostics
+%pyproject_buildrequires -r -x test,array,bag,dataframe,delayed
%if %{without bootstrap}
%pyproject_buildrequires -x distributed
%endif
@@ -111,6 +146,66 @@ rm -rf html/.{doctrees,buildinfo}
%global have_arm 1
%endif
+%ifarch %{ix86}
+# read_sql_query with meta converts dtypes from 32 to 64.
+# https://github.com/dask/dask/issues/8620
+
+# > tm.assert_frame_equal(
+# a, b, check_names=check_names, check_dtype=check_dtype, **kwargs
+# E AssertionError: Attributes of DataFrame.iloc[:, 1] (column name="age") are different
+# E
+# E Attribute "dtype" are different
+# E [left]: int32
+# E [right]: int64
+# dask/dataframe/utils.py:555: AssertionError
+k="${k-}${k+ and }not test_query_with_meta"
+%endif
+
+%ifarch ppc64le
+# TODO: Should this be reported upstream? Is it a dask issue, or a numpy one?
+# Possibly related to
+# https://fedoraproject.org/wiki/Changes/PPC64LE_Float128_Transition?
+
+# > assert allclose(a, b, equal_nan=equal_nan, **kwargs), msg
+# E AssertionError: found values in 'a' and 'b' which differ by more than the allowed amount
+# E assert False
+# E + where False = allclose(array([0.12586355-0.09957204j, 0.20256483+0.04098342j,\n 0.05781123-0.03588671j, 0.01135963-0.03334219j,\n 0.03747771+0.07495994j, 0.2106574 -0.0363521j ,\n 0.16352091+0.03782915j, 0.1381678 -0.06815128j,\n 0.03781295-0.04011523j, 0.01493269+0.07780643j]), array([0.12559072-0.07164038j, 0.20256483+0.05438578j,\n 0.05781123-0.03588671j, 0.01135963-0.03334219j,\n 0.03747771+0.07495994j, 0.2106574 -0.0363521j ,\n 0.16352091+0.03782915j, 0.1381678 -0.06815128j,\n 0.03781295-0.04011523j, 0.01493269+0.07780643j]), equal_nan=True, **{})
+# dask/array/utils.py:361: AssertionError
+k="${k-}${k+ and }not test_lstsq[100-10-10-True]"
+# > assert allclose(a, b, equal_nan=equal_nan, **kwargs), msg
+# E AssertionError: found values in 'a' and 'b' which differ by more than the allowed amount
+# E assert False
+# E + where False = allclose(array([ 0.20168675+0.08857556j, 0.144233 -0.19173091j,\n -0.03367557-0.08053959j, 0.04108325-0.24648308j,\n -0.01844576+0.00841932j, 0.29652375+0.05682199j,\n 0.05551828+0.20156798j, -0.08409592+0.02354949j,\n 0.09848743-0.00748637j, 0.22889193-0.07372773j]), array([ 0.20067551+0.2642591j , 0.144233 -0.18573336j,\n -0.03367557-0.08053959j, 0.04108325-0.24648308j,\n -0.01844576+0.00841932j, 0.29652375+0.05682199j,\n 0.05551828+0.20156798j, -0.08409592+0.02354949j,\n 0.09848743-0.00748637j, 0.22889193-0.07372773j]), equal_nan=True, **{})
+# dask/array/utils.py:361: AssertionError
+k="${k-}${k+ and }not test_lstsq[20-10-5-True]"
+
+# test_vdot fails with NumPy 1.19.0
+# https://github.com/dask/dask/issues/6406
+#
+# vdot returns incorrect results on ppc64le
+# https://github.com/numpy/numpy/issues/17087
+
+# > assert allclose(a, b, equal_nan=equal_nan, **kwargs), msg
+# E AssertionError: found values in 'a' and 'b' which differ by more than the allowed amount
+# E assert False
+# E + where False = allclose((0.38772781971416226-0.6851997484294434j), (0.38772781971416226-0.306563166009585j), equal_nan=True, **{})
+# dask/array/utils.py:361: AssertionError
+k="${k-}${k+ and }not test_vdot[shape0-chunks0]"
+# > assert allclose(a, b, equal_nan=equal_nan, **kwargs), msg
+# E AssertionError: found values in 'a' and 'b' which differ by more than the allowed amount
+# E assert False
+# E + where False = allclose((0.38772781971416226-0.6851997484294434j), (0.38772781971416226-0.306563166009585j), equal_nan=True, **{})
+# dask/array/utils.py:361: AssertionError
+k="${k-}${k+ and }not test_vdot[shape1-chunks1]"
+%endif
+
+# This test compares against files in .github/. It does not work on the PyPI
+# sdist, and is only relevant to upstream CI anyway.
+#
+# test_development_guidelines_matches_ci fails from sdist
+# https://github.com/dask/dask/issues/8499
+k="${k-}${k+ and }not test_development_guidelines_matches_ci"
+
pytest_args=(
-m 'not network'
@@ -127,12 +222,12 @@ pytest_args=(
%files -n python3-%{srcname} -f %{pyproject_files}
%doc README.rst
-%license LICENSE.txt
+%license LICENSE.txt dask/array/NUMPY_LICENSE.txt
%if %{without bootstrap}
%files -n python-%{srcname}-doc
%doc html
-%license LICENSE.txt
+%license LICENSE.txt dask/array/NUMPY_LICENSE.txt
%endif
diff --git a/sources b/sources
index 59ff640..31bce64 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-SHA512 (dask-2022.02.1.tar.gz) = 6f66b5a904ea7ab0137465f622d1606a218b4ddc8b91939759098c66c7b749c674c750bf0caa6b53c7cf9d192312c0991d8e6144cebf9745eb9dfd4583b8b66c
+SHA512 (dask-2022.5.0.tar.gz) = 40d119f5cee86c5ae6756501ed9f73a6fde0954cae961cca0ddf947e36df227163f87d7176d04388ab9ffe8ba18efbfb908adcf45de0064041a412b7596209a8
1 year, 11 months
Architecture specific change in rpms/rust-local-channel.git
by githook-noreply@fedoraproject.org
The package rpms/rust-local-channel.git has added or updated architecture specific content in its
spec file (ExclusiveArch/ExcludeArch or %ifarch/%ifnarch) in commit(s):
https://src.fedoraproject.org/cgit/rpms/rust-local-channel.git/commit/?id....
Change:
+ExclusiveArch: %{rust_arches}
Thanks.
Full change:
============
commit ce4fdc3d6dd4f33b097cd77966eedb20727fb0ea
Author: Anderson Toshiyuki Sasaki <ansasaki(a)redhat.com>
Date: Mon May 9 16:38:20 2022 +0200
Initial import (fedora#2082693).
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki(a)redhat.com>
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..2dbca0e
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+/local-channel-0.1.3.crate
diff --git a/local-channel-fix-metadata.diff b/local-channel-fix-metadata.diff
new file mode 100644
index 0000000..714094b
--- /dev/null
+++ b/local-channel-fix-metadata.diff
@@ -0,0 +1,10 @@
+--- local-channel-0.1.3/Cargo.toml 2022-05-06 20:27:43.119741659 +0200
++++ local-channel-0.1.3/Cargo.toml 2022-05-06 20:34:35.422375671 +0200
+@@ -40,3 +40,7 @@
+
+ [dependencies.local-waker]
+ version = "0.1"
++
++[dev-dependencies.tokio]
++version = "1.13.1"
++features = ["rt", "macros"]
diff --git a/rust-local-channel.spec b/rust-local-channel.spec
new file mode 100644
index 0000000..aa84560
--- /dev/null
+++ b/rust-local-channel.spec
@@ -0,0 +1,75 @@
+# Generated by rust2rpm 21
+%bcond_without check
+%global debug_package %{nil}
+
+%global crate local-channel
+
+Name: rust-%{crate}
+Version: 0.1.3
+Release: %autorelease
+Summary: Non-threadsafe multi-producer, single-consumer, futures-aware, FIFO queue
+
+# Upstream license specification: MIT OR Apache-2.0
+License: MIT or ASL 2.0
+URL: https://crates.io/crates/local-channel
+Source: %{crates_source}
+# Initial patched metadata
+# add missing tokio dev-dependency
+Patch0: local-channel-fix-metadata.diff
+
+ExclusiveArch: %{rust_arches}
+
+BuildRequires: rust-packaging >= 21
+
+%global _description %{expand:
+Non-threadsafe multi-producer, single-consumer, futures-aware, FIFO queue.}
+
+%description %{_description}
+
+%package devel
+Summary: %{summary}
+BuildArch: noarch
+
+%description devel %{_description}
+
+This package contains library source intended for building other packages which
+use the "%{crate}" crate.
+
+%files devel
+%license %{crate_instdir}/LICENSE-APACHE
+%license %{crate_instdir}/LICENSE-MIT
+%doc %{crate_instdir}/CHANGES.md
+%{crate_instdir}/
+
+%package -n %{name}+default-devel
+Summary: %{summary}
+BuildArch: noarch
+
+%description -n %{name}+default-devel %{_description}
+
+This package contains library source intended for building other packages which
+use the "default" feature of the "%{crate}" crate.
+
+%files -n %{name}+default-devel
+%ghost %{crate_instdir}/Cargo.toml
+
+%prep
+%autosetup -n %{crate}-%{version_no_tilde} -p1
+%cargo_prep
+
+%generate_buildrequires
+%cargo_generate_buildrequires
+
+%build
+%cargo_build
+
+%install
+%cargo_install
+
+%if %{with check}
+%check
+%cargo_test
+%endif
+
+%changelog
+%autochangelog
diff --git a/sources b/sources
new file mode 100644
index 0000000..f02ab86
--- /dev/null
+++ b/sources
@@ -0,0 +1 @@
+SHA512 (local-channel-0.1.3.crate) = 886d280c996d706b5d1fbc0f215db9faf7d410009c29cad97e400264d696238d20792abb71f7be4590aea9d1311bc545fbd3ff0b4448b75f8d220c90d77c3ce4
1 year, 11 months
Architecture specific change in rpms/rust-local-waker.git
by githook-noreply@fedoraproject.org
The package rpms/rust-local-waker.git has added or updated architecture specific content in its
spec file (ExclusiveArch/ExcludeArch or %ifarch/%ifnarch) in commit(s):
https://src.fedoraproject.org/cgit/rpms/rust-local-waker.git/commit/?id=6....
Change:
+ExclusiveArch: %{rust_arches}
Thanks.
Full change:
============
commit 69c1d0cc607e6e2fd02b5ee5d0ffd16988c2157e
Author: Anderson Toshiyuki Sasaki <ansasaki(a)redhat.com>
Date: Wed May 4 18:27:00 2022 +0200
Initial import (fedora#2081385)
Signed-off-by: Anderson Toshiyuki Sasaki <ansasaki(a)redhat.com>
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..29b38ff
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1 @@
+/local-waker-0.1.3.crate
diff --git a/rust-local-waker.spec b/rust-local-waker.spec
new file mode 100644
index 0000000..67020eb
--- /dev/null
+++ b/rust-local-waker.spec
@@ -0,0 +1,72 @@
+# Generated by rust2rpm 21
+%bcond_without check
+%global debug_package %{nil}
+
+%global crate local-waker
+
+Name: rust-%{crate}
+Version: 0.1.3
+Release: %autorelease
+Summary: Synchronization primitive for thread-local task wakeup
+
+# Upstream license specification: MIT OR Apache-2.0
+License: MIT or ASL 2.0
+URL: https://crates.io/crates/local-waker
+Source: %{crates_source}
+
+ExclusiveArch: %{rust_arches}
+
+BuildRequires: rust-packaging >= 21
+
+%global _description %{expand:
+Synchronization primitive for thread-local task wakeup.}
+
+%description %{_description}
+
+%package devel
+Summary: %{summary}
+BuildArch: noarch
+
+%description devel %{_description}
+
+This package contains library source intended for building other packages which
+use the "%{crate}" crate.
+
+%files devel
+%license %{crate_instdir}/LICENSE-APACHE
+%license %{crate_instdir}/LICENSE-MIT
+%doc %{crate_instdir}/CHANGES.md
+%{crate_instdir}/
+
+%package -n %{name}+default-devel
+Summary: %{summary}
+BuildArch: noarch
+
+%description -n %{name}+default-devel %{_description}
+
+This package contains library source intended for building other packages which
+use the "default" feature of the "%{crate}" crate.
+
+%files -n %{name}+default-devel
+%ghost %{crate_instdir}/Cargo.toml
+
+%prep
+%autosetup -n %{crate}-%{version_no_tilde} -p1
+%cargo_prep
+
+%generate_buildrequires
+%cargo_generate_buildrequires
+
+%build
+%cargo_build
+
+%install
+%cargo_install
+
+%if %{with check}
+%check
+%cargo_test
+%endif
+
+%changelog
+%autochangelog
diff --git a/sources b/sources
new file mode 100644
index 0000000..704d52f
--- /dev/null
+++ b/sources
@@ -0,0 +1 @@
+SHA512 (local-waker-0.1.3.crate) = 284d5c8d44f6d5e48764736b45c3b9b8a88794ff42b63b51a5fb219114934944bddbcaac28000f54881fb564cf7882d0f31c90999d8e811d9775e926f499f8a9
1 year, 11 months
[Report] Packages Restricting Arches
by root
List of packages currently excluding arches (2501)
===========================================
- 0ad
ExclusiveArch: %{ix86} x86_64 %{arm} aarch64 ppc64le
- 90-Second-Portraits
ExclusiveArch: %{arm} %{ix86} x86_64 aarch64 ppc64le
- GoldenCheetah
ExclusiveArch: %{qt5_qtwebengine_arches}
- GtkAda
ExclusiveArch: %{GPRbuild_arches}
- GtkAda3
ExclusiveArch: %{GPRbuild_arches}
- OpenColorIO
ExclusiveArch: x86_64 ppc64le
- OpenImageIO
ExclusiveArch: x86_64 ppc64le
- OpenMolcas
ExclusiveArch: x86_64 aarch64 ppc64le s390x
- PragmARC
ExclusiveArch: %{GPRbuild_arches}
- R-V8
ExclusiveArch: %{nodejs_arches}
- RdRand
ExclusiveArch: %{ix86} x86_64
- RediSearch
ExclusiveArch: x86_64
- SLOF
ExclusiveArch: ppc64le
- YafaRay
ExclusiveArch: %{ix86} x86_64
- aardvark-dns
ExclusiveArch: %{rust_arches}
- aboot
ExclusiveArch: alpha
- accel-config
ExclusiveArch: %{ix86} x86_64
- acpid
ExclusiveArch: ia64 x86_64 %{ix86} %{arm} aarch64
- ahven
ExclusiveArch: %{GPRbuild_arches}
- algobox
ExclusiveArch: %{qt5_qtwebengine_arches}
- alleyoop
ExclusiveArch: %{ix86} x86_64 ppc ppc64 ppc64le s390x %{arm} aarch64
- american-fuzzy-lop
ExclusiveArch: %{ix86} x86_64 s390x
- anet
ExclusiveArch: %{GPRbuild_arches}
- anki
ExclusiveArch: %{qt5_qtwebengine_arches} noarch
- ant
ExclusiveArch: %{java_arches} noarch
- antlr
ExclusiveArch: %{java_arches}
- apache-commons-beanutils
ExclusiveArch: %{java_arches} noarch
- apache-commons-cli
ExclusiveArch: %{java_arches} noarch
- apache-commons-codec
ExclusiveArch: %{java_arches} noarch
- apache-commons-collections
ExclusiveArch: %{java_arches} noarch
- apache-commons-compress
ExclusiveArch: %{java_arches} noarch
- apache-commons-io
ExclusiveArch: %{java_arches} noarch
- apache-commons-jxpath
ExclusiveArch: %{java_arches} noarch
- apache-commons-lang3
ExclusiveArch: %{java_arches} noarch
- apache-commons-logging
ExclusiveArch: %{java_arches} noarch
- apache-commons-net
ExclusiveArch: %{java_arches} noarch
- apache-commons-parent
ExclusiveArch: %{java_arches} noarch
- apache-parent
ExclusiveArch: %{java_arches} noarch
- apache-resource-bundles
ExclusiveArch: %{java_arches} noarch
- apiguardian
ExclusiveArch: %{java_arches} noarch
- apmd
ExclusiveArch: %{ix86}
- appstream-generator
ExclusiveArch: %{ldc_arches}
- aqute-bnd
ExclusiveArch: %{java_arches} noarch
- arm-trusted-firmware
ExclusiveArch: aarch64
- assertj-core
ExclusiveArch: %{java_arches} noarch
- atinject
ExclusiveArch: %{java_arches} noarch
- aunit
ExclusiveArch: %GPRbuild_arches
- avgtime
ExclusiveArch: %{ldc_arches}
- aws
ExclusiveArch: %GPRbuild_arches
- bcal
ExclusiveArch: x86_64 aarch64 ia64 ppc64 ppc64le s390x
- bcc
ExclusiveArch: x86_64 %{power64} aarch64 s390x armv7hl
- bcel
ExclusiveArch: %{java_arches} noarch
- bcm283x-firmware
ExclusiveArch: %{arm} aarch64
- berusky2
ExclusiveArch: %{ix86} x86_64 %{arm} aarch64 %{mips}
- beust-jcommander
ExclusiveArch: %{java_arches} noarch
- biosdevname
ExclusiveArch: %{ix86} x86_64
- blender
ExclusiveArch: x86_64 aarch64 ppc64le s390x
- bless
ExclusiveArch: %mono_arches
- bpftrace
ExclusiveArch: x86_64 %{power64} aarch64 s390x
- bsf
ExclusiveArch: %{java_arches} noarch
- byte-buddy
ExclusiveArch: %{java_arches} noarch
- calamares
ExclusiveArch: %{ix86} x86_64 aarch64
- calibre
ExclusiveArch: %{qt5_qtwebengine_arches}
- ccdciel
ExclusiveArch: %{fpc_arches}
- cdcollect
ExclusiveArch: %{mono_arches}
- cdi-api
ExclusiveArch: %{java_arches} noarch
- ceph
ExclusiveArch: x86_64 aarch64 ppc64le s390x
- cglib
ExclusiveArch: %{java_arches} noarch
- chromium
ExclusiveArch: x86_64 i686
ExclusiveArch: x86_64 aarch64
ExclusiveArch: x86_64 i686 aarch64
- cjdns
ExclusiveArch: %{nodejs_arches}
- clevis-pin-tpm2
ExclusiveArch: %{rust_arches}
- cmospwd
ExclusiveArch: %{ix86} x86_64
- cmrt
ExclusiveArch: %{ix86} x86_64 ia64
- coffee-script
ExclusiveArch: %{nodejs_arches} noarch
- colorful
ExclusiveArch: %{fpc_arches}
- cpu-x
ExclusiveArch: i686 x86_64
- cpufetch
ExclusiveArch: %{arm} aarch64 x86_64 ppc ppc64 ppc64le
- cpuid
ExclusiveArch: %{ix86} x86_64
- cqrlog
ExclusiveArch: %{fpc_arches}
- crash
ExclusiveArch: %{ix86} ia64 x86_64 ppc ppc64 s390 s390x %{arm} aarch64 ppc64le
- crash-gcore-command
ExclusiveArch: aarch64 ppc64le x86_64
- crash-trace-command
ExclusiveArch: aarch64 ppc64le s390x x86_64
- cri-o
ExclusiveArch: %{?go_arches:%{go_arches}}%{!?go_arches:%{ix86} x86_64 aarch64 %{arm}}
- cri-tools
ExclusiveArch: %{?go_arches:%{go_arches}}%{!?go_arches:%{ix86} x86_64 aarch64 %{arm}}
- criu
ExclusiveArch: x86_64 %{arm} ppc64le aarch64 s390x
- cryptlib
ExclusiveArch: x86_64 aarch64 ppc64le
- cryptobone
ExclusiveArch: x86_64 ppc64le aarch64
- csslint
ExclusiveArch: %{nodejs_arches} noarch
- daq
ExclusiveArch: x86_64 aarch64
- dbus-parsec
ExclusiveArch: %{rust_arches}
- dbus-sharp
ExclusiveArch: %mono_arches
- dbus-sharp-glib
ExclusiveArch: %mono_arches
- dbxtool
ExclusiveArch: i386 x86_64 aarch64
- deepin-daemon
ExclusiveArch: %{?go_arches:%{go_arches}}%{!?go_arches:%{ix86} x86_64 aarch64 %{arm}}
- deepin-desktop-schemas
ExclusiveArch: %{go_arches}
- disruptor
ExclusiveArch: %{java_arches} noarch
- dlm
ExclusiveArch: i686 x86_64
- dmidecode
ExclusiveArch: %{ix86} x86_64 ia64 aarch64
- dmtcp
ExclusiveArch: x86_64
- docker-distribution
ExclusiveArch: %{?go_arches:%{go_arches}}%{!?go_arches:%{ix86} x86_64 %{arm}}
- dolphin-emu
ExclusiveArch: x86_64 aarch64
- dotnet-build-reference-packages
ExclusiveArch: aarch64 x86_64
ExclusiveArch: x86_64
- dotnet6.0
ExclusiveArch: aarch64 x86_64 s390x
ExclusiveArch: x86_64
- doublecmd
ExclusiveArch: %{ix86} x86_64
- dpdk
ExclusiveArch: x86_64 i686 aarch64 ppc64le
- dub
ExclusiveArch: %{ldc_arches}
- dxvk-native
ExclusiveArch: %{ix86} x86_64
- dyninst
ExclusiveArch: %{ix86} x86_64 ppc64le aarch64
- e3
ExclusiveArch: %{ix86} x86_64
- easymock
ExclusiveArch: %{java_arches} noarch
- eclipse-swt
ExclusiveArch: s390x x86_64 aarch64 ppc64le
- edk2
ExclusiveArch: x86_64 aarch64
- efibootmgr
ExclusiveArch: %{efi}
- efifs
ExclusiveArch: %{efi}
- efitools
ExclusiveArch: %{efi}
- efivar
ExclusiveArch: %{efi}
- elk
ExclusiveArch: x86_64 %{ix86}
ExclusiveArch: x86_64 %{ix86} aarch64 %{arm} %{power64}
- emacs-slime
ExclusiveArch: %{arm} %{ix86} x86_64 ppc sparcv9 aarch64
- enki
ExclusiveArch: %{qt5_qtwebengine_arches} noarch
- envytools
ExclusiveArch: %{ix86} x86_64 %{arm} aarch64
- eric
ExclusiveArch: %{qt5_qtwebengine_arches} noarch
- eth-tools
ExclusiveArch: x86_64
- extra-enforcer-rules
ExclusiveArch: %{java_arches} noarch
- fcitx-libpinyin
ExclusiveArch: %{qt5_qtwebengine_arches}
- fedora-dockerfiles
ExclusiveArch: %{go_arches}
- felix-parent
ExclusiveArch: %{java_arches} noarch
- felix-utils
ExclusiveArch: %{java_arches} noarch
- fes
ExclusiveArch: %{ix86} x86_64
- florist
ExclusiveArch: %{GPRbuild_arches}
- fluent-bit
ExclusiveArch: x86_64 aarch64
- fpc
ExclusiveArch: %{arm} aarch64 %{ix86} x86_64 ppc64le
- frescobaldi
ExclusiveArch: %{qt5_qtwebengine_arches}
- frysk
ExclusiveArch: %{ix86} x86_64 ppc64
- fusesource-pom
ExclusiveArch: %{java_arches} noarch
- fwts
ExclusiveArch: x86_64 %{arm} aarch64 s390x riscv64 %{power64}
- fwupd-efi
ExclusiveArch: x86_64 aarch64
- ga
ExclusiveArch: %{ix86} x86_64 %{arm} aarch64 ppc64le
- gbrainy
ExclusiveArch: %mono_arches
- gdb
ExclusiveArch: %{ix86} x86_64
- gdb-exploitable
ExclusiveArch: x86_64 i386
ExclusiveArch: x86_64 noarch
- gearhead1
ExclusiveArch: %{fpc_arches}
- ghdl
ExclusiveArch: %{GNAT_arches}
- ghostwriter
ExclusiveArch: %{qt5_qtwebengine_arches}
- gio-sharp
ExclusiveArch: %mono_arches
- gir-to-d
ExclusiveArch: %{ldc_arches}
- git-octopus
ExclusiveArch: %{?go_arches:%{go_arches}}%{!?go_arches:%{ix86} x86_64 aarch64 %{arm}}
- gitqlient
ExclusiveArch: %{qt5_qtwebengine_arches}
- giver
ExclusiveArch: %{mono_arches}
- gkeyfile-sharp
ExclusiveArch: %mono_arches
- glibc32
ExclusiveArch: x86_64
- glibd
ExclusiveArch: %{ldc_arches}
- gmqcc
ExclusiveArch: %{ix86} x86_64 %{arm} aarch64
- gnatcoll
ExclusiveArch: %{GPRbuild_arches}
- gnatcoll-bindings
ExclusiveArch: %{GPRbuild_arches}
- gnatcoll-db
ExclusiveArch: %{GPRbuild_arches}
- gnome-boxes
ExclusiveArch: x86_64
- gnome-desktop-sharp
ExclusiveArch: %mono_arches
- gnome-do
ExclusiveArch: %mono_arches
- gnome-keyring-sharp
ExclusiveArch: %mono_arches
- gnome-rdp
ExclusiveArch: %{mono_arches}
- gnome-sharp
ExclusiveArch: %mono_arches
- gnome-subtitles
ExclusiveArch: %mono_arches
- gnu-efi
ExclusiveArch: %{efi}
- go-bindata
ExclusiveArch: %{?go_arches:%{go_arches}}%{!?go_arches:%{ix86} x86_64 %{arm}}
- go-compilers
ExclusiveArch: %{go_arches}
- go-rpm-macros
ExclusiveArch: %{golang_arches} %{gccgo_arches}
- godep
ExclusiveArch: %{?go_arches:%{go_arches}}%{!?go_arches:%{ix86} x86_64 %{arm}}
- golang
ExclusiveArch: %{golang_arches}
- gomtree
ExclusiveArch: %{?go_arches:%{go_arches}}%{!?go_arches:%{ix86} x86_64 %{arm}}
- google-guice
ExclusiveArch: %{java_arches} noarch
- gotun
ExclusiveArch: %{?go_arches:%{go_arches}}%{!?go_arches:%{ix86} x86_64 %{arm}}
ExclusiveArch: x86_64
- goverlay
ExclusiveArch: %{fpc_arches}
- gprbuild
ExclusiveArch: %{GPRbuild_arches} %{bootstrap_arch}
- gprolog
ExclusiveArch: x86_64 %{ix86} ppc alpha aarch64
- grafana
ExclusiveArch: %{grafana_arches}
- grafana-pcp
ExclusiveArch: %{grafanapcp_arches}
- greetd
ExclusiveArch: %{rust_arches}
- gtk-sharp-beans
ExclusiveArch: %mono_arches
- gtk-sharp2
ExclusiveArch: %mono_arches
- gtk-sharp3
ExclusiveArch: %{mono_arches}
- gtkd
ExclusiveArch: %{ldc_arches}
- guava
ExclusiveArch: %{java_arches} noarch
- gudev-sharp
ExclusiveArch: %mono_arches
- guestfs-tools
ExclusiveArch: %{kernel_arches}
- hamcrest
ExclusiveArch: %{java_arches} noarch
- hedgewars
ExclusiveArch: %{fpc_arches}
- hsakmt
ExclusiveArch: x86_64 aarch64 ppc64le
- httpcomponents-client
ExclusiveArch: %{java_arches} noarch
- httpcomponents-core
ExclusiveArch: %{java_arches} noarch
- httpcomponents-project
ExclusiveArch: %{java_arches} noarch
- hyena
ExclusiveArch: %{mono_arches}
- hyperscan
ExclusiveArch: x86_64
- hyperv-daemons
ExclusiveArch: i686 x86_64
- i3status-rs
ExclusiveArch: %{rust_arches}
- icaro
ExclusiveArch: %{ix86} x86_64 noarch
- imvirt
ExclusiveArch: %{ix86} x86_64 ia64
- indistarter
ExclusiveArch: %{fpc_arches}
- infinipath-psm
ExclusiveArch: x86_64
- intel-cm-compiler
ExclusiveArch: i686 x86_64
- intel-cmt-cat
ExclusiveArch: x86_64 i686 i586
ExclusiveArch: x86_64 i686 i586
- intel-compute-runtime
ExclusiveArch: x86_64
- intel-gmmlib
ExclusiveArch: x86_64 i686
- intel-igc
ExclusiveArch: x86_64 i686
- intel-ipp-crypto-mb
ExclusiveArch: x86_64
ExclusiveArch: x86_64
- intel-ipsec-mb
ExclusiveArch: x86_64
ExclusiveArch: x86_64
- intel-mediasdk
ExclusiveArch: x86_64
- intel-undervolt
ExclusiveArch: i386 x86_64
- ioport
ExclusiveArch: %{ix86} x86_64
- ipmctl
ExclusiveArch: x86_64
- ispc
ExclusiveArch: x86_64 aarch64
- iucode-tool
ExclusiveArch: %{ix86} x86_64
- iyfct
ExclusiveArch: %{arm} %{ix86} x86_64 aarch64 ppc64le
- jakarta-activation
ExclusiveArch: %{java_arches} noarch
- jakarta-annotations
ExclusiveArch: %{java_arches} noarch
- jakarta-oro
ExclusiveArch: %{java_arches} noarch
- jakarta-servlet
ExclusiveArch: %{java_arches} noarch
- java-1.8.0-openjdk-aarch32
ExclusiveArch: %{arm}
- java_cup
ExclusiveArch: %{java_arches} noarch
- javapackages-bootstrap
ExclusiveArch: %{java_arches} noarch
- jctools
ExclusiveArch: %{java_arches} noarch
- jdepend
ExclusiveArch: %{java_arches} noarch
- jdom
ExclusiveArch: %{java_arches} noarch
- jdom2
ExclusiveArch: %{java_arches} noarch
- jflex
ExclusiveArch: %{java_arches} noarch
- jigawatts
ExclusiveArch: x86_64 %{arm} ppc64le aarch64 s390x
- jsch
ExclusiveArch: %{java_arches} noarch
- jsr-305
ExclusiveArch: %{java_arches} noarch
- junit
ExclusiveArch: %{java_arches} noarch
- junit5
ExclusiveArch: %{java_arches} noarch
- jzlib
ExclusiveArch: %{java_arches} noarch
- kchmviewer
ExclusiveArch: %{qt5_qtwebengine_arches}
- kernel
ExclusiveArch: noarch x86_64 s390x %{arm} aarch64 ppc64le
ExclusiveArch: noarch i386 i686 x86_64 s390x %{arm} aarch64 ppc64le
- keylime-agent-rust
ExclusiveArch: %{rust_arches}
- keyring-ima-signer
ExclusiveArch: %{rust_arches}
- kf5-akonadi-search
ExclusiveArch: x86_64 ppc64le aarch64 %{arm}
- kf5-audiocd-kio
ExclusiveArch: x86_64 ppc64le aarch64 %{arm}
- kf5-kalarmcal
ExclusiveArch: x86_64 ppc64le aarch64 %{arm}
- kf5-kblog
ExclusiveArch: x86_64 ppc64le aarch64 %{arm}
- kf5-kcalendarcore
ExclusiveArch: x86_64 ppc64le aarch64 %{arm}
- kf5-kcalendarutils
ExclusiveArch: x86_64 ppc64le aarch64 %{arm}
- kf5-kitinerary
ExclusiveArch: x86_64 ppc64le aarch64 %{arm}
- kf5-ktnef
ExclusiveArch: x86_64 ppc64le aarch64 %{arm}
- kf5-libkdcraw
ExclusiveArch: x86_64 ppc64le %{arm}
- kicad
ExclusiveArch: %{ix86} x86_64 %{arm} aarch64 ppc64le
- kiwix-desktop
ExclusiveArch: %{qt5_qtwebengine_arches}
- klee
ExclusiveArch: x86_64
- knot-resolver
ExclusiveArch: %{ix86} x86_64
ExclusiveArch: %{arm} aarch64 %{ix86} x86_64
- knotes
ExclusiveArch: x86_64 %{arm}
- kompose
ExclusiveArch: %{ix86} x86_64 %{arm} aarch64 s390x
- kubernetes
ExclusiveArch: x86_64 aarch64 ppc64le s390x %{arm}
- lazarus
ExclusiveArch: %{fpc_arches}
- lazpaint
ExclusiveArch: %{fpc_arches}
- ldc
ExclusiveArch: %{ldc_arches}
- libbsr
ExclusiveArch: %{power64}
- libclc
ExclusiveArch: %{ix86} x86_64 %{arm} aarch64 %{power64} s390x
- libcxl
ExclusiveArch: %{power64}
- libdfp
ExclusiveArch: ppc ppc64 ppc64le s390 s390x x86_64
- libdispatch
ExclusiveArch: x86_64 aarch64 ppc64le
- libguestfs
ExclusiveArch: %{kernel_arches}
- libica
ExclusiveArch: s390 s390x
- libipt
ExclusiveArch: %{ix86} x86_64
ExclusiveArch: %{ix86} x86_64
- libkgapi
ExclusiveArch: x86_64 ppc64le aarch64 %{arm}
- libnxz
ExclusiveArch: ppc64le
- libocxl
ExclusiveArch: ppc64le
- libpmemobj-cpp
ExclusiveArch: x86_64 ppc64le
- libpsm2
ExclusiveArch: x86_64
- libquentier
ExclusiveArch: %{qt5_qtwebengine_arches}
- libretro-desmume2015
ExclusiveArch: i686 x86_64
- librtas
ExclusiveArch: %{power64}
- libservicelog
ExclusiveArch: ppc %{power64}
- libsmbios
ExclusiveArch: x86_64 %{ix86}
- libunwind
ExclusiveArch: %{arm} aarch64 hppa ia64 mips ppc %{power64} s390x %{ix86} x86_64
- libva-intel-hybrid-driver
ExclusiveArch: %{ix86} x86_64 ia64
- libvma
ExclusiveArch: x86_64 ppc64le ppc64 aarch64
- libvmi
ExclusiveArch: x86_64
- libvpd
ExclusiveArch: %{power64}
- libxsmm
ExclusiveArch: x86_64
- libzdnn
ExclusiveArch: s390x
- libzfcphbaapi
ExclusiveArch: s390 s390x
- lightdm
ExclusiveArch: x86_64 ppc64le
- lightdm-gtk
ExclusiveArch: x86_64 ppc64le
- llhttp
ExclusiveArch: %{nodejs_arches}
- log4j
ExclusiveArch: %{java_arches} noarch
- log4net
ExclusiveArch: %mono_arches
- lrmi
ExclusiveArch: %{ix86}
- lsvpd
ExclusiveArch: %{power64}
- luajit
ExclusiveArch: %{arm} %{ix86} x86_64 %{mips} aarch64
- luxcorerender
ExclusiveArch: x86_64
- mactel-boot
ExclusiveArch: x86_64
- manifest-tool
ExclusiveArch: x86_64 aarch64 ppc64le s390x
- marked
ExclusiveArch: %{nodejs_arches} noarch
ExclusiveArch: %{ix86} x86_64 %{arm} noarch
- matreshka
ExclusiveArch: %GPRbuild_arches
- maui-mauikit
ExclusiveArch: %{ix86} s390x aarch64 x86_64
- maven
ExclusiveArch: %{java_arches} noarch
- maven-antrun-plugin
ExclusiveArch: %{java_arches} noarch
- maven-archiver
ExclusiveArch: %{java_arches} noarch
- maven-artifact-transfer
ExclusiveArch: %{java_arches} noarch
- maven-assembly-plugin
ExclusiveArch: %{java_arches} noarch
- maven-common-artifact-filters
ExclusiveArch: %{java_arches} noarch
- maven-compiler-plugin
ExclusiveArch: %{java_arches} noarch
- maven-dependency-analyzer
ExclusiveArch: %{java_arches} noarch
- maven-dependency-plugin
ExclusiveArch: %{java_arches} noarch
- maven-dependency-tree
ExclusiveArch: %{java_arches} noarch
- maven-enforcer
ExclusiveArch: %{java_arches} noarch
- maven-file-management
ExclusiveArch: %{java_arches} noarch
- maven-filtering
ExclusiveArch: %{java_arches} noarch
- maven-jar-plugin
ExclusiveArch: %{java_arches} noarch
- maven-parent
ExclusiveArch: %{java_arches} noarch
- maven-plugin-build-helper
ExclusiveArch: %{java_arches} noarch
- maven-plugin-bundle
ExclusiveArch: %{java_arches} noarch
- maven-plugin-testing
ExclusiveArch: %{java_arches} noarch
- maven-plugin-tools
ExclusiveArch: %{java_arches} noarch
- maven-remote-resources-plugin
ExclusiveArch: %{java_arches} noarch
- maven-resolver
ExclusiveArch: %{java_arches} noarch
- maven-resources-plugin
ExclusiveArch: %{java_arches} noarch
- maven-shared-incremental
ExclusiveArch: %{java_arches} noarch
- maven-shared-io
ExclusiveArch: %{java_arches} noarch
- maven-shared-utils
ExclusiveArch: %{java_arches} noarch
- maven-source-plugin
ExclusiveArch: %{java_arches} noarch
- maven-surefire
ExclusiveArch: %{java_arches} noarch
- maven-verifier
ExclusiveArch: %{java_arches} noarch
- maven-wagon
ExclusiveArch: %{java_arches} noarch
- maxima
ExclusiveArch: %{arm} %{ix86} x86_64 aarch64 ppc sparcv9
ExclusiveArch: %{ix86} x86_64 ppc sparcv9
- mbpfan
ExclusiveArch: x86_64
- mcelog
ExclusiveArch: i686 x86_64
- mdevctl
ExclusiveArch: %{rust_arches}
- mediaconch
ExclusiveArch: %{qt5_qtwebengine_arches}
- mellowplayer
ExclusiveArch: %{qt5_qtwebengine_arches}
- memkind
ExclusiveArch: x86_64 ppc64 ppc64le s390x aarch64
- memtest86+
ExclusiveArch: %{ix86} x86_64
- mesos
ExclusiveArch: x86_64
- microcode_ctl
ExclusiveArch: %{ix86} x86_64
- micropython
ExclusiveArch: %{arm} %{ix86} x86_64
- mine_detector
ExclusiveArch: %{GPRbuild_arches}
- minetest
ExclusiveArch: %{ix86} x86_64
ExclusiveArch: %{arm} %{ix86} x86_64 %{mips} aarch64
- mingw-libidn2
ExclusiveArch: %{ix86} x86_64 %{arm}
- mingw-wine-gecko
ExclusiveArch: %{ix86} x86_64 %{arm} aarch64
- mirrorlist-server
ExclusiveArch: %{rust_arches}
- mkbootdisk
ExclusiveArch: %{ix86} sparc sparc64 x86_64
- mockito
ExclusiveArch: %{java_arches} noarch
- mod_mono
ExclusiveArch: %mono_arches
- modello
ExclusiveArch: %{java_arches} noarch
- module-build-service
ExclusiveArch: %{ix86} x86_64 noarch
- mojo-parent
ExclusiveArch: %{java_arches} noarch
- mokutil
ExclusiveArch: %{ix86} x86_64 aarch64 %{arm}
- mold
ExclusiveArch: %{ix86} x86_64 %{arm} aarch64 riscv64
- mono
ExclusiveArch: %mono_arches
- mono-addins
ExclusiveArch: %mono_arches
- mono-basic
ExclusiveArch: %{mono_arches}
- mono-bouncycastle
ExclusiveArch: %mono_arches
- mono-cecil
ExclusiveArch: %mono_arches
- mono-cecil-flowanalysis
ExclusiveArch: %mono_arches
- mono-reflection
ExclusiveArch: %mono_arches
- mono-tools
ExclusiveArch: %mono_arches
- mono-zeroconf
ExclusiveArch: %mono_arches
- monobristol
ExclusiveArch: %{mono_arches}
- monodevelop
ExclusiveArch: %mono_arches
- monodevelop-debugger-gdb
ExclusiveArch: %{mono_arches}
- monosim
ExclusiveArch: %mono_arches
- mrrescue
ExclusiveArch: %{arm} %{ix86} x86_64 aarch64 ppc64le
- msr-tools
ExclusiveArch: %{ix86} x86_64
- munge-maven-plugin
ExclusiveArch: %{java_arches} noarch
- mustache-d
ExclusiveArch: %{ldc_arches}
- mysql-connector-net
ExclusiveArch: %{mono_arches}
- naev
ExclusiveArch: %{arm} %{ix86} x86_64 %{mips} aarch64
- nant
ExclusiveArch: %mono_arches
- nativejit
ExclusiveArch: x86_64
- nbc
ExclusiveArch: %{fpc_arches}
- nbdkit
ExclusiveArch: x86_64
- ndesk-dbus
ExclusiveArch: %{mono_arches}
- ndesk-dbus-glib
ExclusiveArch: %{mono_arches}
- netavark
ExclusiveArch: %{rust_arches}
- newtonsoft-json
ExclusiveArch: %{mono_arches}
- nispor
ExclusiveArch: %{rust_arches}
- nodejs
ExclusiveArch: %{nodejs_arches}
- nodejs-acorn-object-spread
ExclusiveArch: %{nodejs_arches} noarch
ExclusiveArch: %{ix86} x86_64 %{arm} noarch
- nodejs-backbone
ExclusiveArch: %{nodejs_arches} noarch
- nodejs-bash-language-server
ExclusiveArch: %{nodejs_arches} noarch
- nodejs-buble
ExclusiveArch: %{nodejs_arches} noarch
- nodejs-colors
ExclusiveArch: %{nodejs_arches} noarch
- nodejs-generic-pool
ExclusiveArch: %{nodejs_arches} noarch
- nodejs-less
ExclusiveArch: %{nodejs_arches} noarch
- nodejs-linefix
ExclusiveArch: %{nodejs_arches} noarch
ExclusiveArch: %{ix86} x86_64 %{arm} noarch
- nodejs-nodemon
ExclusiveArch: %{nodejs_arches} noarch
- nodejs-packaging
ExclusiveArch: %{nodejs_arches} noarch
- nodejs-replace-require-self
ExclusiveArch: %{nodejs_arches} noarch
- nodejs-supervisor
ExclusiveArch: %{nodejs_arches} noarch
- nodejs-tape
ExclusiveArch: %{nodejs_arches} noarch
- nodejs-typescript
ExclusiveArch: %{nodejs_arches} noarch
- nodejs-underscore
ExclusiveArch: %{nodejs_arches} noarch
ExclusiveArch: %{ix86} x86_64 %{arm} noarch
- notify-sharp
ExclusiveArch: %{mono_arches}
- notify-sharp3
ExclusiveArch: %{mono_arches}
- nuget
ExclusiveArch: %{mono_arches}
- numatop
ExclusiveArch: x86_64 ppc64le
- nunit
ExclusiveArch: %{mono_arches}
- nunit2
ExclusiveArch: %{mono_arches}
- nvml
ExclusiveArch: x86_64 ppc64le
- nwchem
ExclusiveArch: %{ix86} x86_64 %{arm} aarch64 ppc64le
- objectweb-asm
ExclusiveArch: %{java_arches} noarch
- objenesis
ExclusiveArch: %{java_arches} noarch
- obs-service-rust2rpm
ExclusiveArch: %{rust_arches} noarch
- oci-seccomp-bpf-hook
ExclusiveArch: x86_64 %%{power64} aarch64 s390x armv7hl
- oci-umount
ExclusiveArch: %{ix86} x86_64 %{arm} aarch64 ppc64le s390x %{mips}
- oidn
ExclusiveArch: x86_64
- olpc-kbdshim
ExclusiveArch: %{ix86} %{arm}
- olpc-utils
ExclusiveArch: %{ix86} %{arm}
- oneVPL
ExclusiveArch: x86_64
- oneVPL-intel-gpu
ExclusiveArch: x86_64
- onednn
ExclusiveArch: x86_64 aarch64 ppc64le s390x
- onedrive
ExclusiveArch: %{ldc_arches}
- opae
ExclusiveArch: x86_64
- opal-prd
ExclusiveArch: ppc64le
- open-vm-tools
ExclusiveArch: x86_64 aarch64
ExclusiveArch: %{ix86} x86_64 aarch64
ExclusiveArch: x86_64
- openblas
ExclusiveArch: %{openblas_arches}
- openjfx
ExclusiveArch: x86_64
- openjfx8
ExclusiveArch: x86_64
- openlibm
ExclusiveArch: %{arm} %{ix86} x86_64 aarch64 %{power64}
- openms
ExclusiveArch: %{qt5_qtwebengine_arches}
- openni
ExclusiveArch: %{ix86} x86_64 %{arm}
- openni-primesense
ExclusiveArch: %{ix86} x86_64 %{arm}
- openshadinglanguage
ExclusiveArch: x86_64 aarch64 ppc64le s390x
- openssl-ibmca
ExclusiveArch: s390 s390x
- opentest4j
ExclusiveArch: %{java_arches} noarch
- origin
ExclusiveArch: %{go_arches}
ExclusiveArch: x86_64 aarch64 ppc64le s390x
- orion
ExclusiveArch: %{qt5_qtwebengine_arches}
- orthorobot
ExclusiveArch: %{arm} %{ix86} x86_64 aarch64 ppc64le
- osgi-annotation
ExclusiveArch: %{java_arches} noarch
- osgi-compendium
ExclusiveArch: %{java_arches} noarch
- osgi-core
ExclusiveArch: %{java_arches} noarch
- pacemaker
ExclusiveArch: aarch64 i686 ppc64le s390x x86_64 %{arm}
ExclusiveArch: aarch64 i686 ppc64le s390x x86_64
- paflib
ExclusiveArch: ppc %{power64}
- parsec
ExclusiveArch: %{rust_arches}
- parsec-tool
ExclusiveArch: %{rust_arches}
- pasdoc
ExclusiveArch: %{fpc_arches}
- pcc
ExclusiveArch: %{ix86} x86_64
- pcm
ExclusiveArch: %{ix86} x86_64
- pcmciautils
ExclusiveArch: %{ix86} x86_64 ia64 ppc ppc64 %{arm}
- pdbg
ExclusiveArch: ppc64le
- pdfmod
ExclusiveArch: %mono_arches
- perl-Dumbbench
ExclusiveArch: %{ix86} x86_64 noarch
- perl-Parse-DMIDecode
ExclusiveArch: %{ix86} x86_64 ia64 aarch64
- pesign
ExclusiveArch: %{ix86} x86_64 ia64 aarch64 %{arm}
- pesign-test-app
ExclusiveArch: x86_64
- pinta
ExclusiveArch: %mono_arches
- pioneer
ExclusiveArch: %{ix86} x86_64
- playonlinux
ExclusiveArch: %{arm} aarch64 %{ix86} x86_64
- plexus-archiver
ExclusiveArch: %{java_arches} noarch
- plexus-build-api
ExclusiveArch: %{java_arches} noarch
- plexus-cipher
ExclusiveArch: %{java_arches} noarch
- plexus-classworlds
ExclusiveArch: %{java_arches} noarch
- plexus-compiler
ExclusiveArch: %{java_arches} noarch
- plexus-components-pom
ExclusiveArch: %{java_arches} noarch
- plexus-containers
ExclusiveArch: %{java_arches} noarch
- plexus-interpolation
ExclusiveArch: %{java_arches} noarch
- plexus-io
ExclusiveArch: %{java_arches} noarch
- plexus-languages
ExclusiveArch: %{java_arches} noarch
- plexus-pom
ExclusiveArch: %{java_arches} noarch
- plexus-resources
ExclusiveArch: %{java_arches} noarch
- plexus-sec-dispatcher
ExclusiveArch: %{java_arches} noarch
- plexus-utils
ExclusiveArch: %{java_arches} noarch
- pmdk-convert
ExclusiveArch: x86_64
- pmemkv
ExclusiveArch: x86_64
- podman
ExclusiveArch: %{golang_arches}
- poppler-sharp
ExclusiveArch: %mono_arches
- popub
ExclusiveArch: %{?go_arches:%{go_arches}}%{!?go_arches:%{ix86} x86_64 %{arm}}
- powerpc-utils
ExclusiveArch: ppc %{power64}
- ppc64-diag
ExclusiveArch: ppc %{power64}
- pveclib
ExclusiveArch: ppc %{power64}
- pvs-sbcl
ExclusiveArch: %{ix86} x86_64 ppc sparcv9
- pyqtwebengine
ExclusiveArch: %{qt5_qtwebengine_arches}
- python-cryptography
ExclusiveArch: %{rust_arches}
- python-etcd
ExclusiveArch: noarch %{ix86} x86_64 %{arm} aarch64 ppc64le s390x
- python-healpy
ExclusiveArch: aarch64 ppc64 ppc64le x86_64 s390x
- python-javabridge
ExclusiveArch: i686 x86_64
- python-openoffice
ExclusiveArch: noarch x86_64
- python-pymoc
ExclusiveArch: aarch64 ppc64 ppc64le x86_64 s390x
- python-setuptools-rust
ExclusiveArch: %{rust_arches}
- q4wine
ExclusiveArch: %{ix86} x86_64 %{arm} aarch64
- qatzip
ExclusiveArch: x86_64
- qcint
ExclusiveArch: x86_64
- qclib
ExclusiveArch: s390 s390x
- qdox
ExclusiveArch: %{java_arches} noarch
- qemu-sanity-check
ExclusiveArch: %{kernel_arches}
- qevercloud
ExclusiveArch: %{qt5_qtwebengine_arches}
- qmapshack
ExclusiveArch: %{qt5_qtwebengine_arches}
- qt4pas
ExclusiveArch: %{fpc_arches}
- qt5-qtwebengine
ExclusiveArch: %{qt5_qtwebengine_arches}
- quantum-espresso
ExclusiveArch: x86_64 %{ix86} aarch64 %{power64}
- quentier
ExclusiveArch: %{qt5_qtwebengine_arches}
- rear
ExclusiveArch: %ix86 x86_64 ppc ppc64 ppc64le ia64
- reg
ExclusiveArch: %{?go_arches:%{go_arches}}%{!?go_arches:%{ix86} x86_64 aarch64 %{arm}}
- regexp
ExclusiveArch: %{java_arches} noarch
- renderdoc
ExclusiveArch: x86_64
- reptyr
ExclusiveArch: %{ix86} x86_64 %{arm} aarch64
- rescene
ExclusiveArch: %{mono_arches}
- restool
ExclusiveArch: aarch64
- restsharp
ExclusiveArch: %{mono_arches}
- rhythmbox-alternative-toolbar
ExclusiveArch: %{ix86} %{arm} x86_64 ppc64 ppc64le
- rocm-compilersupport
ExclusiveArch: x86_64 aarch64 ppc64le
- rocm-device-libs
ExclusiveArch: x86_64 aarch64 ppc64le
- rocm-runtime
ExclusiveArch: x86_64 aarch64 ppc64le
- rocminfo
ExclusiveArch: x86_64 aarch64 ppc64le
- rpm-ostree
ExclusiveArch: %{rust_arches}
- rr
ExclusiveArch: %{ix86} x86_64 aarch64
- rssguard
ExclusiveArch: %{qt5_qtwebengine_arches}
- rubygem-childprocess
ExclusiveArch: %{ix86} x86_64 noarch
- runc
ExclusiveArch: %{ix86} x86_64 %{arm} aarch64 ppc64le %{mips} s390x
- rust
ExclusiveArch: %{rust_arches}
- rust-Inflector
ExclusiveArch: %{rust_arches}
- rust-abomonation
ExclusiveArch: %{rust_arches}
- rust-actix
ExclusiveArch: %{rust_arches}
- rust-actix-codec
ExclusiveArch: %{rust_arches}
- rust-actix-connect
ExclusiveArch: %{rust_arches}
- rust-actix-http
ExclusiveArch: %{rust_arches}
- rust-actix-macros
ExclusiveArch: %{rust_arches}
- rust-actix-macros0.1
ExclusiveArch: %{rust_arches}
- rust-actix-router
ExclusiveArch: %{rust_arches}
- rust-actix-rt
ExclusiveArch: %{rust_arches}
- rust-actix-rt1
ExclusiveArch: %{rust_arches}
- rust-actix-server
ExclusiveArch: %{rust_arches}
- rust-actix-service
ExclusiveArch: %{rust_arches}
- rust-actix-testing
ExclusiveArch: %{rust_arches}
- rust-actix-threadpool
ExclusiveArch: %{rust_arches}
- rust-actix-tls
ExclusiveArch: %{rust_arches}
- rust-actix-utils
ExclusiveArch: %{rust_arches}
- rust-actix-web
ExclusiveArch: %{rust_arches}
- rust-actix-web-codegen
ExclusiveArch: %{rust_arches}
- rust-actix0.10
ExclusiveArch: %{rust_arches}
- rust-actix_derive
ExclusiveArch: %{rust_arches}
- rust-actix_derive0.5
ExclusiveArch: %{rust_arches}
- rust-addr2line
ExclusiveArch: %{rust_arches}
- rust-adler
ExclusiveArch: %{rust_arches}
- rust-adler32
ExclusiveArch: %{rust_arches}
- rust-aead
ExclusiveArch: %{rust_arches}
- rust-aes
ExclusiveArch: %{rust_arches}
- rust-aes-gcm
ExclusiveArch: %{rust_arches}
- rust-aes0.7
ExclusiveArch: %{rust_arches}
- rust-afterburn
ExclusiveArch: %{rust_arches}
- rust-ahash
ExclusiveArch: %{rust_arches}
- rust-ahash0.4
ExclusiveArch: %{rust_arches}
- rust-aho-corasick
ExclusiveArch: %{rust_arches}
- rust-alacritty
ExclusiveArch: %{rust_arches}
- rust-alacritty_config_derive
ExclusiveArch: %{rust_arches}
- rust-alacritty_terminal
ExclusiveArch: %{rust_arches}
- rust-alga
ExclusiveArch: %{rust_arches}
- rust-alga_derive
ExclusiveArch: %{rust_arches}
- rust-aliasable
ExclusiveArch: %{rust_arches}
- rust-alloc-no-stdlib
ExclusiveArch: %{rust_arches}
- rust-alloc-stdlib
ExclusiveArch: %{rust_arches}
- rust-ambient-authority
ExclusiveArch: %{rust_arches}
- rust-ammonia
ExclusiveArch: %{rust_arches}
- rust-ansi_colours
ExclusiveArch: %{rust_arches}
- rust-ansi_term
ExclusiveArch: %{rust_arches}
- rust-ansi_term0.11
ExclusiveArch: %{rust_arches}
- rust-antidote
ExclusiveArch: %{rust_arches}
- rust-anyhow
ExclusiveArch: %{rust_arches}
- rust-aom-sys
ExclusiveArch: %{rust_arches}
- rust-app_dirs
ExclusiveArch: %{rust_arches}
- rust-approx
ExclusiveArch: %{rust_arches}
- rust-ar
ExclusiveArch: %{rust_arches}
- rust-arbitrary
ExclusiveArch: %{rust_arches}
- rust-arbitrary0.4
ExclusiveArch: %{rust_arches}
- rust-arc-swap
ExclusiveArch: %{rust_arches}
- rust-arf-strings
ExclusiveArch: %{rust_arches}
- rust-arg_enum_proc_macro
ExclusiveArch: %{rust_arches}
- rust-argh
ExclusiveArch: %{rust_arches}
- rust-argh_derive
ExclusiveArch: %{rust_arches}
- rust-argh_shared
ExclusiveArch: %{rust_arches}
- rust-argparse
ExclusiveArch: %{rust_arches}
- rust-array-init
ExclusiveArch: %{rust_arches}
- rust-arrayref
ExclusiveArch: %{rust_arches}
- rust-arrayvec
ExclusiveArch: %{rust_arches}
- rust-arrayvec0.5
ExclusiveArch: %{rust_arches}
- rust-ascii
ExclusiveArch: %{rust_arches}
- rust-ascii-canvas
ExclusiveArch: %{rust_arches}
- rust-askalono
ExclusiveArch: %{rust_arches}
- rust-askalono-cli
ExclusiveArch: %{rust_arches}
- rust-askama
ExclusiveArch: %{rust_arches}
- rust-askama_derive
ExclusiveArch: %{rust_arches}
- rust-askama_escape
ExclusiveArch: %{rust_arches}
- rust-askama_shared
ExclusiveArch: %{rust_arches}
- rust-asn1
ExclusiveArch: %{rust_arches}
- rust-asn1_derive
ExclusiveArch: %{rust_arches}
- rust-assert-impl
ExclusiveArch: %{rust_arches}
- rust-assert-json-diff
ExclusiveArch: %{rust_arches}
- rust-assert_approx_eq
ExclusiveArch: %{rust_arches}
- rust-assert_cli
ExclusiveArch: %{rust_arches}
- rust-assert_cmd
ExclusiveArch: %{rust_arches}
- rust-assert_fs
ExclusiveArch: %{rust_arches}
- rust-assert_matches
ExclusiveArch: %{rust_arches}
- rust-async-attributes
ExclusiveArch: %{rust_arches}
- rust-async-channel
ExclusiveArch: %{rust_arches}
- rust-async-compression
ExclusiveArch: %{rust_arches}
- rust-async-executor
ExclusiveArch: %{rust_arches}
- rust-async-global-executor
ExclusiveArch: %{rust_arches}
- rust-async-io
ExclusiveArch: %{rust_arches}
- rust-async-lock
ExclusiveArch: %{rust_arches}
- rust-async-mutex
ExclusiveArch: %{rust_arches}
- rust-async-process
ExclusiveArch: %{rust_arches}
- rust-async-std
ExclusiveArch: %{rust_arches}
- rust-async-stream
ExclusiveArch: %{rust_arches}
- rust-async-stream-impl
ExclusiveArch: %{rust_arches}
- rust-async-task
ExclusiveArch: %{rust_arches}
- rust-async-trait
ExclusiveArch: %{rust_arches}
- rust-asyncgit
ExclusiveArch: %{rust_arches}
- rust-atk
ExclusiveArch: %{rust_arches}
- rust-atk-sys
ExclusiveArch: %{rust_arches}
- rust-atom
ExclusiveArch: %{rust_arches}
- rust-atomic
ExclusiveArch: %{rust_arches}
- rust-atomic-traits
ExclusiveArch: %{rust_arches}
- rust-atomic-waker
ExclusiveArch: %{rust_arches}
- rust-atty
ExclusiveArch: %{rust_arches}
- rust-autocfg
ExclusiveArch: %{rust_arches}
- rust-automod
ExclusiveArch: %{rust_arches}
- rust-av-metrics
ExclusiveArch: %{rust_arches}
- rust-average
ExclusiveArch: %{rust_arches}
- rust-awc
ExclusiveArch: %{rust_arches}
- rust-aws-nitro-enclaves-cose
ExclusiveArch: %{rust_arches}
- rust-az
ExclusiveArch: %{rust_arches}
- rust-backtrace
ExclusiveArch: %{rust_arches}
- rust-base100
ExclusiveArch: %{rust_arches}
- rust-base64
ExclusiveArch: %{rust_arches}
- rust-base64-0.10
ExclusiveArch: %{rust_arches}
- rust-base64-0.11
ExclusiveArch: %{rust_arches}
- rust-base64_0.12
ExclusiveArch: %{rust_arches}
- rust-base64ct
ExclusiveArch: %{rust_arches}
- rust-bat
ExclusiveArch: %{rust_arches}
- rust-beef
ExclusiveArch: %{rust_arches}
- rust-below
ExclusiveArch: %{rust_arches}
- rust-below-common
ExclusiveArch: %{rust_arches}
- rust-below-config
ExclusiveArch: %{rust_arches}
- rust-below-dump
ExclusiveArch: %{rust_arches}
- rust-below-model
ExclusiveArch: %{rust_arches}
- rust-below-render
ExclusiveArch: %{rust_arches}
- rust-below-store
ExclusiveArch: %{rust_arches}
- rust-below-view
ExclusiveArch: %{rust_arches}
- rust-below_derive
ExclusiveArch: %{rust_arches}
- rust-bencher
ExclusiveArch: %{rust_arches}
- rust-benfred-read-process-memory
ExclusiveArch: %{rust_arches}
- rust-bigdecimal
ExclusiveArch: %{rust_arches}
- rust-binascii
ExclusiveArch: %{rust_arches}
- rust-bincode
ExclusiveArch: %{rust_arches}
- rust-bincode0.8
ExclusiveArch: %{rust_arches}
- rust-bindgen
ExclusiveArch: %{rust_arches}
- rust-binfarce
ExclusiveArch: %{rust_arches}
- rust-bit-set
ExclusiveArch: %{rust_arches}
- rust-bit-vec
ExclusiveArch: %{rust_arches}
- rust-bitfield
ExclusiveArch: %{rust_arches}
- rust-bitflags
ExclusiveArch: %{rust_arches}
- rust-bitmaps
ExclusiveArch: %{rust_arches}
- rust-bitstream-io
ExclusiveArch: %{rust_arches}
- rust-bitvec
ExclusiveArch: %{rust_arches}
- rust-blake2
ExclusiveArch: %{rust_arches}
- rust-blobby
ExclusiveArch: %{rust_arches}
- rust-blobby0.1
ExclusiveArch: %{rust_arches}
- rust-block-buffer
ExclusiveArch: %{rust_arches}
- rust-block-buffer0.9
ExclusiveArch: %{rust_arches}
- rust-block-modes
ExclusiveArch: %{rust_arches}
- rust-block-padding
ExclusiveArch: %{rust_arches}
- rust-block-padding0.2
ExclusiveArch: %{rust_arches}
- rust-blocking
ExclusiveArch: %{rust_arches}
- rust-blsctl
ExclusiveArch: %{rust_arches}
- rust-bodhi
ExclusiveArch: %{rust_arches}
- rust-bodhi-cli
ExclusiveArch: %{rust_arches}
- rust-bootupd
ExclusiveArch: x86_64 aarch64
- rust-box_drawing
ExclusiveArch: %{rust_arches}
- rust-boxfnonce
ExclusiveArch: %{rust_arches}
- rust-brotli
ExclusiveArch: %{rust_arches}
- rust-brotli-decompressor
ExclusiveArch: %{rust_arches}
- rust-brotli-sys
ExclusiveArch: %{rust_arches}
- rust-brotli2
ExclusiveArch: %{rust_arches}
- rust-bstr
ExclusiveArch: %{rust_arches}
- rust-btrd
ExclusiveArch: %{rust_arches}
- rust-buf_redux
ExclusiveArch: %{rust_arches}
- rust-buffered-reader
ExclusiveArch: %{rust_arches}
- rust-bufstream
ExclusiveArch: %{rust_arches}
- rust-bugreport
ExclusiveArch: %{rust_arches}
- rust-bumpalo
ExclusiveArch: %{rust_arches}
- rust-byte-unit
ExclusiveArch: %{rust_arches}
- rust-byte-unit3
ExclusiveArch: %{rust_arches}
- rust-bytecheck
ExclusiveArch: %{rust_arches}
- rust-bytecheck_derive
ExclusiveArch: %{rust_arches}
- rust-bytecount
ExclusiveArch: %{rust_arches}
- rust-bytelines
ExclusiveArch: %{rust_arches}
- rust-bytemuck
ExclusiveArch: %{rust_arches}
- rust-bytemuck_derive
ExclusiveArch: %{rust_arches}
- rust-byteorder
ExclusiveArch: %{rust_arches}
- rust-bytes
ExclusiveArch: %{rust_arches}
- rust-bytes-cast
ExclusiveArch: %{rust_arches}
- rust-bytes-cast-derive
ExclusiveArch: %{rust_arches}
- rust-bytes0.4
ExclusiveArch: %{rust_arches}
- rust-bytes0.5
ExclusiveArch: %{rust_arches}
- rust-bytesize
ExclusiveArch: %{rust_arches}
- rust-bytestring
ExclusiveArch: %{rust_arches}
- rust-bzip2
ExclusiveArch: %{rust_arches}
- rust-bzip2-sys
ExclusiveArch: %{rust_arches}
- rust-cache-padded
ExclusiveArch: %{rust_arches}
- rust-cairo-rs
ExclusiveArch: %{rust_arches}
- rust-cairo-sys-rs
ExclusiveArch: %{rust_arches}
- rust-calloop
ExclusiveArch: %{rust_arches}
- rust-camino
ExclusiveArch: %{rust_arches}
- rust-cap-async-std
ExclusiveArch: %{rust_arches}
- rust-cap-fs-ext
ExclusiveArch: %{rust_arches}
- rust-cap-primitives
ExclusiveArch: %{rust_arches}
- rust-cap-rand
ExclusiveArch: %{rust_arches}
- rust-cap-std
ExclusiveArch: %{rust_arches}
- rust-cap-tempfile
ExclusiveArch: %{rust_arches}
- rust-cap-time-ext
ExclusiveArch: %{rust_arches}
- rust-capng
ExclusiveArch: %{rust_arches}
- rust-capnp
ExclusiveArch: %{rust_arches}
- rust-capnp-futures
ExclusiveArch: %{rust_arches}
- rust-capnp-rpc
ExclusiveArch: %{rust_arches}
- rust-caps
ExclusiveArch: %{rust_arches}
- rust-cargo
ExclusiveArch: %{rust_arches}
- rust-cargo-bloat
ExclusiveArch: %{rust_arches}
- rust-cargo-c
ExclusiveArch: %{rust_arches}
- rust-cargo-edit
ExclusiveArch: %{rust_arches}
- rust-cargo-husky
ExclusiveArch: %{rust_arches}
- rust-cargo-insta
ExclusiveArch: %{rust_arches}
- rust-cargo-manifest
ExclusiveArch: %{rust_arches}
- rust-cargo-platform
ExclusiveArch: %{rust_arches}
- rust-cargo-readme
ExclusiveArch: %{rust_arches}
- rust-cargo-util
ExclusiveArch: %{rust_arches}
- rust-cargo_metadata
ExclusiveArch: %{rust_arches}
- rust-cascade
ExclusiveArch: %{rust_arches}
- rust-case
ExclusiveArch: %{rust_arches}
- rust-cassowary
ExclusiveArch: %{rust_arches}
- rust-cast
ExclusiveArch: %{rust_arches}
- rust-cbindgen
ExclusiveArch: %{rust_arches}
- rust-cc
ExclusiveArch: %{rust_arches}
- rust-cedarwood
ExclusiveArch: %{rust_arches}
- rust-cexpr
ExclusiveArch: %{rust_arches}
- rust-cfb
ExclusiveArch: %{rust_arches}
- rust-cfg-expr
ExclusiveArch: %{rust_arches}
- rust-cfg-if
ExclusiveArch: %{rust_arches}
- rust-cfg-if0.1
ExclusiveArch: %{rust_arches}
- rust-cgroupfs
ExclusiveArch: %{rust_arches}
- rust-chainerror
ExclusiveArch: %{rust_arches}
- rust-charset
ExclusiveArch: %{rust_arches}
- rust-chbs
ExclusiveArch: %{rust_arches}
- rust-checked_int_cast
ExclusiveArch: %{rust_arches}
- rust-choosier
ExclusiveArch: %{rust_arches}
- rust-chrono
ExclusiveArch: %{rust_arches}
- rust-chrono-humanize
ExclusiveArch: %{rust_arches}
- rust-chrono-tz
ExclusiveArch: %{rust_arches}
- rust-chunked_transfer
ExclusiveArch: %{rust_arches}
- rust-ciborium
ExclusiveArch: %{rust_arches}
- rust-ciborium-io
ExclusiveArch: %{rust_arches}
- rust-ciborium-ll
ExclusiveArch: %{rust_arches}
- rust-cipher
ExclusiveArch: %{rust_arches}
- rust-cipher0.3
ExclusiveArch: %{rust_arches}
- rust-clang-ast
ExclusiveArch: %{rust_arches}
- rust-clang-sys
ExclusiveArch: %{rust_arches}
- rust-clap
ExclusiveArch: %{rust_arches}
- rust-clap-verbosity-flag
ExclusiveArch: %{rust_arches}
- rust-clap2
ExclusiveArch: %{rust_arches}
- rust-clap_complete
ExclusiveArch: %{rust_arches}
- rust-clap_complete_fig
ExclusiveArch: %{rust_arches}
- rust-clap_derive
ExclusiveArch: %{rust_arches}
- rust-clap_generate
ExclusiveArch: %{rust_arches}
- rust-clap_generate_fig
ExclusiveArch: %{rust_arches}
- rust-clap_lex
ExclusiveArch: %{rust_arches}
- rust-clicolors-control
ExclusiveArch: %{rust_arches}
- rust-clircle
ExclusiveArch: %{rust_arches}
- rust-cmake
ExclusiveArch: %{rust_arches}
- rust-codespan-reporting
ExclusiveArch: %{rust_arches}
- rust-codicon
ExclusiveArch: %{rust_arches}
- rust-color-backtrace
ExclusiveArch: %{rust_arches}
- rust-color_quant
ExclusiveArch: %{rust_arches}
- rust-colored
ExclusiveArch: %{rust_arches}
- rust-colored1
ExclusiveArch: %{rust_arches}
- rust-colored_json
ExclusiveArch: %{rust_arches}
- rust-colorful
ExclusiveArch: %{rust_arches}
- rust-combine
ExclusiveArch: %{rust_arches}
- rust-comfy-table
ExclusiveArch: %{rust_arches}
- rust-common-path
ExclusiveArch: %{rust_arches}
- rust-compiletest_rs
ExclusiveArch: %{rust_arches}
- rust-compress-tools
ExclusiveArch: %{rust_arches}
- rust-comrak
ExclusiveArch: %{rust_arches}
- rust-concurrent-queue
ExclusiveArch: %{rust_arches}
- rust-configparser
ExclusiveArch: %{rust_arches}
- rust-confy
ExclusiveArch: %{rust_arches}
- rust-conhash
ExclusiveArch: %{rust_arches}
- rust-console
ExclusiveArch: %{rust_arches}
- rust-console0.11
ExclusiveArch: %{rust_arches}
- rust-console0.12
ExclusiveArch: %{rust_arches}
- rust-console0.13
ExclusiveArch: %{rust_arches}
- rust-console0.14
ExclusiveArch: %{rust_arches}
- rust-console0.9
ExclusiveArch: %{rust_arches}
- rust-console_error_panic_hook
ExclusiveArch: %{rust_arches}
- rust-const-cstr
ExclusiveArch: %{rust_arches}
- rust-const-oid
ExclusiveArch: %{rust_arches}
- rust-const-random
ExclusiveArch: %{rust_arches}
- rust-const-random-macro
ExclusiveArch: %{rust_arches}
- rust-const_fn
ExclusiveArch: %{rust_arches}
- rust-constant_time_eq
ExclusiveArch: %{rust_arches}
- rust-content_inspector
ExclusiveArch: %{rust_arches}
- rust-conv
ExclusiveArch: %{rust_arches}
- rust-convert_case
ExclusiveArch: %{rust_arches}
- rust-cookie
ExclusiveArch: %{rust_arches}
- rust-cookie-factory
ExclusiveArch: %{rust_arches}
- rust-cookie0.14
ExclusiveArch: %{rust_arches}
- rust-cookie_store
ExclusiveArch: %{rust_arches}
- rust-cookie_store0.12
ExclusiveArch: %{rust_arches}
- rust-coolor
ExclusiveArch: %{rust_arches}
- rust-copydeps
ExclusiveArch: %{rust_arches}
- rust-copyless
ExclusiveArch: %{rust_arches}
- rust-copypasta
ExclusiveArch: %{rust_arches}
- rust-cordic
ExclusiveArch: %{rust_arches}
- rust-coreos-installer
ExclusiveArch: %{rust_arches}
- rust-count-zeroes
ExclusiveArch: %{rust_arches}
- rust-counted-array
ExclusiveArch: %{rust_arches}
- rust-cpio
ExclusiveArch: %{rust_arches}
- rust-cpp_demangle
ExclusiveArch: %{rust_arches}
- rust-cpufeatures
ExclusiveArch: %{rust_arches}
- rust-cpython
ExclusiveArch: %{rust_arches}
- rust-cranelift-bforest
ExclusiveArch: %{rust_arches}
- rust-cranelift-codegen
ExclusiveArch: x86_64 aarch64 s390x
- rust-cranelift-codegen-meta
ExclusiveArch: %{rust_arches}
- rust-cranelift-codegen-shared
ExclusiveArch: %{rust_arches}
- rust-cranelift-entity
ExclusiveArch: %{rust_arches}
- rust-cranelift-frontend
ExclusiveArch: x86_64 aarch64 s390x
- rust-cranelift-native
ExclusiveArch: x86_64 aarch64 s390x
- rust-cranelift-wasm
ExclusiveArch: x86_64 aarch64 s390x
- rust-crates-io
ExclusiveArch: %{rust_arches}
- rust-crc
ExclusiveArch: %{rust_arches}
- rust-crc-catalog
ExclusiveArch: %{rust_arches}
- rust-crc32fast
ExclusiveArch: %{rust_arches}
- rust-criterion
ExclusiveArch: %{rust_arches}
- rust-criterion-plot
ExclusiveArch: %{rust_arches}
- rust-crossbeam
ExclusiveArch: %{rust_arches}
- rust-crossbeam-channel
ExclusiveArch: %{rust_arches}
- rust-crossbeam-channel0.4
ExclusiveArch: %{rust_arches}
- rust-crossbeam-deque
ExclusiveArch: %{rust_arches}
- rust-crossbeam-deque0.7
ExclusiveArch: %{rust_arches}
- rust-crossbeam-epoch
ExclusiveArch: %{rust_arches}
- rust-crossbeam-epoch0.8
ExclusiveArch: %{rust_arches}
- rust-crossbeam-queue
ExclusiveArch: %{rust_arches}
- rust-crossbeam-queue0.2
ExclusiveArch: %{rust_arches}
- rust-crossbeam-utils
ExclusiveArch: %{rust_arches}
- rust-crossbeam-utils0.7
ExclusiveArch: %{rust_arches}
- rust-crossbeam0.7
ExclusiveArch: %{rust_arches}
- rust-crossfont
ExclusiveArch: %{rust_arches}
- rust-crossterm
ExclusiveArch: %{rust_arches}
- rust-crossterm0.17
ExclusiveArch: %{rust_arches}
- rust-crossterm0.19
ExclusiveArch: %{rust_arches}
- rust-crosstermion
ExclusiveArch: %{rust_arches}
- rust-crunchy
ExclusiveArch: %{rust_arches}
- rust-crypto-bigint
ExclusiveArch: %{rust_arches}
- rust-crypto-common
ExclusiveArch: %{rust_arches}
- rust-crypto-hash
ExclusiveArch: %{rust_arches}
- rust-crypto-mac
ExclusiveArch: %{rust_arches}
- rust-cryptoki
ExclusiveArch: %{rust_arches}
- rust-cryptoki-sys
ExclusiveArch: %{rust_arches}
- rust-cstr_core
ExclusiveArch: %{rust_arches}
- rust-csv
ExclusiveArch: %{rust_arches}
- rust-csv-core
ExclusiveArch: %{rust_arches}
- rust-ct-logs
ExclusiveArch: %{rust_arches}
- rust-ctor
ExclusiveArch: %{rust_arches}
- rust-ctr
ExclusiveArch: %{rust_arches}
- rust-ctr0.8
ExclusiveArch: %{rust_arches}
- rust-ctrlc
ExclusiveArch: %{rust_arches}
- rust-cty
ExclusiveArch: %{rust_arches}
- rust-curl
ExclusiveArch: %{rust_arches}
- rust-curl-sys
ExclusiveArch: %{rust_arches}
- rust-cursive
ExclusiveArch: %{rust_arches}
- rust-cursive-tabs
ExclusiveArch: %{rust_arches}
- rust-cursive_buffered_backend
ExclusiveArch: %{rust_arches}
- rust-cursive_core
ExclusiveArch: %{rust_arches}
- rust-curve25519-dalek
ExclusiveArch: %{rust_arches}
- rust-custom_derive
ExclusiveArch: %{rust_arches}
- rust-custom_error
ExclusiveArch: %{rust_arches}
- rust-cxx
ExclusiveArch: %{rust_arches}
- rust-cxx-build
ExclusiveArch: %{rust_arches}
- rust-cxx-gen
ExclusiveArch: %{rust_arches}
- rust-cxxbridge-flags
ExclusiveArch: %{rust_arches}
- rust-cxxbridge-macro
ExclusiveArch: %{rust_arches}
- rust-darling
ExclusiveArch: %{rust_arches}
- rust-darling0.12
ExclusiveArch: %{rust_arches}
- rust-darling_core
ExclusiveArch: %{rust_arches}
- rust-darling_core0.12
ExclusiveArch: %{rust_arches}
- rust-darling_macro
ExclusiveArch: %{rust_arches}
- rust-darling_macro0.12
ExclusiveArch: %{rust_arches}
- rust-dashmap
ExclusiveArch: %{rust_arches}
- rust-data-encoding
ExclusiveArch: %{rust_arches}
- rust-data-url
ExclusiveArch: %{rust_arches}
- rust-datetime
ExclusiveArch: %{rust_arches}
- rust-dav1d-sys
ExclusiveArch: %{rust_arches}
- rust-dbus
ExclusiveArch: %{rust_arches}
- rust-dbus-codegen
ExclusiveArch: %{rust_arches}
- rust-dbus-crossroads
ExclusiveArch: %{rust_arches}
- rust-dbus-tokio
ExclusiveArch: %{rust_arches}
- rust-dbus-tree
ExclusiveArch: %{rust_arches}
- rust-dbus0.8
ExclusiveArch: %{rust_arches}
- rust-decimal
ExclusiveArch: %{rust_arches}
- rust-defer-drop
ExclusiveArch: %{rust_arches}
- rust-deflate
ExclusiveArch: %{rust_arches}
- rust-deflate0.8
ExclusiveArch: %{rust_arches}
- rust-defmac
ExclusiveArch: %{rust_arches}
- rust-der
ExclusiveArch: %{rust_arches}
- rust-der_derive
ExclusiveArch: %{rust_arches}
- rust-derivative
ExclusiveArch: %{rust_arches}
- rust-derive-new
ExclusiveArch: %{rust_arches}
- rust-derive_arbitrary
ExclusiveArch: %{rust_arches}
- rust-derive_arbitrary0.4
ExclusiveArch: %{rust_arches}
- rust-derive_builder
ExclusiveArch: %{rust_arches}
- rust-derive_builder0.9
ExclusiveArch: %{rust_arches}
- rust-derive_builder_core
ExclusiveArch: %{rust_arches}
- rust-derive_builder_core0.9
ExclusiveArch: %{rust_arches}
- rust-derive_builder_macro
ExclusiveArch: %{rust_arches}
- rust-derive_more
ExclusiveArch: %{rust_arches}
- rust-des
ExclusiveArch: %{rust_arches}
- rust-des0.7
ExclusiveArch: %{rust_arches}
- rust-desed
ExclusiveArch: %{rust_arches}
- rust-deunicode
ExclusiveArch: %{rust_arches}
- rust-devicemapper
ExclusiveArch: %{rust_arches}
- rust-devicemapper-sys
ExclusiveArch: %{rust_arches}
- rust-dialoguer
ExclusiveArch: %{rust_arches}
- rust-diesel
ExclusiveArch: %{rust_arches}
- rust-diesel_derives
ExclusiveArch: %{rust_arches}
- rust-diff
ExclusiveArch: %{rust_arches}
- rust-difference
ExclusiveArch: %{rust_arches}
- rust-difflib
ExclusiveArch: %{rust_arches}
- rust-digest
ExclusiveArch: %{rust_arches}
- rust-digest0.9
ExclusiveArch: %{rust_arches}
- rust-digest_auth
ExclusiveArch: %{rust_arches}
- rust-directories
ExclusiveArch: %{rust_arches}
- rust-directories-next
ExclusiveArch: %{rust_arches}
- rust-dirs
ExclusiveArch: %{rust_arches}
- rust-dirs-next
ExclusiveArch: %{rust_arches}
- rust-dirs-sys
ExclusiveArch: %{rust_arches}
- rust-dirs-sys-next
ExclusiveArch: %{rust_arches}
- rust-dirs2
ExclusiveArch: %{rust_arches}
- rust-dirs3
ExclusiveArch: %{rust_arches}
- rust-diskonaut
ExclusiveArch: %{rust_arches}
- rust-displaydoc
ExclusiveArch: %{rust_arches}
- rust-dissimilar
ExclusiveArch: %{rust_arches}
- rust-dlib
ExclusiveArch: %{rust_arches}
- rust-dlv-list
ExclusiveArch: %{rust_arches}
- rust-dns-lookup
ExclusiveArch: %{rust_arches}
- rust-doc-comment
ExclusiveArch: %{rust_arches}
- rust-docmatic
ExclusiveArch: %{rust_arches}
- rust-docopt
ExclusiveArch: %{rust_arches}
- rust-dotenv
ExclusiveArch: %{rust_arches}
- rust-downcast
ExclusiveArch: %{rust_arches}
- rust-downcast-rs
ExclusiveArch: %{rust_arches}
- rust-drg
ExclusiveArch: %{rust_arches}
- rust-dtoa
ExclusiveArch: %{rust_arches}
- rust-dua-cli
ExclusiveArch: %{rust_arches}
- rust-duct
ExclusiveArch: %{rust_arches}
- rust-dummy
ExclusiveArch: %{rust_arches}
- rust-dunce
ExclusiveArch: %{rust_arches}
- rust-dutree
ExclusiveArch: %{rust_arches}
- rust-dyn-clone
ExclusiveArch: %{rust_arches}
- rust-easy-cast
ExclusiveArch: %{rust_arches}
- rust-easy-parallel
ExclusiveArch: %{rust_arches}
- rust-edit
ExclusiveArch: %{rust_arches}
- rust-edit-distance
ExclusiveArch: %{rust_arches}
- rust-either
ExclusiveArch: %{rust_arches}
- rust-elasticlunr-rs
ExclusiveArch: %{rust_arches}
- rust-elf
ExclusiveArch: %{rust_arches}
- rust-elfcat
ExclusiveArch: %{rust_arches}
- rust-email-encoding
ExclusiveArch: %{rust_arches}
- rust-ena
ExclusiveArch: %{rust_arches}
- rust-encode_unicode
ExclusiveArch: %{rust_arches}
- rust-encoding
ExclusiveArch: %{rust_arches}
- rust-encoding-index-japanese
ExclusiveArch: %{rust_arches}
- rust-encoding-index-korean
ExclusiveArch: %{rust_arches}
- rust-encoding-index-simpchinese
ExclusiveArch: %{rust_arches}
- rust-encoding-index-singlebyte
ExclusiveArch: %{rust_arches}
- rust-encoding-index-tradchinese
ExclusiveArch: %{rust_arches}
- rust-encoding_index_tests
ExclusiveArch: %{rust_arches}
- rust-encoding_rs
ExclusiveArch: %{rust_arches}
- rust-encoding_rs_io
ExclusiveArch: %{rust_arches}
- rust-endian-type
ExclusiveArch: %{rust_arches}
- rust-enquote
ExclusiveArch: %{rust_arches}
- rust-entities
ExclusiveArch: %{rust_arches}
- rust-enum-as-inner
ExclusiveArch: %{rust_arches}
- rust-enum-iterator
ExclusiveArch: %{rust_arches}
- rust-enum-iterator-derive
ExclusiveArch: %{rust_arches}
- rust-enum-map
ExclusiveArch: %{rust_arches}
- rust-enum-map-derive
ExclusiveArch: %{rust_arches}
- rust-enumflags2
ExclusiveArch: %{rust_arches}
- rust-enumflags2_0.6
ExclusiveArch: %{rust_arches}
- rust-enumflags2_derive
ExclusiveArch: %{rust_arches}
- rust-enumflags2_derive0.6
ExclusiveArch: %{rust_arches}
- rust-enumset
ExclusiveArch: %{rust_arches}
- rust-enumset_derive
ExclusiveArch: %{rust_arches}
- rust-env_logger
ExclusiveArch: %{rust_arches}
- rust-env_logger0.4
ExclusiveArch: %{rust_arches}
- rust-env_logger0.5
ExclusiveArch: %{rust_arches}
- rust-env_logger0.6
ExclusiveArch: %{rust_arches}
- rust-env_logger0.7
ExclusiveArch: %{rust_arches}
- rust-env_logger0.8
ExclusiveArch: %{rust_arches}
- rust-env_proxy
ExclusiveArch: %{rust_arches}
- rust-environment
ExclusiveArch: %{rust_arches}
- rust-envsubst
ExclusiveArch: %{rust_arches}
- rust-epoll
ExclusiveArch: %{rust_arches}
- rust-erased-serde
ExclusiveArch: %{rust_arches}
- rust-err-derive
ExclusiveArch: %{rust_arches}
- rust-errno
ExclusiveArch: %{rust_arches}
- rust-error-chain
ExclusiveArch: %{rust_arches}
- rust-escargot
ExclusiveArch: %{rust_arches}
- rust-ethtool
ExclusiveArch: %{rust_arches}
- rust-event-listener
ExclusiveArch: %{rust_arches}
- rust-exa
ExclusiveArch: %{rust_arches}
- rust-executable-path
ExclusiveArch: %{rust_arches}
- rust-exitcode
ExclusiveArch: %{rust_arches}
- rust-exitfailure
ExclusiveArch: %{rust_arches}
- rust-expat-sys
ExclusiveArch: %{rust_arches}
- rust-eyre
ExclusiveArch: %{rust_arches}
- rust-faccess
ExclusiveArch: %{rust_arches}
- rust-fail
ExclusiveArch: %{rust_arches}
- rust-failure
ExclusiveArch: %{rust_arches}
- rust-failure-tools
ExclusiveArch: %{rust_arches}
- rust-failure_derive
ExclusiveArch: %{rust_arches}
- rust-fake
ExclusiveArch: %{rust_arches}
- rust-fake-simd
ExclusiveArch: %{rust_arches}
- rust-fallible-iterator
ExclusiveArch: %{rust_arches}
- rust-fallible-streaming-iterator
ExclusiveArch: %{rust_arches}
- rust-fancy-regex
ExclusiveArch: %{rust_arches}
- rust-fastrand
ExclusiveArch: %{rust_arches}
- rust-fatfs
ExclusiveArch: %{rust_arches}
- rust-fb_procfs
ExclusiveArch: %{rust_arches}
- rust-fbthrift_codegen_includer_proc_macro
ExclusiveArch: %{rust_arches}
- rust-fd-find
ExclusiveArch: %{rust_arches}
- rust-fd-lock
ExclusiveArch: %{rust_arches}
- rust-fdlimit
ExclusiveArch: %{rust_arches}
- rust-fedora
ExclusiveArch: %{rust_arches}
- rust-fedora-coreos-pinger
ExclusiveArch: %{rust_arches}
- rust-fedora-update-feedback
ExclusiveArch: %{rust_arches}
- rust-femme
ExclusiveArch: %{rust_arches}
- rust-fern
ExclusiveArch: %{rust_arches}
- rust-ffsend
ExclusiveArch: %{rust_arches}
- rust-ffsend-api
ExclusiveArch: %{rust_arches}
- rust-field-offset
ExclusiveArch: %{rust_arches}
- rust-file-per-thread-logger
ExclusiveArch: %{rust_arches}
- rust-filedescriptor
ExclusiveArch: %{rust_arches}
- rust-filesize
ExclusiveArch: %{rust_arches}
- rust-filetime
ExclusiveArch: %{rust_arches}
- rust-filetreelist
ExclusiveArch: %{rust_arches}
- rust-find-crate
ExclusiveArch: %{rust_arches}
- rust-findshlibs
ExclusiveArch: %{rust_arches}
- rust-fixed
ExclusiveArch: %{rust_arches}
- rust-fixedbitset
ExclusiveArch: %{rust_arches}
- rust-flate2
ExclusiveArch: %{rust_arches}
- rust-float-cmp
ExclusiveArch: %{rust_arches}
- rust-float-ord
ExclusiveArch: %{rust_arches}
- rust-fluent
ExclusiveArch: %{rust_arches}
- rust-fluent-bundle
ExclusiveArch: %{rust_arches}
- rust-fluent-langneg
ExclusiveArch: %{rust_arches}
- rust-fluent-syntax
ExclusiveArch: %{rust_arches}
- rust-fn-error-context
ExclusiveArch: %{rust_arches}
- rust-fnv
ExclusiveArch: %{rust_arches}
- rust-font-kit
ExclusiveArch: %{rust_arches}
- rust-foreign-types
ExclusiveArch: %{rust_arches}
- rust-foreign-types-macros
ExclusiveArch: %{rust_arches}
- rust-foreign-types-shared
ExclusiveArch: %{rust_arches}
- rust-foreign-types-shared0.1
ExclusiveArch: %{rust_arches}
- rust-foreign-types0.3
ExclusiveArch: %{rust_arches}
- rust-form_urlencoded
ExclusiveArch: %{rust_arches}
- rust-format-bytes
ExclusiveArch: %{rust_arches}
- rust-format-bytes-macros
ExclusiveArch: %{rust_arches}
- rust-fragile
ExclusiveArch: %{rust_arches}
- rust-freetype
ExclusiveArch: %{rust_arches}
- rust-freetype-rs
ExclusiveArch: %{rust_arches}
- rust-freetype-sys
ExclusiveArch: %{rust_arches}
- rust-fs-err
ExclusiveArch: %{rust_arches}
- rust-fs-set-times
ExclusiveArch: %{rust_arches}
- rust-fs2
ExclusiveArch: %{rust_arches}
- rust-fs_extra
ExclusiveArch: %{rust_arches}
- rust-fscommon
ExclusiveArch: %{rust_arches}
- rust-fslock
ExclusiveArch: %{rust_arches}
- rust-funty
ExclusiveArch: %{rust_arches}
- rust-futf
ExclusiveArch: %{rust_arches}
- rust-futures
ExclusiveArch: %{rust_arches}
- rust-futures-channel
ExclusiveArch: %{rust_arches}
- rust-futures-core
ExclusiveArch: %{rust_arches}
- rust-futures-cpupool
ExclusiveArch: %{rust_arches}
- rust-futures-executor
ExclusiveArch: %{rust_arches}
- rust-futures-io
ExclusiveArch: %{rust_arches}
- rust-futures-lite
ExclusiveArch: %{rust_arches}
- rust-futures-macro
ExclusiveArch: %{rust_arches}
- rust-futures-sink
ExclusiveArch: %{rust_arches}
- rust-futures-task
ExclusiveArch: %{rust_arches}
- rust-futures-test
ExclusiveArch: %{rust_arches}
- rust-futures-timer
ExclusiveArch: %{rust_arches}
- rust-futures-util
ExclusiveArch: %{rust_arches}
- rust-futures0.1
ExclusiveArch: %{rust_arches}
- rust-fuzzy-matcher
ExclusiveArch: %{rust_arches}
- rust-fxhash
ExclusiveArch: %{rust_arches}
- rust-gdk
ExclusiveArch: %{rust_arches}
- rust-gdk-pixbuf
ExclusiveArch: %{rust_arches}
- rust-gdk-pixbuf-sys
ExclusiveArch: %{rust_arches}
- rust-gdk-sys
ExclusiveArch: %{rust_arches}
- rust-gdk4
ExclusiveArch: %{rust_arches}
- rust-gdk4-sys
ExclusiveArch: %{rust_arches}
- rust-generic-array
ExclusiveArch: %{rust_arches}
- rust-generic-array0.12
ExclusiveArch: %{rust_arches}
- rust-genetlink
ExclusiveArch: %{rust_arches}
- rust-getch
ExclusiveArch: %{rust_arches}
- rust-gethostname
ExclusiveArch: %{rust_arches}
- rust-getopts
ExclusiveArch: %{rust_arches}
- rust-getrandom
ExclusiveArch: %{rust_arches}
- rust-getrandom0.1
ExclusiveArch: %{rust_arches}
- rust-getset
ExclusiveArch: %{rust_arches}
- rust-gettext-rs
ExclusiveArch: %{rust_arches}
- rust-gettext-sys
ExclusiveArch: %{rust_arches}
- rust-gh-emoji
ExclusiveArch: %{rust_arches}
- rust-ghash
ExclusiveArch: %{rust_arches}
- rust-ghost
ExclusiveArch: %{rust_arches}
- rust-gif
ExclusiveArch: %{rust_arches}
- rust-gimli
ExclusiveArch: %{rust_arches}
- rust-gio
ExclusiveArch: %{rust_arches}
- rust-gio-sys
ExclusiveArch: %{rust_arches}
- rust-gir-format-check
ExclusiveArch: %{rust_arches}
- rust-git-delta
ExclusiveArch: %{rust_arches}
- rust-git-version
ExclusiveArch: %{rust_arches}
- rust-git-version-macro
ExclusiveArch: %{rust_arches}
- rust-git2
ExclusiveArch: %{rust_arches}
- rust-git2-curl
ExclusiveArch: %{rust_arches}
- rust-gitui
ExclusiveArch: %{rust_arches}
- rust-gl_generator
ExclusiveArch: %{rust_arches}
- rust-glam
ExclusiveArch: %{rust_arches}
- rust-glib
ExclusiveArch: %{rust_arches}
- rust-glib-macros
ExclusiveArch: %{rust_arches}
- rust-glib-sys
ExclusiveArch: %{rust_arches}
- rust-glob
ExclusiveArch: %{rust_arches}
- rust-globset
ExclusiveArch: %{rust_arches}
- rust-globwalk
ExclusiveArch: %{rust_arches}
- rust-glutin
ExclusiveArch: %{rust_arches}
- rust-glutin_egl_sys
ExclusiveArch: %{rust_arches}
- rust-glutin_glx_sys
ExclusiveArch: %{rust_arches}
- rust-gobject-sys
ExclusiveArch: %{rust_arches}
- rust-goblin
ExclusiveArch: %{rust_arches}
- rust-gptman
ExclusiveArch: %{rust_arches}
- rust-graphene-rs
ExclusiveArch: %{rust_arches}
- rust-graphene-sys
ExclusiveArch: %{rust_arches}
- rust-greetd_ipc
ExclusiveArch: %{rust_arches}
- rust-grep
ExclusiveArch: %{rust_arches}
- rust-grep-cli
ExclusiveArch: %{rust_arches}
- rust-grep-matcher
ExclusiveArch: %{rust_arches}
- rust-grep-pcre2
ExclusiveArch: %{rust_arches}
- rust-grep-printer
ExclusiveArch: %{rust_arches}
- rust-grep-regex
ExclusiveArch: %{rust_arches}
- rust-grep-searcher
ExclusiveArch: %{rust_arches}
- rust-groupable
ExclusiveArch: %{rust_arches}
- rust-gsk4
ExclusiveArch: %{rust_arches}
- rust-gsk4-sys
ExclusiveArch: %{rust_arches}
- rust-gstreamer
ExclusiveArch: %{rust_arches}
- rust-gstreamer-audio
ExclusiveArch: %{rust_arches}
- rust-gstreamer-audio-sys
ExclusiveArch: %{rust_arches}
- rust-gstreamer-base
ExclusiveArch: %{rust_arches}
- rust-gstreamer-base-sys
ExclusiveArch: %{rust_arches}
- rust-gstreamer-editing-services
ExclusiveArch: %{rust_arches}
- rust-gstreamer-editing-services-sys
ExclusiveArch: %{rust_arches}
- rust-gstreamer-pbutils
ExclusiveArch: %{rust_arches}
- rust-gstreamer-pbutils-sys
ExclusiveArch: %{rust_arches}
- rust-gstreamer-player
ExclusiveArch: %{rust_arches}
- rust-gstreamer-player-sys
ExclusiveArch: %{rust_arches}
- rust-gstreamer-sys
ExclusiveArch: %{rust_arches}
- rust-gstreamer-video
ExclusiveArch: %{rust_arches}
- rust-gstreamer-video-sys
ExclusiveArch: %{rust_arches}
- rust-gtk
ExclusiveArch: %{rust_arches}
- rust-gtk-sys
ExclusiveArch: %{rust_arches}
- rust-gtk3-macros
ExclusiveArch: %{rust_arches}
- rust-gtk4
ExclusiveArch: %{rust_arches}
- rust-gtk4-macros
ExclusiveArch: %{rust_arches}
- rust-gtk4-sys
ExclusiveArch: %{rust_arches}
- rust-gzip-header
ExclusiveArch: %{rust_arches}
- rust-h2
ExclusiveArch: %{rust_arches}
- rust-h2_0.2
ExclusiveArch: %{rust_arches}
- rust-half
ExclusiveArch: %{rust_arches}
- rust-hamcrest2
ExclusiveArch: %{rust_arches}
- rust-handlebars
ExclusiveArch: %{rust_arches}
- rust-hashbrown
ExclusiveArch: %{rust_arches}
- rust-hashbrown0.9
ExclusiveArch: %{rust_arches}
- rust-hashlink
ExclusiveArch: %{rust_arches}
- rust-headers
ExclusiveArch: %{rust_arches}
- rust-headers-core
ExclusiveArch: %{rust_arches}
- rust-heapsize
ExclusiveArch: %{rust_arches}
- rust-heatseeker
ExclusiveArch: %{rust_arches}
- rust-heck
ExclusiveArch: %{rust_arches}
- rust-heck0.3
ExclusiveArch: %{rust_arches}
- rust-helvum
ExclusiveArch: %{rust_arches}
- rust-hex
ExclusiveArch: %{rust_arches}
- rust-hex-literal
ExclusiveArch: %{rust_arches}
- rust-hex-literal-impl
ExclusiveArch: %{rust_arches}
- rust-hex-literal0.2
ExclusiveArch: %{rust_arches}
- rust-hexyl
ExclusiveArch: %{rust_arches}
- rust-hidapi
ExclusiveArch: %{rust_arches}
- rust-hkdf
ExclusiveArch: %{rust_arches}
- rust-hkdf0.11
ExclusiveArch: %{rust_arches}
- rust-hmac
ExclusiveArch: %{rust_arches}
- rust-hmac0.11
ExclusiveArch: %{rust_arches}
- rust-home
ExclusiveArch: %{rust_arches}
- rust-hostname
ExclusiveArch: %{rust_arches}
- rust-hostname-validator
ExclusiveArch: %{rust_arches}
- rust-html-escape
ExclusiveArch: %{rust_arches}
- rust-html2pango
ExclusiveArch: %{rust_arches}
- rust-html5ever
ExclusiveArch: %{rust_arches}
- rust-http
ExclusiveArch: %{rust_arches}
- rust-http-body
ExclusiveArch: %{rust_arches}
- rust-http-body0.3
ExclusiveArch: %{rust_arches}
- rust-http0.1
ExclusiveArch: %{rust_arches}
- rust-httparse
ExclusiveArch: %{rust_arches}
- rust-httpdate
ExclusiveArch: %{rust_arches}
- rust-human-panic
ExclusiveArch: %{rust_arches}
- rust-human-sort
ExclusiveArch: %{rust_arches}
- rust-humansize
ExclusiveArch: %{rust_arches}
- rust-humantime
ExclusiveArch: %{rust_arches}
- rust-humantime-serde
ExclusiveArch: %{rust_arches}
- rust-humantime1
ExclusiveArch: %{rust_arches}
- rust-hyper
ExclusiveArch: %{rust_arches}
- rust-hyper-native-tls
ExclusiveArch: %{rust_arches}
- rust-hyper-rustls
ExclusiveArch: %{rust_arches}
- rust-hyper-staticfile
ExclusiveArch: %{rust_arches}
- rust-hyper-tls
ExclusiveArch: %{rust_arches}
- rust-hyper-tls0.4
ExclusiveArch: %{rust_arches}
- rust-hyper0.10
ExclusiveArch: %{rust_arches}
- rust-hyper0.13
ExclusiveArch: %{rust_arches}
- rust-hyperfine
ExclusiveArch: %{rust_arches}
- rust-i18n-config
ExclusiveArch: %{rust_arches}
- rust-i18n-embed
ExclusiveArch: %{rust_arches}
- rust-i18n-embed-fl
ExclusiveArch: %{rust_arches}
- rust-i18n-embed-impl
ExclusiveArch: %{rust_arches}
- rust-i3ipc
ExclusiveArch: %{rust_arches}
- rust-iai
ExclusiveArch: %{rust_arches}
- rust-id-arena
ExclusiveArch: %{rust_arches}
- rust-ident_case
ExclusiveArch: %{rust_arches}
- rust-idna
ExclusiveArch: %{rust_arches}
- rust-idna0.1
ExclusiveArch: %{rust_arches}
- rust-ifcfg-devname
ExclusiveArch: %{rust_arches}
- rust-ignition-config
ExclusiveArch: %{rust_arches}
- rust-ignore
ExclusiveArch: %{rust_arches}
- rust-im-rc
ExclusiveArch: %{rust_arches}
- rust-image
ExclusiveArch: %{rust_arches}
- rust-image-roll
ExclusiveArch: %{rust_arches}
- rust-imgref
ExclusiveArch: %{rust_arches}
- rust-indenter
ExclusiveArch: %{rust_arches}
- rust-indexmap
ExclusiveArch: %{rust_arches}
- rust-indicatif
ExclusiveArch: %{rust_arches}
- rust-indicatif0.15
ExclusiveArch: %{rust_arches}
- rust-indoc
ExclusiveArch: %{rust_arches}
- rust-infer
ExclusiveArch: %{rust_arches}
- rust-inferno
ExclusiveArch: %{rust_arches}
- rust-inlinable_string
ExclusiveArch: %{rust_arches}
- rust-inotify
ExclusiveArch: %{rust_arches}
- rust-inotify-sys
ExclusiveArch: %{rust_arches}
- rust-inout
ExclusiveArch: %{rust_arches}
- rust-input_buffer
ExclusiveArch: %{rust_arches}
- rust-insta
ExclusiveArch: %{rust_arches}
- rust-instant
ExclusiveArch: %{rust_arches}
- rust-integer-encoding
ExclusiveArch: %{rust_arches}
- rust-interpolate_name
ExclusiveArch: %{rust_arches}
- rust-intervaltree
ExclusiveArch: %{rust_arches}
- rust-intl-memoizer
ExclusiveArch: %{rust_arches}
- rust-intl_pluralrules
ExclusiveArch: %{rust_arches}
- rust-invalidstring
ExclusiveArch: %{rust_arches}
- rust-inventory
ExclusiveArch: %{rust_arches}
- rust-inventory-impl
ExclusiveArch: %{rust_arches}
- rust-inventory0.1
ExclusiveArch: %{rust_arches}
- rust-io-extras
ExclusiveArch: %{rust_arches}
- rust-io-lifetimes
ExclusiveArch: %{rust_arches}
- rust-ioctl-rs
ExclusiveArch: %{rust_arches}
- rust-iocuddle
ExclusiveArch: %{rust_arches}
- rust-iovec
ExclusiveArch: %{rust_arches}
- rust-ipnet
ExclusiveArch: %{rust_arches}
- rust-ipnetwork
ExclusiveArch: %{rust_arches}
- rust-ipnetwork0.17
ExclusiveArch: %{rust_arches}
- rust-iptables
ExclusiveArch: %{rust_arches}
- rust-iron
ExclusiveArch: %{rust_arches}
- rust-is-terminal
ExclusiveArch: %{rust_arches}
- rust-is_ci
ExclusiveArch: %{rust_arches}
- rust-is_debug
ExclusiveArch: %{rust_arches}
- rust-iso8601
ExclusiveArch: %{rust_arches}
- rust-iter-read
ExclusiveArch: %{rust_arches}
- rust-itertools
ExclusiveArch: %{rust_arches}
- rust-itertools-num
ExclusiveArch: %{rust_arches}
- rust-itertools0.8
ExclusiveArch: %{rust_arches}
- rust-itertools0.9
ExclusiveArch: %{rust_arches}
- rust-itoa
ExclusiveArch: %{rust_arches}
- rust-itoa0.4
ExclusiveArch: %{rust_arches}
- rust-ivf
ExclusiveArch: %{rust_arches}
- rust-jieba-rs
ExclusiveArch: %{rust_arches}
- rust-jobserver
ExclusiveArch: %{rust_arches}
- rust-josekit
ExclusiveArch: %{rust_arches}
- rust-jpeg-decoder
ExclusiveArch: %{rust_arches}
- rust-jql
ExclusiveArch: %{rust_arches}
- rust-js-sys
ExclusiveArch: %{rust_arches}
- rust-json
ExclusiveArch: %{rust_arches}
- rust-json_value_merge
ExclusiveArch: %{rust_arches}
- rust-just
ExclusiveArch: %{rust_arches}
- rust-jwalk
ExclusiveArch: %{rust_arches}
- rust-k9
ExclusiveArch: %{rust_arches}
- rust-keccak
ExclusiveArch: %{rust_arches}
- rust-khronos_api
ExclusiveArch: %{rust_arches}
- rust-kstring
ExclusiveArch: %{rust_arches}
- rust-kv-log-macro
ExclusiveArch: %{rust_arches}
- rust-lab
ExclusiveArch: %{rust_arches}
- rust-lalrpop
ExclusiveArch: %{rust_arches}
- rust-lalrpop-util
ExclusiveArch: %{rust_arches}
- rust-language-tags
ExclusiveArch: %{rust_arches}
- rust-lazy_static
ExclusiveArch: %{rust_arches}
- rust-lazycell
ExclusiveArch: %{rust_arches}
- rust-leb128
ExclusiveArch: %{rust_arches}
- rust-lev_distance
ExclusiveArch: %{rust_arches}
- rust-lexical-core
ExclusiveArch: %{rust_arches}
- rust-lexiclean
ExclusiveArch: %{rust_arches}
- rust-lexopt
ExclusiveArch: %{rust_arches}
- rust-libblkid-rs
ExclusiveArch: %{rust_arches}
- rust-libblkid-rs-sys
ExclusiveArch: %{rust_arches}
- rust-libbpf-cargo
ExclusiveArch: %{rust_arches}
- rust-libbpf-rs
ExclusiveArch: %{rust_arches}
- rust-libbpf-sys
ExclusiveArch: %{rust_arches}
- rust-libc
ExclusiveArch: %{rust_arches}
- rust-libcryptsetup-rs
ExclusiveArch: %{rust_arches}
- rust-libcryptsetup-rs-sys
ExclusiveArch: %{rust_arches}
- rust-libdbus-sys
ExclusiveArch: %{rust_arches}
- rust-libflate
ExclusiveArch: %{rust_arches}
- rust-libflate_lz77
ExclusiveArch: %{rust_arches}
- rust-libgit2-sys
ExclusiveArch: %{rust_arches}
- rust-libhandy
ExclusiveArch: %{rust_arches}
- rust-libhandy-sys
ExclusiveArch: %{rust_arches}
- rust-libloading
ExclusiveArch: %{rust_arches}
- rust-libloading0.6
ExclusiveArch: %{rust_arches}
- rust-libm
ExclusiveArch: %{rust_arches}
- rust-libmount
ExclusiveArch: %{rust_arches}
- rust-libnotcurses-sys
ExclusiveArch: %{rust_arches}
- rust-liboverdrop
ExclusiveArch: %{rust_arches}
- rust-libpulse-binding
ExclusiveArch: %{rust_arches}
- rust-libpulse-sys
ExclusiveArch: %{rust_arches}
- rust-libseccomp-sys
ExclusiveArch: %{rust_arches}
- rust-libslirp
ExclusiveArch: %{rust_arches}
- rust-libslirp-sys
ExclusiveArch: %{rust_arches}
- rust-libspa
ExclusiveArch: %{rust_arches}
- rust-libspa-sys
ExclusiveArch: %{rust_arches}
- rust-libsqlite3-sys
ExclusiveArch: %{rust_arches}
- rust-libssh2-sys
ExclusiveArch: %{rust_arches}
- rust-libsystemd
ExclusiveArch: %{rust_arches}
- rust-libudev
ExclusiveArch: %{rust_arches}
- rust-libudev-sys
ExclusiveArch: %{rust_arches}
- rust-libxml
ExclusiveArch: %{rust_arches}
- rust-libz-sys
ExclusiveArch: %{rust_arches}
- rust-line-wrap
ExclusiveArch: %{rust_arches}
- rust-link-cplusplus
ExclusiveArch: %{rust_arches}
- rust-linked-hash-map
ExclusiveArch: %{rust_arches}
- rust-linkify
ExclusiveArch: %{rust_arches}
- rust-linreg
ExclusiveArch: %{rust_arches}
- rust-linux-raw-sys
ExclusiveArch: %{rust_arches}
- rust-linux_proc
ExclusiveArch: %{rust_arches}
- rust-lipsum
ExclusiveArch: %{rust_arches}
- rust-listenfd
ExclusiveArch: %{rust_arches}
- rust-lmdb
ExclusiveArch: %{rust_arches}
- rust-lmdb-sys
ExclusiveArch: %{rust_arches}
- rust-local-channel
ExclusiveArch: %{rust_arches}
- rust-local-waker
ExclusiveArch: %{rust_arches}
- rust-locale
ExclusiveArch: %{rust_arches}
- rust-locale_config
ExclusiveArch: %{rust_arches}
- rust-lock_api
ExclusiveArch: %{rust_arches}
- rust-lockfree
ExclusiveArch: %{rust_arches}
- rust-log
ExclusiveArch: %{rust_arches}
- rust-log-mdc
ExclusiveArch: %{rust_arches}
- rust-log-panics
ExclusiveArch: %{rust_arches}
- rust-log0.3
ExclusiveArch: %{rust_arches}
- rust-loggerv
ExclusiveArch: %{rust_arches}
- rust-loopdev
ExclusiveArch: %{rust_arches}
- rust-lru-cache
ExclusiveArch: %{rust_arches}
- rust-lscolors
ExclusiveArch: %{rust_arches}
- rust-lsd
ExclusiveArch: %{rust_arches}
- rust-lzma-sys
ExclusiveArch: %{rust_arches}
- rust-lzw
ExclusiveArch: %{rust_arches}
- rust-mac
ExclusiveArch: %{rust_arches}
- rust-mac_address
ExclusiveArch: %{rust_arches}
- rust-macro-attr
ExclusiveArch: %{rust_arches}
- rust-madvr_parse
ExclusiveArch: %{rust_arches}
- rust-maildir
ExclusiveArch: %{rust_arches}
- rust-mailparse
ExclusiveArch: %{rust_arches}
- rust-man
ExclusiveArch: %{rust_arches}
- rust-maplit
ExclusiveArch: %{rust_arches}
- rust-markup5ever
ExclusiveArch: %{rust_arches}
- rust-markup5ever_rcdom
ExclusiveArch: %{rust_arches}
- rust-match_cfg
ExclusiveArch: %{rust_arches}
- rust-matches
ExclusiveArch: %{rust_arches}
- rust-matrixcompare
ExclusiveArch: %{rust_arches}
- rust-matrixcompare-core
ExclusiveArch: %{rust_arches}
- rust-matrixcompare-mock
ExclusiveArch: %{rust_arches}
- rust-matrixmultiply
ExclusiveArch: %{rust_arches}
- rust-maxminddb
ExclusiveArch: %{rust_arches}
- rust-maybe-owned
ExclusiveArch: %{rust_arches}
- rust-maybe-uninit
ExclusiveArch: %{rust_arches}
- rust-mbox
ExclusiveArch: %{rust_arches}
- rust-mbrman
ExclusiveArch: %{rust_arches}
- rust-md-5
ExclusiveArch: %{rust_arches}
- rust-md-5_0.9
ExclusiveArch: %{rust_arches}
- rust-md5
ExclusiveArch: %{rust_arches}
- rust-mdl
ExclusiveArch: %{rust_arches}
- rust-memchr
ExclusiveArch: %{rust_arches}
- rust-memfd
ExclusiveArch: %{rust_arches}
- rust-memmap
ExclusiveArch: %{rust_arches}
- rust-memmap2
ExclusiveArch: %{rust_arches}
- rust-memmap2_0.3
ExclusiveArch: %{rust_arches}
- rust-memmem
ExclusiveArch: %{rust_arches}
- rust-memoffset
ExclusiveArch: %{rust_arches}
- rust-memoffset0.5
ExclusiveArch: %{rust_arches}
- rust-memsec
ExclusiveArch: %{rust_arches}
- rust-micro-timer
ExclusiveArch: %{rust_arches}
- rust-micro-timer-macros
ExclusiveArch: %{rust_arches}
- rust-miette
ExclusiveArch: %{rust_arches}
- rust-miette-derive
ExclusiveArch: %{rust_arches}
- rust-mime
ExclusiveArch: %{rust_arches}
- rust-mime0.2
ExclusiveArch: %{rust_arches}
- rust-mime_guess
ExclusiveArch: %{rust_arches}
- rust-mime_guess1
ExclusiveArch: %{rust_arches}
- rust-minify-html
ExclusiveArch: %{rust_arches}
- rust-minimad
ExclusiveArch: %{rust_arches}
- rust-minimal-lexical
ExclusiveArch: %{rust_arches}
- rust-miniz-sys
ExclusiveArch: %{rust_arches}
- rust-miniz_oxide
ExclusiveArch: %{rust_arches}
- rust-miniz_oxide0.3
ExclusiveArch: %{rust_arches}
- rust-miniz_oxide_c_api
ExclusiveArch: %{rust_arches}
- rust-mint
ExclusiveArch: %{rust_arches}
- rust-mio
ExclusiveArch: %{rust_arches}
- rust-mio-extras
ExclusiveArch: %{rust_arches}
- rust-mio-uds
ExclusiveArch: %{rust_arches}
- rust-mio0.6
ExclusiveArch: %{rust_arches}
- rust-mio0.7
ExclusiveArch: %{rust_arches}
- rust-mktemp
ExclusiveArch: %{rust_arches}
- rust-mnt
ExclusiveArch: %{rust_arches}
- rust-mockall
ExclusiveArch: %{rust_arches}
- rust-mockall_derive
ExclusiveArch: %{rust_arches}
- rust-mockall_double
ExclusiveArch: %{rust_arches}
- rust-mockito
ExclusiveArch: %{rust_arches}
- rust-modifier
ExclusiveArch: %{rust_arches}
- rust-more-asserts
ExclusiveArch: %{rust_arches}
- rust-muldiv
ExclusiveArch: %{rust_arches}
- rust-multer
ExclusiveArch: %{rust_arches}
- rust-multimap
ExclusiveArch: %{rust_arches}
- rust-multipart
ExclusiveArch: %{rust_arches}
- rust-mustache
ExclusiveArch: %{rust_arches}
- rust-nalgebra
ExclusiveArch: %{rust_arches}
- rust-nalgebra-macros
ExclusiveArch: %{rust_arches}
- rust-nasm-rs
ExclusiveArch: %{rust_arches}
- rust-native-tls
ExclusiveArch: %{rust_arches}
- rust-natord
ExclusiveArch: %{rust_arches}
- rust-navi
ExclusiveArch: %{rust_arches}
- rust-nb-connect
ExclusiveArch: %{rust_arches}
- rust-ncurses
ExclusiveArch: %{rust_arches}
- rust-net2
ExclusiveArch: %{rust_arches}
- rust-netlink-packet-core
ExclusiveArch: %{rust_arches}
- rust-netlink-packet-generic
ExclusiveArch: %{rust_arches}
- rust-netlink-packet-route
ExclusiveArch: %{rust_arches}
- rust-netlink-packet-utils
ExclusiveArch: %{rust_arches}
- rust-netlink-proto
ExclusiveArch: %{rust_arches}
- rust-netlink-sys
ExclusiveArch: %{rust_arches}
- rust-netmap_sys
ExclusiveArch: %{rust_arches}
- rust-nettle
ExclusiveArch: %{rust_arches}
- rust-nettle-sys
ExclusiveArch: %{rust_arches}
- rust-new_debug_unreachable
ExclusiveArch: %{rust_arches}
- rust-newtype_derive
ExclusiveArch: %{rust_arches}
- rust-nibble_vec
ExclusiveArch: %{rust_arches}
- rust-nix
ExclusiveArch: %{rust_arches}
- rust-nix0.14
ExclusiveArch: %{rust_arches}
- rust-nix0.17
ExclusiveArch: %{rust_arches}
- rust-nix0.18
ExclusiveArch: %{rust_arches}
- rust-nix0.20
ExclusiveArch: %{rust_arches}
- rust-nix0.22
ExclusiveArch: %{rust_arches}
- rust-no-panic
ExclusiveArch: %{rust_arches}
- rust-nodrop
ExclusiveArch: %{rust_arches}
- rust-nohash-hasher
ExclusiveArch: %{rust_arches}
- rust-nom
ExclusiveArch: %{rust_arches}
- rust-nom4
ExclusiveArch: %{rust_arches}
- rust-nom5
ExclusiveArch: %{rust_arches}
- rust-noop_proc_macro
ExclusiveArch: %{rust_arches}
- rust-normalize-line-endings
ExclusiveArch: %{rust_arches}
- rust-notify
ExclusiveArch: %{rust_arches}
- rust-notify-rust
ExclusiveArch: %{rust_arches}
- rust-nu-ansi-term
ExclusiveArch: %{rust_arches}
- rust-nu-engine
ExclusiveArch: %{rust_arches}
- rust-nu-glob
ExclusiveArch: %{rust_arches}
- rust-nu-json
ExclusiveArch: %{rust_arches}
- rust-nu-parser
ExclusiveArch: %{rust_arches}
- rust-nu-path
ExclusiveArch: %{rust_arches}
- rust-nu-protocol
ExclusiveArch: %{rust_arches}
- rust-nu-utils
ExclusiveArch: %{rust_arches}
- rust-num
ExclusiveArch: %{rust_arches}
- rust-num-bigint
ExclusiveArch: %{rust_arches}
- rust-num-bigint-dig
ExclusiveArch: %{rust_arches}
- rust-num-bigint0.3
ExclusiveArch: %{rust_arches}
- rust-num-complex
ExclusiveArch: %{rust_arches}
- rust-num-complex0.3
ExclusiveArch: %{rust_arches}
- rust-num-derive
ExclusiveArch: %{rust_arches}
- rust-num-format
ExclusiveArch: %{rust_arches}
- rust-num-integer
ExclusiveArch: %{rust_arches}
- rust-num-iter
ExclusiveArch: %{rust_arches}
- rust-num-rational
ExclusiveArch: %{rust_arches}
- rust-num-rational0.3
ExclusiveArch: %{rust_arches}
- rust-num-traits
ExclusiveArch: %{rust_arches}
- rust-num-traits0.1
ExclusiveArch: %{rust_arches}
- rust-num0.3
ExclusiveArch: %{rust_arches}
- rust-num_cpus
ExclusiveArch: %{rust_arches}
- rust-num_enum
ExclusiveArch: %{rust_arches}
- rust-num_enum_derive
ExclusiveArch: %{rust_arches}
- rust-number_prefix
ExclusiveArch: %{rust_arches}
- rust-numtoa
ExclusiveArch: %{rust_arches}
- rust-oauth2
ExclusiveArch: %{rust_arches}
- rust-object
ExclusiveArch: %{rust_arches}
- rust-odds
ExclusiveArch: %{rust_arches}
- rust-oid
ExclusiveArch: %{rust_arches}
- rust-once_cell
ExclusiveArch: %{rust_arches}
- rust-onig
ExclusiveArch: %{rust_arches}
- rust-onig_sys
ExclusiveArch: %{rust_arches}
- rust-oorandom
ExclusiveArch: %{rust_arches}
- rust-opaque-debug
ExclusiveArch: %{rust_arches}
- rust-open
ExclusiveArch: %{rust_arches}
- rust-open1
ExclusiveArch: %{rust_arches}
- rust-openat
ExclusiveArch: %{rust_arches}
- rust-openat-ext
ExclusiveArch: %{rust_arches}
- rust-opener
ExclusiveArch: %{rust_arches}
- rust-openssh-keys
ExclusiveArch: %{rust_arches}
- rust-openssl
ExclusiveArch: %{rust_arches}
- rust-openssl-kdf
ExclusiveArch: %{rust_arches}
- rust-openssl-probe
ExclusiveArch: %{rust_arches}
- rust-openssl-sys
ExclusiveArch: %{rust_arches}
- rust-option-operations
ExclusiveArch: %{rust_arches}
- rust-ord_subset
ExclusiveArch: %{rust_arches}
- rust-ordered-float
ExclusiveArch: %{rust_arches}
- rust-ordered-multimap
ExclusiveArch: %{rust_arches}
- rust-os-release
ExclusiveArch: %{rust_arches}
- rust-os_info
ExclusiveArch: %{rust_arches}
- rust-os_pipe
ExclusiveArch: %{rust_arches}
- rust-os_pipe0.9
ExclusiveArch: %{rust_arches}
- rust-os_str_bytes
ExclusiveArch: %{rust_arches}
- rust-os_type
ExclusiveArch: %{rust_arches}
- rust-osmesa-sys
ExclusiveArch: %{rust_arches}
- rust-osstrtools
ExclusiveArch: %{rust_arches}
- rust-ouroboros
ExclusiveArch: %{rust_arches}
- rust-ouroboros_macro
ExclusiveArch: %{rust_arches}
- rust-overload
ExclusiveArch: %{rust_arches}
- rust-owned-alloc
ExclusiveArch: %{rust_arches}
- rust-owning_ref
ExclusiveArch: %{rust_arches}
- rust-owo-colors
ExclusiveArch: %{rust_arches}
- rust-packaging
ExclusiveArch: %{rust_arches}
- rust-pad
ExclusiveArch: %{rust_arches}
- rust-page_size
ExclusiveArch: %{rust_arches}
- rust-pager
ExclusiveArch: %{rust_arches}
- rust-palette
ExclusiveArch: %{rust_arches}
- rust-palette_derive
ExclusiveArch: %{rust_arches}
- rust-pam
ExclusiveArch: %{rust_arches}
- rust-pam-sys
ExclusiveArch: %{rust_arches}
- rust-pancurses
ExclusiveArch: %{rust_arches}
- rust-pango
ExclusiveArch: %{rust_arches}
- rust-pango-sys
ExclusiveArch: %{rust_arches}
- rust-pangocairo
ExclusiveArch: %{rust_arches}
- rust-pangocairo-sys
ExclusiveArch: %{rust_arches}
- rust-paris
ExclusiveArch: %{rust_arches}
- rust-parity-wasm
ExclusiveArch: %{rust_arches}
- rust-parking
ExclusiveArch: %{rust_arches}
- rust-parking_lot
ExclusiveArch: %{rust_arches}
- rust-parking_lot0.11
ExclusiveArch: %{rust_arches}
- rust-parking_lot_core
ExclusiveArch: %{rust_arches}
- rust-parking_lot_core0.8
ExclusiveArch: %{rust_arches}
- rust-parse-zoneinfo
ExclusiveArch: %{rust_arches}
- rust-parse_cfg
ExclusiveArch: %{rust_arches}
- rust-parsec-client
ExclusiveArch: %{rust_arches}
- rust-parsec-interface
ExclusiveArch: %{rust_arches}
- rust-partial-io
ExclusiveArch: %{rust_arches}
- rust-partition-identity
ExclusiveArch: %{rust_arches}
- rust-password-hash
ExclusiveArch: %{rust_arches}
- rust-paste
ExclusiveArch: %{rust_arches}
- rust-path-absolutize
ExclusiveArch: %{rust_arches}
- rust-path-dedot
ExclusiveArch: %{rust_arches}
- rust-path-slash
ExclusiveArch: %{rust_arches}
- rust-pathdiff
ExclusiveArch: %{rust_arches}
- rust-pathfinder_geometry
ExclusiveArch: %{rust_arches}
- rust-pathfinder_simd
ExclusiveArch: %{rust_arches}
- rust-pbkdf2
ExclusiveArch: %{rust_arches}
- rust-pbr
ExclusiveArch: %{rust_arches}
- rust-pcap
ExclusiveArch: %{rust_arches}
- rust-pcre2
ExclusiveArch: %{rust_arches}
- rust-pcre2-sys
ExclusiveArch: %{rust_arches}
- rust-peeking_take_while
ExclusiveArch: %{rust_arches}
- rust-peg
ExclusiveArch: %{rust_arches}
- rust-peg-macros
ExclusiveArch: %{rust_arches}
- rust-peg-runtime
ExclusiveArch: %{rust_arches}
- rust-peg0.5
ExclusiveArch: %{rust_arches}
- rust-pem
ExclusiveArch: %{rust_arches}
- rust-pem-rfc7468
ExclusiveArch: %{rust_arches}
- rust-pem0.8
ExclusiveArch: %{rust_arches}
- rust-percent-encoding
ExclusiveArch: %{rust_arches}
- rust-percent-encoding1
ExclusiveArch: %{rust_arches}
- rust-peresil
ExclusiveArch: %{rust_arches}
- rust-permutate
ExclusiveArch: %{rust_arches}
- rust-permutohedron
ExclusiveArch: %{rust_arches}
- rust-pest
ExclusiveArch: %{rust_arches}
- rust-pest_derive
ExclusiveArch: %{rust_arches}
- rust-pest_generator
ExclusiveArch: %{rust_arches}
- rust-pest_meta
ExclusiveArch: %{rust_arches}
- rust-petgraph
ExclusiveArch: %{rust_arches}
- rust-phf
ExclusiveArch: %{rust_arches}
- rust-phf0.7
ExclusiveArch: %{rust_arches}
- rust-phf0.8
ExclusiveArch: %{rust_arches}
- rust-phf_codegen
ExclusiveArch: %{rust_arches}
- rust-phf_codegen0.7
ExclusiveArch: %{rust_arches}
- rust-phf_generator
ExclusiveArch: %{rust_arches}
- rust-phf_generator0.7
ExclusiveArch: %{rust_arches}
- rust-phf_generator0.8
ExclusiveArch: %{rust_arches}
- rust-phf_macros
ExclusiveArch: %{rust_arches}
- rust-phf_macros0.7
ExclusiveArch: %{rust_arches}
- rust-phf_macros0.8
ExclusiveArch: %{rust_arches}
- rust-phf_shared
ExclusiveArch: %{rust_arches}
- rust-phf_shared0.7
ExclusiveArch: %{rust_arches}
- rust-phf_shared0.8
ExclusiveArch: %{rust_arches}
- rust-picky-asn1
ExclusiveArch: %{rust_arches}
- rust-picky-asn1-der
ExclusiveArch: %{rust_arches}
- rust-picky-asn1-x509
ExclusiveArch: %{rust_arches}
- rust-pico-args
ExclusiveArch: %{rust_arches}
- rust-pid
ExclusiveArch: %{rust_arches}
- rust-pin-project
ExclusiveArch: %{rust_arches}
- rust-pin-project-internal
ExclusiveArch: %{rust_arches}
- rust-pin-project-internal0.4
ExclusiveArch: %{rust_arches}
- rust-pin-project-lite
ExclusiveArch: %{rust_arches}
- rust-pin-project-lite0.1
ExclusiveArch: %{rust_arches}
- rust-pin-project0.4
ExclusiveArch: %{rust_arches}
- rust-pin-utils
ExclusiveArch: %{rust_arches}
- rust-pipe
ExclusiveArch: %{rust_arches}
- rust-piper
ExclusiveArch: %{rust_arches}
- rust-pipewire
ExclusiveArch: %{rust_arches}
- rust-pipewire-sys
ExclusiveArch: %{rust_arches}
- rust-pkcs1
ExclusiveArch: %{rust_arches}
- rust-pkcs11
ExclusiveArch: %{rust_arches}
- rust-pkcs5
ExclusiveArch: %{rust_arches}
- rust-pkcs8
ExclusiveArch: %{rust_arches}
- rust-pkg-config
ExclusiveArch: %{rust_arches}
- rust-plain
ExclusiveArch: %{rust_arches}
- rust-pleaser
ExclusiveArch: %{rust_arches}
- rust-plist
ExclusiveArch: %{rust_arches}
- rust-plotlib
ExclusiveArch: %{rust_arches}
- rust-plotters
ExclusiveArch: %{rust_arches}
- rust-plotters-backend
ExclusiveArch: %{rust_arches}
- rust-plotters-bitmap
ExclusiveArch: %{rust_arches}
- rust-plotters-svg
ExclusiveArch: %{rust_arches}
- rust-plugin
ExclusiveArch: %{rust_arches}
- rust-pnet_base
ExclusiveArch: %{rust_arches}
- rust-pnet_datalink
ExclusiveArch: %{rust_arches}
- rust-pnet_sys
ExclusiveArch: %{rust_arches}
- rust-png
ExclusiveArch: %{rust_arches}
- rust-png0.16
ExclusiveArch: %{rust_arches}
- rust-podio
ExclusiveArch: %{rust_arches}
- rust-polling
ExclusiveArch: %{rust_arches}
- rust-polyval
ExclusiveArch: %{rust_arches}
- rust-pom
ExclusiveArch: %{rust_arches}
- rust-pommes
ExclusiveArch: %{rust_arches}
- rust-ppv-lite86
ExclusiveArch: %{rust_arches}
- rust-pq-sys
ExclusiveArch: %{rust_arches}
- rust-precomputed-hash
ExclusiveArch: %{rust_arches}
- rust-predicates
ExclusiveArch: %{rust_arches}
- rust-predicates-core
ExclusiveArch: %{rust_arches}
- rust-predicates-tree
ExclusiveArch: %{rust_arches}
- rust-predicates1
ExclusiveArch: %{rust_arches}
- rust-pretty
ExclusiveArch: %{rust_arches}
- rust-pretty-git-prompt
ExclusiveArch: %{rust_arches}
- rust-pretty-hex
ExclusiveArch: %{rust_arches}
- rust-pretty_assertions
ExclusiveArch: %{rust_arches}
- rust-pretty_assertions0.6
ExclusiveArch: %{rust_arches}
- rust-pretty_assertions0.7
ExclusiveArch: %{rust_arches}
- rust-pretty_env_logger
ExclusiveArch: %{rust_arches}
- rust-prettytable-rs
ExclusiveArch: %{rust_arches}
- rust-proc-macro-crate
ExclusiveArch: %{rust_arches}
- rust-proc-macro-crate0.1
ExclusiveArch: %{rust_arches}
- rust-proc-macro-error
ExclusiveArch: %{rust_arches}
- rust-proc-macro-error-attr
ExclusiveArch: %{rust_arches}
- rust-proc-macro-hack
ExclusiveArch: %{rust_arches}
- rust-proc-macro2
ExclusiveArch: %{rust_arches}
- rust-proc-macro2-0.4
ExclusiveArch: %{rust_arches}
- rust-proc-maps
ExclusiveArch: %{rust_arches}
- rust-proc-mounts
ExclusiveArch: %{rust_arches}
- rust-proc-quote-impl
ExclusiveArch: %{rust_arches}
- rust-process_control
ExclusiveArch: %{rust_arches}
- rust-process_path
ExclusiveArch: %{rust_arches}
- rust-procfs
ExclusiveArch: %{rust_arches}
- rust-procs
ExclusiveArch: %{rust_arches}
- rust-progress-streams
ExclusiveArch: %{rust_arches}
- rust-prometheus
ExclusiveArch: %{rust_arches}
- rust-proptest
ExclusiveArch: %{rust_arches}
- rust-proptest-derive
ExclusiveArch: %{rust_arches}
- rust-proptest0.10
ExclusiveArch: %{rust_arches}
- rust-prost
ExclusiveArch: %{rust_arches}
- rust-prost-build
ExclusiveArch: %{rust_arches}
- rust-prost-derive
ExclusiveArch: %{rust_arches}
- rust-prost-types
ExclusiveArch: %{rust_arches}
- rust-protobuf
ExclusiveArch: %{rust_arches}
- rust-protobuf-codegen
ExclusiveArch: %{rust_arches}
- rust-protobuf-codegen-pure
ExclusiveArch: %{rust_arches}
- rust-protoc
ExclusiveArch: %{rust_arches}
- rust-protoc-rust
ExclusiveArch: %{rust_arches}
- rust-psa-crypto
ExclusiveArch: %{rust_arches}
- rust-psa-crypto-sys
ExclusiveArch: %{rust_arches}
- rust-psl-types
ExclusiveArch: %{rust_arches}
- rust-psm
ExclusiveArch: %{rust_arches}
- rust-ptr_meta
ExclusiveArch: %{rust_arches}
- rust-ptr_meta_derive
ExclusiveArch: %{rust_arches}
- rust-publicsuffix
ExclusiveArch: %{rust_arches}
- rust-publicsuffix1
ExclusiveArch: %{rust_arches}
- rust-pulldown-cmark
ExclusiveArch: %{rust_arches}
- rust-pulse
ExclusiveArch: %{rust_arches}
- rust-pure-rust-locales
ExclusiveArch: %{rust_arches}
- rust-pyo3
ExclusiveArch: %{rust_arches}
- rust-pyo3-build-config
ExclusiveArch: %{rust_arches}
- rust-pyo3-macros
ExclusiveArch: %{rust_arches}
- rust-pyo3-macros-backend
ExclusiveArch: %{rust_arches}
- rust-python-launcher
ExclusiveArch: %{rust_arches}
- rust-python3-sys
ExclusiveArch: %{rust_arches}
- rust-qr2term
ExclusiveArch: %{rust_arches}
- rust-qrcode
ExclusiveArch: %{rust_arches}
- rust-qstring
ExclusiveArch: %{rust_arches}
- rust-quantiles
ExclusiveArch: %{rust_arches}
- rust-quick-error
ExclusiveArch: %{rust_arches}
- rust-quick-error1
ExclusiveArch: %{rust_arches}
- rust-quick-xml
ExclusiveArch: %{rust_arches}
- rust-quickcheck
ExclusiveArch: %{rust_arches}
- rust-quickcheck0.6
ExclusiveArch: %{rust_arches}
- rust-quickcheck0.9
ExclusiveArch: %{rust_arches}
- rust-quickcheck_macros
ExclusiveArch: %{rust_arches}
- rust-quickersort
ExclusiveArch: %{rust_arches}
- rust-quicli
ExclusiveArch: %{rust_arches}
- rust-quote
ExclusiveArch: %{rust_arches}
- rust-quote0.3
ExclusiveArch: %{rust_arches}
- rust-quote0.6
ExclusiveArch: %{rust_arches}
- rust-quoted_printable
ExclusiveArch: %{rust_arches}
- rust-r2d2
ExclusiveArch: %{rust_arches}
- rust-radium
ExclusiveArch: %{rust_arches}
- rust-radix_trie
ExclusiveArch: %{rust_arches}
- rust-rand
ExclusiveArch: %{rust_arches}
- rust-rand0.4
ExclusiveArch: %{rust_arches}
- rust-rand0.5
ExclusiveArch: %{rust_arches}
- rust-rand0.6
ExclusiveArch: %{rust_arches}
- rust-rand0.7
ExclusiveArch: %{rust_arches}
- rust-rand_chacha
ExclusiveArch: %{rust_arches}
- rust-rand_chacha0.1
ExclusiveArch: %{rust_arches}
- rust-rand_chacha0.2
ExclusiveArch: %{rust_arches}
- rust-rand_core
ExclusiveArch: %{rust_arches}
- rust-rand_core0.3
ExclusiveArch: %{rust_arches}
- rust-rand_core0.4
ExclusiveArch: %{rust_arches}
- rust-rand_core0.5
ExclusiveArch: %{rust_arches}
- rust-rand_distr
ExclusiveArch: %{rust_arches}
- rust-rand_hc
ExclusiveArch: %{rust_arches}
- rust-rand_hc0.1
ExclusiveArch: %{rust_arches}
- rust-rand_isaac
ExclusiveArch: %{rust_arches}
- rust-rand_isaac0.1
ExclusiveArch: %{rust_arches}
- rust-rand_jitter
ExclusiveArch: %{rust_arches}
- rust-rand_jitter0.1
ExclusiveArch: %{rust_arches}
- rust-rand_os
ExclusiveArch: %{rust_arches}
- rust-rand_os0.1
ExclusiveArch: %{rust_arches}
- rust-rand_pcg
ExclusiveArch: %{rust_arches}
- rust-rand_pcg0.1
ExclusiveArch: %{rust_arches}
- rust-rand_pcg0.2
ExclusiveArch: %{rust_arches}
- rust-rand_xorshift
ExclusiveArch: %{rust_arches}
- rust-rand_xorshift0.1
ExclusiveArch: %{rust_arches}
- rust-rand_xorshift0.2
ExclusiveArch: %{rust_arches}
- rust-rand_xoshiro
ExclusiveArch: %{rust_arches}
- rust-random
ExclusiveArch: %{rust_arches}
- rust-random-fast-rng
ExclusiveArch: %{rust_arches}
- rust-random-trait
ExclusiveArch: %{rust_arches}
- rust-randomize
ExclusiveArch: %{rust_arches}
- rust-rav1e
ExclusiveArch: %{rust_arches}
- rust-raw-window-handle
ExclusiveArch: %{rust_arches}
- rust-rawpointer
ExclusiveArch: %{rust_arches}
- rust-rawslice
ExclusiveArch: %{rust_arches}
- rust-rayon
ExclusiveArch: %{rust_arches}
- rust-rayon-core
ExclusiveArch: %{rust_arches}
- rust-rbspy
ExclusiveArch: %{rust_arches}
- rust-rbspy-ruby-structs
ExclusiveArch: %{rust_arches}
- rust-rbspy-testdata
ExclusiveArch: %{rust_arches}
- rust-rd-agent
ExclusiveArch: %{rust_arches}
- rust-rd-agent-intf
ExclusiveArch: %{rust_arches}
- rust-rd-hashd
ExclusiveArch: %{rust_arches}
- rust-rd-hashd-intf
ExclusiveArch: %{rust_arches}
- rust-rd-util
ExclusiveArch: %{rust_arches}
- rust-read-process-memory
ExclusiveArch: %{rust_arches}
- rust-read_input
ExclusiveArch: %{rust_arches}
- rust-readability-fork
ExclusiveArch: %{rust_arches}
- rust-readwrite
ExclusiveArch: %{rust_arches}
- rust-recycler
ExclusiveArch: %{rust_arches}
- rust-ref-cast
ExclusiveArch: %{rust_arches}
- rust-ref-cast-impl
ExclusiveArch: %{rust_arches}
- rust-regalloc
ExclusiveArch: %{rust_arches}
- rust-regex
ExclusiveArch: %{rust_arches}
- rust-regex-automata
ExclusiveArch: %{rust_arches}
- rust-regex-syntax
ExclusiveArch: %{rust_arches}
- rust-region
ExclusiveArch: %{rust_arches}
- rust-relative-path
ExclusiveArch: %{rust_arches}
- rust-relay
ExclusiveArch: %{rust_arches}
- rust-remoteprocess
ExclusiveArch: %{rust_arches}
- rust-remove_dir_all
ExclusiveArch: %{rust_arches}
- rust-rend
ExclusiveArch: %{rust_arches}
- rust-reqwest
ExclusiveArch: %{rust_arches}
- rust-reqwest0.10
ExclusiveArch: %{rust_arches}
- rust-resctl-bench
ExclusiveArch: %{rust_arches}
- rust-resctl-bench-intf
ExclusiveArch: %{rust_arches}
- rust-resctl-demo
ExclusiveArch: %{rust_arches}
- rust-resize
ExclusiveArch: %{rust_arches}
- rust-resolv-conf
ExclusiveArch: %{rust_arches}
- rust-restson
ExclusiveArch: %{rust_arches}
- rust-retry
ExclusiveArch: %{rust_arches}
- rust-rgb
ExclusiveArch: %{rust_arches}
- rust-ring
ExclusiveArch: %{rust_arches}
- rust-ripgrep
ExclusiveArch: %{rust_arches}
- rust-rkyv
ExclusiveArch: %{rust_arches}
- rust-rkyv_derive
ExclusiveArch: %{rust_arches}
- rust-rle-decode-fast
ExclusiveArch: %{rust_arches}
- rust-rmp
ExclusiveArch: %{rust_arches}
- rust-rmp-serde
ExclusiveArch: %{rust_arches}
- rust-rmpv
ExclusiveArch: %{rust_arches}
- rust-roff
ExclusiveArch: %{rust_arches}
- rust-ron
ExclusiveArch: %{rust_arches}
- rust-roxmltree
ExclusiveArch: %{rust_arches}
- rust-rpassword
ExclusiveArch: %{rust_arches}
- rust-rpick
ExclusiveArch: %{rust_arches}
- rust-rsa
ExclusiveArch: %{rust_arches}
- rust-rspec
ExclusiveArch: %{rust_arches}
- rust-rtnetlink
ExclusiveArch: %{rust_arches}
- rust-rusqlite
ExclusiveArch: %{rust_arches}
- rust-rust-embed
ExclusiveArch: %{rust_arches}
- rust-rust-embed-impl
ExclusiveArch: %{rust_arches}
- rust-rust-embed-utils
ExclusiveArch: %{rust_arches}
- rust-rust-ini
ExclusiveArch: %{rust_arches}
- rust-rust-stemmers
ExclusiveArch: %{rust_arches}
- rust-rust_decimal
ExclusiveArch: %{rust_arches}
- rust-rust_hawktracer
ExclusiveArch: %{rust_arches}
- rust-rust_hawktracer_normal_macro
ExclusiveArch: %{rust_arches}
- rust-rust_hawktracer_proc_macro
ExclusiveArch: %{rust_arches}
- rust-rust_hawktracer_sys
ExclusiveArch: %{rust_arches}
- rust-rustbus
ExclusiveArch: %{rust_arches}
- rust-rustbus_derive
ExclusiveArch: %{rust_arches}
- rust-rustc-demangle
ExclusiveArch: %{rust_arches}
- rust-rustc-hash
ExclusiveArch: %{rust_arches}
- rust-rustc-serialize
ExclusiveArch: %{rust_arches}
- rust-rustc-test
ExclusiveArch: %{rust_arches}
- rust-rustc_tools_util
ExclusiveArch: %{rust_arches}
- rust-rustc_version
ExclusiveArch: %{rust_arches}
- rust-rustc_version0.3
ExclusiveArch: %{rust_arches}
- rust-rustcat
ExclusiveArch: %{rust_arches}
- rust-rustdoc-stripper
ExclusiveArch: %{rust_arches}
- rust-rustfilt
ExclusiveArch: %{rust_arches}
- rust-rustfix
ExclusiveArch: %{rust_arches}
- rust-rustio
ExclusiveArch: %{rust_arches}
- rust-rustix
ExclusiveArch: %{rust_arches}
- rust-rustls
ExclusiveArch: %{rust_arches}
- rust-rustls-native-certs
ExclusiveArch: %{rust_arches}
- rust-rustls-pemfile
ExclusiveArch: %{rust_arches}
- rust-rustversion
ExclusiveArch: %{rust_arches}
- rust-rusty-fork
ExclusiveArch: %{rust_arches}
- rust-rustyline
ExclusiveArch: %{rust_arches}
- rust-rustyline-derive
ExclusiveArch: %{rust_arches}
- rust-ryu
ExclusiveArch: %{rust_arches}
- rust-safe-transmute
ExclusiveArch: %{rust_arches}
- rust-safe_arch
ExclusiveArch: %{rust_arches}
- rust-safemem
ExclusiveArch: %{rust_arches}
- rust-salsa20
ExclusiveArch: %{rust_arches}
- rust-same-file
ExclusiveArch: %{rust_arches}
- rust-sass-rs
ExclusiveArch: %{rust_arches}
- rust-sass-sys
ExclusiveArch: %{rust_arches}
- rust-scan_fmt
ExclusiveArch: %{rust_arches}
- rust-scheduled-thread-pool
ExclusiveArch: %{rust_arches}
- rust-scoped-tls
ExclusiveArch: %{rust_arches}
- rust-scoped-tls-hkt
ExclusiveArch: %{rust_arches}
- rust-scoped_threadpool
ExclusiveArch: %{rust_arches}
- rust-scopeguard
ExclusiveArch: %{rust_arches}
- rust-scopetime
ExclusiveArch: %{rust_arches}
- rust-scratch
ExclusiveArch: %{rust_arches}
- rust-scroll
ExclusiveArch: %{rust_arches}
- rust-scroll_derive
ExclusiveArch: %{rust_arches}
- rust-scrypt
ExclusiveArch: %{rust_arches}
- rust-sct
ExclusiveArch: %{rust_arches}
- rust-sd
ExclusiveArch: %{rust_arches}
- rust-sd-notify
ExclusiveArch: %{rust_arches}
- rust-seahash
ExclusiveArch: %{rust_arches}
- rust-seahash3
ExclusiveArch: %{rust_arches}
- rust-secrecy
ExclusiveArch: %{rust_arches}
- rust-secret-service
ExclusiveArch: %{rust_arches}
- rust-self_cell
ExclusiveArch: %{rust_arches}
- rust-semver
ExclusiveArch: %{rust_arches}
- rust-semver-parser
ExclusiveArch: %{rust_arches}
- rust-semver-parser0.9
ExclusiveArch: %{rust_arches}
- rust-semver0.11
ExclusiveArch: %{rust_arches}
- rust-sequoia-autocrypt
ExclusiveArch: %{rust_arches}
- rust-sequoia-ipc
ExclusiveArch: %{rust_arches}
- rust-sequoia-keyring-linter
ExclusiveArch: %{rust_arches}
- rust-sequoia-net
ExclusiveArch: %{rust_arches}
- rust-sequoia-octopus-librnp
ExclusiveArch: %{rust_arches}
- rust-sequoia-openpgp
ExclusiveArch: %{rust_arches}
- rust-sequoia-openpgp-mt
ExclusiveArch: %{rust_arches}
- rust-sequoia-sop
ExclusiveArch: %{rust_arches}
- rust-sequoia-sq
ExclusiveArch: %{rust_arches}
- rust-sequoia-sqv
ExclusiveArch: %{rust_arches}
- rust-serde
ExclusiveArch: %{rust_arches}
- rust-serde-big-array
ExclusiveArch: %{rust_arches}
- rust-serde-pickle
ExclusiveArch: %{rust_arches}
- rust-serde-value
ExclusiveArch: %{rust_arches}
- rust-serde-xml-rs
ExclusiveArch: %{rust_arches}
- rust-serde_bser
ExclusiveArch: %{rust_arches}
- rust-serde_bytes
ExclusiveArch: %{rust_arches}
- rust-serde_cbor
ExclusiveArch: %{rust_arches}
- rust-serde_derive
ExclusiveArch: %{rust_arches}
- rust-serde_fmt
ExclusiveArch: %{rust_arches}
- rust-serde_ignored
ExclusiveArch: %{rust_arches}
- rust-serde_json
ExclusiveArch: %{rust_arches}
- rust-serde_qs
ExclusiveArch: %{rust_arches}
- rust-serde_repr
ExclusiveArch: %{rust_arches}
- rust-serde_stacker
ExclusiveArch: %{rust_arches}
- rust-serde_test
ExclusiveArch: %{rust_arches}
- rust-serde_url_params
ExclusiveArch: %{rust_arches}
- rust-serde_urlencoded
ExclusiveArch: %{rust_arches}
- rust-serde_with
ExclusiveArch: %{rust_arches}
- rust-serde_with_macros
ExclusiveArch: %{rust_arches}
- rust-serde_yaml
ExclusiveArch: %{rust_arches}
- rust-serial-core
ExclusiveArch: %{rust_arches}
- rust-serial_test
ExclusiveArch: %{rust_arches}
- rust-serial_test0.5
ExclusiveArch: %{rust_arches}
- rust-serial_test_derive
ExclusiveArch: %{rust_arches}
- rust-serial_test_derive0.5
ExclusiveArch: %{rust_arches}
- rust-servo-fontconfig
ExclusiveArch: %{rust_arches}
- rust-servo-fontconfig-sys
ExclusiveArch: %{rust_arches}
- rust-sev
ExclusiveArch: %{rust_arches}
- rust-sevctl
ExclusiveArch: x86_64
- rust-sha-1
ExclusiveArch: %{rust_arches}
- rust-sha-1_0.9
ExclusiveArch: %{rust_arches}
- rust-sha1
ExclusiveArch: %{rust_arches}
- rust-sha1_0.6
ExclusiveArch: %{rust_arches}
- rust-sha1_smol
ExclusiveArch: %{rust_arches}
- rust-sha1collisiondetection
ExclusiveArch: %{rust_arches}
- rust-sha2
ExclusiveArch: %{rust_arches}
- rust-sha2_0.9
ExclusiveArch: %{rust_arches}
- rust-sha3
ExclusiveArch: %{rust_arches}
- rust-sha3_0.9
ExclusiveArch: %{rust_arches}
- rust-shadow-rs
ExclusiveArch: %{rust_arches}
- rust-sharded-slab
ExclusiveArch: %{rust_arches}
- rust-shared_child
ExclusiveArch: %{rust_arches}
- rust-shared_library
ExclusiveArch: %{rust_arches}
- rust-shell-escape
ExclusiveArch: %{rust_arches}
- rust-shell-words
ExclusiveArch: %{rust_arches}
- rust-shellexpand
ExclusiveArch: %{rust_arches}
- rust-shellwords
ExclusiveArch: %{rust_arches}
- rust-shlex
ExclusiveArch: %{rust_arches}
- rust-signal
ExclusiveArch: %{rust_arches}
- rust-signal-hook
ExclusiveArch: %{rust_arches}
- rust-signal-hook-mio
ExclusiveArch: %{rust_arches}
- rust-signal-hook-registry
ExclusiveArch: %{rust_arches}
- rust-signal-hook0.1
ExclusiveArch: %{rust_arches}
- rust-silver
ExclusiveArch: %{rust_arches}
- rust-simba
ExclusiveArch: %{rust_arches}
- rust-simd_helpers
ExclusiveArch: %{rust_arches}
- rust-simdutf8
ExclusiveArch: %{rust_arches}
- rust-similar
ExclusiveArch: %{rust_arches}
- rust-similar-asserts
ExclusiveArch: %{rust_arches}
- rust-simple-error
ExclusiveArch: %{rust_arches}
- rust-simple_asn1
ExclusiveArch: %{rust_arches}
- rust-simple_logger
ExclusiveArch: %{rust_arches}
- rust-simplelog
ExclusiveArch: %{rust_arches}
- rust-siphasher
ExclusiveArch: %{rust_arches}
- rust-size
ExclusiveArch: %{rust_arches}
- rust-sized-chunks
ExclusiveArch: %{rust_arches}
- rust-skeptic
ExclusiveArch: %{rust_arches}
- rust-skim
ExclusiveArch: %{rust_arches}
- rust-slab
ExclusiveArch: %{rust_arches}
- rust-slice-deque
ExclusiveArch: %{rust_arches}
- rust-slog
ExclusiveArch: %{rust_arches}
- rust-slog-async
ExclusiveArch: %{rust_arches}
- rust-slog-scope
ExclusiveArch: %{rust_arches}
- rust-slog-term
ExclusiveArch: %{rust_arches}
- rust-slotmap
ExclusiveArch: %{rust_arches}
- rust-slug
ExclusiveArch: %{rust_arches}
- rust-sluice
ExclusiveArch: %{rust_arches}
- rust-smallbitvec
ExclusiveArch: %{rust_arches}
- rust-smallstr
ExclusiveArch: %{rust_arches}
- rust-smallvec
ExclusiveArch: %{rust_arches}
- rust-smart-default
ExclusiveArch: %{rust_arches}
- rust-smawk
ExclusiveArch: %{rust_arches}
- rust-smithay-client-toolkit
ExclusiveArch: %{rust_arches}
- rust-smithay-clipboard
ExclusiveArch: %{rust_arches}
- rust-smol_str
ExclusiveArch: %{rust_arches}
- rust-snafu
ExclusiveArch: %{rust_arches}
- rust-snafu-derive
ExclusiveArch: %{rust_arches}
- rust-snake_case
ExclusiveArch: %{rust_arches}
- rust-socket2
ExclusiveArch: %{rust_arches}
- rust-socket2_0.3
ExclusiveArch: %{rust_arches}
- rust-sop
ExclusiveArch: %{rust_arches}
- rust-spin
ExclusiveArch: %{rust_arches}
- rust-spin0.5
ExclusiveArch: %{rust_arches}
- rust-spin_on
ExclusiveArch: %{rust_arches}
- rust-spinning_top
ExclusiveArch: %{rust_arches}
- rust-spki
ExclusiveArch: %{rust_arches}
- rust-spmc
ExclusiveArch: %{rust_arches}
- rust-ssh-key-dir
ExclusiveArch: %{rust_arches}
- rust-stable_deref_trait
ExclusiveArch: %{rust_arches}
- rust-stacker
ExclusiveArch: %{rust_arches}
- rust-standback
ExclusiveArch: %{rust_arches}
- rust-starship
ExclusiveArch: %{rust_arches}
- rust-starship-battery
ExclusiveArch: %{rust_arches}
- rust-starship_module_config_derive
ExclusiveArch: %{rust_arches}
- rust-static_assertions
ExclusiveArch: %{rust_arches}
- rust-statistical
ExclusiveArch: %{rust_arches}
- rust-statrs
ExclusiveArch: %{rust_arches}
- rust-stb_truetype
ExclusiveArch: %{rust_arches}
- rust-stderrlog
ExclusiveArch: %{rust_arches}
- rust-str_stack
ExclusiveArch: %{rust_arches}
- rust-stratisd_proc_macros
ExclusiveArch: %{rust_arches}
- rust-streaming-stats
ExclusiveArch: %{rust_arches}
- rust-streebog
ExclusiveArch: %{rust_arches}
- rust-streebog0.9
ExclusiveArch: %{rust_arches}
- rust-strict
ExclusiveArch: %{rust_arches}
- rust-string
ExclusiveArch: %{rust_arches}
- rust-string_cache
ExclusiveArch: %{rust_arches}
- rust-string_cache_codegen
ExclusiveArch: %{rust_arches}
- rust-string_cache_shared
ExclusiveArch: %{rust_arches}
- rust-strings
ExclusiveArch: %{rust_arches}
- rust-strip-ansi-escapes
ExclusiveArch: %{rust_arches}
- rust-strsim
ExclusiveArch: %{rust_arches}
- rust-structopt
ExclusiveArch: %{rust_arches}
- rust-structopt-derive
ExclusiveArch: %{rust_arches}
- rust-structopt-derive0.2
ExclusiveArch: %{rust_arches}
- rust-structopt0.2
ExclusiveArch: %{rust_arches}
- rust-strum
ExclusiveArch: %{rust_arches}
- rust-strum0.21
ExclusiveArch: %{rust_arches}
- rust-strum_macros
ExclusiveArch: %{rust_arches}
- rust-strum_macros0.21
ExclusiveArch: %{rust_arches}
- rust-subprocess
ExclusiveArch: %{rust_arches}
- rust-subtle
ExclusiveArch: %{rust_arches}
- rust-sudo_plugin
ExclusiveArch: %{rust_arches}
- rust-sudo_plugin-sys
ExclusiveArch: %{rust_arches}
- rust-supports-color
ExclusiveArch: %{rust_arches}
- rust-supports-hyperlinks
ExclusiveArch: %{rust_arches}
- rust-supports-unicode
ExclusiveArch: %{rust_arches}
- rust-sval
ExclusiveArch: %{rust_arches}
- rust-sval_derive
ExclusiveArch: %{rust_arches}
- rust-sval_json
ExclusiveArch: %{rust_arches}
- rust-svg
ExclusiveArch: %{rust_arches}
- rust-svg_metadata
ExclusiveArch: %{rust_arches}
- rust-svgtypes
ExclusiveArch: %{rust_arches}
- rust-sxd-document
ExclusiveArch: %{rust_arches}
- rust-syn
ExclusiveArch: %{rust_arches}
- rust-syn0.15
ExclusiveArch: %{rust_arches}
- rust-synom
ExclusiveArch: %{rust_arches}
- rust-synstructure
ExclusiveArch: %{rust_arches}
- rust-syntect
ExclusiveArch: %{rust_arches}
- rust-sys-info
ExclusiveArch: %{rust_arches}
- rust-sys-locale
ExclusiveArch: %{rust_arches}
- rust-sysctl
ExclusiveArch: %{rust_arches}
- rust-sysinfo
ExclusiveArch: %{rust_arches}
- rust-syslog
ExclusiveArch: %{rust_arches}
- rust-system-deps
ExclusiveArch: %{rust_arches}
- rust-system-interface
ExclusiveArch: %{rust_arches}
- rust-system76_ectool
ExclusiveArch: %{rust_arches}
- rust-tabular
ExclusiveArch: %{rust_arches}
- rust-tabwriter
ExclusiveArch: %{rust_arches}
- rust-take
ExclusiveArch: %{rust_arches}
- rust-take_mut
ExclusiveArch: %{rust_arches}
- rust-tap
ExclusiveArch: %{rust_arches}
- rust-tar
ExclusiveArch: %{rust_arches}
- rust-target
ExclusiveArch: %{rust_arches}
- rust-target-lexicon
ExclusiveArch: %{rust_arches}
- rust-tealdeer
ExclusiveArch: %{rust_arches}
- rust-teloxide
ExclusiveArch: %{rust_arches}
- rust-teloxide-macros
ExclusiveArch: %{rust_arches}
- rust-tempdir
ExclusiveArch: %{rust_arches}
- rust-tempfile
ExclusiveArch: %{rust_arches}
- rust-temporary
ExclusiveArch: %{rust_arches}
- rust-temptree
ExclusiveArch: %{rust_arches}
- rust-tendril
ExclusiveArch: %{rust_arches}
- rust-tera
ExclusiveArch: %{rust_arches}
- rust-term
ExclusiveArch: %{rust_arches}
- rust-term0.6
ExclusiveArch: %{rust_arches}
- rust-term_grid
ExclusiveArch: %{rust_arches}
- rust-term_size
ExclusiveArch: %{rust_arches}
- rust-termbg
ExclusiveArch: %{rust_arches}
- rust-termcolor
ExclusiveArch: %{rust_arches}
- rust-terminal_size
ExclusiveArch: %{rust_arches}
- rust-terminfo
ExclusiveArch: %{rust_arches}
- rust-termion
ExclusiveArch: %{rust_arches}
- rust-termios
ExclusiveArch: %{rust_arches}
- rust-termwiz
ExclusiveArch: %{rust_arches}
- rust-test-assembler
ExclusiveArch: %{rust_arches}
- rust-test-case
ExclusiveArch: %{rust_arches}
- rust-tester
ExclusiveArch: %{rust_arches}
- rust-testing_logger
ExclusiveArch: %{rust_arches}
- rust-textwrap
ExclusiveArch: %{rust_arches}
- rust-textwrap0.11
ExclusiveArch: %{rust_arches}
- rust-textwrap0.14
ExclusiveArch: %{rust_arches}
- rust-thiserror
ExclusiveArch: %{rust_arches}
- rust-thiserror-impl
ExclusiveArch: %{rust_arches}
- rust-thread-id
ExclusiveArch: %{rust_arches}
- rust-thread-tree
ExclusiveArch: %{rust_arches}
- rust-thread_local
ExclusiveArch: %{rust_arches}
- rust-threadpool
ExclusiveArch: %{rust_arches}
- rust-tiff
ExclusiveArch: %{rust_arches}
- rust-tiger
ExclusiveArch: %{rust_arches}
- rust-time
ExclusiveArch: %{rust_arches}
- rust-time-macros
ExclusiveArch: %{rust_arches}
- rust-time-macros-impl
ExclusiveArch: %{rust_arches}
- rust-time-macros0.1
ExclusiveArch: %{rust_arches}
- rust-time0.1
ExclusiveArch: %{rust_arches}
- rust-time0.2
ExclusiveArch: %{rust_arches}
- rust-timebomb
ExclusiveArch: %{rust_arches}
- rust-timer
ExclusiveArch: %{rust_arches}
- rust-timerfd
ExclusiveArch: %{rust_arches}
- rust-tiny-keccak
ExclusiveArch: %{rust_arches}
- rust-tiny_http
ExclusiveArch: %{rust_arches}
- rust-tiny_http0.6
ExclusiveArch: %{rust_arches}
- rust-tinystr
ExclusiveArch: %{rust_arches}
- rust-tinytemplate
ExclusiveArch: %{rust_arches}
- rust-tinyvec
ExclusiveArch: %{rust_arches}
- rust-tinyvec_macros
ExclusiveArch: %{rust_arches}
- rust-tokei
ExclusiveArch: %{rust_arches}
- rust-tokio
ExclusiveArch: %{rust_arches}
- rust-tokio-codec
ExclusiveArch: %{rust_arches}
- rust-tokio-core
ExclusiveArch: %{rust_arches}
- rust-tokio-current-thread
ExclusiveArch: %{rust_arches}
- rust-tokio-executor
ExclusiveArch: %{rust_arches}
- rust-tokio-fs
ExclusiveArch: %{rust_arches}
- rust-tokio-io
ExclusiveArch: %{rust_arches}
- rust-tokio-macros
ExclusiveArch: %{rust_arches}
- rust-tokio-macros0.2
ExclusiveArch: %{rust_arches}
- rust-tokio-mock-task
ExclusiveArch: %{rust_arches}
- rust-tokio-native-tls
ExclusiveArch: %{rust_arches}
- rust-tokio-openssl
ExclusiveArch: %{rust_arches}
- rust-tokio-openssl0.4
ExclusiveArch: %{rust_arches}
- rust-tokio-reactor
ExclusiveArch: %{rust_arches}
- rust-tokio-rustls
ExclusiveArch: %{rust_arches}
- rust-tokio-socks
ExclusiveArch: %{rust_arches}
- rust-tokio-socks0.3
ExclusiveArch: %{rust_arches}
- rust-tokio-stream
ExclusiveArch: %{rust_arches}
- rust-tokio-sync
ExclusiveArch: %{rust_arches}
- rust-tokio-tcp
ExclusiveArch: %{rust_arches}
- rust-tokio-test
ExclusiveArch: %{rust_arches}
- rust-tokio-threadpool
ExclusiveArch: %{rust_arches}
- rust-tokio-timer
ExclusiveArch: %{rust_arches}
- rust-tokio-tls
ExclusiveArch: %{rust_arches}
- rust-tokio-tls0.2
ExclusiveArch: %{rust_arches}
- rust-tokio-tungstenite
ExclusiveArch: %{rust_arches}
- rust-tokio-udp
ExclusiveArch: %{rust_arches}
- rust-tokio-uds
ExclusiveArch: %{rust_arches}
- rust-tokio-util
ExclusiveArch: %{rust_arches}
- rust-tokio-util0.3
ExclusiveArch: %{rust_arches}
- rust-tokio-util0.6
ExclusiveArch: %{rust_arches}
- rust-tokio0.1
ExclusiveArch: %{rust_arches}
- rust-tokio0.2
ExclusiveArch: %{rust_arches}
- rust-toml
ExclusiveArch: %{rust_arches}
- rust-toml0.4
ExclusiveArch: %{rust_arches}
- rust-toml_edit
ExclusiveArch: %{rust_arches}
- rust-totp-lite
ExclusiveArch: %{rust_arches}
- rust-tower-layer
ExclusiveArch: %{rust_arches}
- rust-tower-service
ExclusiveArch: %{rust_arches}
- rust-tower-test
ExclusiveArch: %{rust_arches}
- rust-tower-util
ExclusiveArch: %{rust_arches}
- rust-tpm2-policy
ExclusiveArch: %{rust_arches}
- rust-tracing
ExclusiveArch: %{rust_arches}
- rust-tracing-attributes
ExclusiveArch: %{rust_arches}
- rust-tracing-core
ExclusiveArch: %{rust_arches}
- rust-tracing-futures
ExclusiveArch: %{rust_arches}
- rust-tracing-log
ExclusiveArch: %{rust_arches}
- rust-traitobject
ExclusiveArch: %{rust_arches}
- rust-trash
ExclusiveArch: %{rust_arches}
- rust-tree-sitter
ExclusiveArch: %{rust_arches}
- rust-tree-sitter-cli
ExclusiveArch: %{rust_arches}
- rust-tree-sitter-config
ExclusiveArch: %{rust_arches}
- rust-tree-sitter-highlight
ExclusiveArch: %{rust_arches}
- rust-tree-sitter-loader
ExclusiveArch: %{rust_arches}
- rust-tree-sitter-tags
ExclusiveArch: %{rust_arches}
- rust-treebitmap
ExclusiveArch: %{rust_arches}
- rust-treeline
ExclusiveArch: %{rust_arches}
- rust-trust-dns-https
ExclusiveArch: %{rust_arches}
- rust-trust-dns-native-tls
ExclusiveArch: %{rust_arches}
- rust-trust-dns-native-tls0.19
ExclusiveArch: %{rust_arches}
- rust-trust-dns-openssl
ExclusiveArch: %{rust_arches}
- rust-trust-dns-openssl0.19
ExclusiveArch: %{rust_arches}
- rust-trust-dns-proto
ExclusiveArch: %{rust_arches}
- rust-trust-dns-proto0.19
ExclusiveArch: %{rust_arches}
- rust-trust-dns-resolver
ExclusiveArch: %{rust_arches}
- rust-trust-dns-resolver0.19
ExclusiveArch: %{rust_arches}
- rust-trust-dns-rustls
ExclusiveArch: %{rust_arches}
- rust-try-lock
ExclusiveArch: %{rust_arches}
- rust-trybuild
ExclusiveArch: %{rust_arches}
- rust-tss-esapi
ExclusiveArch: %{rust_arches}
- rust-tss-esapi-sys
ExclusiveArch: %{rust_arches}
- rust-ttf-parser
ExclusiveArch: %{rust_arches}
- rust-ttf-parser0.12
ExclusiveArch: %{rust_arches}
- rust-tui
ExclusiveArch: %{rust_arches}
- rust-tui-react
ExclusiveArch: %{rust_arches}
- rust-tui0.11
ExclusiveArch: %{rust_arches}
- rust-tui0.9
ExclusiveArch: %{rust_arches}
- rust-tuikit
ExclusiveArch: %{rust_arches}
- rust-tungstenite
ExclusiveArch: %{rust_arches}
- rust-twoway
ExclusiveArch: %{rust_arches}
- rust-twox-hash
ExclusiveArch: %{rust_arches}
- rust-type-map
ExclusiveArch: %{rust_arches}
- rust-typeable
ExclusiveArch: %{rust_arches}
- rust-typed-arena
ExclusiveArch: %{rust_arches}
- rust-typed-arena1
ExclusiveArch: %{rust_arches}
- rust-typemap
ExclusiveArch: %{rust_arches}
- rust-typenum
ExclusiveArch: %{rust_arches}
- rust-typetag
ExclusiveArch: %{rust_arches}
- rust-typetag-impl
ExclusiveArch: %{rust_arches}
- rust-tzfile
ExclusiveArch: %{rust_arches}
- rust-ubyte
ExclusiveArch: %{rust_arches}
- rust-ucd-parse
ExclusiveArch: %{rust_arches}
- rust-ucd-trie
ExclusiveArch: %{rust_arches}
- rust-ucd-util
ExclusiveArch: %{rust_arches}
- rust-umask
ExclusiveArch: %{rust_arches}
- rust-uncased
ExclusiveArch: %{rust_arches}
- rust-unchecked-index
ExclusiveArch: %{rust_arches}
- rust-unescape
ExclusiveArch: %{rust_arches}
- rust-unic-char-property
ExclusiveArch: %{rust_arches}
- rust-unic-char-range
ExclusiveArch: %{rust_arches}
- rust-unic-common
ExclusiveArch: %{rust_arches}
- rust-unic-langid
ExclusiveArch: %{rust_arches}
- rust-unic-langid-impl
ExclusiveArch: %{rust_arches}
- rust-unic-langid-macros
ExclusiveArch: %{rust_arches}
- rust-unic-langid-macros-impl
ExclusiveArch: %{rust_arches}
- rust-unic-locale
ExclusiveArch: %{rust_arches}
- rust-unic-locale-impl
ExclusiveArch: %{rust_arches}
- rust-unic-locale-macros
ExclusiveArch: %{rust_arches}
- rust-unic-locale-macros-impl
ExclusiveArch: %{rust_arches}
- rust-unic-segment
ExclusiveArch: %{rust_arches}
- rust-unic-ucd-category
ExclusiveArch: %{rust_arches}
- rust-unic-ucd-common
ExclusiveArch: %{rust_arches}
- rust-unic-ucd-segment
ExclusiveArch: %{rust_arches}
- rust-unic-ucd-version
ExclusiveArch: %{rust_arches}
- rust-unicase
ExclusiveArch: %{rust_arches}
- rust-unicase1
ExclusiveArch: %{rust_arches}
- rust-unicode-bidi
ExclusiveArch: %{rust_arches}
- rust-unicode-linebreak
ExclusiveArch: %{rust_arches}
- rust-unicode-normalization
ExclusiveArch: %{rust_arches}
- rust-unicode-segmentation
ExclusiveArch: %{rust_arches}
- rust-unicode-truncate
ExclusiveArch: %{rust_arches}
- rust-unicode-width
ExclusiveArch: %{rust_arches}
- rust-unicode-xid
ExclusiveArch: %{rust_arches}
- rust-unicode-xid0.1
ExclusiveArch: %{rust_arches}
- rust-unicode_categories
ExclusiveArch: %{rust_arches}
- rust-unindent
ExclusiveArch: %{rust_arches}
- rust-universal-hash
ExclusiveArch: %{rust_arches}
- rust-unix_socket
ExclusiveArch: %{rust_arches}
- rust-unreachable
ExclusiveArch: %{rust_arches}
- rust-unsafe-any
ExclusiveArch: %{rust_arches}
- rust-untrusted
ExclusiveArch: %{rust_arches}
- rust-uom
ExclusiveArch: %{rust_arches}
- rust-url
ExclusiveArch: %{rust_arches}
- rust-url1
ExclusiveArch: %{rust_arches}
- rust-url_serde
ExclusiveArch: %{rust_arches}
- rust-urlencoding
ExclusiveArch: %{rust_arches}
- rust-urlocator
ExclusiveArch: %{rust_arches}
- rust-urlshortener
ExclusiveArch: %{rust_arches}
- rust-userfaultfd
ExclusiveArch: %{rust_arches}
- rust-userfaultfd-sys
ExclusiveArch: %{rust_arches}
- rust-users
ExclusiveArch: %{rust_arches}
- rust-users0.10
ExclusiveArch: %{rust_arches}
- rust-utf-8
ExclusiveArch: %{rust_arches}
- rust-utf8-ranges
ExclusiveArch: %{rust_arches}
- rust-utf8-width
ExclusiveArch: %{rust_arches}
- rust-utf8parse
ExclusiveArch: %{rust_arches}
- rust-uuid
ExclusiveArch: %{rust_arches}
- rust-uuid0.7
ExclusiveArch: %{rust_arches}
- rust-v_frame
ExclusiveArch: %{rust_arches}
- rust-value-bag
ExclusiveArch: %{rust_arches}
- rust-varbincode
ExclusiveArch: %{rust_arches}
- rust-varlink
ExclusiveArch: %{rust_arches}
- rust-varlink-cli
ExclusiveArch: %{rust_arches}
- rust-varlink_generator
ExclusiveArch: %{rust_arches}
- rust-varlink_parser
ExclusiveArch: %{rust_arches}
- rust-varlink_stdinterfaces
ExclusiveArch: %{rust_arches}
- rust-vcsgraph
ExclusiveArch: %{rust_arches}
- rust-vec_map
ExclusiveArch: %{rust_arches}
- rust-vergen
ExclusiveArch: %{rust_arches}
- rust-vergen3
ExclusiveArch: %{rust_arches}
- rust-version
ExclusiveArch: %{rust_arches}
- rust-version-compare
ExclusiveArch: %{rust_arches}
- rust-version-sync
ExclusiveArch: %{rust_arches}
- rust-version-sync0.8
ExclusiveArch: %{rust_arches}
- rust-version_check
ExclusiveArch: %{rust_arches}
- rust-versions
ExclusiveArch: %{rust_arches}
- rust-vhost
ExclusiveArch: %{rust_arches}
- rust-vhost-user-backend
ExclusiveArch: %{rust_arches}
- rust-virtio-bindings
ExclusiveArch: x86_64 aarch64 ppc64le
- rust-virtio-queue
ExclusiveArch: x86_64 aarch64 s390x
- rust-vm-memory
ExclusiveArch: x86_64 aarch64 ppc64le
- rust-vmm-sys-util
ExclusiveArch: x86_64 aarch64 ppc64le
- rust-vmw_backdoor
ExclusiveArch: %{rust_arches}
- rust-void
ExclusiveArch: %{rust_arches}
- rust-vsprintf
ExclusiveArch: %{rust_arches}
- rust-vte
ExclusiveArch: %{rust_arches}
- rust-vte_generate_state_changes
ExclusiveArch: %{rust_arches}
- rust-vtparse
ExclusiveArch: %{rust_arches}
- rust-wait-timeout
ExclusiveArch: %{rust_arches}
- rust-waker-fn
ExclusiveArch: %{rust_arches}
- rust-walkdir
ExclusiveArch: %{rust_arches}
- rust-want
ExclusiveArch: %{rust_arches}
- rust-warp
ExclusiveArch: %{rust_arches}
- rust-wasm-bindgen
ExclusiveArch: %{rust_arches}
- rust-wasm-bindgen-backend
ExclusiveArch: %{rust_arches}
- rust-wasm-bindgen-futures
ExclusiveArch: %{rust_arches}
- rust-wasm-bindgen-macro
ExclusiveArch: %{rust_arches}
- rust-wasm-bindgen-macro-support
ExclusiveArch: %{rust_arches}
- rust-wasm-bindgen-shared
ExclusiveArch: %{rust_arches}
- rust-wasm-bindgen-test
ExclusiveArch: %{rust_arches}
- rust-wasm-bindgen-test-macro
ExclusiveArch: %{rust_arches}
- rust-wasmer_enumset
ExclusiveArch: %{rust_arches}
- rust-wasmer_enumset_derive
ExclusiveArch: %{rust_arches}
- rust-wasmparser
ExclusiveArch: %{rust_arches}
- rust-wasmtime
ExclusiveArch: x86_64 aarch64 s390x
- rust-wasmtime-cache
ExclusiveArch: %{rust_arches}
- rust-wasmtime-cranelift
ExclusiveArch: x86_64 aarch64 s390x
- rust-wasmtime-environ
ExclusiveArch: %{rust_arches}
- rust-wasmtime-fiber
ExclusiveArch: x86_64 aarch64 s390x
- rust-wasmtime-jit
ExclusiveArch: x86_64 aarch64 s390x
- rust-wasmtime-jit-debug
ExclusiveArch: %{rust_arches}
- rust-wasmtime-runtime
ExclusiveArch: x86_64 aarch64 s390x
- rust-wasmtime-types
ExclusiveArch: %{rust_arches}
- rust-wasmtime-wast
ExclusiveArch: x86_64 aarch64 s390x
- rust-wast
ExclusiveArch: %{rust_arches}
- rust-wat
ExclusiveArch: %{rust_arches}
- rust-watchman_client
ExclusiveArch: %{rust_arches}
- rust-wayland-client
ExclusiveArch: %{rust_arches}
- rust-wayland-commons
ExclusiveArch: %{rust_arches}
- rust-wayland-cursor
ExclusiveArch: %{rust_arches}
- rust-wayland-egl
ExclusiveArch: %{rust_arches}
- rust-wayland-protocols
ExclusiveArch: %{rust_arches}
- rust-wayland-scanner
ExclusiveArch: %{rust_arches}
- rust-wayland-server
ExclusiveArch: %{rust_arches}
- rust-wayland-sys
ExclusiveArch: %{rust_arches}
- rust-web-sys
ExclusiveArch: %{rust_arches}
- rust-webbrowser
ExclusiveArch: %{rust_arches}
- rust-webpki
ExclusiveArch: %{rust_arches}
- rust-webpki-roots
ExclusiveArch: %{rust_arches}
- rust-websocket
ExclusiveArch: %{rust_arches}
- rust-websocket-base
ExclusiveArch: %{rust_arches}
- rust-weezl
ExclusiveArch: %{rust_arches}
- rust-which
ExclusiveArch: %{rust_arches}
- rust-wide
ExclusiveArch: %{rust_arches}
- rust-wiggle
ExclusiveArch: x86_64 aarch64 s390x
- rust-wiggle-generate
ExclusiveArch: %{rust_arches}
- rust-wiggle-macro
ExclusiveArch: %{rust_arches}
- rust-wild
ExclusiveArch: %{rust_arches}
- rust-winit
ExclusiveArch: %{rust_arches}
- rust-witx
ExclusiveArch: %{rust_arches}
- rust-ws
ExclusiveArch: %{rust_arches}
- rust-wyz
ExclusiveArch: %{rust_arches}
- rust-x11
ExclusiveArch: %{rust_arches}
- rust-x11-clipboard
ExclusiveArch: %{rust_arches}
- rust-x11-dl
ExclusiveArch: %{rust_arches}
- rust-xattr
ExclusiveArch: %{rust_arches}
- rust-xcb
ExclusiveArch: %{rust_arches}
- rust-xcursor
ExclusiveArch: %{rust_arches}
- rust-xdg
ExclusiveArch: %{rust_arches}
- rust-xi-unicode
ExclusiveArch: %{rust_arches}
- rust-xkbcommon
ExclusiveArch: %{rust_arches}
- rust-xml-rs
ExclusiveArch: %{rust_arches}
- rust-xml5ever
ExclusiveArch: %{rust_arches}
- rust-xmlparser
ExclusiveArch: %{rust_arches}
- rust-xmlwriter
ExclusiveArch: %{rust_arches}
- rust-xxhash-c-sys
ExclusiveArch: %{rust_arches}
- rust-xxhash-rust
ExclusiveArch: %{rust_arches}
- rust-xz2
ExclusiveArch: %{rust_arches}
- rust-y4m
ExclusiveArch: %{rust_arches}
- rust-yaml-rust
ExclusiveArch: %{rust_arches}
- rust-yaml-rust0.3
ExclusiveArch: %{rust_arches}
- rust-yansi
ExclusiveArch: %{rust_arches}
- rust-ybaas
ExclusiveArch: %{rust_arches}
- rust-yubibomb
ExclusiveArch: %{rust_arches}
- rust-zbase32
ExclusiveArch: %{rust_arches}
- rust-zbus
ExclusiveArch: %{rust_arches}
- rust-zbus_macros
ExclusiveArch: %{rust_arches}
- rust-zeroize
ExclusiveArch: %{rust_arches}
- rust-zeroize_derive
ExclusiveArch: %{rust_arches}
- rust-zincati
ExclusiveArch: %{rust_arches}
- rust-zip
ExclusiveArch: %{rust_arches}
- rust-zmq
ExclusiveArch: %{rust_arches}
- rust-zmq-sys
ExclusiveArch: %{rust_arches}
- rust-zoneinfo_compiled
ExclusiveArch: %{rust_arches}
- rust-zoxide
ExclusiveArch: %{rust_arches}
- rust-zram-generator
ExclusiveArch: %{rust_arches}
- rust-zstd
ExclusiveArch: %{rust_arches}
- rust-zstd-safe
ExclusiveArch: %{rust_arches}
- rust-zstd-sys
ExclusiveArch: %{rust_arches}
- rust-zvariant
ExclusiveArch: %{rust_arches}
- rust-zvariant_derive
ExclusiveArch: %{rust_arches}
- s390utils
ExclusiveArch: s390 s390x
- safetyblanket
ExclusiveArch: %{arm} %{ix86} x86_64 aarch64 ppc64le
- sagemath
ExclusiveArch: aarch64 x86_64
- sbcl
ExclusiveArch: %{arm} %{ix86} x86_64 ppc sparcv9 aarch64
- sbd
ExclusiveArch: i686 x86_64 s390x aarch64 ppc64le
- sbsigntools
ExclusiveArch: x86_64 aarch64 %{arm} %{ix86}
- sdsl-lite
ExclusiveArch: %{power64} x86_64 aarch64
- seabios
ExclusiveArch: x86_64
- seadrive-gui
ExclusiveArch: %{qt5_qtwebengine_arches}
- seafile-client
ExclusiveArch: %{qt5_qtwebengine_arches}
- seamonkey
ExclusiveArch: x86_64
- seqan3
ExclusiveArch: %{power64} x86_64 aarch64
- servicelog
ExclusiveArch: ppc %{power64}
- sgabios
ExclusiveArch: %{ix86} x86_64
- sharpfont
ExclusiveArch: %mono_arches
- sharpziplib
ExclusiveArch: %{mono_arches}
- shim
ExclusiveArch: %{efi}
- shim-unsigned-aarch64
ExclusiveArch: aarch64
- shim-unsigned-x64
ExclusiveArch: x86_64
- sigul
ExclusiveArch: x86_64
- sisu
ExclusiveArch: %{java_arches} noarch
- sisu-mojos
ExclusiveArch: %{java_arches} noarch
- skopeo
ExclusiveArch: %{go_arches}
- skychart
ExclusiveArch: %{fpc_arches}
- slf4j
ExclusiveArch: %{java_arches} noarch
- snapd
ExclusiveArch: %{?go_arches:%{go_arches}}%{!?go_arches:%{ix86} x86_64 %{arm}}
ExclusiveArch: %{ix86} x86_64 %{arm} aarch64 ppc64le s390x
- soup-sharp
ExclusiveArch: %{mono_arches}
- sparkleshare
ExclusiveArch: %{mono_arches}
- spicctrl
ExclusiveArch: %{ix86} x86_64
- spice
ExclusiveArch: x86_64
ExclusiveArch: %{ix86} x86_64 %{arm} aarch64
- springlobby
ExclusiveArch: %{ix86} x86_64
- squeekboard
ExclusiveArch: %{rust_arches}
- startdde
ExclusiveArch: %{?go_arches:%{go_arches}}%{!?go_arches:%{ix86} x86_64 %{arm}}
- statsd
ExclusiveArch: %{nodejs_arches} noarch
- stratis-cli
ExclusiveArch: %{rust_arches} noarch
- stratisd
ExclusiveArch: %{rust_arches}
ExclusiveArch: %{rust_arches}
- stripesnoop
ExclusiveArch: %{ix86} x86_64
- supercollider
ExclusiveArch: %{qt5_qtwebengine_arches}
- supermin
ExclusiveArch: %{kernel_arches}
- svt-av1
ExclusiveArch: x86_64
- svt-vp9
ExclusiveArch: x86_64
- swift-lang
ExclusiveArch: x86_64 aarch64
- sysbench
ExclusiveArch: %{arm} %{ix86} x86_64 %{mips}
ExclusiveArch: %{arm} %{ix86} x86_64 %{mips} aarch64
ExclusiveArch: %{arm} %{ix86} x86_64 %{mips} aarch64 ppc64le s390x
- syslinux
ExclusiveArch: %{ix86} x86_64
ExclusiveArch: %{ix86} x86_64
- system76-keyboard-configurator
ExclusiveArch: %{rust_arches}
- taglib-sharp
ExclusiveArch: %{mono_arches}
- tarantool
ExclusiveArch: %{ix86} x86_64
- tboot
ExclusiveArch: %{ix86} x86_64
- tdlib
ExclusiveArch: x86_64 aarch64
- templates_parser
ExclusiveArch: %GPRbuild_arches
- ternimal
ExclusiveArch: %{rust_arches}
- testcloud
ExclusiveArch: %{kernel_arches} noarch
- testng
ExclusiveArch: %{java_arches} noarch
- themonospot-base
ExclusiveArch: %mono_arches
- themonospot-console
ExclusiveArch: %mono_arches
- themonospot-gui-gtk
ExclusiveArch: %mono_arches
- themonospot-plugin-avi
ExclusiveArch: %mono_arches
- themonospot-plugin-mkv
ExclusiveArch: %mono_arches
- thermald
ExclusiveArch: %{ix86} x86_64
- tilix
ExclusiveArch: %{ldc_arches}
- tomboy
ExclusiveArch: %{mono_arches}
- torbrowser-launcher
ExclusiveArch: %{ix86} x86_64
- tuned-profiles-nfv-host-bin
ExclusiveArch: %{ix86} x86_64
- uClibc
ExclusiveArch: %{arm} %{ix86} x86_64 %{mips}
- ucx
ExclusiveArch: aarch64 ppc64le x86_64
- uglify-js
ExclusiveArch: %{nodejs_arches} noarch
- unetbootin
ExclusiveArch: %{ix86} x86_64
- univocity-parsers
ExclusiveArch: %{java_arches} noarch
- ursa-major
ExclusiveArch: noarch aarch64 ppc64le s390x x86_64
- usd
ExclusiveArch: aarch64 x86_64
- v8-314
ExclusiveArch: %{ix86} x86_64 %{arm} mips mipsel ppc ppc64
- valgrind
ExclusiveArch: %{ix86} x86_64 ppc ppc64 ppc64le s390x armv7hl aarch64
- vboot-utils
ExclusiveArch: %{arm} aarch64 %{ix86} x86_64
- velocity
ExclusiveArch: %{java_arches} noarch
- vim-go
ExclusiveArch: %{?golang_arches}%{!?golang_arches:%{ix86} x86_64 %{arm}}
- virt-p2v
ExclusiveArch: x86_64
- virt-v2v
ExclusiveArch: x86_64
- virtiofsd
ExclusiveArch: x86_64 aarch64
- virtualbox-guest-additions
ExclusiveArch: i686 x86_64
- vkd3d
ExclusiveArch: %{ix86} x86_64 %{arm}
ExclusiveArch: %{ix86} x86_64 %{arm} aarch64
- vmaf
ExclusiveArch: x86_64
- vmemcache
ExclusiveArch: x86_64 ppc64 ppc64le s390x aarch64
- vrq
ExclusiveArch: %{ix86} x86_64
- warsow
ExclusiveArch: %{ix86} x86_64 %{arm}
- warsow-data
ExclusiveArch: %{ix86} x86_64 %{arm} noarch
ExclusiveArch: %{ix86} x86_64 %{arm}
- webkit2-sharp
ExclusiveArch: %mono_arches
- wine
ExclusiveArch: %{ix86} x86_64 aarch64
ExclusiveArch: %{ix86}
- wine-dxvk
ExclusiveArch: %{ix86} x86_64
- winetricks
ExclusiveArch: %{ix86} x86_64 %{arm} aarch64
- wxMaxima
ExclusiveArch: %{arm} %{ix86} x86_64 aarch64 ppc sparcv9
- x2goclient
ExclusiveArch: x86_64
- xalan-j2
ExclusiveArch: %{java_arches} noarch
- xbean
ExclusiveArch: %{java_arches} noarch
- xe-guest-utilities-latest
ExclusiveArch: %{ix86} x86_64
- xen
ExclusiveArch: %{ix86} x86_64 armv7hl aarch64
- xerces-j2
ExclusiveArch: %{java_arches} noarch
- xml-commons-apis
ExclusiveArch: %{java_arches} noarch
- xml-commons-resolver
ExclusiveArch: %{java_arches} noarch
- xmlada
ExclusiveArch: %{GPRbuild_arches}
- xmlunit
ExclusiveArch: %{java_arches} noarch
- xmvn
ExclusiveArch: %{java_arches} noarch
- xorg-x11-drv-armsoc
ExclusiveArch: %{arm} aarch64
- xorg-x11-drv-intel
ExclusiveArch: %{ix86} x86_64
- xorg-x11-drv-openchrome
ExclusiveArch: %{ix86} x86_64
- xorg-x11-drv-vesa
ExclusiveArch: %{ix86} x86_64
- xorg-x11-drv-vmware
ExclusiveArch: %{ix86} x86_64 ia64
- xsp
ExclusiveArch: %mono_arches
- xz-java
ExclusiveArch: %{java_arches} noarch
- yarnpkg
ExclusiveArch: %{nodejs_arches} noarch
- zcfan
ExclusiveArch: x86_64
- zeal
ExclusiveArch: %{qt5_qtwebengine_arches}
- zeromq-ada
ExclusiveArch: %{GPRbuild_arches}
- zig
ExclusiveArch: %{zig_arches}
- zlib-ada
ExclusiveArch: %{GPRbuild_arches}
- zlib-ng
ExclusiveArch: aarch64 i686 ppc64le s390x x86_64
- zola
ExclusiveArch: %{rust_arches}
1 year, 11 months
Architecture specific change in rpms/kexec-tools.git
by githook-noreply@fedoraproject.org
The package rpms/kexec-tools.git has added or updated architecture specific content in its
spec file (ExclusiveArch/ExcludeArch or %ifarch/%ifnarch) in commit(s):
https://src.fedoraproject.org/cgit/rpms/kexec-tools.git/commit/?id=311b5b....
Change:
+%ifarch ppc64 ppc64le
Thanks.
Full change:
============
commit f1f9612420c1ad507b1b6b81c6e20b87684b12c8
Merge: 4b6445a 6f9653b
Author: Coiby Xu <coxu(a)redhat.com>
Date: Mon May 23 18:40:59 2022 +0800
Merge branch 'rawhide' into f36
commit 4b6445a794521755899b2663be015ebaff811bf7
Author: Coiby Xu <coxu(a)redhat.com>
Date: Mon May 23 18:39:49 2022 +0800
Revert "Release 2.0.23-6"
This reverts commit 01a7da83f7a49579f77767bc3097b9bf31777738.
Signed-off-by: Coiby Xu <coxu(a)redhat.com>
diff --git a/kexec-tools.spec b/kexec-tools.spec
index 0b61b21..b4b80e6 100644
--- a/kexec-tools.spec
+++ b/kexec-tools.spec
@@ -5,7 +5,7 @@
Name: kexec-tools
Version: 2.0.23
-Release: 6%{?dist}
+Release: 5%{?dist}
License: GPLv2
Summary: The kexec/kdump userspace component
@@ -404,10 +404,6 @@ fi
%endif
%changelog
-* Sat Apr 2 2022
-- arm64/kexec-arm64: add support for R_AARCH64_LDST128_ABS_LO12_NC rela
-- purgatory: do not enable vectorization automatically for purgatory compiling
-
* Mon Feb 14 2022 Coiby <coxu(a)redhat.com> - 2.0.23-5
- fix incorrect usage of _get_all_kernels_from_grubby
- fix the mistake of swapping function parameters of read_proc_environ_var
commit 1c7c89a76b1bd7e69333a393ae728fa14651e3a5
Author: Coiby Xu <coxu(a)redhat.com>
Date: Mon May 23 18:38:40 2022 +0800
Revert "arm64/kexec-arm64: add support for R_AARCH64_LDST128_ABS_LO12_NC rela"
This reverts commit 39789963fb3385d23500d9cfb6aceb1dac4e2271.
Signed-off-by: Coiby Xu <coxu(a)redhat.com>
diff --git a/kexec-tools-2.0.23-arm64-kexec-arm64-add-support-for-R_AARCH64_LDST128_.patch b/kexec-tools-2.0.23-arm64-kexec-arm64-add-support-for-R_AARCH64_LDST128_.patch
deleted file mode 100644
index da5d8c9..0000000
--- a/kexec-tools-2.0.23-arm64-kexec-arm64-add-support-for-R_AARCH64_LDST128_.patch
+++ /dev/null
@@ -1,94 +0,0 @@
-From 8e3f663a4dfe39b303e25ea2b945a4fab9fef7ae Mon Sep 17 00:00:00 2001
-From: Pingfan Liu <piliu(a)redhat.com>
-Date: Thu, 31 Mar 2022 11:38:05 +0800
-Subject: [PATCH] arm64/kexec-arm64: add support for
- R_AARCH64_LDST128_ABS_LO12_NC rela
-
-GCC 12 has some changes, which affects the generated AArch64 code of kexec-tools.
-Accordingly, a new rel type R_AARCH64_LDST128_ABS_LO12_NC is confronted
-by machine_apply_elf_rel() on AArch64. This fails the load of kernel
-with the message "machine_apply_elf_rel: ERROR Unknown type: 299"
-
-Citing from objdump -rDSl purgatory/purgatory.ro
-
-0000000000000f80 <sha256_starts>:
-sha256_starts():
- f80: 90000001 adrp x1, 0 <verify_sha256_digest>
- f80: R_AARCH64_ADR_PREL_PG_HI21 .text+0xfa0
- f84: a9007c1f stp xzr, xzr, [x0]
- f88: 3dc00021 ldr q1, [x1]
- f88: R_AARCH64_LDST128_ABS_LO12_NC .text+0xfa0
- f8c: 90000001 adrp x1, 0 <verify_sha256_digest>
- f8c: R_AARCH64_ADR_PREL_PG_HI21 .text+0xfb0
- f90: 3dc00020 ldr q0, [x1]
- f90: R_AARCH64_LDST128_ABS_LO12_NC .text+0xfb0
- f94: ad008001 stp q1, q0, [x0, #16]
- f98: d65f03c0 ret
- f9c: d503201f nop
- fa0: 6a09e667 .inst 0x6a09e667 ; undefined
- fa4: bb67ae85 .inst 0xbb67ae85 ; undefined
- fa8: 3c6ef372 .inst 0x3c6ef372 ; undefined
- fac: a54ff53a ld3w {z26.s-z28.s}, p5/z, [x9, #-3, mul vl]
- fb0: 510e527f sub wsp, w19, #0x394
- fb4: 9b05688c madd x12, x4, x5, x26
- fb8: 1f83d9ab .inst 0x1f83d9ab ; undefined
- fbc: 5be0cd19 .inst 0x5be0cd19 ; undefined
-
-Here, gcc generates codes, which make loads and stores carried out using
-the 128-bits floating-point registers. And a new rel type
-R_AARCH64_LDST128_ABS_LO12_NC should be handled.
-
-Make machine_apply_elf_rel() coped with this new reloc, so kexec-tools
-can work smoothly.
-
-Signed-off-by: Pingfan Liu <piliu(a)redhat.com>
-Signed-off-by: Simon Horman <horms(a)verge.net.au>
-Signed-off-by: Coiby Xu <coiby.xu(a)gmail.com>
----
- kexec/arch/arm64/kexec-arm64.c | 16 ++++++++++++++++
- 1 file changed, 16 insertions(+)
-
-diff --git a/kexec/arch/arm64/kexec-arm64.c b/kexec/arch/arm64/kexec-arm64.c
-index 9dd072c..e25f600 100644
---- a/kexec/arch/arm64/kexec-arm64.c
-+++ b/kexec/arch/arm64/kexec-arm64.c
-@@ -1248,6 +1248,10 @@ void machine_apply_elf_rel(struct mem_ehdr *ehdr, struct mem_sym *UNUSED(sym),
-
- #if !defined(R_AARCH64_LDST64_ABS_LO12_NC)
- # define R_AARCH64_LDST64_ABS_LO12_NC 286
-+#endif
-+
-+#if !defined(R_AARCH64_LDST128_ABS_LO12_NC)
-+# define R_AARCH64_LDST128_ABS_LO12_NC 299
- #endif
-
- uint64_t *loc64;
-@@ -1309,6 +1313,7 @@ void machine_apply_elf_rel(struct mem_ehdr *ehdr, struct mem_sym *UNUSED(sym),
- *loc32 = cpu_to_le32(le32_to_cpu(*loc32)
- + (((value - address) >> 2) & 0x3ffffff));
- break;
-+ /* encode imm field with bits [11:3] of value */
- case R_AARCH64_LDST64_ABS_LO12_NC:
- if (value & 7)
- die("%s: ERROR Unaligned value: %lx\n", __func__,
-@@ -1318,6 +1323,17 @@ void machine_apply_elf_rel(struct mem_ehdr *ehdr, struct mem_sym *UNUSED(sym),
- *loc32 = cpu_to_le32(le32_to_cpu(*loc32)
- + ((value & 0xff8) << (10 - 3)));
- break;
-+
-+ /* encode imm field with bits [11:4] of value */
-+ case R_AARCH64_LDST128_ABS_LO12_NC:
-+ if (value & 15)
-+ die("%s: ERROR Unaligned value: %lx\n", __func__,
-+ value);
-+ type = "LDST128_ABS_LO12_NC";
-+ loc32 = ptr;
-+ imm = value & 0xff0;
-+ *loc32 = cpu_to_le32(le32_to_cpu(*loc32) + (imm << (10 - 4)));
-+ break;
- default:
- die("%s: ERROR Unknown type: %lu\n", __func__, r_type);
- break;
---
-2.34.1
-
diff --git a/kexec-tools.spec b/kexec-tools.spec
index 3c8d5e7..0b61b21 100644
--- a/kexec-tools.spec
+++ b/kexec-tools.spec
@@ -107,7 +107,6 @@ Requires: systemd-udev%{?_isa}
#
# Patches 501 through 600 are meant for ARM kexec-tools enablement
#
-Patch501: ./kexec-tools-2.0.23-arm64-kexec-arm64-add-support-for-R_AARCH64_LDST128_.patch
#
# Patches 601 onward are generic patches
@@ -127,8 +126,6 @@ mkdir -p -m755 kcp
tar -z -x -v -f %{SOURCE9}
tar -z -x -v -f %{SOURCE19}
-%patch501 -p1
-
%ifarch ppc
%define archdef ARCH=ppc
%endif
commit 799ff6c49a4b415cc5302ccf03f2cde6172d6734
Author: Coiby Xu <coxu(a)redhat.com>
Date: Mon May 23 18:37:44 2022 +0800
Revert "purgatory: do not enable vectorization automatically for purgatory compiling"
This reverts commit c6b2a4b26ba75e14af39ce990a6f20d38edd0b60.
Signed-off-by: Coiby Xu <coxu(a)redhat.com>
diff --git a/kexec-tools-2.0.23-purgatory-do-not-enable-vectorization-automatically-.patch b/kexec-tools-2.0.23-purgatory-do-not-enable-vectorization-automatically-.patch
deleted file mode 100644
index 85ae7e6..0000000
--- a/kexec-tools-2.0.23-purgatory-do-not-enable-vectorization-automatically-.patch
+++ /dev/null
@@ -1,44 +0,0 @@
-From 1b03cf7adc3c156ecab2618acb1ec585336a3f75 Mon Sep 17 00:00:00 2001
-From: Baoquan He <bhe(a)redhat.com>
-Date: Tue, 29 Mar 2022 18:12:28 +0800
-Subject: [PATCH] purgatory: do not enable vectorization automatically for
- purgatory compiling
-
-Redhat CKI reported kdump kernel will hang a while very early after crash
-triggered, then reset to firmware to reboot.
-
-This failure can only be observed with kdump or kexec reboot via
-kexec_load system call. With kexec_file_load interface, both kdump and
-kexec reboot work very well. And further investigation shows that gcc
-version 11 doesn't have this issue, while gcc version 12 does.
-
-After checking the release notes of the latest gcc, Dave found out it's
-because gcc 12 enables auto-vectorization for -O2 optimization level.
-Please see below link for more information:
-
- https://www.phoronix.com/scan.php?page=news_item&px=GCC-12-Auto-Vec-O2
-
-Adding -fno-tree-vectorize to Makefile of purgatory can fix the issue.
-
-Signed-off-by: Baoquan He <bhe(a)redhat.com>
-Signed-off-by: Simon Horman <horms(a)verge.net.au>
----
- purgatory/Makefile | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/purgatory/Makefile b/purgatory/Makefile
-index 2dd6c47..15adb12 100644
---- a/purgatory/Makefile
-+++ b/purgatory/Makefile
-@@ -49,7 +49,7 @@ $(PURGATORY): CFLAGS=$(PURGATORY_EXTRA_CFLAGS) \
- $($(ARCH)_PURGATORY_EXTRA_CFLAGS) \
- -Os -fno-builtin -ffreestanding \
- -fno-zero-initialized-in-bss \
-- -fno-PIC -fno-PIE -fno-stack-protector
-+ -fno-PIC -fno-PIE -fno-stack-protector -fno-tree-vectorize
-
- $(PURGATORY): CPPFLAGS=$($(ARCH)_PURGATORY_EXTRA_CFLAGS) \
- -I$(srcdir)/purgatory/include \
---
-2.34.1
-
diff --git a/kexec-tools.spec b/kexec-tools.spec
index e5d1428..3c8d5e7 100644
--- a/kexec-tools.spec
+++ b/kexec-tools.spec
@@ -112,8 +112,6 @@ Patch501: ./kexec-tools-2.0.23-arm64-kexec-arm64-add-support-for-R_AARCH64_LDST1
#
# Patches 601 onward are generic patches
#
-Patch601: ./kexec-tools-2.0.23-purgatory-do-not-enable-vectorization-automatically-.patch
-
%description
kexec-tools provides /sbin/kexec binary that facilitates a new
@@ -130,7 +128,6 @@ tar -z -x -v -f %{SOURCE9}
tar -z -x -v -f %{SOURCE19}
%patch501 -p1
-%patch601 -p1
%ifarch ppc
%define archdef ARCH=ppc
commit 873fe47f78afce8928b88411768fc8f1ab14c312
Author: Coiby Xu <coxu(a)redhat.com>
Date: Mon May 23 18:36:47 2022 +0800
Revert "s390: handle R_390_PLT32DBL reloc entries in machine_apply_elf_rel()"
This reverts commit ca5a33855ff637d53c70e71282e73f3c67d85c86.
Signed-off-by: Coiby Xu <coxu(a)redhat.com>
diff --git a/kexec-tools-2.0.23-s390_handle_R_390_PLT32DBL_reloc_entries_in_machine_apply_elf_rel_.patch b/kexec-tools-2.0.23-s390_handle_R_390_PLT32DBL_reloc_entries_in_machine_apply_elf_rel_.patch
deleted file mode 100644
index 10bc5ef..0000000
--- a/kexec-tools-2.0.23-s390_handle_R_390_PLT32DBL_reloc_entries_in_machine_apply_elf_rel_.patch
+++ /dev/null
@@ -1,95 +0,0 @@
-commit 186e7b0752d8fce1618fa37519671c834c46340e
-Author: Alexander Egorenkov <egorenar(a)linux.ibm.com>
-Date: Wed Dec 15 18:48:53 2021 +0100
-
- s390: handle R_390_PLT32DBL reloc entries in machine_apply_elf_rel()
-
- Starting with gcc 11.3, the C compiler will generate PLT-relative function
- calls even if they are local and do not require it. Later on during linking,
- the linker will replace all PLT-relative calls to local functions with
- PC-relative ones. Unfortunately, the purgatory code of kexec/kdump is
- not being linked as a regular executable or shared library would have been,
- and therefore, all PLT-relative addresses remain in the generated purgatory
- object code unresolved. This in turn lets kexec-tools fail with
- "Unknown rela relocation: 0x14 0x73c0901c" for such relocation types.
-
- Furthermore, the clang C compiler has always behaved like described above
- and this commit should fix the purgatory code built with the latter.
-
- Because the purgatory code is no regular executable or shared library,
- contains only calls to local functions and has no PLT, all R_390_PLT32DBL
- relocation entries can be resolved just like a R_390_PC32DBL one.
-
- * https://refspecs.linuxfoundation.org/ELF/zSeries/lzsabi0_zSeries/x1633.ht...
-
- Relocation entries of purgatory code generated with gcc 11.3
- ------------------------------------------------------------
-
- $ readelf -r purgatory/purgatory.o
-
- Relocation section '.rela.text' at offset 0x6e8 contains 27 entries:
- Offset Info Type Sym. Value Sym. Name + Addend
- 00000000000c 000300000013 R_390_PC32DBL 0000000000000000 .data + 2
- 00000000001a 001000000014 R_390_PLT32DBL 0000000000000000 sha256_starts + 2
- 000000000030 001100000014 R_390_PLT32DBL 0000000000000000 sha256_update + 2
- 000000000046 001200000014 R_390_PLT32DBL 0000000000000000 sha256_finish + 2
- 000000000050 000300000013 R_390_PC32DBL 0000000000000000 .data + 102
- 00000000005a 001300000014 R_390_PLT32DBL 0000000000000000 memcmp + 2
- ...
- 000000000118 001600000014 R_390_PLT32DBL 0000000000000000 setup_arch + 2
- 00000000011e 000300000013 R_390_PC32DBL 0000000000000000 .data + 2
- 00000000012c 000f00000014 R_390_PLT32DBL 0000000000000000 verify_sha256_digest + 2
- 000000000142 001700000014 R_390_PLT32DBL 0000000000000000
- post_verification[...] + 2
-
- Relocation entries of purgatory code generated with gcc 11.2
- ------------------------------------------------------------
-
- $ readelf -r purgatory/purgatory.o
-
- Relocation section '.rela.text' at offset 0x6e8 contains 27 entries:
- Offset Info Type Sym. Value Sym. Name + Addend
- 00000000000e 000300000013 R_390_PC32DBL 0000000000000000 .data + 2
- 00000000001c 001000000013 R_390_PC32DBL 0000000000000000 sha256_starts + 2
- 000000000036 001100000013 R_390_PC32DBL 0000000000000000 sha256_update + 2
- 000000000048 001200000013 R_390_PC32DBL 0000000000000000 sha256_finish + 2
- 000000000052 000300000013 R_390_PC32DBL 0000000000000000 .data + 102
- 00000000005c 001300000013 R_390_PC32DBL 0000000000000000 memcmp + 2
- ...
- 00000000011a 001600000013 R_390_PC32DBL 0000000000000000 setup_arch + 2
- 000000000120 000300000013 R_390_PC32DBL 0000000000000000 .data + 122
- 000000000130 000f00000013 R_390_PC32DBL 0000000000000000 verify_sha256_digest + 2
- 000000000146 001700000013 R_390_PC32DBL 0000000000000000 post_verification[...] + 2
-
- Corresponding s390 kernel discussion:
- * https://lore.kernel.org/linux-s390/20211208105801.188140-1-egorenar@linux...
-
- Signed-off-by: Alexander Egorenkov <egorenar(a)linux.ibm.com>
- Reported-by: Tao Liu <ltao(a)redhat.com>
- Suggested-by: Philipp Rudo <prudo(a)redhat.com>
- Reviewed-by: Philipp Rudo <prudo(a)redhat.com>
- [hca(a)linux.ibm.com: changed commit message as requested by Philipp Rudo]
- Signed-off-by: Heiko Carstens <hca(a)linux.ibm.com>
- Signed-off-by: Simon Horman <horms(a)verge.net.au>
-
-diff --git a/kexec/arch/s390/kexec-elf-rel-s390.c b/kexec/arch/s390/kexec-elf-rel-s390.c
-index a5e1b73455785ae3bc3aa72b3beee13ae202e82f..91ba86a9991dad4271b834fc3b24861c40309e52 100644
---- a/kexec/arch/s390/kexec-elf-rel-s390.c
-+++ b/kexec/arch/s390/kexec-elf-rel-s390.c
-@@ -56,6 +56,7 @@ void machine_apply_elf_rel(struct mem_ehdr *UNUSED(ehdr),
- case R_390_PC16: /* PC relative 16 bit. */
- case R_390_PC16DBL: /* PC relative 16 bit shifted by 1. */
- case R_390_PC32DBL: /* PC relative 32 bit shifted by 1. */
-+ case R_390_PLT32DBL: /* 32 bit PC rel. PLT shifted by 1. */
- case R_390_PC32: /* PC relative 32 bit. */
- case R_390_PC64: /* PC relative 64 bit. */
- val -= address;
-@@ -63,7 +64,7 @@ void machine_apply_elf_rel(struct mem_ehdr *UNUSED(ehdr),
- *(unsigned short *) loc = val;
- else if (r_type == R_390_PC16DBL)
- *(unsigned short *) loc = val >> 1;
-- else if (r_type == R_390_PC32DBL)
-+ else if (r_type == R_390_PC32DBL || r_type == R_390_PLT32DBL)
- *(unsigned int *) loc = val >> 1;
- else if (r_type == R_390_PC32)
- *(unsigned int *) loc = val;
diff --git a/kexec-tools.spec b/kexec-tools.spec
index e0f5b5e..e5d1428 100644
--- a/kexec-tools.spec
+++ b/kexec-tools.spec
@@ -103,7 +103,6 @@ Requires: systemd-udev%{?_isa}
#
# Patches 401 through 500 are meant for s390 kexec-tools enablement
#
-Patch401: ./kexec-tools-2.0.23-s390_handle_R_390_PLT32DBL_reloc_entries_in_machine_apply_elf_rel_.patch
#
# Patches 501 through 600 are meant for ARM kexec-tools enablement
@@ -130,7 +129,6 @@ mkdir -p -m755 kcp
tar -z -x -v -f %{SOURCE9}
tar -z -x -v -f %{SOURCE19}
-%patch401 -p1
%patch501 -p1
%patch601 -p1
commit 6f9653b9183b710008b8271e6cc51ea47c2585bd
Author: Coiby Xu <coxu(a)redhat.com>
Date: Sun Apr 24 09:48:05 2022 +0800
Release 2.0.24-3
Signed-off-by: Coiby Xu <coxu(a)redhat.com>
diff --git a/kexec-tools.spec b/kexec-tools.spec
index 9b8218d..9c6ea8d 100644
--- a/kexec-tools.spec
+++ b/kexec-tools.spec
@@ -5,7 +5,7 @@
Name: kexec-tools
Version: 2.0.24
-Release: 2%{?dist}
+Release: 3%{?dist}
License: GPLv2
Summary: The kexec/kdump userspace component
@@ -405,6 +405,13 @@ fi
%endif
%changelog
+* Mon May 23 2022 Coiby <coxu(a)redhat.com> - 2.0.24-3
+- Update makedumpfile to 1.7.1
+- unit tests: add tests for get_system_size and get_recommend_size
+- improve get_recommend_size
+- fix a calculation error in get_system_size
+- logger: save log after all kdump progress finished
+
* Sun Apr 24 2022 Coiby <coxu(a)redhat.com> - 2.0.24-2
- remove the upper bound of default crashkernel value example
- update fadump-howto
commit 8f7ffb1a0054e48f833590d908a7d051008986f7
Author: Coiby Xu <coxu(a)redhat.com>
Date: Sun Apr 24 09:47:26 2022 +0800
Update makedumpfile to 1.7.1
Signed-off-by: Coiby Xu <coxu(a)redhat.com>
diff --git a/kexec-tools.spec b/kexec-tools.spec
index 6673000..9b8218d 100644
--- a/kexec-tools.spec
+++ b/kexec-tools.spec
@@ -1,6 +1,6 @@
%global eppic_ver e8844d3793471163ae4a56d8f95897be9e5bd554
%global eppic_shortver %(c=%{eppic_ver}; echo ${c:0:7})
-%global mkdf_ver 1.7.0
+%global mkdf_ver 1.7.1
%global mkdf_shortver %(c=%{mkdf_ver}; echo ${c:0:7})
Name: kexec-tools
@@ -220,8 +220,8 @@ install -m 755 -D %{SOURCE33} $RPM_BUILD_ROOT%{_prefix}/lib/kernel/install.d/92-
%ifarch %{ix86} x86_64 ppc64 s390x ppc64le aarch64
install -m 755 makedumpfile-%{mkdf_ver}/makedumpfile $RPM_BUILD_ROOT/usr/sbin/makedumpfile
-install -m 644 makedumpfile-%{mkdf_ver}/makedumpfile.8.gz $RPM_BUILD_ROOT/%{_mandir}/man8/makedumpfile.8.gz
-install -m 644 makedumpfile-%{mkdf_ver}/makedumpfile.conf.5.gz $RPM_BUILD_ROOT/%{_mandir}/man5/makedumpfile.conf.5.gz
+install -m 644 makedumpfile-%{mkdf_ver}/makedumpfile.8 $RPM_BUILD_ROOT/%{_mandir}/man8/makedumpfile.8
+install -m 644 makedumpfile-%{mkdf_ver}/makedumpfile.conf.5 $RPM_BUILD_ROOT/%{_mandir}/man5/makedumpfile.conf.5
install -m 644 makedumpfile-%{mkdf_ver}/makedumpfile.conf $RPM_BUILD_ROOT/%{_sysconfdir}/makedumpfile.conf.sample
install -m 755 makedumpfile-%{mkdf_ver}/eppic_makedumpfile.so $RPM_BUILD_ROOT/%{_libdir}/eppic_makedumpfile.so
mkdir -p $RPM_BUILD_ROOT/usr/share/makedumpfile/eppic_scripts/
diff --git a/sources b/sources
index 95c0fc6..d0190bb 100644
--- a/sources
+++ b/sources
@@ -1,3 +1,3 @@
SHA512 (eppic-e8844d3.tar.gz) = d86b9f90c57e694107272d8f71b87f66a30743b9530480fb6f665026bbada4c6b0205a83e40b5383663a945681cfbfcf1ee79469fc219ddf679473c4b2290763
SHA512 (kexec-tools-2.0.24.tar.xz) = ef7cf78246e2d729d81a3649791a5a23c385353cc75cbe8ef279616329fdaccc876d614c7f51e1456822a13a11520296070d9897467d24310399909e049c3822
-SHA512 (makedumpfile-1.7.0.tar.gz) = 579a1fb79d023a1419fc8612a02a04dda3e3b3d72455566433ab6bec08627aa9a176c55566393a081a7aae3fd0543800196596b25445b21b16346556723e9cf7
+SHA512 (makedumpfile-1.7.1.tar.gz) = 93e36487b71f567d3685b151459806cf36017e52bf3ee68dd448382b279a422d1a8abef72e291ccb8206f2149ccd08ba484ec0027d1caab3fa1edbc3d28c3632
commit 218d9917c03f25bc9872f076491c587815d16efb
Author: Dusty Mabe <dusty(a)dustymabe.com>
Date: Mon May 16 14:04:12 2022 -0400
kdump.sysconfig*: add ignition.firstboot to KDUMP_COMMANDLINE_REMOVE
For CoreOS based systems we use Ignition for provisioning machines
in the initramfs on first boot. We trigger Ignition right now by
the presence of `ignition.firstboot` in the kernel command line. The
kernel argument is only present on first boot so after a reboot it
no longer is in the kernel command line.
If a kernel crash happens before the first reboot of a machine we
want the `ignition.firstboot` kernel argument to be removed and not
passed on to the crash kernel.
diff --git a/kdump.sysconfig b/kdump.sysconfig
index 70ebf04..c1143f3 100644
--- a/kdump.sysconfig
+++ b/kdump.sysconfig
@@ -17,7 +17,7 @@ KDUMP_COMMANDLINE=""
# This variable lets us remove arguments from the current kdump commandline
# as taken from either KDUMP_COMMANDLINE above, or from /proc/cmdline
# NOTE: some arguments such as crashkernel will always be removed
-KDUMP_COMMANDLINE_REMOVE="hugepages hugepagesz slub_debug quiet log_buf_len swiotlb cma hugetlb_cma"
+KDUMP_COMMANDLINE_REMOVE="hugepages hugepagesz slub_debug quiet log_buf_len swiotlb cma hugetlb_cma ignition.firstboot"
# This variable lets us append arguments to the current kdump commandline
# after processed by KDUMP_COMMANDLINE_REMOVE
diff --git a/kdump.sysconfig.aarch64 b/kdump.sysconfig.aarch64
index 67a2af7..df75f94 100644
--- a/kdump.sysconfig.aarch64
+++ b/kdump.sysconfig.aarch64
@@ -17,7 +17,7 @@ KDUMP_COMMANDLINE=""
# This variable lets us remove arguments from the current kdump commandline
# as taken from either KDUMP_COMMANDLINE above, or from /proc/cmdline
# NOTE: some arguments such as crashkernel will always be removed
-KDUMP_COMMANDLINE_REMOVE="hugepages hugepagesz slub_debug quiet log_buf_len swiotlb cma hugetlb_cma"
+KDUMP_COMMANDLINE_REMOVE="hugepages hugepagesz slub_debug quiet log_buf_len swiotlb cma hugetlb_cma ignition.firstboot"
# This variable lets us append arguments to the current kdump commandline
# after processed by KDUMP_COMMANDLINE_REMOVE
diff --git a/kdump.sysconfig.i386 b/kdump.sysconfig.i386
index 7e18c1c..d8bf5f6 100644
--- a/kdump.sysconfig.i386
+++ b/kdump.sysconfig.i386
@@ -17,7 +17,7 @@ KDUMP_COMMANDLINE=""
# This variable lets us remove arguments from the current kdump commandline
# as taken from either KDUMP_COMMANDLINE above, or from /proc/cmdline
# NOTE: some arguments such as crashkernel will always be removed
-KDUMP_COMMANDLINE_REMOVE="hugepages hugepagesz slub_debug quiet log_buf_len swiotlb cma hugetlb_cma"
+KDUMP_COMMANDLINE_REMOVE="hugepages hugepagesz slub_debug quiet log_buf_len swiotlb cma hugetlb_cma ignition.firstboot"
# This variable lets us append arguments to the current kdump commandline
# after processed by KDUMP_COMMANDLINE_REMOVE
diff --git a/kdump.sysconfig.ppc64 b/kdump.sysconfig.ppc64
index ebb22f6..1b0cdc7 100644
--- a/kdump.sysconfig.ppc64
+++ b/kdump.sysconfig.ppc64
@@ -17,7 +17,7 @@ KDUMP_COMMANDLINE=""
# This variable lets us remove arguments from the current kdump commandline
# as taken from either KDUMP_COMMANDLINE above, or from /proc/cmdline
# NOTE: some arguments such as crashkernel will always be removed
-KDUMP_COMMANDLINE_REMOVE="hugepages hugepagesz slub_debug quiet log_buf_len swiotlb hugetlb_cma"
+KDUMP_COMMANDLINE_REMOVE="hugepages hugepagesz slub_debug quiet log_buf_len swiotlb hugetlb_cma ignition.firstboot"
# This variable lets us append arguments to the current kdump commandline
# after processed by KDUMP_COMMANDLINE_REMOVE
diff --git a/kdump.sysconfig.ppc64le b/kdump.sysconfig.ppc64le
index 270a2cf..d951def 100644
--- a/kdump.sysconfig.ppc64le
+++ b/kdump.sysconfig.ppc64le
@@ -17,7 +17,7 @@ KDUMP_COMMANDLINE=""
# This variable lets us remove arguments from the current kdump commandline
# as taken from either KDUMP_COMMANDLINE above, or from /proc/cmdline
# NOTE: some arguments such as crashkernel will always be removed
-KDUMP_COMMANDLINE_REMOVE="hugepages hugepagesz slub_debug quiet log_buf_len swiotlb hugetlb_cma"
+KDUMP_COMMANDLINE_REMOVE="hugepages hugepagesz slub_debug quiet log_buf_len swiotlb hugetlb_cma ignition.firstboot"
# This variable lets us append arguments to the current kdump commandline
# after processed by KDUMP_COMMANDLINE_REMOVE
diff --git a/kdump.sysconfig.s390x b/kdump.sysconfig.s390x
index 234cfe9..2971ae7 100644
--- a/kdump.sysconfig.s390x
+++ b/kdump.sysconfig.s390x
@@ -17,7 +17,7 @@ KDUMP_COMMANDLINE=""
# This variable lets us remove arguments from the current kdump commandline
# as taken from either KDUMP_COMMANDLINE above, or from /proc/cmdline
# NOTE: some arguments such as crashkernel will always be removed
-KDUMP_COMMANDLINE_REMOVE="hugepages hugepagesz slub_debug quiet log_buf_len swiotlb vmcp_cma cma hugetlb_cma prot_virt"
+KDUMP_COMMANDLINE_REMOVE="hugepages hugepagesz slub_debug quiet log_buf_len swiotlb vmcp_cma cma hugetlb_cma prot_virt ignition.firstboot"
# This variable lets us append arguments to the current kdump commandline
# after processed by KDUMP_COMMANDLINE_REMOVE
diff --git a/kdump.sysconfig.x86_64 b/kdump.sysconfig.x86_64
index 188ba3c..6a3ba6e 100644
--- a/kdump.sysconfig.x86_64
+++ b/kdump.sysconfig.x86_64
@@ -17,7 +17,7 @@ KDUMP_COMMANDLINE=""
# This variable lets us remove arguments from the current kdump commandline
# as taken from either KDUMP_COMMANDLINE above, or from /proc/cmdline
# NOTE: some arguments such as crashkernel will always be removed
-KDUMP_COMMANDLINE_REMOVE="hugepages hugepagesz slub_debug quiet log_buf_len swiotlb cma hugetlb_cma"
+KDUMP_COMMANDLINE_REMOVE="hugepages hugepagesz slub_debug quiet log_buf_len swiotlb cma hugetlb_cma ignition.firstboot"
# This variable lets us append arguments to the current kdump commandline
# after processed by KDUMP_COMMANDLINE_REMOVE
commit 1101190e1cc11c25c50f26af61120154eeed1133
Author: Coiby Xu <coxu(a)redhat.com>
Date: Wed Apr 27 19:17:32 2022 +0800
unit tests: add tests for get_system_size and get_recommend_size
Signed-off-by: Coiby Xu <coxu(a)redhat.com>
Reviewed-by: Philipp Rudo <prudo(a)redhat.com>
diff --git a/spec/kdump-lib_spec.sh b/spec/kdump-lib_spec.sh
new file mode 100644
index 0000000..8c91480
--- /dev/null
+++ b/spec/kdump-lib_spec.sh
@@ -0,0 +1,51 @@
+#!/bin/bash
+Describe 'kdump-lib'
+ Include ./kdump-lib.sh
+
+ Describe 'get_system_size()'
+
+ PROC_IOMEM=$(mktemp -t spec_test_proc_iomem_file.XXXXXXXXXX)
+
+ cleanup() {
+ rm -rf "$PROC_IOMEM"
+ }
+
+ AfterAll 'cleanup'
+
+ ONE_GIGABYTE='000000-3fffffff : System RAM'
+ Parameters
+ 1
+ 3
+ End
+
+ It 'should return correct system RAM size'
+ echo -n >"$PROC_IOMEM"
+ for _ in $(seq 1 "$1"); do echo "$ONE_GIGABYTE" >>"$PROC_IOMEM"; done
+ When call get_system_size
+ The output should equal "$1"
+ End
+
+ End
+
+ Describe 'get_recommend_size()'
+ # Testing stragety:
+ # 1. inclusive for the lower bound of the range of crashkernel
+ # 2. exclusive for the upper bound of the range of crashkernel
+ # 3. supports ranges not sorted in increasing order
+
+ ck="4G-64G:256M,2G-4G:192M,64G-1T:512M,1T-:12345M"
+ Parameters
+ 1 0M
+ 2 192M
+ 64 512M
+ 1024 12345M
+ "$((64 * 1024))" 12345M
+ End
+
+ It 'should handle all cases correctly'
+ When call get_recommend_size "$1" $ck
+ The output should equal "$2"
+ End
+ End
+
+End
commit 4f702c81e9d14a90d22d6b587de37733d0126960
Author: Coiby Xu <coxu(a)redhat.com>
Date: Thu May 12 10:48:31 2022 +0800
improve get_recommend_size
This patch rewrites get_recommend_size to get rid of the following
limitations,
1. only supports ranges in crashkernel sorted in increasing order
2. the first entry of crashkernel should have only a single digit and
it's in gigabytes
Suggested-by: Philipp Rudo <prudo(a)redhat.com>
Signed-off-by: Coiby Xu <coxu(a)redhat.com>
Reviewed-by: Philipp Rudo <prudo(a)redhat.com>
diff --git a/kdump-lib.sh b/kdump-lib.sh
index ed28df3..b137c89 100755
--- a/kdump-lib.sh
+++ b/kdump-lib.sh
@@ -796,33 +796,40 @@ get_system_size()
echo $(( (sum) / 1024 / 1024 / 1024))
}
+# Return the recommended size for the reserved crashkernel memory
+# depending on the system memory size.
+#
+# This functions is expected to be consistent with the parse_crashkernel_mem()
+# in kernel i.e. how kernel allocates the kdump memory given the crashkernel
+# parameter crashkernel=range1:size1[,range2:size2,…] and the system memory
+# size.
get_recommend_size()
{
local mem_size=$1
local _ck_cmdline=$2
- local OLDIFS="$IFS"
+ local range start start_unit end end_unit size
- start=${_ck_cmdline::1}
- if [[ $mem_size -lt $start ]]; then
- echo "0M"
- return
- fi
- IFS=','
- for i in $_ck_cmdline; do
- end=$(echo "$i" | awk -F "-" '{ print $2 }' | awk -F ":" '{ print $1 }')
- recommend=$(echo "$i" | awk -F "-" '{ print $2 }' | awk -F ":" '{ print $2 }')
- size=${end::-1}
- unit=${end: -1}
- if [[ $unit == 'T' ]]; then
- size=$((size * 1024))
- fi
- if [[ $mem_size -lt $size ]]; then
- echo "$recommend"
- IFS="$OLDIFS"
+ while read -r -d , range; do
+ # need to use non-default IFS as double spaces are used as a
+ # single delimiter while commas aren't...
+ IFS=, read start start_unit end end_unit size <<< \
+ "$(echo "$range" | sed -n "s/\([0-9]\+\)\([GT]\?\)-\([0-9]*\)\([GT]\?\):\([0-9]\+[MG]\)/\1,\2,\3,\4,\5/p")"
+
+ # aka. 102400T
+ end=${end:-104857600}
+ [[ "$end_unit" == T ]] && end=$((end * 1024))
+ [[ "$start_unit" == T ]] && start=$((start * 1024))
+
+ if [[ $mem_size -ge $start ]] && [[ $mem_size -lt $end ]]; then
+ echo "$size"
return
fi
- done
- IFS="$OLDIFS"
+
+ # append a ',' as read expects the 'file' to end with a delimiter
+ done <<< "$_ck_cmdline,"
+
+ # no matching range found
+ echo "0M"
}
# get default crashkernel
commit 5c23b6ebb79c5e06ff713d437cb54fb2843aa12d
Author: Coiby Xu <coxu(a)redhat.com>
Date: Sat May 7 16:30:39 2022 +0800
fix a calculation error in get_system_size
Recently, it's found 'kdumpctl estimate' returns 512M while the system
reserves 1024M kdump memory in a case. This happens because the ranges
in /proc/iomem are inclusively. For example, "0-1: System RAM" means 2
bytes of system memory other than 1 byte. Fix this error by adding one
more byte.
Note
1. the function has been simplified as well.
2. define PROC_IOMEM as /proc/iomem for the sake of unit tests
Reported-by: Ruowen Qin <ruqin(a)redhat.com>
Fixes: 1813189 ("kdump-lib.sh: introduce functions to return recommened mem size")
Suggested-by: Philipp Rudo <prudo(a)redhat.com>
Signed-off-by: Coiby Xu <coxu(a)redhat.com>
Reviewed-by: Philipp Rudo <prudo(a)redhat.com>
diff --git a/kdump-lib.sh b/kdump-lib.sh
index 557eff6..ed28df3 100755
--- a/kdump-lib.sh
+++ b/kdump-lib.sh
@@ -788,17 +788,12 @@ prepare_cmdline()
echo "$cmdline"
}
-#get system memory size in the unit of GB
+PROC_IOMEM=/proc/iomem
+#get system memory size i.e. memblock.memory.total_size in the unit of GB
get_system_size()
{
- result=$(grep "System RAM" /proc/iomem | awk -F ":" '{ print $1 }' | tr "[:lower:]" "[:upper:]" | paste -sd+)
- result="+$result"
- # replace '-' with '+0x' and '+' with '-0x'
- sum=$(echo "$result" | sed -e 's/-/K0x/g' -e 's/+/-0x/g' -e 's/K/+/g')
- size=$(printf "%d\n" $((sum)))
- size=$((size / 1024 / 1024 / 1024))
-
- echo "$size"
+ sum=$(sed -n "s/\s*\([0-9a-fA-F]\+\)-\([0-9a-fA-F]\+\) : System RAM$/+ 0x\2 - 0x\1 + 1/p" $PROC_IOMEM)
+ echo $(( (sum) / 1024 / 1024 / 1024))
}
get_recommend_size()
commit 3d70f8b04958c6f7a4a6b937fb828f9970d0c525
Author: Kairui Song <kasong(a)tencent.com>
Date: Sat Apr 23 21:07:31 2022 +0800
logger: save log after all kdump progress finished
Make log saving the last step of kdump.sh, so it can catch more info,
for example, the output of post.d hooks will be covered by the log now.
Signed-off-by: Kairui Song <kasong(a)tencent.com>
Reviewed-by: Philipp Rudo <prudo(a)redhat.com>
diff --git a/dracut-kdump.sh b/dracut-kdump.sh
index b17455a..f4456a1 100755
--- a/dracut-kdump.sh
+++ b/dracut-kdump.sh
@@ -15,6 +15,8 @@ fi
KDUMP_PATH="/var/crash"
KDUMP_LOG_FILE="/run/initramfs/kexec-dmesg.log"
+KDUMP_LOG_DEST=""
+KDUMP_LOG_OP=""
CORE_COLLECTOR=""
DEFAULT_CORE_COLLECTOR="makedumpfile -l --message-level 7 -d 31"
DMESG_COLLECTOR="/sbin/vmcore-dmesg"
@@ -113,12 +115,19 @@ get_kdump_confs()
# store the kexec kernel log to a file.
save_log()
{
+ # LOG_OP is empty when log can't be saved, eg. raw target
+ [ -n "$KDUMP_LOG_OP" ] || return
+
dmesg -T > $KDUMP_LOG_FILE
if command -v journalctl > /dev/null; then
journalctl -ab >> $KDUMP_LOG_FILE
fi
chmod 600 $KDUMP_LOG_FILE
+
+ dinfo "saving the $KDUMP_LOG_FILE to $KDUMP_LOG_DEST/"
+
+ eval "$KDUMP_LOG_OP"
}
# $1: dump path, must be a mount point
@@ -159,6 +168,9 @@ dump_fs()
save_opalcore_fs "$_dump_fs_path"
dinfo "saving vmcore"
+ KDUMP_LOG_DEST=$_dump_fs_path/
+ KDUMP_LOG_OP="mv '$KDUMP_LOG_FILE' '$KDUMP_LOG_DEST/'"
+
$CORE_COLLECTOR /proc/vmcore "$_dump_fs_path/vmcore-incomplete"
_dump_exitcode=$?
if [ $_dump_exitcode -eq 0 ]; then
@@ -167,12 +179,6 @@ dump_fs()
dinfo "saving vmcore complete"
else
derror "saving vmcore failed, exitcode:$_dump_exitcode"
- fi
-
- dinfo "saving the $KDUMP_LOG_FILE to $_dump_fs_path/"
- save_log
- mv "$KDUMP_LOG_FILE" "$_dump_fs_path/"
- if [ $_dump_exitcode -ne 0 ]; then
return 1
fi
@@ -395,8 +401,12 @@ dump_ssh()
ssh -q $_ssh_opt "$2" mkdir -p "$_ssh_dir" || return 1
save_vmcore_dmesg_ssh "$DMESG_COLLECTOR" "$_ssh_dir" "$_ssh_opt" "$2"
+
dinfo "saving vmcore"
+ KDUMP_LOG_DEST=$2:$_ssh_dir/
+ KDUMP_LOG_OP="scp -q $_ssh_opt '$KDUMP_LOG_FILE' '$_scp_address:$_ssh_dir/'"
+
save_opalcore_ssh "$_ssh_dir" "$_ssh_opt" "$2" "$_scp_address"
if [ "${CORE_COLLECTOR%%[[:blank:]]*}" = "scp" ]; then
@@ -421,12 +431,6 @@ dump_ssh()
derror "saving vmcore failed, exitcode:$_ret"
fi
- dinfo "saving the $KDUMP_LOG_FILE to $2:$_ssh_dir/"
- save_log
- if ! scp -q $_ssh_opt $KDUMP_LOG_FILE "$_scp_address:$_ssh_dir/"; then
- derror "saving log file failed, _exitcode:$_ret"
- fi
-
return $_ret
}
@@ -576,6 +580,8 @@ if ! do_kdump_post $DUMP_RETVAL; then
derror "kdump_post script exited with non-zero status!"
fi
+save_log
+
if [ $DUMP_RETVAL -ne 0 ]; then
exit 1
fi
commit 1facd0c11876bcbe83a9c52c67c1ce7a59f681dd
Author: Coiby Xu <coxu(a)redhat.com>
Date: Sun Apr 24 11:38:04 2022 +0800
fix incorrect date format in changelog
Signed-off-by: Coiby Xu <coxu(a)redhat.com>
diff --git a/kexec-tools.spec b/kexec-tools.spec
index 8b1acf5..6673000 100644
--- a/kexec-tools.spec
+++ b/kexec-tools.spec
@@ -405,7 +405,7 @@ fi
%endif
%changelog
-* Apr 24 2022 Coiby <coxu(a)redhat.com> - 2.0.24-2
+* Sun Apr 24 2022 Coiby <coxu(a)redhat.com> - 2.0.24-2
- remove the upper bound of default crashkernel value example
- update fadump-howto
- update kexec-kdump-howto
commit d5b01d7ef0f05c5ecb028aa1e8942ec099cbd9dd
Author: Coiby Xu <coxu(a)redhat.com>
Date: Sun Apr 24 09:39:22 2022 +0800
Release 2.0.24-2
A issue of bogus date in %changelog is fixed as well.
Signed-off-by: Coiby Xu <coxu(a)redhat.com>
diff --git a/kexec-tools.spec b/kexec-tools.spec
index db6374c..8b1acf5 100644
--- a/kexec-tools.spec
+++ b/kexec-tools.spec
@@ -5,7 +5,7 @@
Name: kexec-tools
Version: 2.0.24
-Release: 1%{?dist}
+Release: 2%{?dist}
License: GPLv2
Summary: The kexec/kdump userspace component
@@ -405,6 +405,21 @@ fi
%endif
%changelog
+* Apr 24 2022 Coiby <coxu(a)redhat.com> - 2.0.24-2
+- remove the upper bound of default crashkernel value example
+- update fadump-howto
+- update kexec-kdump-howto
+- update crashkernel-howto
+- add man documentation for kdumpctl get-default-crashkernel
+- unit tests: add check_config with with the default kdump.conf
+- unit tests: add tests for kdump_get_conf_val in kdump-lib-initramfs.sh
+- unit tests: add tests for "kdumpctl reset-crashkernel"
+- unit tests: add tests for _{update,read}_kernel_arg_in_grub_etc_default in kdumpctl
+- unit tests: add tests for kdumpctl read_proc_environ_var and _is_osbuild
+- unit tests: add tests for get_dump_mode_by_fadump_val
+- unit tests: add tests for get_grub_kernel_boot_parameter
+- unit tests: prepare for kdumpctl and kdump-lib.sh to be unit-tested
+
* Mon Apr 11 2022 Coiby <coxu(a)redhat.com> - 2.0.24-1
- Update kexec-tools to 2.0.24
- kdumpctl: remove kdump_get_conf_val in save_raw
@@ -472,7 +487,7 @@ fi
- sysconfig: make kexec_file_load as default option on aarch64
- Enable zstd compression for makedumpfile in kexec-tools.spec
-* Mon Nov 18 2021 Coiby <coxu(a)redhat.com> - 2.0.23-1
+* Thu Nov 18 2021 Coiby <coxu(a)redhat.com> - 2.0.23-1
- Update kexec-tools to 2.0.23
- Rebase makedumpfile to 1.7.0
- fix broken extra_bins when installing multiple binaries
commit be20580b06dc3fe92556933046ec8d2fd3a9b4b5
Author: Coiby Xu <coxu(a)redhat.com>
Date: Tue Mar 1 17:33:24 2022 +0800
remove the upper bound of default crashkernel value example
Reviewed-by: Philipp Rudo <prudo(a)redhat.com>
Signed-off-by: Coiby Xu <coxu(a)redhat.com>
diff --git a/crashkernel-howto.txt b/crashkernel-howto.txt
index 94f4e52..6573847 100644
--- a/crashkernel-howto.txt
+++ b/crashkernel-howto.txt
@@ -17,7 +17,7 @@ Latest kexec-tools provides "kdumpctl get-default-crashkernel" to retrieve
the default crashkernel value,
$ echo $(kdumpctl get-default-crashkernel)
- 1G-4G:192M,4G-64G:256M,64G-102400T:512M
+ 1G-4G:192M,4G-64G:256M,64G-:512M
It will be taken as the default value of 'crashkernel=', you can use
this value as a reference for setting crashkernel value manually.
commit 695e5b8676ecbdf999ed535eae4074db8c3ef7aa
Author: Coiby Xu <coxu(a)redhat.com>
Date: Tue Mar 1 17:30:30 2022 +0800
update fadump-howto
1. yum is deprecated so use dnf instead
2. use the "kdumpctl reset-crashkernel --fadump=on" API
Reviewed-by: Philipp Rudo <prudo(a)redhat.com>
Signed-off-by: Coiby Xu <coxu(a)redhat.com>
diff --git a/fadump-howto.txt b/fadump-howto.txt
index bc87644..9773f78 100644
--- a/fadump-howto.txt
+++ b/fadump-howto.txt
@@ -39,7 +39,7 @@ kernel are one and the same on ppc64.
If you're reading this document, you should already have kexec-tools
installed. If not, you install it via the following command:
- # yum install kexec-tools
+ # dnf install kexec-tools
Fadump Operational Flow:
@@ -82,7 +82,7 @@ How to configure fadump:
Again, we assume if you're reading this document, you should already have
kexec-tools installed. If not, you install it via the following command:
- # yum install kexec-tools
+ # dnf install kexec-tools
Make the kernel to be configured with FADump as the default boot entry, if
it isn't already:
@@ -94,20 +94,24 @@ anything interesting in the way of debug analysis, you'll also need to install
the kernel-debuginfo package, of the same arch as your running kernel, and the
crash utility:
- # yum --enablerepo=\*debuginfo install kernel-debuginfo.$(uname -m) crash
+ # dnf --enablerepo=\*debuginfo install kernel-debuginfo.$(uname -m) crash
-Next up, we need to modify some boot parameters to enable firmware assisted
-dump. With the help of grubby, it's very easy to append "fadump=on" to the end
-of your kernel boot parameters. To reserve the appropriate amount of memory
-for boot memory preservation, pass 'crashkernel=X' kernel cmdline parameter.
-For the recommended value of X, see 'FADump Memory Requirements' section.
+Next up, we can enable firmware assisted dump and reserve the memory for boot
+memory preservation as specified in in the table of 'FADump Memory Requirements'
+section:
+
+ # kdumpctl reset-crashkernel --fadump=on
+
+Alternatively, you can use grubby to reserve custom amount of memory:
# grubby --args="fadump=on crashkernel=6G" --update-kernel=/boot/vmlinuz-`uname -r`
By default, FADump reserved memory will be initialized as CMA area to make the
memory available through CMA allocator on the production kernel. We can opt out
of this, making reserved memory unavailable to production kernel, by booting the
-linux kernel with 'fadump=nocma' instead of 'fadump=on'.
+linux kernel with 'fadump=nocma' instead of 'fadump=on':
+
+ # kdumpctl reset-crashkernel --fadump=nocma
The term 'boot memory' means size of the low memory chunk that is required for
a kernel to boot successfully when booted with restricted memory. By default,
@@ -350,6 +354,6 @@ Remove "crashkernel=" from kernel cmdline parameters:
If KDump is to be used as the dump capturing mechanism, reset the crashkernel parameter:
- # kdumpctl reset-crashkernel `uname -r`
+ # kdumpctl reset-crashkernel --fadump=off
Reboot the system for the settings to take effect.
commit 1e7df3e1f355da4fe0eca6422479963f7e772bf8
Author: Coiby Xu <coxu(a)redhat.com>
Date: Tue Mar 1 17:30:50 2022 +0800
update kexec-kdump-howto
1. yum is deprecated so use dnf instead
2. use the "kdumpctl reset-crashkernel" API
3. ask the users to refer to crashkernel-howto.txt for setting custom
crashkernel value
4. fix a typo
Philipp Rudo <prudo(a)redhat.com>
Signed-off-by: Coiby Xu <coxu(a)redhat.com>
diff --git a/kexec-kdump-howto.txt b/kexec-kdump-howto.txt
index 1aeffc7..6741faf 100644
--- a/kexec-kdump-howto.txt
+++ b/kexec-kdump-howto.txt
@@ -44,7 +44,7 @@ ia64 and ppc64.
If you're reading this document, you should already have kexec-tools
installed. If not, you install it via the following command:
- # yum install kexec-tools
+ # dnf install kexec-tools
Now load a kernel with kexec:
@@ -66,23 +66,31 @@ How to configure kdump
Again, we assume if you're reading this document, you should already have
kexec-tools installed. If not, you install it via the following command:
- # yum install kexec-tools
+ # dnf install kexec-tools
To be able to do much of anything interesting in the way of debug analysis,
you'll also need to install the kernel-debuginfo package, of the same arch
as your running kernel, and the crash utility:
- # yum --enablerepo=\*debuginfo install kernel-debuginfo.$(uname -m) crash
+ # dnf --enablerepo=\*debuginfo install kernel-debuginfo.$(uname -m) crash
-Next up, we need to modify some boot parameters to reserve a chunk of memory for
-the capture kernel. With the help of grubby, it's very easy to append
-"crashkernel=128M" to the end of your kernel boot parameters. Note that the X
-values are such that X = the amount of memory to reserve for the capture kernel.
-And based on arch and system configuration, one might require more than 128M to
-be reserved for kdump. One need to experiment and test kdump, if 128M is not
-sufficient, try reserving more memory.
+Next up, we need to reserve a chunk of memory for the capture kernel. To use
+the default crashkernel value, you can kdumpctl:
- # grubby --args="crashkernel=128M" --update-kernel=/boot/vmlinuz-`uname -r`
+ # kdumpctl reset-crashkernel --kernel=/boot/vmlinuz-`uname -r`
+
+If the default value does not work for your setup you can use
+
+ # grubby --args="crashkernel=256M" --update-kernel=/boot/vmlinuz-`uname -r`
+
+to specify a larger value, in this case 256M. You need to experiment to
+find the best value that works for your setup. To begin with
+
+ # kdumpctl estimate
+
+gives you an estimation for the crashkernel value based on the currently
+running kernel. For more details, please refer to the "Estimate crashkernel"
+section in /usr/share/doc/kexec-tools/crashkernel-howto.txt.
Note that there is an alternative form in which to specify a crashkernel
memory reservation, in the event that more control is needed over the size and
@@ -135,7 +143,7 @@ in /var/crash/<YYYY-MM-DD-HH:MM>/vmcore), then the system rebooted back into
your normal kernel.
Once back to your normal kernel, you can use the previously installed crash
-kernel in conjunction with the previously installed kernel-debuginfo to
+utility in conjunction with the previously installed kernel-debuginfo to
perform postmortem analysis:
# crash /usr/lib/debug/lib/modules/2.6.17-1.2621.el5/vmlinux
commit 683ff878213ea2a58971902f90f9dd77d4e64b8f
Author: Coiby Xu <coxu(a)redhat.com>
Date: Mon Apr 18 15:54:53 2022 +0800
update crashkernel-howto
1. clean up left crashkernel.default
2. fix a few typos and grammar mistakes
3. ask the users to refer to `man kdumpctl` for reset-crashkernel
Philipp Rudo <prudo(a)redhat.com>
Signed-off-by: Coiby Xu <coxu(a)redhat.com>
diff --git a/crashkernel-howto.txt b/crashkernel-howto.txt
index 1ba79ab..94f4e52 100644
--- a/crashkernel-howto.txt
+++ b/crashkernel-howto.txt
@@ -37,10 +37,10 @@ Users can override the value during Anaconda installation manually.
Auto update of crashkernel boot parameter
=========================================
-A new release of kexec-tools could update the default crashkernel value.
-By default, kexec-tools would reset crashkernel to the new default value if it
-detects old default crashkernel value is used by installed kernels. If you don't
-want kexec-tools to update the old default crashkernel to the new default
+A new release of kexec-tools could update the default crashkernel value. By
+default, kexec-tools would reset crashkernel to the new default value if it
+detects the old default crashkernel value is used by installed kernels. If you
+don't want kexec-tools to update the old default crashkernel to the new default
crashkernel, you can change auto_reset_crashkernel to no in kdump.conf.
Supported Bootloaders
@@ -67,19 +67,18 @@ value properly, `kdumpctl` also provides a sub-command:
`kdumpctl reset-crashkernel [--kernel=path_to_kernel] [--reboot]`
-This command will read from the `crashkernel.default` file and reset
-bootloader's kernel cmdline to the default value. It will also update bootloader
-config if the bootloader has a standalone config file. User will have to reboot
-the machine after this command to make it take effect if --reboot is not specified.
-For ppc64le, an optional "[--fadump=[on|off|nocma]]" can also be specified to toggle
-FADump on/off.
+This command will reset the bootloader's kernel cmdline to the default value.
+It will also update bootloader config if the bootloader has a standalone config
+file. User will have to reboot the machine after this command to make it take
+effect if --reboot is not specified. For more details, please refer to the
+reset-crashkernel command in `man kdumpctl`.
Reset manually
--------------
To reset the crashkernel value manually, it's recommended to use utils like
`grubby`. A one liner script for resetting `crashkernel=` value of all installed
-kernels to current boot kernel's crashkernel.default` is:
+kernels to the default value is:
grubby --update-kernel ALL --args "crashkernel=$(kdumpctl get-default-crashkernel)"
@@ -98,7 +97,7 @@ triggering kdump:
The output will be like this:
```
- Encrypted kdump target requires extra memory, assuming using the keyslot with minimun memory requirement
+ Encrypted kdump target requires extra memory, assuming using the keyslot with minimum memory requirement
Reserved crashkernel: 256M
Recommended crashkernel: 655M
commit a1c63fa6449740f771349f931748b0ccc8a67ec7
Author: Coiby Xu <coxu(a)redhat.com>
Date: Tue Mar 1 17:35:39 2022 +0800
add man documentation for kdumpctl get-default-crashkernel
A few typos and grammar issues are fixed as well.
Philipp Rudo <prudo(a)redhat.com>
Signed-off-by: Coiby Xu <coxu(a)redhat.com>
diff --git a/kdumpctl.8 b/kdumpctl.8
index 067117b..33c1115 100644
--- a/kdumpctl.8
+++ b/kdumpctl.8
@@ -14,7 +14,7 @@ In most cases, you should use
.B systemctl
to start / stop / enable kdump service instead. However,
.B kdumpctl
-provides more details for debug and a helper to setup ssh key authentication.
+provides more details for debugging and a helper to set up ssh key authentication.
.SH COMMANDS
.TP
@@ -26,14 +26,14 @@ Stop the service.
.TP
.I status
Prints the current status of kdump service.
-It returns non-zero value if kdump is not operational.
+It returns a non-zero value if kdump is not operational.
.TP
.I restart
Is equal to
.I start; stop
.TP
.I reload
-reload crash kernel image and initramfs without triggering a rebuild.
+reload the crash kernel image and initramfs without triggering a rebuild.
.TP
.I rebuild
rebuild the crash kernel initramfs.
@@ -43,20 +43,23 @@ Helps to setup key authentication for ssh storage since it's
impossible to use password authentication during kdump.
.TP
.I showmem
-Prints the size of reserved memory for crash kernel in megabytes.
+Prints the size of reserved memory for the crash kernel in megabytes.
.TP
.I estimate
-Estimate a suitable crashkernel value for current machine. This is a
-best-effort estimate. It will print a recommanded crashkernel value
-based on current kdump setup, and list some details of memory usage.
+Estimate a suitable crashkernel value for the current machine. This is a
+best-effort estimate. It will print a recommended crashkernel value
+based on the current kdump setup, and list some details of memory usage.
+.TP
+.I get-default-crashkernel
+Return the default crashkernel value provided by kexec-tools.
.TP
.I reset-crashkernel [--kernel=path_to_kernel] [--reboot]
Reset crashkernel to default value recommended by kexec-tools. If no kernel
is specified, will reset KDUMP_KERNELVER if it's defined in /etc/sysconfig/kdump
-or current running kernel's crashkernel value if KDUMP_KERNELVER is empty. You can
+or the current running kernel's crashkernel value if KDUMP_KERNELVER is empty. You can
also specify --kernel=ALL and --kernel=DEFAULT which have the same meaning as
grubby's kernel-path=ALL and kernel-path=DEFAULT. ppc64le supports FADump and
-supports an additonal [--fadump=[on|off|nocma]] parameter to toggle FADump
+supports an additional [--fadump=[on|off|nocma]] parameter to toggle FADump
on/off.
Note: The memory requirements for kdump varies heavily depending on the
commit 3d4cb38d96e45cf5da1460daf3345dd318fdee2f
Author: Coiby Xu <coxu(a)redhat.com>
Date: Fri Jan 7 16:00:08 2022 +0800
unit tests: add check_config with with the default kdump.conf
This test prevents the mistake of adding an option to kdump.conf
without changing check_config as is the case with commit 73ced7f
("introduce the auto_reset_crashkernel option to kdump.conf").
Reviewed-by: Philipp Rudo <prudo(a)redhat.com>
Signed-off-by: Coiby Xu <coxu(a)redhat.com>
diff --git a/spec/kdumpctl_general_spec.sh b/spec/kdumpctl_general_spec.sh
index e72bf1d..5a3ce1c 100644
--- a/spec/kdumpctl_general_spec.sh
+++ b/spec/kdumpctl_general_spec.sh
@@ -174,4 +174,29 @@ Describe 'kdumpctl'
End
End
+ Describe 'parse_config()'
+ bad_kdump_conf=$(mktemp -t bad_kdump_conf.XXXXXXXXXX)
+ cleanup() {
+ rm -f "$bad_kdump_conf"
+ }
+ AfterAll 'cleanup'
+
+ It 'should not be happy with unkown option in kdump.conf'
+ KDUMP_CONFIG_FILE="$bad_kdump_conf"
+ echo blabla > "$bad_kdump_conf"
+ When call parse_config
+ The status should be failure
+ The stderr should include 'Invalid kdump config option blabla'
+ End
+
+ It 'should be happy with the default kdump.conf'
+ # shellcheck disable=SC2034
+ # override the KDUMP_CONFIG_FILE variable
+ KDUMP_CONFIG_FILE=./kdump.conf
+ When call parse_config
+ The status should be success
+ End
+
+ End
+
End
commit e28a1399a3c9e60806a64216e6457e928a594dc8
Author: Coiby Xu <coxu(a)redhat.com>
Date: Thu Jan 6 14:24:22 2022 +0800
unit tests: add tests for kdump_get_conf_val in kdump-lib-initramfs.sh
kdump_get_conf_val allows to retrieves config value defined in
kdump.conf and it also supports sed regex like
"ext[234]\|xfs\|btrfs\|minix\|raw\|nfs\|ssh".
Reviewed-by: Philipp Rudo <prudo(a)redhat.com>
Signed-off-by: Coiby Xu <coxu(a)redhat.com>
diff --git a/spec/kdump-lib-initramfs_spec.sh b/spec/kdump-lib-initramfs_spec.sh
new file mode 100644
index 0000000..dc50793
--- /dev/null
+++ b/spec/kdump-lib-initramfs_spec.sh
@@ -0,0 +1,41 @@
+#!/bin/bash
+Describe 'kdump-lib-initramfs'
+ Include ./kdump-lib-initramfs.sh
+
+ Describe 'Test kdump_get_conf_val'
+ KDUMP_CONFIG_FILE=/tmp/kdump_shellspec_test.conf
+ kdump_config() {
+ %text
+ #|default shell
+ #|nfs my.server.com:/export/tmp # trailing comment
+ #| failure_action shell
+ #|dracut_args --omit-drivers "cfg80211 snd" --add-drivers "ext2 ext3"
+ #|sshkey /root/.ssh/kdump_id_rsa
+ #|ssh user(a)my.server.com
+ }
+ kdump_config >$KDUMP_CONFIG_FILE
+ Context 'Given different cases'
+ # Test the following cases:
+ # - there is trailing comment
+ # - there is space before the parameter
+ # - complicate value for dracut_args
+ # - Given two parameters, retrive one parameter that has value specified
+ # - Given two parameters (in reverse order), retrive one parameter that has value specified
+ Parameters
+ "#1" nfs my.server.com:/export/tmp
+ "#2" ssh user(a)my.server.com
+ "#3" failure_action shell
+ "#4" dracut_args '--omit-drivers "cfg80211 snd" --add-drivers "ext2 ext3"'
+ "#5" 'ssh\|aaa' user(a)my.server.com
+ "#6" 'aaa\|ssh' user(a)my.server.com
+ End
+
+ It 'should handle all cases correctly'
+ When call kdump_get_conf_val "$2"
+ The output should equal "$3"
+ End
+ End
+
+ End
+
+End
commit e00b45d75fa00a1d47b6cab0f609faf089ff563e
Author: Coiby Xu <coxu(a)redhat.com>
Date: Tue Jan 4 15:24:34 2022 +0800
unit tests: add tests for "kdumpctl reset-crashkernel"
This commit adds a relatively thorough test suite for
kdumpctl reset-crashkernel [--fadump=[on|off|nocma]] [--kernel=path_to_kernel] [--reboot]
as implemented in commit 140da74 ("rewrite reset_crashkernel to support
fadump and to used by RPM scriptlet").
grubby have a few options to support its own testing,
- --no-etc-grub-update, not update /etc/default/grub
- --bad-image-okay, don't check the validity of the image
- --env, specify custom grub2 environment block file to avoid modifying
the default /boot/grub2/grubenv
- --bls-directory, specify custom BootLoaderSpec config files to avoid
modifying the default /boot/loader/entries
So the grubby called by kdumpctl is mocked as
@grubby --grub2 --no-etc-grub-update --bad-image-okay --env=$SPEC_TEST_DIR/env_temp -b $SPEC_TEST_DIR/boot_load_entries "$@"
in the tests. To be able to call the actual grubby in the mock function [1],
ShellSpec provides the following command
$ shellspec --gen-bin @grubby
to generate spec/support/bins/@grubby which is used to call the actual grubby.
kdumpctl has implemented its own version of updating /etc/default/grub
in _update_kernel_cmdline_in_grub_etc_default. To avoiding writing to
/etc/default/grub, this function is mocked as outputting its name and
received arguments similar to python unitest's assert_called_with.
[1] https://github.com/shellspec/shellspec#execute-the-actual-command-within-...
Reviewed-by: Philipp Rudo <prudo(a)redhat.com>
Signed-off-by: Coiby Xu <coxu(a)redhat.com>
diff --git a/spec/kdumpctl_reset_crashkernel_spec.sh b/spec/kdumpctl_reset_crashkernel_spec.sh
new file mode 100644
index 0000000..28d9277
--- /dev/null
+++ b/spec/kdumpctl_reset_crashkernel_spec.sh
@@ -0,0 +1,224 @@
+#!/bin/bash
+Describe 'kdumpctl reset-crashkernel [--kernel] [--fadump]'
+ Include ./kdumpctl
+ kernel1=/boot/vmlinuz-5.15.6-100.fc34.x86_64
+ kernel2=/boot/vmlinuz-5.14.14-200.fc34.x86_64
+ ck=222M
+ KDUMP_SPEC_TEST_RUN_DIR=$(mktemp -d /tmp/spec_test.XXXXXXXXXX)
+ current_kernel=5.15.6-100.fc34.x86_64
+
+ setup() {
+ cp -r spec/support/boot_load_entries "$KDUMP_SPEC_TEST_RUN_DIR"
+ cp spec/support/grub_env "$KDUMP_SPEC_TEST_RUN_DIR"/env_temp
+ }
+
+ cleanup() {
+ rm -rf "$KDUMP_SPEC_TEST_RUN_DIR"
+ }
+
+ BeforeAll 'setup'
+ AfterAll 'cleanup'
+
+ grubby() {
+ # - --no-etc-grub-update, not update /etc/default/grub
+ # - --bad-image-okay, don't check the validity of the image
+ # - --env, specify custom grub2 environment block file to avoid modifying
+ # the default /boot/grub2/grubenv
+ # - --bls-directory, specify custom BootLoaderSpec config files to avoid
+ # modifying the default /boot/loader/entries
+ @grubby --no-etc-grub-update --grub2 --bad-image-okay --env="$KDUMP_SPEC_TEST_RUN_DIR"/env_temp -b "$KDUMP_SPEC_TEST_RUN_DIR"/boot_load_entries "$@"
+ }
+
+ Describe "Test the kdump dump mode "
+ uname() {
+ if [[ $1 == '-m' ]]; then
+ echo -n x86_64
+ elif [[ $1 == '-r' ]]; then
+ echo -n $current_kernel
+ fi
+ }
+ kdump_crashkernel=$(get_default_crashkernel kdump)
+ Context "when --kernel not specified"
+ grubby --args crashkernel=$ck --update-kernel ALL
+ Specify 'kdumpctl should warn the user that crashkernel has been udpated'
+ When call reset_crashkernel
+ The error should include "Updated crashkernel=$kdump_crashkernel"
+ End
+
+ Specify 'Current running kernel should have crashkernel updated'
+ When call grubby --info $kernel1
+ The line 3 of output should include crashkernel="$kdump_crashkernel"
+ The line 3 of output should not include crashkernel=$ck
+ End
+
+ Specify 'Other kernel still use the old crashkernel value'
+ When call grubby --info $kernel2
+ The line 3 of output should include crashkernel=$ck
+ End
+ End
+
+ Context "--kernel=ALL"
+ grubby --args crashkernel=$ck --update-kernel ALL
+ Specify 'kdumpctl should warn the user that crashkernel has been udpated'
+ When call reset_crashkernel --kernel=ALL
+ The error should include "Updated crashkernel=$kdump_crashkernel for kernel=$kernel1"
+ The error should include "Updated crashkernel=$kdump_crashkernel for kernel=$kernel2"
+ End
+
+ Specify 'kernel1 should have crashkernel updated'
+ When call grubby --info $kernel1
+ The line 3 of output should include crashkernel="$kdump_crashkernel"
+ End
+
+ Specify 'kernel2 should have crashkernel updated'
+ When call grubby --info $kernel2
+ The line 3 of output should include crashkernel="$kdump_crashkernel"
+ End
+ End
+
+ Context "--kernel=/boot/one-kernel to update one specified kernel"
+ grubby --args crashkernel=$ck --update-kernel ALL
+ Specify 'kdumpctl should warn the user that crashkernel has been updated'
+ When call reset_crashkernel --kernel=$kernel1
+ The error should include "Updated crashkernel=$kdump_crashkernel for kernel=$kernel1"
+ End
+
+ Specify 'kernel1 should have crashkernel updated'
+ When call grubby --info $kernel1
+ The line 3 of output should include crashkernel="$kdump_crashkernel"
+ End
+
+ Specify 'kernel2 should have the old crashkernel'
+ When call grubby --info $kernel2
+ The line 3 of output should include crashkernel=$ck
+ End
+
+ End
+
+ End
+
+ Describe "FADump" fadump
+ uname() {
+ if [[ $1 == '-m' ]]; then
+ echo -n ppc64le
+ elif [[ $1 == '-r' ]]; then
+ echo -n $current_kernel
+ fi
+ }
+
+ _update_kernel_arg_in_grub_etc_default() {
+ # don't modify /etc/default/grub during the test
+ echo _update_kernel_arg_in_grub_etc_default "$@"
+ }
+
+ kdump_crashkernel=$(get_default_crashkernel kdump)
+ fadump_crashkernel=$(get_default_crashkernel fadump)
+ Context "when no --kernel specified"
+ grubby --args crashkernel=$ck --update-kernel ALL
+ grubby --remove-args=fadump --update-kernel ALL
+ Specify 'kdumpctl should warn the user that crashkernel has been udpated'
+ When call reset_crashkernel
+ The error should include "Updated crashkernel=$kdump_crashkernel"
+ End
+
+ Specify 'Current running kernel should have crashkernel updated'
+ When call grubby --info $kernel1
+ The line 3 of output should include crashkernel="$kdump_crashkernel"
+ End
+
+ Specify 'Other kernel still use the old crashkernel value'
+ When call grubby --info $kernel2
+ The line 3 of output should include crashkernel=$ck
+ End
+ End
+
+ Context "--kernel=ALL --fadump=on"
+ grubby --args crashkernel=$ck --update-kernel ALL
+ Specify 'kdumpctl should warn the user that crashkernel has been udpated'
+ When call reset_crashkernel --kernel=ALL --fadump=on
+ The line 1 of output should include "_update_kernel_arg_in_grub_etc_default crashkernel $fadump_crashkernel"
+ The error should include "Updated crashkernel=$fadump_crashkernel for kernel=$kernel1"
+ The error should include "Updated crashkernel=$fadump_crashkernel for kernel=$kernel2"
+ End
+
+ Specify 'kernel1 should have crashkernel updated'
+ When call grubby --info $kernel1
+ The line 3 of output should include crashkernel="$fadump_crashkernel"
+ End
+
+ Specify 'kernel2 should have crashkernel updated'
+ When call get_grub_kernel_boot_parameter $kernel2 crashkernel
+ The output should equal "$fadump_crashkernel"
+ End
+ End
+
+ Context "--kernel=/boot/one-kernel to update one specified kernel"
+ grubby --args crashkernel=$ck --update-kernel ALL
+ grubby --args fadump=on --update-kernel $kernel1
+ Specify 'kdumpctl should warn the user that crashkernel has been updated'
+ When call reset_crashkernel --kernel=$kernel1
+ The error should include "Updated crashkernel=$fadump_crashkernel for kernel=$kernel1"
+ End
+
+ Specify 'kernel1 should have crashkernel updated'
+ When call grubby --info $kernel1
+ The line 3 of output should include crashkernel="$fadump_crashkernel"
+ End
+
+ Specify 'kernel2 should have the old crashkernel'
+ When call get_grub_kernel_boot_parameter $kernel2 crashkernel
+ The output should equal $ck
+ End
+ End
+
+ Context "Update all kernels but without --fadump specified"
+ grubby --args crashkernel=$ck --update-kernel ALL
+ grubby --args fadump=on --update-kernel $kernel1
+ Specify 'kdumpctl should warn the user that crashkernel has been updated'
+ When call reset_crashkernel --kernel=$kernel1
+ The error should include "Updated crashkernel=$fadump_crashkernel for kernel=$kernel1"
+ End
+
+ Specify 'kernel1 should have crashkernel updated'
+ When call get_grub_kernel_boot_parameter $kernel1 crashkernel
+ The output should equal "$fadump_crashkernel"
+ End
+
+ Specify 'kernel2 should have the old crashkernel'
+ When call get_grub_kernel_boot_parameter $kernel2 crashkernel
+ The output should equal $ck
+ End
+ End
+
+ Context 'Switch between fadump=on and fadump=nocma'
+ grubby --args crashkernel=$ck --update-kernel ALL
+ grubby --args fadump=on --update-kernel ALL
+ Specify 'fadump=on to fadump=nocma'
+ When call reset_crashkernel --kernel=ALL --fadump=nocma
+ The line 1 of output should equal "_update_kernel_arg_in_grub_etc_default crashkernel $fadump_crashkernel"
+ The line 2 of output should equal "_update_kernel_arg_in_grub_etc_default fadump nocma"
+ The error should include "Updated crashkernel=$fadump_crashkernel for kernel=$kernel1"
+ The error should include "Updated crashkernel=$fadump_crashkernel for kernel=$kernel2"
+ End
+
+ Specify 'kernel1 should have fadump=nocma in cmdline'
+ When call get_grub_kernel_boot_parameter $kernel1 fadump
+ The output should equal nocma
+ End
+
+ Specify 'fadump=nocma to fadump=on'
+ When call reset_crashkernel --kernel=ALL --fadump=on
+ The line 1 of output should equal "_update_kernel_arg_in_grub_etc_default crashkernel $fadump_crashkernel"
+ The line 2 of output should equal "_update_kernel_arg_in_grub_etc_default fadump on"
+ The error should include "Updated fadump=on for kernel=$kernel1"
+ End
+
+ Specify 'kernel2 should have fadump=on in cmdline'
+ When call get_grub_kernel_boot_parameter $kernel1 fadump
+ The output should equal on
+ End
+
+ End
+
+ End
+End
diff --git a/spec/support/bin/@grubby b/spec/support/bin/@grubby
new file mode 100755
index 0000000..2a9b33f
--- /dev/null
+++ b/spec/support/bin/@grubby
@@ -0,0 +1,3 @@
+#!/bin/sh -e
+. "$SHELLSPEC_SUPPORT_BIN"
+invoke grubby "$@"
diff --git a/spec/support/boot_load_entries/e986846f63134c7295458cf36300ba5b-0-rescue.conf b/spec/support/boot_load_entries/e986846f63134c7295458cf36300ba5b-0-rescue.conf
new file mode 100644
index 0000000..b821952
--- /dev/null
+++ b/spec/support/boot_load_entries/e986846f63134c7295458cf36300ba5b-0-rescue.conf
@@ -0,0 +1,8 @@
+title Fedora (0-rescue-e986846f63134c7295458cf36300ba5b) 33 (Workstation Edition)
+version 0-rescue-e986846f63134c7295458cf36300ba5b
+linux /boot/vmlinuz-0-rescue-e986846f63134c7295458cf36300ba5b
+initrd /boot/initramfs-0-rescue-e986846f63134c7295458cf36300ba5b.img
+options root=UUID=45fdf703-3966-401b-b8f7-cf056affd2b0 ro rd.driver.blacklist=nouveau modprobe.blacklist=nouveau nvidia-drm.modeset=1 rhgb quiet rd.driver.blacklist=nouveau modprobe.blacklist=nouveau nvidia-drm.modeset=1 crashkernel=4G-16G:768M,16G-64G:1G,64G-128G:2G,128G-1T:4G,1T-2T:6G,2T-4T:12G,4T-8T:20G,8T-16T:36G,16T-32T:64G,32T-64T:128G,64T-102400T:180G fadump=on
+grub_users $grub_users
+grub_arg --unrestricted
+grub_class kernel
diff --git a/spec/support/boot_load_entries/e986846f63134c7295458cf36300ba5b-5.14.14-200.fc34.x86_64.conf b/spec/support/boot_load_entries/e986846f63134c7295458cf36300ba5b-5.14.14-200.fc34.x86_64.conf
new file mode 100644
index 0000000..08bd411
--- /dev/null
+++ b/spec/support/boot_load_entries/e986846f63134c7295458cf36300ba5b-5.14.14-200.fc34.x86_64.conf
@@ -0,0 +1,8 @@
+title Fedora (5.14.14-200.fc34.x86_64) 34 (Workstation Edition)
+version 5.14.14-200.fc34.x86_64
+linux /boot/vmlinuz-5.14.14-200.fc34.x86_64
+initrd /boot/initramfs-5.14.14-200.fc34.x86_64.img
+options root=UUID=45fdf703-3966-401b-b8f7-cf056affd2b0 ro rd.driver.blacklist=nouveau modprobe.blacklist=nouveau nvidia-drm.modeset=1 rhgb quiet rd.driver.blacklist=nouveau modprobe.blacklist=nouveau nvidia-drm.modeset=1 crashkernel=4G-16G:768M,16G-64G:1G,64G-128G:2G,128G-1T:4G,1T-2T:6G,2T-4T:12G,4T-8T:20G,8T-16T:36G,16T-32T:64G,32T-64T:128G,64T-102400T:180G fadump=on
+grub_users $grub_users
+grub_arg --unrestricted
+grub_class kernel
diff --git a/spec/support/boot_load_entries/e986846f63134c7295458cf36300ba5b-5.15.6-100.fc34.x86_64.conf b/spec/support/boot_load_entries/e986846f63134c7295458cf36300ba5b-5.15.6-100.fc34.x86_64.conf
new file mode 100644
index 0000000..9259b99
--- /dev/null
+++ b/spec/support/boot_load_entries/e986846f63134c7295458cf36300ba5b-5.15.6-100.fc34.x86_64.conf
@@ -0,0 +1,8 @@
+title Fedora (5.15.6-100.fc34.x86_64) 34 (Workstation Edition)
+version 5.15.6-100.fc34.x86_64
+linux /boot/vmlinuz-5.15.6-100.fc34.x86_64
+initrd /boot/initramfs-5.15.6-100.fc34.x86_64.img
+options root=UUID=45fdf703-3966-401b-b8f7-cf056affd2b0 ro rd.driver.blacklist=nouveau modprobe.blacklist=nouveau nvidia-drm.modeset=1 rhgb quiet rd.driver.blacklist=nouveau modprobe.blacklist=nouveau nvidia-drm.modeset=1 crashkernel=4G-16G:768M,16G-64G:1G,64G-128G:2G,128G-1T:4G,1T-2T:6G,2T-4T:12G,4T-8T:20G,8T-16T:36G,16T-32T:64G,32T-64T:128G,64T-102400T:180G fadump=on
+grub_users $grub_users
+grub_arg --unrestricted
+grub_class fedora
diff --git a/spec/support/grub_env b/spec/support/grub_env
new file mode 100644
index 0000000..a77303c
--- /dev/null
+++ b/spec/support/grub_env
@@ -0,0 +1,3 @@
+# GRUB Environment Block
+# WARNING: Do not edit this file by tools other than grub-editenv!!!
+##################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################
\ No newline at end of file
commit ea8b06df8392d71bdb694646a4e24fd29a947977
Author: Coiby Xu <coxu(a)redhat.com>
Date: Tue Jan 4 20:57:55 2022 +0800
unit tests: add tests for _{update,read}_kernel_arg_in_grub_etc_default in kdumpctl
Reviewed-by: Philipp Rudo <prudo(a)redhat.com>
Signed-off-by: Coiby Xu <coxu(a)redhat.com>
diff --git a/spec/kdumpctl_general_spec.sh b/spec/kdumpctl_general_spec.sh
index 9fbc1a0..e72bf1d 100644
--- a/spec/kdumpctl_general_spec.sh
+++ b/spec/kdumpctl_general_spec.sh
@@ -107,4 +107,71 @@ Describe 'kdumpctl'
End
End
+ Describe '_update_kernel_arg_in_grub_etc_default()'
+ GRUB_ETC_DEFAULT=/tmp/default_grub
+
+ cleanup() {
+ rm -rf "$GRUB_ETC_DEFAULT"
+ }
+ AfterAll 'cleanup'
+
+ Context 'when the given parameter is in different positions'
+ Parameters
+ "crashkernel=222M fadump=on rhgb quiet" crashkernel 333M
+ " fadump=on crashkernel=222M rhgb quiet" crashkernel 333M
+ "fadump=on rhgb quiet crashkernel=222M" crashkernel 333M
+ "fadump=on rhgb quiet" crashkernel 333M
+ "fadump=on foo=bar1 rhgb quiet" foo bar2
+ End
+
+ It 'should update the kernel parameter correctly'
+ echo 'GRUB_CMDLINE_LINUX="'"$1"'"' >$GRUB_ETC_DEFAULT
+ When call _update_kernel_arg_in_grub_etc_default "$2" "$3"
+ # the updated kernel parameter should appear in the end
+ The contents of file $GRUB_ETC_DEFAULT should include "$2=$3\""
+ End
+ End
+
+ It 'should only update the given parameter and not update the parameter that has the given parameter as suffix'
+ echo 'GRUB_CMDLINE_LINUX="fadump=on rhgb quiet ckcrashkernel=222M"' >$GRUB_ETC_DEFAULT
+ _ck_val=1G-4G:192M,4G-64G:256M,64G-102400T:512M
+ When call _update_kernel_arg_in_grub_etc_default crashkernel "$_ck_val"
+ The contents of file $GRUB_ETC_DEFAULT should include "crashkernel=$_ck_val\""
+ The contents of file $GRUB_ETC_DEFAULT should include "ckcrashkernel=222M"
+ End
+
+ It 'should be able to handle the cases of there are multiple crashkernel entries'
+ echo 'GRUB_CMDLINE_LINUX="fadump=on rhgb quiet crashkernel=101M crashkernel=222M"' >$GRUB_ETC_DEFAULT
+ _ck_val=1G-4G:192M,4G-64G:256M,64G-102400T:512M
+ When call _update_kernel_arg_in_grub_etc_default crashkernel "$_ck_val"
+ The contents of file $GRUB_ETC_DEFAULT should include "crashkernel=$_ck_val\""
+ The contents of file $GRUB_ETC_DEFAULT should not include "crashkernel=222M"
+ End
+
+ Context 'when it removes a kernel parameter'
+
+ It 'should remove all values for given arg'
+ echo 'GRUB_CMDLINE_LINUX="crashkernel=33M crashkernel=11M fadump=on crashkernel=222M"' >$GRUB_ETC_DEFAULT
+ When call _update_kernel_arg_in_grub_etc_default crashkernel
+ The contents of file $GRUB_ETC_DEFAULT should equal 'GRUB_CMDLINE_LINUX="fadump=on"'
+ End
+
+ It 'should not remove args that have the given arg as suffix'
+ echo 'GRUB_CMDLINE_LINUX="ckcrashkernel=33M crashkernel=11M ckcrashkernel=222M"' >$GRUB_ETC_DEFAULT
+ When call _update_kernel_arg_in_grub_etc_default crashkernel
+ The contents of file $GRUB_ETC_DEFAULT should equal 'GRUB_CMDLINE_LINUX="ckcrashkernel=33M ckcrashkernel=222M"'
+ End
+ End
+
+ End
+
+ Describe '_read_kernel_arg_in_grub_etc_default()'
+ GRUB_ETC_DEFAULT=/tmp/default_grub
+ It 'should read the value for given arg'
+ echo 'GRUB_CMDLINE_LINUX="crashkernel=33M crashkernel=11M ckcrashkernel=222M"' >$GRUB_ETC_DEFAULT
+ When call _read_kernel_arg_in_grub_etc_default crashkernel
+ The output should equal '11M'
+ End
+ End
+
End
commit 6506bd9b1bcd4117676aaef513c144c4d81bec21
Author: Coiby Xu <coxu(a)redhat.com>
Date: Fri Jan 21 15:46:40 2022 +0800
unit tests: add tests for kdumpctl read_proc_environ_var and _is_osbuild
AfterAll is an example group hook [1] which would be run after the group
tests are executed. Use this hook to clean up the files created by mktemp.
[1] https://github.com/shellspec/shellspec#beforeall-afterall---example-group...
Reviewed-by: Philipp Rudo <prudo(a)redhat.com>
Signed-off-by: Coiby Xu <coxu(a)redhat.com>
diff --git a/spec/kdumpctl_general_spec.sh b/spec/kdumpctl_general_spec.sh
index b968f74..9fbc1a0 100644
--- a/spec/kdumpctl_general_spec.sh
+++ b/spec/kdumpctl_general_spec.sh
@@ -70,5 +70,41 @@ Describe 'kdumpctl'
End
+ Describe "read_proc_environ_var()"
+ environ_test_file=$(mktemp -t spec_test_environ_test_file.XXXXXXXXXX)
+ cleanup() {
+ rm -rf "$environ_test_file"
+ }
+ AfterAll 'cleanup'
+ echo -ne "container=bwrap-osbuild\x00SSH_AUTH_SOCK=/tmp/ssh-XXXXXXEbw33A/agent.1794\x00SSH_AGENT_PID=1929\x00env=test_env" >"$environ_test_file"
+ Parameters
+ container bwrap-osbuild
+ SSH_AUTH_SOCK /tmp/ssh-XXXXXXEbw33A/agent.1794
+ env test_env
+ not_exist ""
+ End
+ It 'should read the environ variable value as expected'
+ When call read_proc_environ_var "$1" "$environ_test_file"
+ The output should equal "$2"
+ The status should be success
+ End
+ End
+
+ Describe "_is_osbuild()"
+ environ_test_file=$(mktemp -t spec_test_environ_test_file.XXXXXXXXXX)
+ # shellcheck disable=SC2034
+ # override the _OSBUILD_ENVIRON_PATH variable
+ _OSBUILD_ENVIRON_PATH="$environ_test_file"
+ Parameters
+ 'container=bwrap-osbuild' success
+ '' failure
+ End
+ It 'should be able to tell if it is the osbuild environment'
+ echo -ne "$1" >"$environ_test_file"
+ When call _is_osbuild
+ The status should be "$2"
+ The stderr should equal ""
+ End
+ End
End
commit 59386d5a8b1d2c2c2f9e8cdeb2a9e17565316033
Author: Coiby Xu <coxu(a)redhat.com>
Date: Wed Jan 5 15:24:02 2022 +0800
unit tests: add tests for get_dump_mode_by_fadump_val
Reviewed-by: Philipp Rudo <prudo(a)redhat.com>
Signed-off-by: Coiby Xu <coxu(a)redhat.com>
diff --git a/spec/kdumpctl_general_spec.sh b/spec/kdumpctl_general_spec.sh
index e1d8698..b968f74 100644
--- a/spec/kdumpctl_general_spec.sh
+++ b/spec/kdumpctl_general_spec.sh
@@ -45,4 +45,30 @@ Describe 'kdumpctl'
The error should include "kernel_path=ALL invalid"
End
End
+
+ Describe 'get_dump_mode_by_fadump_val()'
+
+ Context 'when given valid fadump values'
+ Parameters
+ "#1" on fadump
+ "#2" nocma fadump
+ "#3" "" kdump
+ "#4" off kdump
+ End
+ It "should return the dump mode correctly"
+ When call get_dump_mode_by_fadump_val "$2"
+ The output should equal "$3"
+ The status should be success
+ End
+ End
+
+ It 'should complain given invalid fadump value'
+ When call get_dump_mode_by_fadump_val /boot/vmlinuz
+ The status should be failure
+ The error should include 'invalid fadump'
+ End
+
+ End
+
+
End
commit 93373c040627f31826d864110413c4e1f72e9b4b
Author: Coiby Xu <coxu(a)redhat.com>
Date: Wed Jan 5 13:48:58 2022 +0800
unit tests: add tests for get_grub_kernel_boot_parameter
This test suite makes use of three features provided by ShellSpec
- funcion-based mock [2]: mock a function by re-defining and exporting it
- parameterized tests [3]: run multiple sets of input against the same
test
- %text directive [4]: similar to heredoc but free of
the indentation issue
Note
1. Describe and Context are aliases for ExampleGroup which a block for
grouping example groups or examples [5]. Describe and Context are used to
improve readability.
2. ShellSpec requires .shellspec file.
[1] https://github.com/dodie/testing-in-bash#detailed-comparision
[2] https://github.com/shellspec/shellspec#function-based-mock
[3] https://github.com/shellspec/shellspec#parameters---parameterized-example
[4] https://github.com/shellspec/shellspec#text---embedded-text
[5] https://github.com/shellspec/shellspec#dsl-syntax
Reviewed-by: Philipp Rudo <prudo(a)redhat.com>
Signed-off-by: Coiby Xu <coxu(a)redhat.com>
diff --git a/.shellspec b/.shellspec
new file mode 100644
index 0000000..e69de29
diff --git a/spec/kdumpctl_general_spec.sh b/spec/kdumpctl_general_spec.sh
new file mode 100644
index 0000000..e1d8698
--- /dev/null
+++ b/spec/kdumpctl_general_spec.sh
@@ -0,0 +1,48 @@
+#!/bin/bash
+Describe 'kdumpctl'
+ Include ./kdumpctl
+
+ Describe 'get_grub_kernel_boot_parameter()'
+ grubby() {
+ %text
+ #|index=1
+ #|kernel="/boot/vmlinuz-5.14.14-200.fc34.x86_64"
+ #|args="crashkernel=11M nvidia-drm.modeset=1 crashkernel=100M ro rhgb quiet crcrashkernel=200M crashkernel=32T-64T:128G,64T-102400T:180G fadump=on"
+ #|root="UUID=45fdf703-3966-401b-b8f7-cf056affd2b0"
+ }
+ DUMMY_PARAM=/boot/vmlinuz
+
+ Context "when given a kernel parameter in different positions"
+ # Test the following cases:
+ # - the kernel parameter in the end
+ # - the kernel parameter in the first
+ # - the kernel parameter is crashkernel (suffix of crcrashkernel)
+ # - the kernel parameter that does not exist
+ # - the kernel parameter doesn't have a value
+ Parameters
+ # parameter answer
+ fadump on
+ nvidia-drm.modeset 1
+ crashkernel 32T-64T:128G,64T-102400T:180G
+ aaaa ""
+ ro ""
+ End
+
+ It 'should retrieve the value succesfully'
+ When call get_grub_kernel_boot_parameter "$DUMMY_PARAM" "$2"
+ The output should equal "$3"
+ End
+ End
+
+ It 'should retrive the last value if multiple <parameter=value> entries exist'
+ When call get_grub_kernel_boot_parameter "$DUMMY_PARAM" crashkernel
+ The output should equal '32T-64T:128G,64T-102400T:180G'
+ End
+
+ It 'should fail when called with kernel_path=ALL'
+ When call get_grub_kernel_boot_parameter ALL ro
+ The status should be failure
+ The error should include "kernel_path=ALL invalid"
+ End
+ End
+End
commit b97310428f336d58028d34f3f3c7a551e47b5c32
Author: Coiby Xu <coxu(a)redhat.com>
Date: Tue Jan 4 14:04:38 2022 +0800
unit tests: prepare for kdumpctl and kdump-lib.sh to be unit-tested
Currently there are two issues with unit-testing the functions defined
in kdumpctl and other shell scripts after sourcing them,
- kdumpctl would call main which requires root permission and would
create single instance lock (/var/lock/kdump)
- kdumpctl and other shell scripts directly source files under /usr/lib/kdump/
When ShellSpec load a script via "Include", it defines the__SOURCED__
variable. By making use of __SOURCED__, we can
1. let kdumpctl not call main when kdumpctl is "Include"d by ShellSpec
2. instruct kdumpctl and kdump-lib.sh to source the files in the repo
when running ShelSpec tests
Note coverage/ is added to .gitignore because ShellSpec generates code
coverage results in this folder.
Reviewed-by: Philipp Rudo <prudo(a)redhat.com>
Signed-off-by: Coiby Xu <coxu(a)redhat.com>
diff --git a/.gitignore b/.gitignore
index 7a38a39..e9c2dd8 100644
--- a/.gitignore
+++ b/.gitignore
@@ -21,3 +21,4 @@
/kexec-tools-2.0.11.tar.xz
/makedumpfile-1.5.9.tar.gz
/kexec-tools-2.0.12.tar.xz
+coverage/
diff --git a/kdump-lib.sh b/kdump-lib.sh
index 5b1656e..557eff6 100755
--- a/kdump-lib.sh
+++ b/kdump-lib.sh
@@ -2,8 +2,11 @@
#
# Kdump common variables and functions
#
-
-. /usr/lib/kdump/kdump-lib-initramfs.sh
+if [[ ${__SOURCED__:+x} ]]; then
+ . ./kdump-lib-initramfs.sh
+else
+ . /lib/kdump/kdump-lib-initramfs.sh
+fi
FADUMP_ENABLED_SYS_NODE="/sys/kernel/fadump_enabled"
diff --git a/kdumpctl b/kdumpctl
index 4d819c2..6188d47 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -32,8 +32,14 @@ fi
[[ $dracutbasedir ]] || dracutbasedir=/usr/lib/dracut
. $dracutbasedir/dracut-functions.sh
-. /lib/kdump/kdump-lib.sh
-. /lib/kdump/kdump-logger.sh
+
+if [[ ${__SOURCED__:+x} ]]; then
+ KDUMP_LIB_PATH=.
+else
+ KDUMP_LIB_PATH=/lib/kdump
+fi
+. $KDUMP_LIB_PATH/kdump-lib.sh
+. $KDUMP_LIB_PATH/kdump-logger.sh
#initiate the kdump logger
if ! dlog_init; then
@@ -1676,11 +1682,6 @@ reset_crashkernel_for_installed_kernel()
fi
}
-if [[ ! -f $KDUMP_CONFIG_FILE ]]; then
- derror "Error: No kdump config file found!"
- exit 1
-fi
-
main()
{
# Determine if the dump mode is kdump or fadump
@@ -1753,6 +1754,15 @@ main()
esac
}
+if [[ ${__SOURCED__:+x} ]]; then
+ return
+fi
+
+if [[ ! -f $KDUMP_CONFIG_FILE ]]; then
+ derror "Error: No kdump config file found!"
+ exit 1
+fi
+
# Other kdumpctl instances will block in queue, until this one exits
single_instance_lock
commit 11140c28a25169837333c5bf7d51cbe17c897025
Author: Coiby Xu <coxu(a)redhat.com>
Date: Mon Apr 11 10:56:46 2022 +0800
Release 2.0.24-1
diff --git a/kexec-tools.spec b/kexec-tools.spec
index 6b7ef14..db6374c 100644
--- a/kexec-tools.spec
+++ b/kexec-tools.spec
@@ -4,8 +4,8 @@
%global mkdf_shortver %(c=%{mkdf_ver}; echo ${c:0:7})
Name: kexec-tools
-Version: 2.0.23
-Release: 5%{?dist}
+Version: 2.0.24
+Release: 1%{?dist}
License: GPLv2
Summary: The kexec/kdump userspace component
@@ -103,7 +103,6 @@ Requires: systemd-udev%{?_isa}
#
# Patches 401 through 500 are meant for s390 kexec-tools enablement
#
-Patch401: ./kexec-tools-2.0.23-s390_handle_R_390_PLT32DBL_reloc_entries_in_machine_apply_elf_rel_.patch
#
# Patches 501 through 600 are meant for ARM kexec-tools enablement
@@ -127,7 +126,6 @@ mkdir -p -m755 kcp
tar -z -x -v -f %{SOURCE9}
tar -z -x -v -f %{SOURCE19}
-%patch401 -p1
%ifarch ppc
%define archdef ARCH=ppc
@@ -407,6 +405,28 @@ fi
%endif
%changelog
+* Mon Apr 11 2022 Coiby <coxu(a)redhat.com> - 2.0.24-1
+- Update kexec-tools to 2.0.24
+- kdumpctl: remove kdump_get_conf_val in save_raw
+- kdumpctl: drop DUMP_TARGET variable
+- kdumpctl: drop SSH_KEY_LOCATION variable
+- kdumpctl: drop SAVE_PATH variable
+- kdumpctl: reduce file operations on kdump.conf
+- kdumpctl: merge check_ssh_config into check_config
+- kdumpctl: simplify propagate_ssh_key
+- kdumpctl: forbid aliases from ssh config
+- kdumpctl: fix comment in check_and_wait_network_ready
+- kdump-lib-initramfs: merge definitions for default ssh key
+- kdumpctl: remove unnecessary uses of $?
+- kdump-lib: fix typo in variable name
+- kdump-capture.service: switch to journal for stdout
+- kdumpctl/estimate: Fix unnecessary warning
+- kdumpctl: sync the $TARGET_INITRD after rebuild
+- try to update the crashkernel in GRUB_ETC_DEFAULT after kexec-tools updates the default crashkernel value
+- address the case where there are multiple values for the same kernel arg
+- update kernel crashkernel in posttrans RPM scriptlet when updating kexec-tools
+- kdump-lib.sh: Check the output of blkid with sed instead of eval
+
* Mon Feb 14 2022 Coiby <coxu(a)redhat.com> - 2.0.23-5
- fix incorrect usage of _get_all_kernels_from_grubby
- fix the mistake of swapping function parameters of read_proc_environ_var
diff --git a/sources b/sources
index 5069108..95c0fc6 100644
--- a/sources
+++ b/sources
@@ -1,3 +1,3 @@
SHA512 (eppic-e8844d3.tar.gz) = d86b9f90c57e694107272d8f71b87f66a30743b9530480fb6f665026bbada4c6b0205a83e40b5383663a945681cfbfcf1ee79469fc219ddf679473c4b2290763
-SHA512 (kexec-tools-2.0.23.tar.xz) = b6e3b967cacc31c434b185d25da4d53c822ae4bbcec26ef9d6cb171f294fdcc80913d381e686a0a41e025187835f4dc088052ff88efe75a021d7624c8b1a1ed8
+SHA512 (kexec-tools-2.0.24.tar.xz) = ef7cf78246e2d729d81a3649791a5a23c385353cc75cbe8ef279616329fdaccc876d614c7f51e1456822a13a11520296070d9897467d24310399909e049c3822
SHA512 (makedumpfile-1.7.0.tar.gz) = 579a1fb79d023a1419fc8612a02a04dda3e3b3d72455566433ab6bec08627aa9a176c55566393a081a7aae3fd0543800196596b25445b21b16346556723e9cf7
commit 55b5c4e2b0105ae5b64ab3a5ea1c1879dc818a03
Author: Philipp Rudo <prudo(a)redhat.com>
Date: Fri Mar 25 15:47:11 2022 +0100
kdumpctl: simplify local_fs_dump_target
Make use of the new ${OPT[]} array and simplify local_fs_dump_target to
remove one more file operations.
While at it rename the local_fs_dump_target to is_local_target
Signed-off-by: Philipp Rudo <prudo(a)redhat.com>
Reviewed-by: Tao Liu <ltao(a)redhat.com>
Reviewed-by: Coiby Xu <coxu(a)redhat.com>
diff --git a/kdumpctl b/kdumpctl
index 82e8574..4d819c2 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -850,27 +850,22 @@ save_raw()
return 0
}
-local_fs_dump_target()
+is_local_target()
{
- local _target
-
- if _target=$(grep -E "^ext[234]|^xfs|^btrfs|^minix" /etc/kdump.conf); then
- echo "$_target" | awk '{print $2}'
- fi
+ [[ ${OPT[_fstype]} =~ ^ext[234]|^xfs|^btrfs|^minix ]]
}
path_to_be_relabeled()
{
- local _path _target _mnt="/" _rmnt
+ local _path _mnt="/" _rmnt
if is_user_configured_dump_target; then
if is_mount_in_dracut_args; then
return
fi
- _target=$(local_fs_dump_target)
- if [[ -n $_target ]]; then
- _mnt=$(get_mntpoint_from_target "$_target")
+ if is_local_target; then
+ _mnt=$(get_mntpoint_from_target "${OPT[_target]}")
if ! is_mounted "$_mnt"; then
return
fi
commit ac5968218f4d4d86d5ad217c0912a81e985c5893
Author: Philipp Rudo <prudo(a)redhat.com>
Date: Fri Mar 25 15:47:10 2022 +0100
kdumpctl: remove kdump_get_conf_val in save_raw
With the introduction of ${OPT[fstype]} this call to kdump_get_conf_val
can be removed now as well.
Signed-off-by: Philipp Rudo <prudo(a)redhat.com>
Reviewed-by: Tao Liu <ltao(a)redhat.com>
Reviewed-by: Coiby Xu <coxu(a)redhat.com>
diff --git a/kdumpctl b/kdumpctl
index bfba442..82e8574 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -819,8 +819,9 @@ save_raw()
{
local raw_target
- raw_target=$(kdump_get_conf_val raw)
- [[ -z $raw_target ]] && return 0
+ [[ ${OPT[_fstype]} == raw ]] || return 0
+
+ raw_target=${OPT[_target]}
[[ -b $raw_target ]] || {
derror "raw partition $raw_target not found"
return 1
commit 5118daf2ff9f2283782ea38e4b99cf9c307c2324
Author: Philipp Rudo <prudo(a)redhat.com>
Date: Fri Mar 25 15:47:09 2022 +0100
kdumpctl: drop DUMP_TARGET variable
The variable is only used for ssh dump targets. Furthermore it is
identical to the value stored in ${OPT[_target]}. Thus drop DUMP_TARGET and
use ${OPT[_target]} instead.
In order to be able to distinguish between the different target types
introduce the internal ${OPT[_fstype]}.
Signed-off-by: Philipp Rudo <prudo(a)redhat.com>
Reviewed-by: Tao Liu <ltao(a)redhat.com>
Reviewed-by: Coiby Xu <coxu(a)redhat.com>
diff --git a/kdumpctl b/kdumpctl
index c5afedb..bfba442 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -10,7 +10,6 @@ MKDUMPRD="/sbin/mkdumprd -f"
MKFADUMPRD="/sbin/mkfadumprd"
DRACUT_MODULES_FILE="/usr/lib/dracut/modules.txt"
INITRD_CHECKSUM_LOCATION="/boot/.fadump_initrd_checksum"
-DUMP_TARGET=""
DEFAULT_INITRD=""
DEFAULT_INITRD_BAK=""
KDUMP_INITRD=""
@@ -196,7 +195,7 @@ _set_config()
fi
if [[ -n ${OPT[$opt]} ]]; then
- if [[ $opt == _target ]]; then
+ if [[ $opt == _target ]] || [[ $opt == _fstype ]]; then
derror "More than one dump targets specified"
else
derror "Duplicated kdump config value of option $opt"
@@ -216,6 +215,7 @@ parse_config()
derror 'Multiple mount targets specified in one "dracut_args".'
return 1
fi
+ _set_config _fstype "$(get_dracut_args_fstype "$config_val")" || return 1
_set_config _target "$(get_dracut_args_target "$config_val")" || return 1
fi
;;
@@ -223,15 +223,13 @@ parse_config()
if [[ -d "/proc/device-tree/ibm,opal/dump" ]]; then
dwarn "WARNING: Won't capture opalcore when 'raw' dump target is used."
fi
+ _set_config _fstype "$config_opt" || return 1
config_opt=_target
;;
- ext[234] | minix | btrfs | xfs | nfs )
+ ext[234] | minix | btrfs | xfs | nfs | ssh)
+ _set_config _fstype "$config_opt" || return 1
config_opt=_target
;;
- ssh)
- config_opt=_target
- DUMP_TARGET=$config_val
- ;;
sshkey)
if [[ -z $config_val ]]; then
derror "Invalid kdump config value for option '$config_opt'"
@@ -691,12 +689,12 @@ check_ssh_config()
{
local target
- [[ -n $DUMP_TARGET ]] || return 0
+ [[ "${OPT[_fstype]}" == ssh ]] || return 0
- [[ $DUMP_TARGET =~ .*@.* ]] || return 1
- target=$(ssh -G "$DUMP_TARGET" | sed -n -e "s/^hostname[[:space:]]\+\([^[:space:]]*\).*$/\1/p")
- if [[ ${DUMP_TARGET#*@} != "$target" ]]; then
- derror "Invalid ssh destination $DUMP_TARGET provided."
+ target=$(ssh -G "${OPT[_target]}" | sed -n -e "s/^hostname[[:space:]]\+\([^[:space:]]*\).*$/\1/p")
+ [[ ${OPT[_target]} =~ .*@.* ]] || return 1
+ if [[ ${OPT[_target]#*@} != "$target" ]]; then
+ derror "Invalid ssh destination ${OPT[_target]} provided."
return 1
fi
@@ -715,25 +713,25 @@ check_and_wait_network_ready()
local retval
local errmsg
- [[ -n $DUMP_TARGET ]] || return 0
+ [[ "${OPT[_fstype]}" == ssh ]] || return 0
start_time=$(date +%s)
while true; do
- errmsg=$(ssh -i "${OPT[sshkey]}" -o BatchMode=yes "$DUMP_TARGET" mkdir -p "${OPT[path]}" 2>&1)
+ errmsg=$(ssh -i "${OPT[sshkey]}" -o BatchMode=yes "${OPT[_target]}" mkdir -p "${OPT[path]}" 2>&1)
retval=$?
# ssh exits with the exit status of the remote command or with 255 if an error occurred
if [[ $retval -eq 0 ]]; then
return 0
elif [[ $retval -ne 255 ]]; then
- derror "Could not create $DUMP_TARGET:${OPT[path]}, you should check the privilege on server side"
+ derror "Could not create ${OPT[_target]}:${OPT[path]}, you should check the privilege on server side"
return 1
fi
# if server removes the authorized_keys or, no /root/.ssh/kdump_id_rsa
ddebug "$errmsg"
if echo "$errmsg" | grep -q "Permission denied\|No such file or directory\|Host key verification failed"; then
- derror "Could not create $DUMP_TARGET:${OPT[path]}, you probably need to run \"kdumpctl propagate\""
+ derror "Could not create ${OPT[_target]}:${OPT[path]}, you probably need to run \"kdumpctl propagate\""
return 1
fi
@@ -751,7 +749,7 @@ check_and_wait_network_ready()
sleep 1
done
- dinfo "Could not create $DUMP_TARGET:${OPT[path]}, ipaddr is not ready yet. You should check network connection"
+ dinfo "Could not create ${OPT[_target]}:${OPT[path]}, ipaddr is not ready yet. You should check network connection"
return 1
}
@@ -761,7 +759,7 @@ propagate_ssh_key()
parse_config || return 1
- if [[ -z $DUMP_TARGET ]] ; then
+ if [[ ${OPT[_fstype]} != ssh ]] ; then
derror "No ssh destination defined in $KDUMP_CONFIG_FILE."
derror "Please verify that $KDUMP_CONFIG_FILE contains 'ssh <user>@<host>' and that it is properly formatted."
exit 1
@@ -778,9 +776,9 @@ propagate_ssh_key()
dinfo "done."
fi
- SSH_USER=${DUMP_TARGET%@*}
- SSH_SERVER=${DUMP_TARGET#*@}
- if ssh-copy-id -i "$KEYFILE" "$DUMP_TARGET"; then
+ SSH_USER=${OPT[_target]%@*}
+ SSH_SERVER=${OPT[_target]#*@}
+ if ssh-copy-id -i "$KEYFILE" "${OPT[_target]}"; then
dinfo "$KEYFILE has been added to ~$SSH_USER/.ssh/authorized_keys on $SSH_SERVER"
return 0
else
commit a859abe3652c1eea75b847e6f6f93033b478a4d3
Author: Philipp Rudo <prudo(a)redhat.com>
Date: Fri Mar 25 15:47:08 2022 +0100
kdumpctl: drop SSH_KEY_LOCATION variable
The variable is only used for ssh dump targets. Furthermore it is
identical to the value stored in ${OPT[sshkey]}. Thus drop
SSH_KEY_LOCATION and use ${OPT[sshkey]} instead.
Signed-off-by: Philipp Rudo <prudo(a)redhat.com>
Reviewed-by: Tao Liu <ltao(a)redhat.com>
Reviewed-by: Coiby Xu <coxu(a)redhat.com>
diff --git a/kdumpctl b/kdumpctl
index 876561e..c5afedb 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -9,7 +9,6 @@ KDUMP_LOG_PATH="/var/log"
MKDUMPRD="/sbin/mkdumprd -f"
MKFADUMPRD="/sbin/mkfadumprd"
DRACUT_MODULES_FILE="/usr/lib/dracut/modules.txt"
-SSH_KEY_LOCATION=$DEFAULT_SSHKEY
INITRD_CHECKSUM_LOCATION="/boot/.fadump_initrd_checksum"
DUMP_TARGET=""
DEFAULT_INITRD=""
@@ -238,9 +237,10 @@ parse_config()
derror "Invalid kdump config value for option '$config_opt'"
return 1
elif [[ -f $config_val ]]; then
- SSH_KEY_LOCATION=$(/usr/bin/readlink -m "$config_val")
+ config_val=$(/usr/bin/readlink -m "$config_val")
else
- dwarn "WARNING: '$config_val' doesn't exist, using default value '$SSH_KEY_LOCATION'"
+ dwarn "WARNING: '$config_val' doesn't exist, using default value '$DEFAULT_SSHKEY'"
+ config_val=$DEFAULT_SSHKEY
fi
;;
path | core_collector | kdump_post | kdump_pre | extra_bins | extra_modules | failure_action | default | final_action | force_rebuild | force_no_rebuild | fence_kdump_args | fence_kdump_nodes | auto_reset_crashkernel) ;;
@@ -262,6 +262,7 @@ parse_config()
done <<< "$(kdump_read_conf)"
OPT[path]=${OPT[path]:-$DEFAULT_PATH}
+ OPT[sshkey]=${OPT[sshkey]:-$DEFAULT_SSHKEY}
check_failure_action_config || return 1
check_final_action_config || return 1
@@ -718,7 +719,7 @@ check_and_wait_network_ready()
start_time=$(date +%s)
while true; do
- errmsg=$(ssh -i "$SSH_KEY_LOCATION" -o BatchMode=yes "$DUMP_TARGET" mkdir -p "${OPT[path]}" 2>&1)
+ errmsg=$(ssh -i "${OPT[sshkey]}" -o BatchMode=yes "$DUMP_TARGET" mkdir -p "${OPT[path]}" 2>&1)
retval=$?
# ssh exits with the exit status of the remote command or with 255 if an error occurred
@@ -766,7 +767,7 @@ propagate_ssh_key()
exit 1
fi
- local KEYFILE=$SSH_KEY_LOCATION
+ local KEYFILE=${OPT[sshkey]}
#Check to see if we already created key, if not, create it.
if [[ -f $KEYFILE ]]; then
commit 0460f0a7686334a14c5b17ef00721ad25c54324b
Author: Philipp Rudo <prudo(a)redhat.com>
Date: Fri Mar 25 15:47:07 2022 +0100
kdumpctl: drop SAVE_PATH variable
The variable is only used for ssh dump targets. Furthermore it is
identical to the value stored in ${OPT[path]}. Thus drop SAVE_PATH and
use ${OPT[path]} instead.
Also make sure that ${OPT[path]} is always set to the default value when
no entry in kdump.conf is found.
Signed-off-by: Philipp Rudo <prudo(a)redhat.com>
Reviewed-by: Tao Liu <ltao(a)redhat.com>
Reviewed-by: Coiby Xu <coxu(a)redhat.com>
diff --git a/kdumpctl b/kdumpctl
index 0b57384..876561e 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -9,7 +9,6 @@ KDUMP_LOG_PATH="/var/log"
MKDUMPRD="/sbin/mkdumprd -f"
MKFADUMPRD="/sbin/mkfadumprd"
DRACUT_MODULES_FILE="/usr/lib/dracut/modules.txt"
-SAVE_PATH=/var/crash
SSH_KEY_LOCATION=$DEFAULT_SSHKEY
INITRD_CHECKSUM_LOCATION="/boot/.fadump_initrd_checksum"
DUMP_TARGET=""
@@ -244,10 +243,7 @@ parse_config()
dwarn "WARNING: '$config_val' doesn't exist, using default value '$SSH_KEY_LOCATION'"
fi
;;
- path)
- SAVE_PATH=$config_val
- ;;
- core_collector | kdump_post | kdump_pre | extra_bins | extra_modules | failure_action | default | final_action | force_rebuild | force_no_rebuild | fence_kdump_args | fence_kdump_nodes | auto_reset_crashkernel) ;;
+ path | core_collector | kdump_post | kdump_pre | extra_bins | extra_modules | failure_action | default | final_action | force_rebuild | force_no_rebuild | fence_kdump_args | fence_kdump_nodes | auto_reset_crashkernel) ;;
net | options | link_delay | disk_timeout | debug_mem_level | blacklist)
derror "Deprecated kdump config option: $config_opt. Refer to kdump.conf manpage for alternatives."
@@ -265,6 +261,8 @@ parse_config()
_set_config "$config_opt" "$config_val" || return 1
done <<< "$(kdump_read_conf)"
+ OPT[path]=${OPT[path]:-$DEFAULT_PATH}
+
check_failure_action_config || return 1
check_final_action_config || return 1
check_fence_kdump_config || return 1
@@ -720,21 +718,21 @@ check_and_wait_network_ready()
start_time=$(date +%s)
while true; do
- errmsg=$(ssh -i "$SSH_KEY_LOCATION" -o BatchMode=yes "$DUMP_TARGET" mkdir -p "$SAVE_PATH" 2>&1)
+ errmsg=$(ssh -i "$SSH_KEY_LOCATION" -o BatchMode=yes "$DUMP_TARGET" mkdir -p "${OPT[path]}" 2>&1)
retval=$?
# ssh exits with the exit status of the remote command or with 255 if an error occurred
if [[ $retval -eq 0 ]]; then
return 0
elif [[ $retval -ne 255 ]]; then
- derror "Could not create $DUMP_TARGET:$SAVE_PATH, you should check the privilege on server side"
+ derror "Could not create $DUMP_TARGET:${OPT[path]}, you should check the privilege on server side"
return 1
fi
# if server removes the authorized_keys or, no /root/.ssh/kdump_id_rsa
ddebug "$errmsg"
if echo "$errmsg" | grep -q "Permission denied\|No such file or directory\|Host key verification failed"; then
- derror "Could not create $DUMP_TARGET:$SAVE_PATH, you probably need to run \"kdumpctl propagate\""
+ derror "Could not create $DUMP_TARGET:${OPT[path]}, you probably need to run \"kdumpctl propagate\""
return 1
fi
@@ -752,7 +750,7 @@ check_and_wait_network_ready()
sleep 1
done
- dinfo "Could not create $DUMP_TARGET:$SAVE_PATH, ipaddr is not ready yet. You should check network connection"
+ dinfo "Could not create $DUMP_TARGET:${OPT[path]}, ipaddr is not ready yet. You should check network connection"
return 1
}
@@ -820,7 +818,6 @@ check_current_status()
save_raw()
{
- local kdump_dir
local raw_target
raw_target=$(kdump_get_conf_val raw)
@@ -834,13 +831,8 @@ save_raw()
dwarn "Warning: Detected '$check_fs' signature on $raw_target, data loss is expected."
return 0
fi
- kdump_dir=${OPT[path]}
- if [[ -z ${kdump_dir} ]]; then
- coredir="/var/crash/$(date +"%Y-%m-%d-%H:%M")"
- else
- coredir="${kdump_dir}/$(date +"%Y-%m-%d-%H:%M")"
- fi
+ coredir="${OPT[path]}/$(date +"%Y-%m-%d-%H:%M")"
mkdir -p "$coredir"
[[ -d $coredir ]] || {
derror "failed to create $coredir"
commit edb1d04425605db53637f698422017b609efe2b4
Author: Philipp Rudo <prudo(a)redhat.com>
Date: Fri Mar 25 15:47:06 2022 +0100
kdumpctl: reduce file operations on kdump.conf
Every call to kdump_get_conf_val parses kdump.conf although the file has
already been parsed in check_config. Thus store the values parsed in
check_config in an array and use them later instead of re-parsing the
file over and over again.
While at it rename check_config to parse_config.
Signed-off-by: Philipp Rudo <prudo(a)redhat.com>
Reviewed-by: Tao Liu <ltao(a)redhat.com>
Reviewed-by: Coiby Xu <coxu(a)redhat.com>
diff --git a/kdumpctl b/kdumpctl
index 85ea7aa..0b57384 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -27,6 +27,8 @@ standard_kexec_args="-d -p"
# Some default values in case /etc/sysconfig/kdump doesn't include
KDUMP_COMMANDLINE_REMOVE="hugepages hugepagesz slub_debug"
+declare -A OPT
+
if [[ -f /etc/sysconfig/kdump ]]; then
. /etc/sysconfig/kdump
fi
@@ -185,9 +187,29 @@ restore_default_initrd()
fi
}
-check_config()
+_set_config()
+{
+ local opt=$1
+ local val=$2
+
+ if [[ -z $val ]]; then
+ derror "Invalid kdump config value for option '$opt'"
+ return 1
+ fi
+
+ if [[ -n ${OPT[$opt]} ]]; then
+ if [[ $opt == _target ]]; then
+ derror "More than one dump targets specified"
+ else
+ derror "Duplicated kdump config value of option $opt"
+ fi
+ return 1
+ fi
+ OPT[$opt]="$val"
+}
+
+parse_config()
{
- local -A _opt_rec
while read -r config_opt config_val; do
case "$config_opt" in
dracut_args)
@@ -196,7 +218,7 @@ check_config()
derror 'Multiple mount targets specified in one "dracut_args".'
return 1
fi
- config_opt=_target
+ _set_config _target "$(get_dracut_args_target "$config_val")" || return 1
fi
;;
raw)
@@ -240,20 +262,7 @@ check_config()
;;
esac
- if [[ -z $config_val ]]; then
- derror "Invalid kdump config value for option '$config_opt'"
- return 1
- fi
-
- if [[ -n ${_opt_rec[$config_opt]} ]]; then
- if [[ $config_opt == _target ]]; then
- derror "More than one dump targets specified"
- else
- derror "Duplicated kdump config value of option $config_opt"
- fi
- return 1
- fi
- _opt_rec[$config_opt]="$config_val"
+ _set_config "$config_opt" "$config_val" || return 1
done <<< "$(kdump_read_conf)"
check_failure_action_config || return 1
@@ -321,8 +330,8 @@ check_files_modified()
#also rebuild when Pacemaker cluster conf is changed and fence kdump is enabled.
modified_files=$(get_pcs_cluster_modified_files)
- EXTRA_BINS=$(kdump_get_conf_val kdump_post)
- CHECK_FILES=$(kdump_get_conf_val kdump_pre)
+ EXTRA_BINS=${OPT[kdump_post]}
+ CHECK_FILES=${OPT[kdump_pre]}
HOOKS="/etc/kdump/post.d/ /etc/kdump/pre.d/"
if [[ -d /etc/kdump/post.d ]]; then
for file in /etc/kdump/post.d/*; do
@@ -339,17 +348,17 @@ check_files_modified()
done
fi
HOOKS="$HOOKS $POST_FILES $PRE_FILES"
- CORE_COLLECTOR=$(kdump_get_conf_val core_collector | awk '{print $1}')
+ CORE_COLLECTOR=$(echo "${OPT[core_collector]}" | awk '{print $1}')
CORE_COLLECTOR=$(type -P "$CORE_COLLECTOR")
# POST_FILES and PRE_FILES are already checked against executable, need not to check again.
EXTRA_BINS="$EXTRA_BINS $CHECK_FILES"
- CHECK_FILES=$(kdump_get_conf_val extra_bins)
+ CHECK_FILES=${OPT[extra_bins]}
EXTRA_BINS="$EXTRA_BINS $CHECK_FILES"
files="$KDUMP_CONFIG_FILE $KDUMP_KERNEL $EXTRA_BINS $CORE_COLLECTOR"
[[ -e /etc/fstab ]] && files="$files /etc/fstab"
# Check for any updated extra module
- EXTRA_MODULES="$(kdump_get_conf_val extra_modules)"
+ EXTRA_MODULES="${OPT[extra_modules]}"
if [[ -n $EXTRA_MODULES ]]; then
if [[ -e /lib/modules/$KDUMP_KERNELVER/modules.dep ]]; then
files="$files /lib/modules/$KDUMP_KERNELVER/modules.dep"
@@ -541,14 +550,14 @@ check_rebuild()
setup_initrd || return 1
- force_no_rebuild=$(kdump_get_conf_val force_no_rebuild)
+ force_no_rebuild=${OPT[force_no_rebuild]}
force_no_rebuild=${force_no_rebuild:-0}
if [[ $force_no_rebuild != "0" ]] && [[ $force_no_rebuild != "1" ]]; then
derror "Error: force_no_rebuild value is invalid"
return 1
fi
- force_rebuild=$(kdump_get_conf_val force_rebuild)
+ force_rebuild=${OPT[force_rebuild]}
force_rebuild=${force_rebuild:-0}
if [[ $force_rebuild != "0" ]] && [[ $force_rebuild != "1" ]]; then
derror "Error: force_rebuild value is invalid"
@@ -751,7 +760,7 @@ propagate_ssh_key()
{
local SSH_USER SSH_SERVER
- check_config || return 1
+ parse_config || return 1
if [[ -z $DUMP_TARGET ]] ; then
derror "No ssh destination defined in $KDUMP_CONFIG_FILE."
@@ -825,7 +834,7 @@ save_raw()
dwarn "Warning: Detected '$check_fs' signature on $raw_target, data loss is expected."
return 0
fi
- kdump_dir=$(kdump_get_conf_val path)
+ kdump_dir=${OPT[path]}
if [[ -z ${kdump_dir} ]]; then
coredir="/var/crash/$(date +"%Y-%m-%d-%H:%M")"
else
@@ -911,7 +920,7 @@ check_fence_kdump_config()
hostname=$(hostname)
ipaddrs=$(hostname -I)
- nodes=$(kdump_get_conf_val "fence_kdump_nodes")
+ nodes=${OPT[fence_kdump_nodes]}
for node in $nodes; do
if [[ $node == "$hostname" ]]; then
@@ -964,8 +973,8 @@ check_failure_action_config()
local failure_action
local option="failure_action"
- default_option=$(kdump_get_conf_val default)
- failure_action=$(kdump_get_conf_val failure_action)
+ default_option=${OPT[default]}
+ failure_action=${OPT[failure_action]}
if [[ -z $failure_action ]] && [[ -z $default_option ]]; then
return 0
@@ -994,7 +1003,7 @@ check_final_action_config()
{
local final_action
- final_action=$(kdump_get_conf_val final_action)
+ final_action=${OPT[final_action]}
if [[ -z $final_action ]]; then
return 0
else
@@ -1017,7 +1026,7 @@ start()
return 1
fi
- if ! check_config; then
+ if ! parse_config; then
derror "Starting kdump: [FAILED]"
return 1
fi
@@ -1153,7 +1162,7 @@ stop()
rebuild()
{
- check_config || return 1
+ parse_config || return 1
check_and_wait_network_ready || return 1
setup_initrd || return 1
commit 4adf6d3cc85811d47ddc90c89a6f47b699350410
Author: Philipp Rudo <prudo(a)redhat.com>
Date: Fri Mar 25 15:47:05 2022 +0100
kdumpctl: merge check_ssh_config into check_config
check_config and check_ssh_config both parse /etc/kdump.conf and are
usually used together. The difference between both is that
check_ssh_config does some extra checks on the format of the provided
ssh destination but ignores invalid or deprecated options in the config.
Thus merge check_ssh_config into check_config. Leave the additional
checks on the ssh destination in check_ssh_config but treat it like the
checks done for e.g. the failure_action.
This slightly changes the behavior of 'kdumpctl propagate', which now
fails if kdump.conf contains an invalid value unrelated to ssh. This
change in behavior isn't problematic because 'kdumpctl propagate' always
needs to be followed by a 'kdumpctl start' to have a working kdump
environment. For the situations where 'propagate' fails now the 'start'
would have failed in the past. So the failure only moved one step ahead
in the sequence.
While at it drop check_ssh_target and call check_and_wait_network_ready
directly.
Signed-off-by: Philipp Rudo <prudo(a)redhat.com>
Reviewed-by: Tao Liu <ltao(a)redhat.com>
Reviewed-by: Coiby Xu <coxu(a)redhat.com>
diff --git a/kdumpctl b/kdumpctl
index e6d5066..85ea7aa 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -205,10 +205,27 @@ check_config()
fi
config_opt=_target
;;
- ext[234] | minix | btrfs | xfs | nfs | ssh)
+ ext[234] | minix | btrfs | xfs | nfs )
config_opt=_target
;;
- sshkey | path | core_collector | kdump_post | kdump_pre | extra_bins | extra_modules | failure_action | default | final_action | force_rebuild | force_no_rebuild | fence_kdump_args | fence_kdump_nodes | auto_reset_crashkernel) ;;
+ ssh)
+ config_opt=_target
+ DUMP_TARGET=$config_val
+ ;;
+ sshkey)
+ if [[ -z $config_val ]]; then
+ derror "Invalid kdump config value for option '$config_opt'"
+ return 1
+ elif [[ -f $config_val ]]; then
+ SSH_KEY_LOCATION=$(/usr/bin/readlink -m "$config_val")
+ else
+ dwarn "WARNING: '$config_val' doesn't exist, using default value '$SSH_KEY_LOCATION'"
+ fi
+ ;;
+ path)
+ SAVE_PATH=$config_val
+ ;;
+ core_collector | kdump_post | kdump_pre | extra_bins | extra_modules | failure_action | default | final_action | force_rebuild | force_no_rebuild | fence_kdump_args | fence_kdump_nodes | auto_reset_crashkernel) ;;
net | options | link_delay | disk_timeout | debug_mem_level | blacklist)
derror "Deprecated kdump config option: $config_opt. Refer to kdump.conf manpage for alternatives."
@@ -242,6 +259,7 @@ check_config()
check_failure_action_config || return 1
check_final_action_config || return 1
check_fence_kdump_config || return 1
+ check_ssh_config || return 1
return 0
}
@@ -665,29 +683,8 @@ check_ssh_config()
{
local target
- while read -r config_opt config_val; do
- case "$config_opt" in
- sshkey)
- # remove inline comments after the end of a directive.
- if [[ -f $config_val ]]; then
- # canonicalize the path
- SSH_KEY_LOCATION=$(/usr/bin/readlink -m "$config_val")
- else
- dwarn "WARNING: '$config_val' doesn't exist, using default value '$SSH_KEY_LOCATION'"
- fi
- ;;
- path)
- SAVE_PATH=$config_val
- ;;
- ssh)
- DUMP_TARGET=$config_val
- ;;
- *) ;;
-
- esac
- done <<< "$(kdump_read_conf)"
+ [[ -n $DUMP_TARGET ]] || return 0
- [[ -n $DUMP_TARGET ]] || return 1
[[ $DUMP_TARGET =~ .*@.* ]] || return 1
target=$(ssh -G "$DUMP_TARGET" | sed -n -e "s/^hostname[[:space:]]\+\([^[:space:]]*\).*$/\1/p")
if [[ ${DUMP_TARGET#*@} != "$target" ]]; then
@@ -710,6 +707,8 @@ check_and_wait_network_ready()
local retval
local errmsg
+ [[ -n $DUMP_TARGET ]] || return 0
+
start_time=$(date +%s)
while true; do
errmsg=$(ssh -i "$SSH_KEY_LOCATION" -o BatchMode=yes "$DUMP_TARGET" mkdir -p "$SAVE_PATH" 2>&1)
@@ -748,16 +747,13 @@ check_and_wait_network_ready()
return 1
}
-check_ssh_target()
-{
- check_and_wait_network_ready
-}
-
propagate_ssh_key()
{
local SSH_USER SSH_SERVER
- if ! check_ssh_config; then
+ check_config || return 1
+
+ if [[ -z $DUMP_TARGET ]] ; then
derror "No ssh destination defined in $KDUMP_CONFIG_FILE."
derror "Please verify that $KDUMP_CONFIG_FILE contains 'ssh <user>@<host>' and that it is properly formatted."
exit 1
@@ -1040,11 +1036,9 @@ start()
return 0
fi
- if check_ssh_config; then
- if ! check_ssh_target; then
- derror "Starting kdump: [FAILED]"
- return 1
- fi
+ if ! check_and_wait_network_ready; then
+ derror "Starting kdump: [FAILED]"
+ return 1
fi
if ! check_rebuild; then
@@ -1160,12 +1154,7 @@ stop()
rebuild()
{
check_config || return 1
-
- if check_ssh_config; then
- if ! check_ssh_target; then
- return 1
- fi
- fi
+ check_and_wait_network_ready || return 1
setup_initrd || return 1
commit e3fa3678404e161be27914b91c69693613b1fcfe
Author: Philipp Rudo <prudo(a)redhat.com>
Date: Fri Mar 25 15:47:04 2022 +0100
kdumpctl: simplify propagate_ssh_key
The function has multiple problems:
1) SSH_{USER,SERVER} aren't defined local
2) Weird use of cut and sed to parse the DUMP_TARGET for the user and
host although check_ssh_config guarantees that it has the format
<user>@<host>.
3) Unnecessary use of a variable for the return value
4) Weird behavior to first unpack the DUMP_TARGET to SSH_USER and
SSH_SERVER and then putting it back together again
5) Definition of variable errmsg that is only used once but breaks
grep-ability of error message.
6) Wrong order when redirecting output of ssh-keygen, see SC2069 [1]
Fix them now.
While at it also improve the error messages in the function.
[1] https://www.shellcheck.net/wiki/SC2069
Signed-off-by: Philipp Rudo <prudo(a)redhat.com>
Reviewed-by: Tao Liu <ltao(a)redhat.com>
Reviewed-by: Coiby Xu <coxu(a)redhat.com>
diff --git a/kdumpctl b/kdumpctl
index 8ad6e4c..e6d5066 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -755,35 +755,32 @@ check_ssh_target()
propagate_ssh_key()
{
+ local SSH_USER SSH_SERVER
+
if ! check_ssh_config; then
- derror "No ssh config specified in $KDUMP_CONFIG_FILE. Can't propagate"
+ derror "No ssh destination defined in $KDUMP_CONFIG_FILE."
+ derror "Please verify that $KDUMP_CONFIG_FILE contains 'ssh <user>@<host>' and that it is properly formatted."
exit 1
fi
local KEYFILE=$SSH_KEY_LOCATION
- local errmsg="Failed to propagate ssh key"
#Check to see if we already created key, if not, create it.
if [[ -f $KEYFILE ]]; then
dinfo "Using existing keys..."
else
dinfo "Generating new ssh keys... "
- /usr/bin/ssh-keygen -t rsa -f "$KEYFILE" -N "" 2>&1 > /dev/null
+ /usr/bin/ssh-keygen -t rsa -f "$KEYFILE" -N "" &> /dev/null
dinfo "done."
fi
- #now find the target ssh user and server to contact.
- SSH_USER=$(echo "$DUMP_TARGET" | cut -d@ -f1)
- SSH_SERVER=$(echo "$DUMP_TARGET" | sed -e's/\(.*(a)\)\(.*$\)/\2/')
-
- #now send the found key to the found server
- ssh-copy-id -i "$KEYFILE" "$SSH_USER@$SSH_SERVER"
- RET=$?
- if [[ $RET == 0 ]]; then
+ SSH_USER=${DUMP_TARGET%@*}
+ SSH_SERVER=${DUMP_TARGET#*@}
+ if ssh-copy-id -i "$KEYFILE" "$DUMP_TARGET"; then
dinfo "$KEYFILE has been added to ~$SSH_USER/.ssh/authorized_keys on $SSH_SERVER"
return 0
else
- derror "$errmsg, $KEYFILE failed in transfer to $SSH_SERVER"
+ derror "Failed to propagate ssh key, could not transfer $KEYFILE to $SSH_SERVER"
exit 1
fi
}
commit b802dbff9f0da8b5cd6eebf28dd3e7fd207cc45c
Author: Philipp Rudo <prudo(a)redhat.com>
Date: Fri Mar 25 15:47:03 2022 +0100
kdumpctl: forbid aliases from ssh config
For ssh targets kdumpctl only verifies that the config value has the
correct <user>@<host> format itself. For all other tests, e.g. if the
destination can be reached, it relies on ssh. This allows users to
provide a <host> that isn't the proper hostname but an alias defined in
the ssh_config without failing the tests. If this is done
dracut-module-setup.sh:kdump_get_remote_ip will fail to obtain the
targets ip address. This failure is not detected and thus will not fail
the initramfs creation. The resulting initramfs however doesn't have the
necessary information for setting up the network and thus will fail to
boot.
Prevent the use of alias hostnames by verifying that the given hostname
is the same one ssh would use after parsing the ssh_config.
Note: Don't use getent ahosts to verify that the given host can be
resolved as this requires the network to be up which cannot be
guaranteed when the kdump.conf is parsed.
Signed-off-by: Philipp Rudo <prudo(a)redhat.com>
Reviewed-by: Tao Liu <ltao(a)redhat.com>
Reviewed-by: Coiby Xu <coxu(a)redhat.com>
diff --git a/kdumpctl b/kdumpctl
index 7d40f76..8ad6e4c 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -663,7 +663,7 @@ load_kdump()
check_ssh_config()
{
- local SSH_TARGET
+ local target
while read -r config_opt config_val; do
case "$config_opt" in
@@ -687,11 +687,14 @@ check_ssh_config()
esac
done <<< "$(kdump_read_conf)"
- #make sure they've configured kdump.conf for ssh dumps
- SSH_TARGET=$(echo -n "$DUMP_TARGET" | sed -n '/.*@/p')
- if [[ -z $SSH_TARGET ]]; then
+ [[ -n $DUMP_TARGET ]] || return 1
+ [[ $DUMP_TARGET =~ .*@.* ]] || return 1
+ target=$(ssh -G "$DUMP_TARGET" | sed -n -e "s/^hostname[[:space:]]\+\([^[:space:]]*\).*$/\1/p")
+ if [[ ${DUMP_TARGET#*@} != "$target" ]]; then
+ derror "Invalid ssh destination $DUMP_TARGET provided."
return 1
fi
+
return 0
}
commit 247b3dd297f1ee2224af2d3b838019af428c387e
Author: Philipp Rudo <prudo(a)redhat.com>
Date: Fri Mar 25 15:47:02 2022 +0100
kdumpctl: fix comment in check_and_wait_network_ready
The time out was increased to 180 seconds in 680c0d3 ("kdumpctl:
distinguish the failed reason of ssh"). Update the comment to reflect
that change.
Signed-off-by: Philipp Rudo <prudo(a)redhat.com>
Reviewed-by: Tao Liu <ltao(a)redhat.com>
Reviewed-by: Coiby Xu <coxu(a)redhat.com>
diff --git a/kdumpctl b/kdumpctl
index 7b01cd3..7d40f76 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -734,7 +734,7 @@ check_and_wait_network_ready()
cur=$(date +%s)
diff=$((cur - start_time))
- # 60s time out
+ # time out after 180s
if [[ $diff -gt 180 ]]; then
break
fi
commit 7cd3f232d50c76bb5c6bf0b3175cc2c36c2f3351
Author: Philipp Rudo <prudo(a)redhat.com>
Date: Fri Mar 25 15:47:01 2022 +0100
kdump-lib-initramfs: merge definitions for default ssh key
There are currently three identical definitions for the default ssh key.
Combine them into one in kdump-lib-initramfs.sh.
Signed-off-by: Philipp Rudo <prudo(a)redhat.com>
Reviewed-by: Tao Liu <ltao(a)redhat.com>
Reviewed-by: Coiby Xu <coxu(a)redhat.com>
diff --git a/dracut-kdump.sh b/dracut-kdump.sh
index b69bc98..b17455a 100755
--- a/dracut-kdump.sh
+++ b/dracut-kdump.sh
@@ -22,7 +22,7 @@ FAILURE_ACTION="systemctl reboot -f"
DATEDIR=$(date +%Y-%m-%d-%T)
HOST_IP='127.0.0.1'
DUMP_INSTRUCTION=""
-SSH_KEY_LOCATION="/root/.ssh/kdump_id_rsa"
+SSH_KEY_LOCATION=$DEFAULT_SSHKEY
DD_BLKSIZE=512
FINAL_ACTION="systemctl reboot -f"
KDUMP_PRE=""
diff --git a/kdump-lib-initramfs.sh b/kdump-lib-initramfs.sh
index 9be0fe9..84e6bf7 100755
--- a/kdump-lib-initramfs.sh
+++ b/kdump-lib-initramfs.sh
@@ -4,6 +4,7 @@
# not be the default shell. Any code added must be POSIX compliant.
DEFAULT_PATH="/var/crash/"
+DEFAULT_SSHKEY="/root/.ssh/kdump_id_rsa"
KDUMP_CONFIG_FILE="/etc/kdump.conf"
FENCE_KDUMP_CONFIG_FILE="/etc/sysconfig/fence_kdump"
FENCE_KDUMP_SEND="/usr/libexec/fence_kdump_send"
diff --git a/kdumpctl b/kdumpctl
index 35fd6e0..7b01cd3 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -10,7 +10,7 @@ MKDUMPRD="/sbin/mkdumprd -f"
MKFADUMPRD="/sbin/mkfadumprd"
DRACUT_MODULES_FILE="/usr/lib/dracut/modules.txt"
SAVE_PATH=/var/crash
-SSH_KEY_LOCATION="/root/.ssh/kdump_id_rsa"
+SSH_KEY_LOCATION=$DEFAULT_SSHKEY
INITRD_CHECKSUM_LOCATION="/boot/.fadump_initrd_checksum"
DUMP_TARGET=""
DEFAULT_INITRD=""
diff --git a/mkdumprd b/mkdumprd
index 5996d50..3e250e0 100644
--- a/mkdumprd
+++ b/mkdumprd
@@ -22,7 +22,7 @@ if ! dlog_init; then
exit 1
fi
-SSH_KEY_LOCATION="/root/.ssh/kdump_id_rsa"
+SSH_KEY_LOCATION=$DEFAULT_SSHKEY
SAVE_PATH=$(get_save_path)
OVERRIDE_RESETTABLE=0
commit b49083126fcdd5be8cb7d84e0048ac2adddb6aed
Author: Philipp Rudo <prudo(a)redhat.com>
Date: Fri Mar 25 15:47:00 2022 +0100
kdumpctl: remove unnecessary uses of $?
Signed-off-by: Philipp Rudo <prudo(a)redhat.com>
Reviewed-by: Tao Liu <ltao(a)redhat.com>
Reviewed-by: Coiby Xu <coxu(a)redhat.com>
diff --git a/kdumpctl b/kdumpctl
index b7922a6..35fd6e0 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -86,7 +86,6 @@ rebuild_fadump_initrd()
check_earlykdump_is_enabled()
{
grep -q -w "rd.earlykdump" /proc/cmdline
- return $?
}
rebuild_kdump_initrd()
@@ -117,8 +116,6 @@ rebuild_initrd()
else
rebuild_kdump_initrd
fi
-
- return $?
}
#$1: the files to be checked with IFS=' '
@@ -584,7 +581,6 @@ check_rebuild()
dinfo "Rebuilding $TARGET_INITRD"
rebuild_initrd
- return $?
}
# On ppc64le LPARs, the keys trusted by firmware do not end up in
@@ -815,8 +811,6 @@ check_current_status()
else
check_current_kdump_status
fi
-
- return $?
}
save_raw()
@@ -945,7 +939,6 @@ check_dump_feasibility()
fi
check_kdump_feasibility
- return $?
}
start_fadump()
@@ -967,8 +960,6 @@ start_dump()
else
load_kdump
fi
-
- return $?
}
check_failure_action_config()
@@ -1077,7 +1068,7 @@ reload()
if [[ $DEFAULT_DUMP_MODE == "fadump" ]]; then
reload_fadump
- return $?
+ return
else
if ! stop_kdump; then
derror "Stopping kdump: [FAILED]"
@@ -1141,7 +1132,7 @@ reload_fadump()
# to handle such scenario.
if stop_fadump; then
start_fadump
- return $?
+ return
fi
fi
@@ -1180,7 +1171,6 @@ rebuild()
dinfo "Rebuilding $TARGET_INITRD"
rebuild_initrd
- return $?
}
do_estimate()
@@ -1787,5 +1777,3 @@ single_instance_lock
exec 9<&-
main "$@"
)
-
-exit $?
commit aa9bb8f8cef734fb1f6ab36ccaaa8936edb4f467
Author: Philipp Rudo <prudo(a)redhat.com>
Date: Fri Mar 25 15:46:59 2022 +0100
kdump-lib: fix typo in variable name
in prepare_kdump_bootinfo s/defaut/default/.
While at it declare it with the other local variables as local.
Signed-off-by: Philipp Rudo <prudo(a)redhat.com>
Reviewed-by: Tao Liu <ltao(a)redhat.com>
Reviewed-by: Coiby Xu <coxu(a)redhat.com>
diff --git a/kdump-lib.sh b/kdump-lib.sh
index 4ed5035..5b1656e 100755
--- a/kdump-lib.sh
+++ b/kdump-lib.sh
@@ -640,7 +640,7 @@ prepare_kexec_args()
prepare_kdump_bootinfo()
{
local boot_img boot_imglist boot_dirlist boot_initrdlist
- local machine_id
+ local machine_id dir img default_initrd_base var_target_initrd_dir
if [[ -z $KDUMP_KERNELVER ]]; then
KDUMP_KERNELVER="$(uname -r)"
@@ -677,8 +677,8 @@ prepare_kdump_bootinfo()
boot_initrdlist="initramfs-$KDUMP_KERNELVER.img initrd"
for initrd in $boot_initrdlist; do
if [[ -f "$KDUMP_BOOTDIR/$initrd" ]]; then
- defaut_initrd_base="$initrd"
- DEFAULT_INITRD="$KDUMP_BOOTDIR/$defaut_initrd_base"
+ default_initrd_base="$initrd"
+ DEFAULT_INITRD="$KDUMP_BOOTDIR/$default_initrd_base"
break
fi
done
@@ -686,12 +686,12 @@ prepare_kdump_bootinfo()
# Create kdump initrd basename from default initrd basename
# initramfs-5.7.9-200.fc32.x86_64.img => initramfs-5.7.9-200.fc32.x86_64kdump.img
# initrd => initrdkdump
- if [[ -z $defaut_initrd_base ]]; then
+ if [[ -z $default_initrd_base ]]; then
kdump_initrd_base=initramfs-${KDUMP_KERNELVER}kdump.img
- elif [[ $defaut_initrd_base == *.* ]]; then
- kdump_initrd_base=${defaut_initrd_base%.*}kdump.${DEFAULT_INITRD##*.}
+ elif [[ $default_initrd_base == *.* ]]; then
+ kdump_initrd_base=${default_initrd_base%.*}kdump.${DEFAULT_INITRD##*.}
else
- kdump_initrd_base=${defaut_initrd_base}kdump
+ kdump_initrd_base=${default_initrd_base}kdump
fi
# Place kdump initrd in $(/var/lib/kdump) if $(KDUMP_BOOTDIR) not writable
commit 5947707682e7de478aa1e1b41006ce50f84699cc
Author: Philipp Rudo <prudo(a)redhat.com>
Date: Fri Mar 25 15:46:58 2022 +0100
kdump-capture.service: switch to journal for stdout
Using syslog for StandardOutput in a service file was deprecated in
systemd v246 with commit f3dc6af20f ("core: automatically update
StandardOuput=syslog to =journal (and similar for StandardError=)").
Thus the following warnings are printed in the crash kernel when
creating a dump.
systemd[1]: /usr/lib/systemd/system/kdump-capture.service:23: Standard output type syslog is obsolete, automatically updating to journal. Please update your unit file, and consider removing the setting altogether.
systemd[1]: /usr/lib/systemd/system/kdump-capture.service:24: Standard output type syslog+console is obsolete, automatically updating to journal+console. Please update your unit file, and consider removing the setting altogether.
Fix this by redirecting the stdout and stderr to the journal.
Signed-off-by: Philipp Rudo <prudo(a)redhat.com>
Reviewed-by: Tao Liu <ltao(a)redhat.com>
Reviewed-by: Coiby Xu <coxu(a)redhat.com>
diff --git a/dracut-kdump-capture.service b/dracut-kdump-capture.service
index 3f20aba..7109169 100644
--- a/dracut-kdump-capture.service
+++ b/dracut-kdump-capture.service
@@ -20,8 +20,8 @@ Environment=NEWROOT=/sysroot
Type=oneshot
ExecStart=/bin/kdump.sh
StandardInput=null
-StandardOutput=syslog
-StandardError=syslog+console
+StandardOutput=journal
+StandardError=journal+console
KillMode=process
RemainAfterExit=yes
commit 8736aa5bb359e0fccbb07919e49f68c22299c55a
Author: Philipp Rudo <prudo(a)redhat.com>
Date: Fri Mar 25 16:19:40 2022 +0100
kdumpctl/estimate: Fix unnecessary warning
do_estimate prints the warning that the reserved crashkernel is lower
than the recommended one even then when both values are identical. This
might cause confusion. So omit printing the warning when both values are
equal.
Signed-off-by: Philipp Rudo <prudo(a)redhat.com>
Acked-by: Coiby Xu <coxu(a)redhat.com>
diff --git a/kdumpctl b/kdumpctl
index 1869753..b7922a6 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -1270,7 +1270,7 @@ do_estimate()
done
fi
- if [[ $reserved_size -le $recommended_size ]]; then
+ if [[ $reserved_size -lt $recommended_size ]]; then
echo "WARNING: Current crashkernel size is lower than recommended size $((recommended_size / size_mb))M."
fi
}
commit 7141d044c8880815f308e61f612b710b7bc8a9a3
Author: Lichen Liu <lichliu(a)redhat.com>
Date: Tue Mar 1 13:09:00 2022 +0800
kdumpctl: sync the $TARGET_INITRD after rebuild
There is a system-wide sync call at the end of mkdumprd, move it to
kdumpctl after rebuild initrd and add another one for mkfadumprd.
Sync only the $TARGET_INITRD to avoid a system-wide sync taking too
long on a system with high disk activity.
Also update the sync in kdumpctl:restore_default_initrd which will
mv the $DEFAULT_INITRD_BAK to $DEFAULT_INITRD.
Signed-off-by: Lichen Liu <lichliu(a)redhat.com>
Reviewed-by: Philipp Rudo <prudo(a)redhat.com>
diff --git a/kdumpctl b/kdumpctl
index ac6ffeb..1869753 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -79,6 +79,7 @@ rebuild_fadump_initrd()
return 1
fi
+ sync -f "$TARGET_INITRD"
return 0
}
@@ -100,6 +101,7 @@ rebuild_kdump_initrd()
dwarn "Tips: If early kdump is enabled, also require rebuilding the system initramfs to make the changes take effect for early kdump."
fi
+ sync -f "$TARGET_INITRD"
return 0
}
@@ -180,7 +182,7 @@ restore_default_initrd()
rm -f $INITRD_CHECKSUM_LOCATION
if mv "$DEFAULT_INITRD_BAK" "$DEFAULT_INITRD"; then
derror "Restoring original initrd as fadump mode is disabled."
- sync
+ sync -f "$DEFAULT_INITRD"
fi
fi
fi
diff --git a/mkdumprd b/mkdumprd
index 593ec77..5996d50 100644
--- a/mkdumprd
+++ b/mkdumprd
@@ -458,7 +458,3 @@ if ! is_fadump_capable; then
fi
dracut "${dracut_args[@]}" "$@"
-
-_rc=$?
-sync
-exit $_rc
commit 6d4062a936694b7cab7e0c536414b4d5b6ab8668
Author: Coiby Xu <coxu(a)redhat.com>
Date: Wed Feb 16 09:42:54 2022 +0800
try to update the crashkernel in GRUB_ETC_DEFAULT after kexec-tools updates the default crashkernel value
If GRUB_ETC_DEFAULT use crashkernel=auto or
crashkernel=OLD_DEFAULT_CRASHKERNEL, it should be updated as well.
Add a helper function to read kernel cmdline parameter from
GRUB_ETC_DEFAULT. This function is used to read kernel cmdline
parameter like fadump or crashkernel.
Reviewed-by: Philipp Rudo <prudo(a)redhat.com>
diff --git a/kdumpctl b/kdumpctl
index 1c94405..ac6ffeb 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -1444,6 +1444,16 @@ _update_kernel_arg_in_grub_etc_default()
}" "$GRUB_ETC_DEFAULT"
}
+# Read the kernel arg in default grub conf.
+
+# Note reading a kernel parameter that doesn't have a value isn't supported.
+#
+# $1: the name of the kernel command line parameter
+_read_kernel_arg_in_grub_etc_default()
+{
+ sed -n -E "s/^GRUB_CMDLINE_LINUX=.*[[:space:]\"]${1}=([^[:space:]\"]*).*$/\1/p" "$GRUB_ETC_DEFAULT"
+}
+
reset_crashkernel()
{
local _opt _val _dump_mode _fadump_val _reboot _grubby_kernel_path _kernel _kernels
@@ -1577,6 +1587,34 @@ reset_crashkernel()
fi
}
+# update the crashkernel value in GRUB_ETC_DEFAULT if necessary
+#
+# called by reset_crashkernel_after_update and inherit its array variable
+# _crashkernel_vals
+update_crashkernel_in_grub_etc_default_after_update()
+{
+ local _crashkernel _fadump_val
+ local _dump_mode _old_default_crashkernel _new_default_crashkernel
+
+ _crashkernel=$(_read_kernel_arg_in_grub_etc_default crashkernel)
+
+ if [[ -z $_crashkernel ]]; then
+ return
+ fi
+
+ _fadump_val=$(_read_kernel_arg_in_grub_etc_default fadump)
+ _dump_mode=$(get_dump_mode_by_fadump_val "$_fadump_val")
+
+ _old_default_crashkernel=${_crashkernel_vals[old_${_dump_mode}]}
+ _new_default_crashkernel=${_crashkernel_vals[new_${_dump_mode}]}
+
+ if [[ $_crashkernel == auto ]] ||
+ [[ $_crashkernel == "$_old_default_crashkernel" &&
+ $_new_default_crashkernel != "$_old_default_crashkernel" ]]; then
+ _update_kernel_arg_in_grub_etc_default crashkernel "$_new_default_crashkernel"
+ fi
+}
+
# shellcheck disable=SC2154 # false positive when dereferencing an array
reset_crashkernel_after_update()
{
@@ -1605,6 +1643,8 @@ reset_crashkernel_after_update()
fi
fi
done
+
+ update_crashkernel_in_grub_etc_default_after_update
}
# read the value of an environ variable from given environ file path
commit 37f4f2c1f6f1304e1b58604a788c57c51508eead
Author: Coiby Xu <coxu(a)redhat.com>
Date: Tue Feb 15 13:24:19 2022 +0800
address the case where there are multiple values for the same kernel arg
There is the case where there are multiple entries of the same parameter on
the command line, e.g.
GRUB_CMDLINE_LINUX="crashkernel=110M crashkernel=220M fadump=on crashkernel=330M".
In such an situation _update_kernel_cmdline_in_grub_etc_default only
updates/removes the last entry which is usually not what you want as the
kernel (for crashkernel) takes the last entry it can find.
Thus make sure the case with multiple entries of the same parameter is
handled properly by removing all occurrences of given parameter first.
Note
1. sed command group and conditional control has been used to get rid of
grep.
2. Fully supporting kernel cmdline as documented in
Documentation/admin-guide/kernel-parameters.rst is complex and in
foreseeable future a full implementation is not needed. So simply
document the unsupported cases instead.
Fixes: 140da74 ("rewrite reset_crashkernel to support fadump and to used by RPM scriptlet")
Reported-by: Philipp Rudo <prudo(a)redhat.com>
Suggested-by: Philipp Rudo <prudo(a)redhat.com>
Reviewed-by: Philipp Rudo <prudo(a)redhat.com>
diff --git a/kdumpctl b/kdumpctl
index 9fd76ac..1c94405 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -1399,25 +1399,49 @@ _get_all_kernels_from_grubby()
}
GRUB_ETC_DEFAULT="/etc/default/grub"
-# modify the kernel command line parameter in default grub conf
+# Update a kernel parameter in default grub conf
+#
+# If a value is specified, it will be inserted in the end. Otherwise it
+# would remove given kernel parameter.
+#
+# Note this function doesn't address the following cases,
+# 1. The kernel ignores everything on the command line after a '--'. So
+# simply adding the new entry to the end will fail if the cmdline
+# contains a --.
+# 2. If the value for a parameter contains spaces it can be quoted using
+# double quotes, for example param="value with spaces". This will
+# break the [^[:space:]\"] regex for the value.
+# 3. Dashes and underscores in the parameter name are equivalent. So
+# some_parameter and some-parameter are identical.
+# 4. Some parameters, e.g. efivar_ssdt, can be given multiple times.
+# 5. Some kernel parameters, e.g. quiet, doesn't have value
#
# $1: the name of the kernel command line parameter
-# $2: new value. If empty, the parameter would be removed
-_update_kernel_cmdline_in_grub_etc_default()
+# $2: new value. If empty, given parameter would be removed
+_update_kernel_arg_in_grub_etc_default()
{
- local _para=$1 _val=$2 _para_val _regex
+ local _para=$1 _val=$2 _para_val
if [[ -n $_val ]]; then
_para_val="$_para=$_val"
fi
- _regex='^(GRUB_CMDLINE_LINUX=.*)([[:space:]"])'"$_para"'=[^[:space:]"]*(.*)$'
- if grep -q -E "$_regex" "$GRUB_ETC_DEFAULT"; then
- sed -i -E 's/'"$_regex"'/\1\2'"$_para_val"'\3/' "$GRUB_ETC_DEFAULT"
- elif [[ -n $_para_val ]]; then
- # If the kernel parameter doesn't exist, put it in the first
- sed -i -E 's/^(GRUB_CMDLINE_LINUX=")/\1'"$_para_val"' /' "$GRUB_ETC_DEFAULT"
- fi
+ # Update the command line /etc/default/grub, i.e.
+ # on the line that starts with 'GRUB_CMDLINE_LINUX=',
+ # 1) remove $para=$val if the it's the first arg
+ # 2) remove all occurences of $para=$val
+ # 3) insert $_para_val to end
+ # 4) remove duplicate spaces left over by 1) or 2) or 3)
+ # 5) remove space at the beginning of the string left over by 1) or 2) or 3)
+ # 6) remove space at the end of the string left over by 1) or 2) or 3)
+ sed -i -E "/^GRUB_CMDLINE_LINUX=/ {
+ s/\"${_para}=[^[:space:]\"]*/\"/g;
+ s/[[:space:]]+${_para}=[^[:space:]\"]*/ /g;
+ s/\"$/ ${_para_val}\"/
+ s/[[:space:]]+/ /g;
+ s/(\")[[:space:]]+/\1/g;
+ s/[[:space:]]+(\")/\1/g;
+ }" "$GRUB_ETC_DEFAULT"
}
reset_crashkernel()
@@ -1496,10 +1520,12 @@ reset_crashkernel()
# - set the dump mode as kdump for non-ppc64le cases
# - retrieved the default crashkernel value for given dump mode
if [[ $_grubby_kernel_path == ALL && -n $_dump_mode ]]; then
- _update_kernel_cmdline_in_grub_etc_default crashkernel "$_crashkernel"
+ _update_kernel_arg_in_grub_etc_default crashkernel "$_crashkernel"
# remove the fadump if fadump is disabled
- [[ $_fadump_val == off ]] && _fadump_val=""
- _update_kernel_cmdline_in_grub_etc_default fadump "$_fadump_val"
+ if [[ $_fadump_val == off ]]; then
+ _fadump_val=""
+ fi
+ _update_kernel_arg_in_grub_etc_default fadump "$_fadump_val"
fi
# If kernel-path not specified, either
commit 311b5b100b512134cddb189f46c8bb85d74f9275
Author: Coiby Xu <coxu(a)redhat.com>
Date: Fri Feb 11 13:11:17 2022 +0800
update kernel crashkernel in posttrans RPM scriptlet when updating kexec-tools
When doing in-place upgrading using leapp on x86_64, kdumpcl can't
acquire instance lock when running in %post RPM scriplet on x86_64,
localhost upgrade[1306]: /bin/kdumpctl: line 49: /var/lock/kdump: No such file or directory
localhost upgrade[1306]: kdump: Create file lock failed
and running "touch /var/lock/dkump" also fails with
"No such file or directory". Thus kdumpctl can't be run in %post
scriptlet. But kdumpctl can be run in %posttrans RPM scriplet.
Besides, it's better to update crashkernel after the kernel has been
updated. So let's update kernel crashkernel in the %posttrans
scriptlet which will be run in the end of a transaction i.e. after
the kernel has been updated.
Note for %posttrans scriptlet, "$1 == 1" means both installing a new
package and upgrading a package.
[1] https://github.com/apptainer/singularity/issues/2386#issuecomment-474747054
Reported-by: Jie Li <jieli(a)redhat.com>
Signed-off-by: Coiby Xu <coxu(a)redhat.com>
Reviewed-by: Philipp Rudo <prudo(a)redhat.com>
diff --git a/kexec-tools.spec b/kexec-tools.spec
index ac134da..6b7ef14 100644
--- a/kexec-tools.spec
+++ b/kexec-tools.spec
@@ -305,19 +305,6 @@ then
mv /etc/sysconfig/kdump.new /etc/sysconfig/kdump
fi
-# try to reset kernel crashkernel value to new default value when upgrading
-# the package
-if ! grep -qs "ostree" /proc/cmdline && [ $1 == 2 ]; then
- kdumpctl reset-crashkernel-after-update
- rm /tmp/old_default_crashkernel 2>/dev/null
-%ifarch ppc64 ppc64le
- rm /tmp/old_default_crashkernel_fadump 2>/dev/null
-%endif
- # dnf would complain about the exit code not being 0. To keep it happy,
- # always return 0
- :
-fi
-
%postun
%systemd_postun_with_restart kdump.service
@@ -350,6 +337,21 @@ do
fi
done
+%posttrans
+# try to reset kernel crashkernel value to new default value when upgrading
+# the package
+if ! grep -qs "ostree" /proc/cmdline && [ $1 == 1 ]; then
+ kdumpctl reset-crashkernel-after-update
+ rm /tmp/old_default_crashkernel 2>/dev/null
+%ifarch ppc64 ppc64le
+ rm /tmp/old_default_crashkernel_fadump 2>/dev/null
+%endif
+ # dnf would complain about the exit code not being 0. To keep it happy,
+ # always return 0
+ :
+fi
+
+
%files
/usr/sbin/kexec
%ifarch %{ix86} x86_64 ppc64 s390x ppc64le aarch64
commit 2bbc7512a2f2cf953ea047f54bd590d4d285b658
Author: Tao Liu <ltao(a)redhat.com>
Date: Wed Feb 16 14:26:38 2022 +0800
kdump-lib.sh: Check the output of blkid with sed instead of eval
Previously the output of blkid is not checked. If the output
is empty, the eval will report the following error message:
/lib/kdump/kdump-lib.sh: eval: line 925: syntax error near unexpected token `;'
/lib/kdump/kdump-lib.sh: eval: line 925: `; echo $TYPE'
For example, we can observe such a failing when blkid is invoked
against a lvm thinpool block device:
$ blkid -u filesystem,crypto -o export -- "/dev/block/253\:2"
$ echo $?
2
$ udevadm info /dev/block/253\:2|grep S\:
S: mapper/vg00-thinpoll_tmeta
In this patch, we will use sed instead of eval, to output the
fstype of block device if any.
Signed-off-by: Tao Liu <ltao(a)redhat.com>
Reviewed-by: Philipp Rudo <prudo(a)redhat.com>
diff --git a/kdump-lib.sh b/kdump-lib.sh
index 3e912cc..4ed5035 100755
--- a/kdump-lib.sh
+++ b/kdump-lib.sh
@@ -885,7 +885,8 @@ get_luks_crypt_dev()
[[ -b /dev/block/$1 ]] || return 1
- _type=$(eval "$(blkid -u filesystem,crypto -o export -- "/dev/block/$1"); echo \$TYPE")
+ _type=$(blkid -u filesystem,crypto -o export -- "/dev/block/$1" | \
+ sed -n -E "s/^TYPE=(.*)$/\1/p")
[[ $_type == "crypto_LUKS" ]] && echo "$1"
for _x in "/sys/dev/block/$1/slaves/"*; do
commit 59fcb8ae5b13d776f5a1966173b57d6404699aae
Author: Coiby Xu <coxu(a)redhat.com>
Date: Mon Feb 14 12:07:08 2022 +0800
Release 2.0.23-5
Signed-off-by: Coiby Xu <coxu(a)redhat.com>
diff --git a/kexec-tools.spec b/kexec-tools.spec
index 1750db0..ac134da 100644
--- a/kexec-tools.spec
+++ b/kexec-tools.spec
@@ -5,7 +5,7 @@
Name: kexec-tools
Version: 2.0.23
-Release: 4%{?dist}
+Release: 5%{?dist}
License: GPLv2
Summary: The kexec/kdump userspace component
@@ -405,6 +405,10 @@ done
%endif
%changelog
+* Mon Feb 14 2022 Coiby <coxu(a)redhat.com> - 2.0.23-5
+- fix incorrect usage of _get_all_kernels_from_grubby
+- fix the mistake of swapping function parameters of read_proc_environ_var
+
* Wed Jan 26 2022 Coiby <coxu(a)redhat.com> - 2.0.23-4
- fix broken kdump_get_arch_recommend_size
- remove the upper bound of 102400T for the range in default crashkernel
commit 41b8f9528c8ed89c68ad59750c18f032b5675a06
Author: Coiby Xu <coxu(a)redhat.com>
Date: Wed Feb 9 08:04:39 2022 +0800
fix incorrect usage of _get_all_kernels_from_grubby
It's found that the kernel cmdline crashkernel=auto doesn't get updated
when upgrading kexec-tools. This happens because _get_all_kernels_from_grubby
is called with no argument by reset_crashkernel_after_update. When retrieving
all kernel paths on the system, "grubby --info ALL" should be used. Fix this
error by passing "ALL" argument.
Fixes: 0adb0f4 ("try to reset kernel crashkernel when kexec-tools updates the default crashkernel value")
Reported-by: Jie Li <jieli(a)redhat.com>
Signed-off-by: Coiby Xu <coxu(a)redhat.com>
Reviewed-by: Tao Liu <ltao(a)redhat.com>
diff --git a/kdumpctl b/kdumpctl
index bf74c75..9fd76ac 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -1382,6 +1382,11 @@ _valid_grubby_kernel_path()
[[ -n "$1" ]] && grubby --info="$1" > /dev/null 2>&1
}
+# return all the kernel paths given a grubby kernel-path
+#
+# $1: kernel path accepted by grubby, e.g. DEFAULT, ALL,
+# /boot/vmlinuz-`uname -r`
+# return: kernel paths separated by space
_get_all_kernels_from_grubby()
{
local _kernels _line _kernel_path _grubby_kernel_path=$1
@@ -1557,7 +1562,7 @@ reset_crashkernel_after_update()
_crashkernel_vals[new_kdump]=$(get_default_crashkernel kdump)
_crashkernel_vals[new_fadump]=$(get_default_crashkernel fadump)
- for _kernel in $(_get_all_kernels_from_grubby); do
+ for _kernel in $(_get_all_kernels_from_grubby ALL); do
_crashkernel=$(get_grub_kernel_boot_parameter "$_kernel" crashkernel)
if [[ $_crashkernel == auto ]]; then
reset_crashkernel "--kernel=$_kernel"
1 year, 11 months
Architecture specific change in rpms/kexec-tools.git
by githook-noreply@fedoraproject.org
The package rpms/kexec-tools.git has added or updated architecture specific content in its
spec file (ExclusiveArch/ExcludeArch or %ifarch/%ifnarch) in commit(s):
https://src.fedoraproject.org/cgit/rpms/kexec-tools.git/commit/?id=311b5b...
https://src.fedoraproject.org/cgit/rpms/kexec-tools.git/commit/?id=748eb3...
https://src.fedoraproject.org/cgit/rpms/kexec-tools.git/commit/?id=0adb0f....
Change:
+%ifarch ppc64 ppc64le
+%ifarch ppc64 ppc64le
+%ifarch ppc64 ppc64le
Thanks.
Full change:
============
commit 6f9653b9183b710008b8271e6cc51ea47c2585bd
Author: Coiby Xu <coxu(a)redhat.com>
Date: Sun Apr 24 09:48:05 2022 +0800
Release 2.0.24-3
Signed-off-by: Coiby Xu <coxu(a)redhat.com>
diff --git a/kexec-tools.spec b/kexec-tools.spec
index 9b8218d..9c6ea8d 100644
--- a/kexec-tools.spec
+++ b/kexec-tools.spec
@@ -5,7 +5,7 @@
Name: kexec-tools
Version: 2.0.24
-Release: 2%{?dist}
+Release: 3%{?dist}
License: GPLv2
Summary: The kexec/kdump userspace component
@@ -405,6 +405,13 @@ fi
%endif
%changelog
+* Mon May 23 2022 Coiby <coxu(a)redhat.com> - 2.0.24-3
+- Update makedumpfile to 1.7.1
+- unit tests: add tests for get_system_size and get_recommend_size
+- improve get_recommend_size
+- fix a calculation error in get_system_size
+- logger: save log after all kdump progress finished
+
* Sun Apr 24 2022 Coiby <coxu(a)redhat.com> - 2.0.24-2
- remove the upper bound of default crashkernel value example
- update fadump-howto
commit 8f7ffb1a0054e48f833590d908a7d051008986f7
Author: Coiby Xu <coxu(a)redhat.com>
Date: Sun Apr 24 09:47:26 2022 +0800
Update makedumpfile to 1.7.1
Signed-off-by: Coiby Xu <coxu(a)redhat.com>
diff --git a/kexec-tools.spec b/kexec-tools.spec
index 6673000..9b8218d 100644
--- a/kexec-tools.spec
+++ b/kexec-tools.spec
@@ -1,6 +1,6 @@
%global eppic_ver e8844d3793471163ae4a56d8f95897be9e5bd554
%global eppic_shortver %(c=%{eppic_ver}; echo ${c:0:7})
-%global mkdf_ver 1.7.0
+%global mkdf_ver 1.7.1
%global mkdf_shortver %(c=%{mkdf_ver}; echo ${c:0:7})
Name: kexec-tools
@@ -220,8 +220,8 @@ install -m 755 -D %{SOURCE33} $RPM_BUILD_ROOT%{_prefix}/lib/kernel/install.d/92-
%ifarch %{ix86} x86_64 ppc64 s390x ppc64le aarch64
install -m 755 makedumpfile-%{mkdf_ver}/makedumpfile $RPM_BUILD_ROOT/usr/sbin/makedumpfile
-install -m 644 makedumpfile-%{mkdf_ver}/makedumpfile.8.gz $RPM_BUILD_ROOT/%{_mandir}/man8/makedumpfile.8.gz
-install -m 644 makedumpfile-%{mkdf_ver}/makedumpfile.conf.5.gz $RPM_BUILD_ROOT/%{_mandir}/man5/makedumpfile.conf.5.gz
+install -m 644 makedumpfile-%{mkdf_ver}/makedumpfile.8 $RPM_BUILD_ROOT/%{_mandir}/man8/makedumpfile.8
+install -m 644 makedumpfile-%{mkdf_ver}/makedumpfile.conf.5 $RPM_BUILD_ROOT/%{_mandir}/man5/makedumpfile.conf.5
install -m 644 makedumpfile-%{mkdf_ver}/makedumpfile.conf $RPM_BUILD_ROOT/%{_sysconfdir}/makedumpfile.conf.sample
install -m 755 makedumpfile-%{mkdf_ver}/eppic_makedumpfile.so $RPM_BUILD_ROOT/%{_libdir}/eppic_makedumpfile.so
mkdir -p $RPM_BUILD_ROOT/usr/share/makedumpfile/eppic_scripts/
diff --git a/sources b/sources
index 95c0fc6..d0190bb 100644
--- a/sources
+++ b/sources
@@ -1,3 +1,3 @@
SHA512 (eppic-e8844d3.tar.gz) = d86b9f90c57e694107272d8f71b87f66a30743b9530480fb6f665026bbada4c6b0205a83e40b5383663a945681cfbfcf1ee79469fc219ddf679473c4b2290763
SHA512 (kexec-tools-2.0.24.tar.xz) = ef7cf78246e2d729d81a3649791a5a23c385353cc75cbe8ef279616329fdaccc876d614c7f51e1456822a13a11520296070d9897467d24310399909e049c3822
-SHA512 (makedumpfile-1.7.0.tar.gz) = 579a1fb79d023a1419fc8612a02a04dda3e3b3d72455566433ab6bec08627aa9a176c55566393a081a7aae3fd0543800196596b25445b21b16346556723e9cf7
+SHA512 (makedumpfile-1.7.1.tar.gz) = 93e36487b71f567d3685b151459806cf36017e52bf3ee68dd448382b279a422d1a8abef72e291ccb8206f2149ccd08ba484ec0027d1caab3fa1edbc3d28c3632
commit 218d9917c03f25bc9872f076491c587815d16efb
Author: Dusty Mabe <dusty(a)dustymabe.com>
Date: Mon May 16 14:04:12 2022 -0400
kdump.sysconfig*: add ignition.firstboot to KDUMP_COMMANDLINE_REMOVE
For CoreOS based systems we use Ignition for provisioning machines
in the initramfs on first boot. We trigger Ignition right now by
the presence of `ignition.firstboot` in the kernel command line. The
kernel argument is only present on first boot so after a reboot it
no longer is in the kernel command line.
If a kernel crash happens before the first reboot of a machine we
want the `ignition.firstboot` kernel argument to be removed and not
passed on to the crash kernel.
diff --git a/kdump.sysconfig b/kdump.sysconfig
index 70ebf04..c1143f3 100644
--- a/kdump.sysconfig
+++ b/kdump.sysconfig
@@ -17,7 +17,7 @@ KDUMP_COMMANDLINE=""
# This variable lets us remove arguments from the current kdump commandline
# as taken from either KDUMP_COMMANDLINE above, or from /proc/cmdline
# NOTE: some arguments such as crashkernel will always be removed
-KDUMP_COMMANDLINE_REMOVE="hugepages hugepagesz slub_debug quiet log_buf_len swiotlb cma hugetlb_cma"
+KDUMP_COMMANDLINE_REMOVE="hugepages hugepagesz slub_debug quiet log_buf_len swiotlb cma hugetlb_cma ignition.firstboot"
# This variable lets us append arguments to the current kdump commandline
# after processed by KDUMP_COMMANDLINE_REMOVE
diff --git a/kdump.sysconfig.aarch64 b/kdump.sysconfig.aarch64
index 67a2af7..df75f94 100644
--- a/kdump.sysconfig.aarch64
+++ b/kdump.sysconfig.aarch64
@@ -17,7 +17,7 @@ KDUMP_COMMANDLINE=""
# This variable lets us remove arguments from the current kdump commandline
# as taken from either KDUMP_COMMANDLINE above, or from /proc/cmdline
# NOTE: some arguments such as crashkernel will always be removed
-KDUMP_COMMANDLINE_REMOVE="hugepages hugepagesz slub_debug quiet log_buf_len swiotlb cma hugetlb_cma"
+KDUMP_COMMANDLINE_REMOVE="hugepages hugepagesz slub_debug quiet log_buf_len swiotlb cma hugetlb_cma ignition.firstboot"
# This variable lets us append arguments to the current kdump commandline
# after processed by KDUMP_COMMANDLINE_REMOVE
diff --git a/kdump.sysconfig.i386 b/kdump.sysconfig.i386
index 7e18c1c..d8bf5f6 100644
--- a/kdump.sysconfig.i386
+++ b/kdump.sysconfig.i386
@@ -17,7 +17,7 @@ KDUMP_COMMANDLINE=""
# This variable lets us remove arguments from the current kdump commandline
# as taken from either KDUMP_COMMANDLINE above, or from /proc/cmdline
# NOTE: some arguments such as crashkernel will always be removed
-KDUMP_COMMANDLINE_REMOVE="hugepages hugepagesz slub_debug quiet log_buf_len swiotlb cma hugetlb_cma"
+KDUMP_COMMANDLINE_REMOVE="hugepages hugepagesz slub_debug quiet log_buf_len swiotlb cma hugetlb_cma ignition.firstboot"
# This variable lets us append arguments to the current kdump commandline
# after processed by KDUMP_COMMANDLINE_REMOVE
diff --git a/kdump.sysconfig.ppc64 b/kdump.sysconfig.ppc64
index ebb22f6..1b0cdc7 100644
--- a/kdump.sysconfig.ppc64
+++ b/kdump.sysconfig.ppc64
@@ -17,7 +17,7 @@ KDUMP_COMMANDLINE=""
# This variable lets us remove arguments from the current kdump commandline
# as taken from either KDUMP_COMMANDLINE above, or from /proc/cmdline
# NOTE: some arguments such as crashkernel will always be removed
-KDUMP_COMMANDLINE_REMOVE="hugepages hugepagesz slub_debug quiet log_buf_len swiotlb hugetlb_cma"
+KDUMP_COMMANDLINE_REMOVE="hugepages hugepagesz slub_debug quiet log_buf_len swiotlb hugetlb_cma ignition.firstboot"
# This variable lets us append arguments to the current kdump commandline
# after processed by KDUMP_COMMANDLINE_REMOVE
diff --git a/kdump.sysconfig.ppc64le b/kdump.sysconfig.ppc64le
index 270a2cf..d951def 100644
--- a/kdump.sysconfig.ppc64le
+++ b/kdump.sysconfig.ppc64le
@@ -17,7 +17,7 @@ KDUMP_COMMANDLINE=""
# This variable lets us remove arguments from the current kdump commandline
# as taken from either KDUMP_COMMANDLINE above, or from /proc/cmdline
# NOTE: some arguments such as crashkernel will always be removed
-KDUMP_COMMANDLINE_REMOVE="hugepages hugepagesz slub_debug quiet log_buf_len swiotlb hugetlb_cma"
+KDUMP_COMMANDLINE_REMOVE="hugepages hugepagesz slub_debug quiet log_buf_len swiotlb hugetlb_cma ignition.firstboot"
# This variable lets us append arguments to the current kdump commandline
# after processed by KDUMP_COMMANDLINE_REMOVE
diff --git a/kdump.sysconfig.s390x b/kdump.sysconfig.s390x
index 234cfe9..2971ae7 100644
--- a/kdump.sysconfig.s390x
+++ b/kdump.sysconfig.s390x
@@ -17,7 +17,7 @@ KDUMP_COMMANDLINE=""
# This variable lets us remove arguments from the current kdump commandline
# as taken from either KDUMP_COMMANDLINE above, or from /proc/cmdline
# NOTE: some arguments such as crashkernel will always be removed
-KDUMP_COMMANDLINE_REMOVE="hugepages hugepagesz slub_debug quiet log_buf_len swiotlb vmcp_cma cma hugetlb_cma prot_virt"
+KDUMP_COMMANDLINE_REMOVE="hugepages hugepagesz slub_debug quiet log_buf_len swiotlb vmcp_cma cma hugetlb_cma prot_virt ignition.firstboot"
# This variable lets us append arguments to the current kdump commandline
# after processed by KDUMP_COMMANDLINE_REMOVE
diff --git a/kdump.sysconfig.x86_64 b/kdump.sysconfig.x86_64
index 188ba3c..6a3ba6e 100644
--- a/kdump.sysconfig.x86_64
+++ b/kdump.sysconfig.x86_64
@@ -17,7 +17,7 @@ KDUMP_COMMANDLINE=""
# This variable lets us remove arguments from the current kdump commandline
# as taken from either KDUMP_COMMANDLINE above, or from /proc/cmdline
# NOTE: some arguments such as crashkernel will always be removed
-KDUMP_COMMANDLINE_REMOVE="hugepages hugepagesz slub_debug quiet log_buf_len swiotlb cma hugetlb_cma"
+KDUMP_COMMANDLINE_REMOVE="hugepages hugepagesz slub_debug quiet log_buf_len swiotlb cma hugetlb_cma ignition.firstboot"
# This variable lets us append arguments to the current kdump commandline
# after processed by KDUMP_COMMANDLINE_REMOVE
commit 1101190e1cc11c25c50f26af61120154eeed1133
Author: Coiby Xu <coxu(a)redhat.com>
Date: Wed Apr 27 19:17:32 2022 +0800
unit tests: add tests for get_system_size and get_recommend_size
Signed-off-by: Coiby Xu <coxu(a)redhat.com>
Reviewed-by: Philipp Rudo <prudo(a)redhat.com>
diff --git a/spec/kdump-lib_spec.sh b/spec/kdump-lib_spec.sh
new file mode 100644
index 0000000..8c91480
--- /dev/null
+++ b/spec/kdump-lib_spec.sh
@@ -0,0 +1,51 @@
+#!/bin/bash
+Describe 'kdump-lib'
+ Include ./kdump-lib.sh
+
+ Describe 'get_system_size()'
+
+ PROC_IOMEM=$(mktemp -t spec_test_proc_iomem_file.XXXXXXXXXX)
+
+ cleanup() {
+ rm -rf "$PROC_IOMEM"
+ }
+
+ AfterAll 'cleanup'
+
+ ONE_GIGABYTE='000000-3fffffff : System RAM'
+ Parameters
+ 1
+ 3
+ End
+
+ It 'should return correct system RAM size'
+ echo -n >"$PROC_IOMEM"
+ for _ in $(seq 1 "$1"); do echo "$ONE_GIGABYTE" >>"$PROC_IOMEM"; done
+ When call get_system_size
+ The output should equal "$1"
+ End
+
+ End
+
+ Describe 'get_recommend_size()'
+ # Testing stragety:
+ # 1. inclusive for the lower bound of the range of crashkernel
+ # 2. exclusive for the upper bound of the range of crashkernel
+ # 3. supports ranges not sorted in increasing order
+
+ ck="4G-64G:256M,2G-4G:192M,64G-1T:512M,1T-:12345M"
+ Parameters
+ 1 0M
+ 2 192M
+ 64 512M
+ 1024 12345M
+ "$((64 * 1024))" 12345M
+ End
+
+ It 'should handle all cases correctly'
+ When call get_recommend_size "$1" $ck
+ The output should equal "$2"
+ End
+ End
+
+End
commit 4f702c81e9d14a90d22d6b587de37733d0126960
Author: Coiby Xu <coxu(a)redhat.com>
Date: Thu May 12 10:48:31 2022 +0800
improve get_recommend_size
This patch rewrites get_recommend_size to get rid of the following
limitations,
1. only supports ranges in crashkernel sorted in increasing order
2. the first entry of crashkernel should have only a single digit and
it's in gigabytes
Suggested-by: Philipp Rudo <prudo(a)redhat.com>
Signed-off-by: Coiby Xu <coxu(a)redhat.com>
Reviewed-by: Philipp Rudo <prudo(a)redhat.com>
diff --git a/kdump-lib.sh b/kdump-lib.sh
index ed28df3..b137c89 100755
--- a/kdump-lib.sh
+++ b/kdump-lib.sh
@@ -796,33 +796,40 @@ get_system_size()
echo $(( (sum) / 1024 / 1024 / 1024))
}
+# Return the recommended size for the reserved crashkernel memory
+# depending on the system memory size.
+#
+# This functions is expected to be consistent with the parse_crashkernel_mem()
+# in kernel i.e. how kernel allocates the kdump memory given the crashkernel
+# parameter crashkernel=range1:size1[,range2:size2,…] and the system memory
+# size.
get_recommend_size()
{
local mem_size=$1
local _ck_cmdline=$2
- local OLDIFS="$IFS"
+ local range start start_unit end end_unit size
- start=${_ck_cmdline::1}
- if [[ $mem_size -lt $start ]]; then
- echo "0M"
- return
- fi
- IFS=','
- for i in $_ck_cmdline; do
- end=$(echo "$i" | awk -F "-" '{ print $2 }' | awk -F ":" '{ print $1 }')
- recommend=$(echo "$i" | awk -F "-" '{ print $2 }' | awk -F ":" '{ print $2 }')
- size=${end::-1}
- unit=${end: -1}
- if [[ $unit == 'T' ]]; then
- size=$((size * 1024))
- fi
- if [[ $mem_size -lt $size ]]; then
- echo "$recommend"
- IFS="$OLDIFS"
+ while read -r -d , range; do
+ # need to use non-default IFS as double spaces are used as a
+ # single delimiter while commas aren't...
+ IFS=, read start start_unit end end_unit size <<< \
+ "$(echo "$range" | sed -n "s/\([0-9]\+\)\([GT]\?\)-\([0-9]*\)\([GT]\?\):\([0-9]\+[MG]\)/\1,\2,\3,\4,\5/p")"
+
+ # aka. 102400T
+ end=${end:-104857600}
+ [[ "$end_unit" == T ]] && end=$((end * 1024))
+ [[ "$start_unit" == T ]] && start=$((start * 1024))
+
+ if [[ $mem_size -ge $start ]] && [[ $mem_size -lt $end ]]; then
+ echo "$size"
return
fi
- done
- IFS="$OLDIFS"
+
+ # append a ',' as read expects the 'file' to end with a delimiter
+ done <<< "$_ck_cmdline,"
+
+ # no matching range found
+ echo "0M"
}
# get default crashkernel
commit 5c23b6ebb79c5e06ff713d437cb54fb2843aa12d
Author: Coiby Xu <coxu(a)redhat.com>
Date: Sat May 7 16:30:39 2022 +0800
fix a calculation error in get_system_size
Recently, it's found 'kdumpctl estimate' returns 512M while the system
reserves 1024M kdump memory in a case. This happens because the ranges
in /proc/iomem are inclusively. For example, "0-1: System RAM" means 2
bytes of system memory other than 1 byte. Fix this error by adding one
more byte.
Note
1. the function has been simplified as well.
2. define PROC_IOMEM as /proc/iomem for the sake of unit tests
Reported-by: Ruowen Qin <ruqin(a)redhat.com>
Fixes: 1813189 ("kdump-lib.sh: introduce functions to return recommened mem size")
Suggested-by: Philipp Rudo <prudo(a)redhat.com>
Signed-off-by: Coiby Xu <coxu(a)redhat.com>
Reviewed-by: Philipp Rudo <prudo(a)redhat.com>
diff --git a/kdump-lib.sh b/kdump-lib.sh
index 557eff6..ed28df3 100755
--- a/kdump-lib.sh
+++ b/kdump-lib.sh
@@ -788,17 +788,12 @@ prepare_cmdline()
echo "$cmdline"
}
-#get system memory size in the unit of GB
+PROC_IOMEM=/proc/iomem
+#get system memory size i.e. memblock.memory.total_size in the unit of GB
get_system_size()
{
- result=$(grep "System RAM" /proc/iomem | awk -F ":" '{ print $1 }' | tr "[:lower:]" "[:upper:]" | paste -sd+)
- result="+$result"
- # replace '-' with '+0x' and '+' with '-0x'
- sum=$(echo "$result" | sed -e 's/-/K0x/g' -e 's/+/-0x/g' -e 's/K/+/g')
- size=$(printf "%d\n" $((sum)))
- size=$((size / 1024 / 1024 / 1024))
-
- echo "$size"
+ sum=$(sed -n "s/\s*\([0-9a-fA-F]\+\)-\([0-9a-fA-F]\+\) : System RAM$/+ 0x\2 - 0x\1 + 1/p" $PROC_IOMEM)
+ echo $(( (sum) / 1024 / 1024 / 1024))
}
get_recommend_size()
commit 3d70f8b04958c6f7a4a6b937fb828f9970d0c525
Author: Kairui Song <kasong(a)tencent.com>
Date: Sat Apr 23 21:07:31 2022 +0800
logger: save log after all kdump progress finished
Make log saving the last step of kdump.sh, so it can catch more info,
for example, the output of post.d hooks will be covered by the log now.
Signed-off-by: Kairui Song <kasong(a)tencent.com>
Reviewed-by: Philipp Rudo <prudo(a)redhat.com>
diff --git a/dracut-kdump.sh b/dracut-kdump.sh
index b17455a..f4456a1 100755
--- a/dracut-kdump.sh
+++ b/dracut-kdump.sh
@@ -15,6 +15,8 @@ fi
KDUMP_PATH="/var/crash"
KDUMP_LOG_FILE="/run/initramfs/kexec-dmesg.log"
+KDUMP_LOG_DEST=""
+KDUMP_LOG_OP=""
CORE_COLLECTOR=""
DEFAULT_CORE_COLLECTOR="makedumpfile -l --message-level 7 -d 31"
DMESG_COLLECTOR="/sbin/vmcore-dmesg"
@@ -113,12 +115,19 @@ get_kdump_confs()
# store the kexec kernel log to a file.
save_log()
{
+ # LOG_OP is empty when log can't be saved, eg. raw target
+ [ -n "$KDUMP_LOG_OP" ] || return
+
dmesg -T > $KDUMP_LOG_FILE
if command -v journalctl > /dev/null; then
journalctl -ab >> $KDUMP_LOG_FILE
fi
chmod 600 $KDUMP_LOG_FILE
+
+ dinfo "saving the $KDUMP_LOG_FILE to $KDUMP_LOG_DEST/"
+
+ eval "$KDUMP_LOG_OP"
}
# $1: dump path, must be a mount point
@@ -159,6 +168,9 @@ dump_fs()
save_opalcore_fs "$_dump_fs_path"
dinfo "saving vmcore"
+ KDUMP_LOG_DEST=$_dump_fs_path/
+ KDUMP_LOG_OP="mv '$KDUMP_LOG_FILE' '$KDUMP_LOG_DEST/'"
+
$CORE_COLLECTOR /proc/vmcore "$_dump_fs_path/vmcore-incomplete"
_dump_exitcode=$?
if [ $_dump_exitcode -eq 0 ]; then
@@ -167,12 +179,6 @@ dump_fs()
dinfo "saving vmcore complete"
else
derror "saving vmcore failed, exitcode:$_dump_exitcode"
- fi
-
- dinfo "saving the $KDUMP_LOG_FILE to $_dump_fs_path/"
- save_log
- mv "$KDUMP_LOG_FILE" "$_dump_fs_path/"
- if [ $_dump_exitcode -ne 0 ]; then
return 1
fi
@@ -395,8 +401,12 @@ dump_ssh()
ssh -q $_ssh_opt "$2" mkdir -p "$_ssh_dir" || return 1
save_vmcore_dmesg_ssh "$DMESG_COLLECTOR" "$_ssh_dir" "$_ssh_opt" "$2"
+
dinfo "saving vmcore"
+ KDUMP_LOG_DEST=$2:$_ssh_dir/
+ KDUMP_LOG_OP="scp -q $_ssh_opt '$KDUMP_LOG_FILE' '$_scp_address:$_ssh_dir/'"
+
save_opalcore_ssh "$_ssh_dir" "$_ssh_opt" "$2" "$_scp_address"
if [ "${CORE_COLLECTOR%%[[:blank:]]*}" = "scp" ]; then
@@ -421,12 +431,6 @@ dump_ssh()
derror "saving vmcore failed, exitcode:$_ret"
fi
- dinfo "saving the $KDUMP_LOG_FILE to $2:$_ssh_dir/"
- save_log
- if ! scp -q $_ssh_opt $KDUMP_LOG_FILE "$_scp_address:$_ssh_dir/"; then
- derror "saving log file failed, _exitcode:$_ret"
- fi
-
return $_ret
}
@@ -576,6 +580,8 @@ if ! do_kdump_post $DUMP_RETVAL; then
derror "kdump_post script exited with non-zero status!"
fi
+save_log
+
if [ $DUMP_RETVAL -ne 0 ]; then
exit 1
fi
commit 1facd0c11876bcbe83a9c52c67c1ce7a59f681dd
Author: Coiby Xu <coxu(a)redhat.com>
Date: Sun Apr 24 11:38:04 2022 +0800
fix incorrect date format in changelog
Signed-off-by: Coiby Xu <coxu(a)redhat.com>
diff --git a/kexec-tools.spec b/kexec-tools.spec
index 8b1acf5..6673000 100644
--- a/kexec-tools.spec
+++ b/kexec-tools.spec
@@ -405,7 +405,7 @@ fi
%endif
%changelog
-* Apr 24 2022 Coiby <coxu(a)redhat.com> - 2.0.24-2
+* Sun Apr 24 2022 Coiby <coxu(a)redhat.com> - 2.0.24-2
- remove the upper bound of default crashkernel value example
- update fadump-howto
- update kexec-kdump-howto
commit d5b01d7ef0f05c5ecb028aa1e8942ec099cbd9dd
Author: Coiby Xu <coxu(a)redhat.com>
Date: Sun Apr 24 09:39:22 2022 +0800
Release 2.0.24-2
A issue of bogus date in %changelog is fixed as well.
Signed-off-by: Coiby Xu <coxu(a)redhat.com>
diff --git a/kexec-tools.spec b/kexec-tools.spec
index db6374c..8b1acf5 100644
--- a/kexec-tools.spec
+++ b/kexec-tools.spec
@@ -5,7 +5,7 @@
Name: kexec-tools
Version: 2.0.24
-Release: 1%{?dist}
+Release: 2%{?dist}
License: GPLv2
Summary: The kexec/kdump userspace component
@@ -405,6 +405,21 @@ fi
%endif
%changelog
+* Apr 24 2022 Coiby <coxu(a)redhat.com> - 2.0.24-2
+- remove the upper bound of default crashkernel value example
+- update fadump-howto
+- update kexec-kdump-howto
+- update crashkernel-howto
+- add man documentation for kdumpctl get-default-crashkernel
+- unit tests: add check_config with with the default kdump.conf
+- unit tests: add tests for kdump_get_conf_val in kdump-lib-initramfs.sh
+- unit tests: add tests for "kdumpctl reset-crashkernel"
+- unit tests: add tests for _{update,read}_kernel_arg_in_grub_etc_default in kdumpctl
+- unit tests: add tests for kdumpctl read_proc_environ_var and _is_osbuild
+- unit tests: add tests for get_dump_mode_by_fadump_val
+- unit tests: add tests for get_grub_kernel_boot_parameter
+- unit tests: prepare for kdumpctl and kdump-lib.sh to be unit-tested
+
* Mon Apr 11 2022 Coiby <coxu(a)redhat.com> - 2.0.24-1
- Update kexec-tools to 2.0.24
- kdumpctl: remove kdump_get_conf_val in save_raw
@@ -472,7 +487,7 @@ fi
- sysconfig: make kexec_file_load as default option on aarch64
- Enable zstd compression for makedumpfile in kexec-tools.spec
-* Mon Nov 18 2021 Coiby <coxu(a)redhat.com> - 2.0.23-1
+* Thu Nov 18 2021 Coiby <coxu(a)redhat.com> - 2.0.23-1
- Update kexec-tools to 2.0.23
- Rebase makedumpfile to 1.7.0
- fix broken extra_bins when installing multiple binaries
commit be20580b06dc3fe92556933046ec8d2fd3a9b4b5
Author: Coiby Xu <coxu(a)redhat.com>
Date: Tue Mar 1 17:33:24 2022 +0800
remove the upper bound of default crashkernel value example
Reviewed-by: Philipp Rudo <prudo(a)redhat.com>
Signed-off-by: Coiby Xu <coxu(a)redhat.com>
diff --git a/crashkernel-howto.txt b/crashkernel-howto.txt
index 94f4e52..6573847 100644
--- a/crashkernel-howto.txt
+++ b/crashkernel-howto.txt
@@ -17,7 +17,7 @@ Latest kexec-tools provides "kdumpctl get-default-crashkernel" to retrieve
the default crashkernel value,
$ echo $(kdumpctl get-default-crashkernel)
- 1G-4G:192M,4G-64G:256M,64G-102400T:512M
+ 1G-4G:192M,4G-64G:256M,64G-:512M
It will be taken as the default value of 'crashkernel=', you can use
this value as a reference for setting crashkernel value manually.
commit 695e5b8676ecbdf999ed535eae4074db8c3ef7aa
Author: Coiby Xu <coxu(a)redhat.com>
Date: Tue Mar 1 17:30:30 2022 +0800
update fadump-howto
1. yum is deprecated so use dnf instead
2. use the "kdumpctl reset-crashkernel --fadump=on" API
Reviewed-by: Philipp Rudo <prudo(a)redhat.com>
Signed-off-by: Coiby Xu <coxu(a)redhat.com>
diff --git a/fadump-howto.txt b/fadump-howto.txt
index bc87644..9773f78 100644
--- a/fadump-howto.txt
+++ b/fadump-howto.txt
@@ -39,7 +39,7 @@ kernel are one and the same on ppc64.
If you're reading this document, you should already have kexec-tools
installed. If not, you install it via the following command:
- # yum install kexec-tools
+ # dnf install kexec-tools
Fadump Operational Flow:
@@ -82,7 +82,7 @@ How to configure fadump:
Again, we assume if you're reading this document, you should already have
kexec-tools installed. If not, you install it via the following command:
- # yum install kexec-tools
+ # dnf install kexec-tools
Make the kernel to be configured with FADump as the default boot entry, if
it isn't already:
@@ -94,20 +94,24 @@ anything interesting in the way of debug analysis, you'll also need to install
the kernel-debuginfo package, of the same arch as your running kernel, and the
crash utility:
- # yum --enablerepo=\*debuginfo install kernel-debuginfo.$(uname -m) crash
+ # dnf --enablerepo=\*debuginfo install kernel-debuginfo.$(uname -m) crash
-Next up, we need to modify some boot parameters to enable firmware assisted
-dump. With the help of grubby, it's very easy to append "fadump=on" to the end
-of your kernel boot parameters. To reserve the appropriate amount of memory
-for boot memory preservation, pass 'crashkernel=X' kernel cmdline parameter.
-For the recommended value of X, see 'FADump Memory Requirements' section.
+Next up, we can enable firmware assisted dump and reserve the memory for boot
+memory preservation as specified in in the table of 'FADump Memory Requirements'
+section:
+
+ # kdumpctl reset-crashkernel --fadump=on
+
+Alternatively, you can use grubby to reserve custom amount of memory:
# grubby --args="fadump=on crashkernel=6G" --update-kernel=/boot/vmlinuz-`uname -r`
By default, FADump reserved memory will be initialized as CMA area to make the
memory available through CMA allocator on the production kernel. We can opt out
of this, making reserved memory unavailable to production kernel, by booting the
-linux kernel with 'fadump=nocma' instead of 'fadump=on'.
+linux kernel with 'fadump=nocma' instead of 'fadump=on':
+
+ # kdumpctl reset-crashkernel --fadump=nocma
The term 'boot memory' means size of the low memory chunk that is required for
a kernel to boot successfully when booted with restricted memory. By default,
@@ -350,6 +354,6 @@ Remove "crashkernel=" from kernel cmdline parameters:
If KDump is to be used as the dump capturing mechanism, reset the crashkernel parameter:
- # kdumpctl reset-crashkernel `uname -r`
+ # kdumpctl reset-crashkernel --fadump=off
Reboot the system for the settings to take effect.
commit 1e7df3e1f355da4fe0eca6422479963f7e772bf8
Author: Coiby Xu <coxu(a)redhat.com>
Date: Tue Mar 1 17:30:50 2022 +0800
update kexec-kdump-howto
1. yum is deprecated so use dnf instead
2. use the "kdumpctl reset-crashkernel" API
3. ask the users to refer to crashkernel-howto.txt for setting custom
crashkernel value
4. fix a typo
Philipp Rudo <prudo(a)redhat.com>
Signed-off-by: Coiby Xu <coxu(a)redhat.com>
diff --git a/kexec-kdump-howto.txt b/kexec-kdump-howto.txt
index 1aeffc7..6741faf 100644
--- a/kexec-kdump-howto.txt
+++ b/kexec-kdump-howto.txt
@@ -44,7 +44,7 @@ ia64 and ppc64.
If you're reading this document, you should already have kexec-tools
installed. If not, you install it via the following command:
- # yum install kexec-tools
+ # dnf install kexec-tools
Now load a kernel with kexec:
@@ -66,23 +66,31 @@ How to configure kdump
Again, we assume if you're reading this document, you should already have
kexec-tools installed. If not, you install it via the following command:
- # yum install kexec-tools
+ # dnf install kexec-tools
To be able to do much of anything interesting in the way of debug analysis,
you'll also need to install the kernel-debuginfo package, of the same arch
as your running kernel, and the crash utility:
- # yum --enablerepo=\*debuginfo install kernel-debuginfo.$(uname -m) crash
+ # dnf --enablerepo=\*debuginfo install kernel-debuginfo.$(uname -m) crash
-Next up, we need to modify some boot parameters to reserve a chunk of memory for
-the capture kernel. With the help of grubby, it's very easy to append
-"crashkernel=128M" to the end of your kernel boot parameters. Note that the X
-values are such that X = the amount of memory to reserve for the capture kernel.
-And based on arch and system configuration, one might require more than 128M to
-be reserved for kdump. One need to experiment and test kdump, if 128M is not
-sufficient, try reserving more memory.
+Next up, we need to reserve a chunk of memory for the capture kernel. To use
+the default crashkernel value, you can kdumpctl:
- # grubby --args="crashkernel=128M" --update-kernel=/boot/vmlinuz-`uname -r`
+ # kdumpctl reset-crashkernel --kernel=/boot/vmlinuz-`uname -r`
+
+If the default value does not work for your setup you can use
+
+ # grubby --args="crashkernel=256M" --update-kernel=/boot/vmlinuz-`uname -r`
+
+to specify a larger value, in this case 256M. You need to experiment to
+find the best value that works for your setup. To begin with
+
+ # kdumpctl estimate
+
+gives you an estimation for the crashkernel value based on the currently
+running kernel. For more details, please refer to the "Estimate crashkernel"
+section in /usr/share/doc/kexec-tools/crashkernel-howto.txt.
Note that there is an alternative form in which to specify a crashkernel
memory reservation, in the event that more control is needed over the size and
@@ -135,7 +143,7 @@ in /var/crash/<YYYY-MM-DD-HH:MM>/vmcore), then the system rebooted back into
your normal kernel.
Once back to your normal kernel, you can use the previously installed crash
-kernel in conjunction with the previously installed kernel-debuginfo to
+utility in conjunction with the previously installed kernel-debuginfo to
perform postmortem analysis:
# crash /usr/lib/debug/lib/modules/2.6.17-1.2621.el5/vmlinux
commit 683ff878213ea2a58971902f90f9dd77d4e64b8f
Author: Coiby Xu <coxu(a)redhat.com>
Date: Mon Apr 18 15:54:53 2022 +0800
update crashkernel-howto
1. clean up left crashkernel.default
2. fix a few typos and grammar mistakes
3. ask the users to refer to `man kdumpctl` for reset-crashkernel
Philipp Rudo <prudo(a)redhat.com>
Signed-off-by: Coiby Xu <coxu(a)redhat.com>
diff --git a/crashkernel-howto.txt b/crashkernel-howto.txt
index 1ba79ab..94f4e52 100644
--- a/crashkernel-howto.txt
+++ b/crashkernel-howto.txt
@@ -37,10 +37,10 @@ Users can override the value during Anaconda installation manually.
Auto update of crashkernel boot parameter
=========================================
-A new release of kexec-tools could update the default crashkernel value.
-By default, kexec-tools would reset crashkernel to the new default value if it
-detects old default crashkernel value is used by installed kernels. If you don't
-want kexec-tools to update the old default crashkernel to the new default
+A new release of kexec-tools could update the default crashkernel value. By
+default, kexec-tools would reset crashkernel to the new default value if it
+detects the old default crashkernel value is used by installed kernels. If you
+don't want kexec-tools to update the old default crashkernel to the new default
crashkernel, you can change auto_reset_crashkernel to no in kdump.conf.
Supported Bootloaders
@@ -67,19 +67,18 @@ value properly, `kdumpctl` also provides a sub-command:
`kdumpctl reset-crashkernel [--kernel=path_to_kernel] [--reboot]`
-This command will read from the `crashkernel.default` file and reset
-bootloader's kernel cmdline to the default value. It will also update bootloader
-config if the bootloader has a standalone config file. User will have to reboot
-the machine after this command to make it take effect if --reboot is not specified.
-For ppc64le, an optional "[--fadump=[on|off|nocma]]" can also be specified to toggle
-FADump on/off.
+This command will reset the bootloader's kernel cmdline to the default value.
+It will also update bootloader config if the bootloader has a standalone config
+file. User will have to reboot the machine after this command to make it take
+effect if --reboot is not specified. For more details, please refer to the
+reset-crashkernel command in `man kdumpctl`.
Reset manually
--------------
To reset the crashkernel value manually, it's recommended to use utils like
`grubby`. A one liner script for resetting `crashkernel=` value of all installed
-kernels to current boot kernel's crashkernel.default` is:
+kernels to the default value is:
grubby --update-kernel ALL --args "crashkernel=$(kdumpctl get-default-crashkernel)"
@@ -98,7 +97,7 @@ triggering kdump:
The output will be like this:
```
- Encrypted kdump target requires extra memory, assuming using the keyslot with minimun memory requirement
+ Encrypted kdump target requires extra memory, assuming using the keyslot with minimum memory requirement
Reserved crashkernel: 256M
Recommended crashkernel: 655M
commit a1c63fa6449740f771349f931748b0ccc8a67ec7
Author: Coiby Xu <coxu(a)redhat.com>
Date: Tue Mar 1 17:35:39 2022 +0800
add man documentation for kdumpctl get-default-crashkernel
A few typos and grammar issues are fixed as well.
Philipp Rudo <prudo(a)redhat.com>
Signed-off-by: Coiby Xu <coxu(a)redhat.com>
diff --git a/kdumpctl.8 b/kdumpctl.8
index 067117b..33c1115 100644
--- a/kdumpctl.8
+++ b/kdumpctl.8
@@ -14,7 +14,7 @@ In most cases, you should use
.B systemctl
to start / stop / enable kdump service instead. However,
.B kdumpctl
-provides more details for debug and a helper to setup ssh key authentication.
+provides more details for debugging and a helper to set up ssh key authentication.
.SH COMMANDS
.TP
@@ -26,14 +26,14 @@ Stop the service.
.TP
.I status
Prints the current status of kdump service.
-It returns non-zero value if kdump is not operational.
+It returns a non-zero value if kdump is not operational.
.TP
.I restart
Is equal to
.I start; stop
.TP
.I reload
-reload crash kernel image and initramfs without triggering a rebuild.
+reload the crash kernel image and initramfs without triggering a rebuild.
.TP
.I rebuild
rebuild the crash kernel initramfs.
@@ -43,20 +43,23 @@ Helps to setup key authentication for ssh storage since it's
impossible to use password authentication during kdump.
.TP
.I showmem
-Prints the size of reserved memory for crash kernel in megabytes.
+Prints the size of reserved memory for the crash kernel in megabytes.
.TP
.I estimate
-Estimate a suitable crashkernel value for current machine. This is a
-best-effort estimate. It will print a recommanded crashkernel value
-based on current kdump setup, and list some details of memory usage.
+Estimate a suitable crashkernel value for the current machine. This is a
+best-effort estimate. It will print a recommended crashkernel value
+based on the current kdump setup, and list some details of memory usage.
+.TP
+.I get-default-crashkernel
+Return the default crashkernel value provided by kexec-tools.
.TP
.I reset-crashkernel [--kernel=path_to_kernel] [--reboot]
Reset crashkernel to default value recommended by kexec-tools. If no kernel
is specified, will reset KDUMP_KERNELVER if it's defined in /etc/sysconfig/kdump
-or current running kernel's crashkernel value if KDUMP_KERNELVER is empty. You can
+or the current running kernel's crashkernel value if KDUMP_KERNELVER is empty. You can
also specify --kernel=ALL and --kernel=DEFAULT which have the same meaning as
grubby's kernel-path=ALL and kernel-path=DEFAULT. ppc64le supports FADump and
-supports an additonal [--fadump=[on|off|nocma]] parameter to toggle FADump
+supports an additional [--fadump=[on|off|nocma]] parameter to toggle FADump
on/off.
Note: The memory requirements for kdump varies heavily depending on the
commit 3d4cb38d96e45cf5da1460daf3345dd318fdee2f
Author: Coiby Xu <coxu(a)redhat.com>
Date: Fri Jan 7 16:00:08 2022 +0800
unit tests: add check_config with with the default kdump.conf
This test prevents the mistake of adding an option to kdump.conf
without changing check_config as is the case with commit 73ced7f
("introduce the auto_reset_crashkernel option to kdump.conf").
Reviewed-by: Philipp Rudo <prudo(a)redhat.com>
Signed-off-by: Coiby Xu <coxu(a)redhat.com>
diff --git a/spec/kdumpctl_general_spec.sh b/spec/kdumpctl_general_spec.sh
index e72bf1d..5a3ce1c 100644
--- a/spec/kdumpctl_general_spec.sh
+++ b/spec/kdumpctl_general_spec.sh
@@ -174,4 +174,29 @@ Describe 'kdumpctl'
End
End
+ Describe 'parse_config()'
+ bad_kdump_conf=$(mktemp -t bad_kdump_conf.XXXXXXXXXX)
+ cleanup() {
+ rm -f "$bad_kdump_conf"
+ }
+ AfterAll 'cleanup'
+
+ It 'should not be happy with unkown option in kdump.conf'
+ KDUMP_CONFIG_FILE="$bad_kdump_conf"
+ echo blabla > "$bad_kdump_conf"
+ When call parse_config
+ The status should be failure
+ The stderr should include 'Invalid kdump config option blabla'
+ End
+
+ It 'should be happy with the default kdump.conf'
+ # shellcheck disable=SC2034
+ # override the KDUMP_CONFIG_FILE variable
+ KDUMP_CONFIG_FILE=./kdump.conf
+ When call parse_config
+ The status should be success
+ End
+
+ End
+
End
commit e28a1399a3c9e60806a64216e6457e928a594dc8
Author: Coiby Xu <coxu(a)redhat.com>
Date: Thu Jan 6 14:24:22 2022 +0800
unit tests: add tests for kdump_get_conf_val in kdump-lib-initramfs.sh
kdump_get_conf_val allows to retrieves config value defined in
kdump.conf and it also supports sed regex like
"ext[234]\|xfs\|btrfs\|minix\|raw\|nfs\|ssh".
Reviewed-by: Philipp Rudo <prudo(a)redhat.com>
Signed-off-by: Coiby Xu <coxu(a)redhat.com>
diff --git a/spec/kdump-lib-initramfs_spec.sh b/spec/kdump-lib-initramfs_spec.sh
new file mode 100644
index 0000000..dc50793
--- /dev/null
+++ b/spec/kdump-lib-initramfs_spec.sh
@@ -0,0 +1,41 @@
+#!/bin/bash
+Describe 'kdump-lib-initramfs'
+ Include ./kdump-lib-initramfs.sh
+
+ Describe 'Test kdump_get_conf_val'
+ KDUMP_CONFIG_FILE=/tmp/kdump_shellspec_test.conf
+ kdump_config() {
+ %text
+ #|default shell
+ #|nfs my.server.com:/export/tmp # trailing comment
+ #| failure_action shell
+ #|dracut_args --omit-drivers "cfg80211 snd" --add-drivers "ext2 ext3"
+ #|sshkey /root/.ssh/kdump_id_rsa
+ #|ssh user(a)my.server.com
+ }
+ kdump_config >$KDUMP_CONFIG_FILE
+ Context 'Given different cases'
+ # Test the following cases:
+ # - there is trailing comment
+ # - there is space before the parameter
+ # - complicate value for dracut_args
+ # - Given two parameters, retrive one parameter that has value specified
+ # - Given two parameters (in reverse order), retrive one parameter that has value specified
+ Parameters
+ "#1" nfs my.server.com:/export/tmp
+ "#2" ssh user(a)my.server.com
+ "#3" failure_action shell
+ "#4" dracut_args '--omit-drivers "cfg80211 snd" --add-drivers "ext2 ext3"'
+ "#5" 'ssh\|aaa' user(a)my.server.com
+ "#6" 'aaa\|ssh' user(a)my.server.com
+ End
+
+ It 'should handle all cases correctly'
+ When call kdump_get_conf_val "$2"
+ The output should equal "$3"
+ End
+ End
+
+ End
+
+End
commit e00b45d75fa00a1d47b6cab0f609faf089ff563e
Author: Coiby Xu <coxu(a)redhat.com>
Date: Tue Jan 4 15:24:34 2022 +0800
unit tests: add tests for "kdumpctl reset-crashkernel"
This commit adds a relatively thorough test suite for
kdumpctl reset-crashkernel [--fadump=[on|off|nocma]] [--kernel=path_to_kernel] [--reboot]
as implemented in commit 140da74 ("rewrite reset_crashkernel to support
fadump and to used by RPM scriptlet").
grubby have a few options to support its own testing,
- --no-etc-grub-update, not update /etc/default/grub
- --bad-image-okay, don't check the validity of the image
- --env, specify custom grub2 environment block file to avoid modifying
the default /boot/grub2/grubenv
- --bls-directory, specify custom BootLoaderSpec config files to avoid
modifying the default /boot/loader/entries
So the grubby called by kdumpctl is mocked as
@grubby --grub2 --no-etc-grub-update --bad-image-okay --env=$SPEC_TEST_DIR/env_temp -b $SPEC_TEST_DIR/boot_load_entries "$@"
in the tests. To be able to call the actual grubby in the mock function [1],
ShellSpec provides the following command
$ shellspec --gen-bin @grubby
to generate spec/support/bins/@grubby which is used to call the actual grubby.
kdumpctl has implemented its own version of updating /etc/default/grub
in _update_kernel_cmdline_in_grub_etc_default. To avoiding writing to
/etc/default/grub, this function is mocked as outputting its name and
received arguments similar to python unitest's assert_called_with.
[1] https://github.com/shellspec/shellspec#execute-the-actual-command-within-...
Reviewed-by: Philipp Rudo <prudo(a)redhat.com>
Signed-off-by: Coiby Xu <coxu(a)redhat.com>
diff --git a/spec/kdumpctl_reset_crashkernel_spec.sh b/spec/kdumpctl_reset_crashkernel_spec.sh
new file mode 100644
index 0000000..28d9277
--- /dev/null
+++ b/spec/kdumpctl_reset_crashkernel_spec.sh
@@ -0,0 +1,224 @@
+#!/bin/bash
+Describe 'kdumpctl reset-crashkernel [--kernel] [--fadump]'
+ Include ./kdumpctl
+ kernel1=/boot/vmlinuz-5.15.6-100.fc34.x86_64
+ kernel2=/boot/vmlinuz-5.14.14-200.fc34.x86_64
+ ck=222M
+ KDUMP_SPEC_TEST_RUN_DIR=$(mktemp -d /tmp/spec_test.XXXXXXXXXX)
+ current_kernel=5.15.6-100.fc34.x86_64
+
+ setup() {
+ cp -r spec/support/boot_load_entries "$KDUMP_SPEC_TEST_RUN_DIR"
+ cp spec/support/grub_env "$KDUMP_SPEC_TEST_RUN_DIR"/env_temp
+ }
+
+ cleanup() {
+ rm -rf "$KDUMP_SPEC_TEST_RUN_DIR"
+ }
+
+ BeforeAll 'setup'
+ AfterAll 'cleanup'
+
+ grubby() {
+ # - --no-etc-grub-update, not update /etc/default/grub
+ # - --bad-image-okay, don't check the validity of the image
+ # - --env, specify custom grub2 environment block file to avoid modifying
+ # the default /boot/grub2/grubenv
+ # - --bls-directory, specify custom BootLoaderSpec config files to avoid
+ # modifying the default /boot/loader/entries
+ @grubby --no-etc-grub-update --grub2 --bad-image-okay --env="$KDUMP_SPEC_TEST_RUN_DIR"/env_temp -b "$KDUMP_SPEC_TEST_RUN_DIR"/boot_load_entries "$@"
+ }
+
+ Describe "Test the kdump dump mode "
+ uname() {
+ if [[ $1 == '-m' ]]; then
+ echo -n x86_64
+ elif [[ $1 == '-r' ]]; then
+ echo -n $current_kernel
+ fi
+ }
+ kdump_crashkernel=$(get_default_crashkernel kdump)
+ Context "when --kernel not specified"
+ grubby --args crashkernel=$ck --update-kernel ALL
+ Specify 'kdumpctl should warn the user that crashkernel has been udpated'
+ When call reset_crashkernel
+ The error should include "Updated crashkernel=$kdump_crashkernel"
+ End
+
+ Specify 'Current running kernel should have crashkernel updated'
+ When call grubby --info $kernel1
+ The line 3 of output should include crashkernel="$kdump_crashkernel"
+ The line 3 of output should not include crashkernel=$ck
+ End
+
+ Specify 'Other kernel still use the old crashkernel value'
+ When call grubby --info $kernel2
+ The line 3 of output should include crashkernel=$ck
+ End
+ End
+
+ Context "--kernel=ALL"
+ grubby --args crashkernel=$ck --update-kernel ALL
+ Specify 'kdumpctl should warn the user that crashkernel has been udpated'
+ When call reset_crashkernel --kernel=ALL
+ The error should include "Updated crashkernel=$kdump_crashkernel for kernel=$kernel1"
+ The error should include "Updated crashkernel=$kdump_crashkernel for kernel=$kernel2"
+ End
+
+ Specify 'kernel1 should have crashkernel updated'
+ When call grubby --info $kernel1
+ The line 3 of output should include crashkernel="$kdump_crashkernel"
+ End
+
+ Specify 'kernel2 should have crashkernel updated'
+ When call grubby --info $kernel2
+ The line 3 of output should include crashkernel="$kdump_crashkernel"
+ End
+ End
+
+ Context "--kernel=/boot/one-kernel to update one specified kernel"
+ grubby --args crashkernel=$ck --update-kernel ALL
+ Specify 'kdumpctl should warn the user that crashkernel has been updated'
+ When call reset_crashkernel --kernel=$kernel1
+ The error should include "Updated crashkernel=$kdump_crashkernel for kernel=$kernel1"
+ End
+
+ Specify 'kernel1 should have crashkernel updated'
+ When call grubby --info $kernel1
+ The line 3 of output should include crashkernel="$kdump_crashkernel"
+ End
+
+ Specify 'kernel2 should have the old crashkernel'
+ When call grubby --info $kernel2
+ The line 3 of output should include crashkernel=$ck
+ End
+
+ End
+
+ End
+
+ Describe "FADump" fadump
+ uname() {
+ if [[ $1 == '-m' ]]; then
+ echo -n ppc64le
+ elif [[ $1 == '-r' ]]; then
+ echo -n $current_kernel
+ fi
+ }
+
+ _update_kernel_arg_in_grub_etc_default() {
+ # don't modify /etc/default/grub during the test
+ echo _update_kernel_arg_in_grub_etc_default "$@"
+ }
+
+ kdump_crashkernel=$(get_default_crashkernel kdump)
+ fadump_crashkernel=$(get_default_crashkernel fadump)
+ Context "when no --kernel specified"
+ grubby --args crashkernel=$ck --update-kernel ALL
+ grubby --remove-args=fadump --update-kernel ALL
+ Specify 'kdumpctl should warn the user that crashkernel has been udpated'
+ When call reset_crashkernel
+ The error should include "Updated crashkernel=$kdump_crashkernel"
+ End
+
+ Specify 'Current running kernel should have crashkernel updated'
+ When call grubby --info $kernel1
+ The line 3 of output should include crashkernel="$kdump_crashkernel"
+ End
+
+ Specify 'Other kernel still use the old crashkernel value'
+ When call grubby --info $kernel2
+ The line 3 of output should include crashkernel=$ck
+ End
+ End
+
+ Context "--kernel=ALL --fadump=on"
+ grubby --args crashkernel=$ck --update-kernel ALL
+ Specify 'kdumpctl should warn the user that crashkernel has been udpated'
+ When call reset_crashkernel --kernel=ALL --fadump=on
+ The line 1 of output should include "_update_kernel_arg_in_grub_etc_default crashkernel $fadump_crashkernel"
+ The error should include "Updated crashkernel=$fadump_crashkernel for kernel=$kernel1"
+ The error should include "Updated crashkernel=$fadump_crashkernel for kernel=$kernel2"
+ End
+
+ Specify 'kernel1 should have crashkernel updated'
+ When call grubby --info $kernel1
+ The line 3 of output should include crashkernel="$fadump_crashkernel"
+ End
+
+ Specify 'kernel2 should have crashkernel updated'
+ When call get_grub_kernel_boot_parameter $kernel2 crashkernel
+ The output should equal "$fadump_crashkernel"
+ End
+ End
+
+ Context "--kernel=/boot/one-kernel to update one specified kernel"
+ grubby --args crashkernel=$ck --update-kernel ALL
+ grubby --args fadump=on --update-kernel $kernel1
+ Specify 'kdumpctl should warn the user that crashkernel has been updated'
+ When call reset_crashkernel --kernel=$kernel1
+ The error should include "Updated crashkernel=$fadump_crashkernel for kernel=$kernel1"
+ End
+
+ Specify 'kernel1 should have crashkernel updated'
+ When call grubby --info $kernel1
+ The line 3 of output should include crashkernel="$fadump_crashkernel"
+ End
+
+ Specify 'kernel2 should have the old crashkernel'
+ When call get_grub_kernel_boot_parameter $kernel2 crashkernel
+ The output should equal $ck
+ End
+ End
+
+ Context "Update all kernels but without --fadump specified"
+ grubby --args crashkernel=$ck --update-kernel ALL
+ grubby --args fadump=on --update-kernel $kernel1
+ Specify 'kdumpctl should warn the user that crashkernel has been updated'
+ When call reset_crashkernel --kernel=$kernel1
+ The error should include "Updated crashkernel=$fadump_crashkernel for kernel=$kernel1"
+ End
+
+ Specify 'kernel1 should have crashkernel updated'
+ When call get_grub_kernel_boot_parameter $kernel1 crashkernel
+ The output should equal "$fadump_crashkernel"
+ End
+
+ Specify 'kernel2 should have the old crashkernel'
+ When call get_grub_kernel_boot_parameter $kernel2 crashkernel
+ The output should equal $ck
+ End
+ End
+
+ Context 'Switch between fadump=on and fadump=nocma'
+ grubby --args crashkernel=$ck --update-kernel ALL
+ grubby --args fadump=on --update-kernel ALL
+ Specify 'fadump=on to fadump=nocma'
+ When call reset_crashkernel --kernel=ALL --fadump=nocma
+ The line 1 of output should equal "_update_kernel_arg_in_grub_etc_default crashkernel $fadump_crashkernel"
+ The line 2 of output should equal "_update_kernel_arg_in_grub_etc_default fadump nocma"
+ The error should include "Updated crashkernel=$fadump_crashkernel for kernel=$kernel1"
+ The error should include "Updated crashkernel=$fadump_crashkernel for kernel=$kernel2"
+ End
+
+ Specify 'kernel1 should have fadump=nocma in cmdline'
+ When call get_grub_kernel_boot_parameter $kernel1 fadump
+ The output should equal nocma
+ End
+
+ Specify 'fadump=nocma to fadump=on'
+ When call reset_crashkernel --kernel=ALL --fadump=on
+ The line 1 of output should equal "_update_kernel_arg_in_grub_etc_default crashkernel $fadump_crashkernel"
+ The line 2 of output should equal "_update_kernel_arg_in_grub_etc_default fadump on"
+ The error should include "Updated fadump=on for kernel=$kernel1"
+ End
+
+ Specify 'kernel2 should have fadump=on in cmdline'
+ When call get_grub_kernel_boot_parameter $kernel1 fadump
+ The output should equal on
+ End
+
+ End
+
+ End
+End
diff --git a/spec/support/bin/@grubby b/spec/support/bin/@grubby
new file mode 100755
index 0000000..2a9b33f
--- /dev/null
+++ b/spec/support/bin/@grubby
@@ -0,0 +1,3 @@
+#!/bin/sh -e
+. "$SHELLSPEC_SUPPORT_BIN"
+invoke grubby "$@"
diff --git a/spec/support/boot_load_entries/e986846f63134c7295458cf36300ba5b-0-rescue.conf b/spec/support/boot_load_entries/e986846f63134c7295458cf36300ba5b-0-rescue.conf
new file mode 100644
index 0000000..b821952
--- /dev/null
+++ b/spec/support/boot_load_entries/e986846f63134c7295458cf36300ba5b-0-rescue.conf
@@ -0,0 +1,8 @@
+title Fedora (0-rescue-e986846f63134c7295458cf36300ba5b) 33 (Workstation Edition)
+version 0-rescue-e986846f63134c7295458cf36300ba5b
+linux /boot/vmlinuz-0-rescue-e986846f63134c7295458cf36300ba5b
+initrd /boot/initramfs-0-rescue-e986846f63134c7295458cf36300ba5b.img
+options root=UUID=45fdf703-3966-401b-b8f7-cf056affd2b0 ro rd.driver.blacklist=nouveau modprobe.blacklist=nouveau nvidia-drm.modeset=1 rhgb quiet rd.driver.blacklist=nouveau modprobe.blacklist=nouveau nvidia-drm.modeset=1 crashkernel=4G-16G:768M,16G-64G:1G,64G-128G:2G,128G-1T:4G,1T-2T:6G,2T-4T:12G,4T-8T:20G,8T-16T:36G,16T-32T:64G,32T-64T:128G,64T-102400T:180G fadump=on
+grub_users $grub_users
+grub_arg --unrestricted
+grub_class kernel
diff --git a/spec/support/boot_load_entries/e986846f63134c7295458cf36300ba5b-5.14.14-200.fc34.x86_64.conf b/spec/support/boot_load_entries/e986846f63134c7295458cf36300ba5b-5.14.14-200.fc34.x86_64.conf
new file mode 100644
index 0000000..08bd411
--- /dev/null
+++ b/spec/support/boot_load_entries/e986846f63134c7295458cf36300ba5b-5.14.14-200.fc34.x86_64.conf
@@ -0,0 +1,8 @@
+title Fedora (5.14.14-200.fc34.x86_64) 34 (Workstation Edition)
+version 5.14.14-200.fc34.x86_64
+linux /boot/vmlinuz-5.14.14-200.fc34.x86_64
+initrd /boot/initramfs-5.14.14-200.fc34.x86_64.img
+options root=UUID=45fdf703-3966-401b-b8f7-cf056affd2b0 ro rd.driver.blacklist=nouveau modprobe.blacklist=nouveau nvidia-drm.modeset=1 rhgb quiet rd.driver.blacklist=nouveau modprobe.blacklist=nouveau nvidia-drm.modeset=1 crashkernel=4G-16G:768M,16G-64G:1G,64G-128G:2G,128G-1T:4G,1T-2T:6G,2T-4T:12G,4T-8T:20G,8T-16T:36G,16T-32T:64G,32T-64T:128G,64T-102400T:180G fadump=on
+grub_users $grub_users
+grub_arg --unrestricted
+grub_class kernel
diff --git a/spec/support/boot_load_entries/e986846f63134c7295458cf36300ba5b-5.15.6-100.fc34.x86_64.conf b/spec/support/boot_load_entries/e986846f63134c7295458cf36300ba5b-5.15.6-100.fc34.x86_64.conf
new file mode 100644
index 0000000..9259b99
--- /dev/null
+++ b/spec/support/boot_load_entries/e986846f63134c7295458cf36300ba5b-5.15.6-100.fc34.x86_64.conf
@@ -0,0 +1,8 @@
+title Fedora (5.15.6-100.fc34.x86_64) 34 (Workstation Edition)
+version 5.15.6-100.fc34.x86_64
+linux /boot/vmlinuz-5.15.6-100.fc34.x86_64
+initrd /boot/initramfs-5.15.6-100.fc34.x86_64.img
+options root=UUID=45fdf703-3966-401b-b8f7-cf056affd2b0 ro rd.driver.blacklist=nouveau modprobe.blacklist=nouveau nvidia-drm.modeset=1 rhgb quiet rd.driver.blacklist=nouveau modprobe.blacklist=nouveau nvidia-drm.modeset=1 crashkernel=4G-16G:768M,16G-64G:1G,64G-128G:2G,128G-1T:4G,1T-2T:6G,2T-4T:12G,4T-8T:20G,8T-16T:36G,16T-32T:64G,32T-64T:128G,64T-102400T:180G fadump=on
+grub_users $grub_users
+grub_arg --unrestricted
+grub_class fedora
diff --git a/spec/support/grub_env b/spec/support/grub_env
new file mode 100644
index 0000000..a77303c
--- /dev/null
+++ b/spec/support/grub_env
@@ -0,0 +1,3 @@
+# GRUB Environment Block
+# WARNING: Do not edit this file by tools other than grub-editenv!!!
+##################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################################
\ No newline at end of file
commit ea8b06df8392d71bdb694646a4e24fd29a947977
Author: Coiby Xu <coxu(a)redhat.com>
Date: Tue Jan 4 20:57:55 2022 +0800
unit tests: add tests for _{update,read}_kernel_arg_in_grub_etc_default in kdumpctl
Reviewed-by: Philipp Rudo <prudo(a)redhat.com>
Signed-off-by: Coiby Xu <coxu(a)redhat.com>
diff --git a/spec/kdumpctl_general_spec.sh b/spec/kdumpctl_general_spec.sh
index 9fbc1a0..e72bf1d 100644
--- a/spec/kdumpctl_general_spec.sh
+++ b/spec/kdumpctl_general_spec.sh
@@ -107,4 +107,71 @@ Describe 'kdumpctl'
End
End
+ Describe '_update_kernel_arg_in_grub_etc_default()'
+ GRUB_ETC_DEFAULT=/tmp/default_grub
+
+ cleanup() {
+ rm -rf "$GRUB_ETC_DEFAULT"
+ }
+ AfterAll 'cleanup'
+
+ Context 'when the given parameter is in different positions'
+ Parameters
+ "crashkernel=222M fadump=on rhgb quiet" crashkernel 333M
+ " fadump=on crashkernel=222M rhgb quiet" crashkernel 333M
+ "fadump=on rhgb quiet crashkernel=222M" crashkernel 333M
+ "fadump=on rhgb quiet" crashkernel 333M
+ "fadump=on foo=bar1 rhgb quiet" foo bar2
+ End
+
+ It 'should update the kernel parameter correctly'
+ echo 'GRUB_CMDLINE_LINUX="'"$1"'"' >$GRUB_ETC_DEFAULT
+ When call _update_kernel_arg_in_grub_etc_default "$2" "$3"
+ # the updated kernel parameter should appear in the end
+ The contents of file $GRUB_ETC_DEFAULT should include "$2=$3\""
+ End
+ End
+
+ It 'should only update the given parameter and not update the parameter that has the given parameter as suffix'
+ echo 'GRUB_CMDLINE_LINUX="fadump=on rhgb quiet ckcrashkernel=222M"' >$GRUB_ETC_DEFAULT
+ _ck_val=1G-4G:192M,4G-64G:256M,64G-102400T:512M
+ When call _update_kernel_arg_in_grub_etc_default crashkernel "$_ck_val"
+ The contents of file $GRUB_ETC_DEFAULT should include "crashkernel=$_ck_val\""
+ The contents of file $GRUB_ETC_DEFAULT should include "ckcrashkernel=222M"
+ End
+
+ It 'should be able to handle the cases of there are multiple crashkernel entries'
+ echo 'GRUB_CMDLINE_LINUX="fadump=on rhgb quiet crashkernel=101M crashkernel=222M"' >$GRUB_ETC_DEFAULT
+ _ck_val=1G-4G:192M,4G-64G:256M,64G-102400T:512M
+ When call _update_kernel_arg_in_grub_etc_default crashkernel "$_ck_val"
+ The contents of file $GRUB_ETC_DEFAULT should include "crashkernel=$_ck_val\""
+ The contents of file $GRUB_ETC_DEFAULT should not include "crashkernel=222M"
+ End
+
+ Context 'when it removes a kernel parameter'
+
+ It 'should remove all values for given arg'
+ echo 'GRUB_CMDLINE_LINUX="crashkernel=33M crashkernel=11M fadump=on crashkernel=222M"' >$GRUB_ETC_DEFAULT
+ When call _update_kernel_arg_in_grub_etc_default crashkernel
+ The contents of file $GRUB_ETC_DEFAULT should equal 'GRUB_CMDLINE_LINUX="fadump=on"'
+ End
+
+ It 'should not remove args that have the given arg as suffix'
+ echo 'GRUB_CMDLINE_LINUX="ckcrashkernel=33M crashkernel=11M ckcrashkernel=222M"' >$GRUB_ETC_DEFAULT
+ When call _update_kernel_arg_in_grub_etc_default crashkernel
+ The contents of file $GRUB_ETC_DEFAULT should equal 'GRUB_CMDLINE_LINUX="ckcrashkernel=33M ckcrashkernel=222M"'
+ End
+ End
+
+ End
+
+ Describe '_read_kernel_arg_in_grub_etc_default()'
+ GRUB_ETC_DEFAULT=/tmp/default_grub
+ It 'should read the value for given arg'
+ echo 'GRUB_CMDLINE_LINUX="crashkernel=33M crashkernel=11M ckcrashkernel=222M"' >$GRUB_ETC_DEFAULT
+ When call _read_kernel_arg_in_grub_etc_default crashkernel
+ The output should equal '11M'
+ End
+ End
+
End
commit 6506bd9b1bcd4117676aaef513c144c4d81bec21
Author: Coiby Xu <coxu(a)redhat.com>
Date: Fri Jan 21 15:46:40 2022 +0800
unit tests: add tests for kdumpctl read_proc_environ_var and _is_osbuild
AfterAll is an example group hook [1] which would be run after the group
tests are executed. Use this hook to clean up the files created by mktemp.
[1] https://github.com/shellspec/shellspec#beforeall-afterall---example-group...
Reviewed-by: Philipp Rudo <prudo(a)redhat.com>
Signed-off-by: Coiby Xu <coxu(a)redhat.com>
diff --git a/spec/kdumpctl_general_spec.sh b/spec/kdumpctl_general_spec.sh
index b968f74..9fbc1a0 100644
--- a/spec/kdumpctl_general_spec.sh
+++ b/spec/kdumpctl_general_spec.sh
@@ -70,5 +70,41 @@ Describe 'kdumpctl'
End
+ Describe "read_proc_environ_var()"
+ environ_test_file=$(mktemp -t spec_test_environ_test_file.XXXXXXXXXX)
+ cleanup() {
+ rm -rf "$environ_test_file"
+ }
+ AfterAll 'cleanup'
+ echo -ne "container=bwrap-osbuild\x00SSH_AUTH_SOCK=/tmp/ssh-XXXXXXEbw33A/agent.1794\x00SSH_AGENT_PID=1929\x00env=test_env" >"$environ_test_file"
+ Parameters
+ container bwrap-osbuild
+ SSH_AUTH_SOCK /tmp/ssh-XXXXXXEbw33A/agent.1794
+ env test_env
+ not_exist ""
+ End
+ It 'should read the environ variable value as expected'
+ When call read_proc_environ_var "$1" "$environ_test_file"
+ The output should equal "$2"
+ The status should be success
+ End
+ End
+
+ Describe "_is_osbuild()"
+ environ_test_file=$(mktemp -t spec_test_environ_test_file.XXXXXXXXXX)
+ # shellcheck disable=SC2034
+ # override the _OSBUILD_ENVIRON_PATH variable
+ _OSBUILD_ENVIRON_PATH="$environ_test_file"
+ Parameters
+ 'container=bwrap-osbuild' success
+ '' failure
+ End
+ It 'should be able to tell if it is the osbuild environment'
+ echo -ne "$1" >"$environ_test_file"
+ When call _is_osbuild
+ The status should be "$2"
+ The stderr should equal ""
+ End
+ End
End
commit 59386d5a8b1d2c2c2f9e8cdeb2a9e17565316033
Author: Coiby Xu <coxu(a)redhat.com>
Date: Wed Jan 5 15:24:02 2022 +0800
unit tests: add tests for get_dump_mode_by_fadump_val
Reviewed-by: Philipp Rudo <prudo(a)redhat.com>
Signed-off-by: Coiby Xu <coxu(a)redhat.com>
diff --git a/spec/kdumpctl_general_spec.sh b/spec/kdumpctl_general_spec.sh
index e1d8698..b968f74 100644
--- a/spec/kdumpctl_general_spec.sh
+++ b/spec/kdumpctl_general_spec.sh
@@ -45,4 +45,30 @@ Describe 'kdumpctl'
The error should include "kernel_path=ALL invalid"
End
End
+
+ Describe 'get_dump_mode_by_fadump_val()'
+
+ Context 'when given valid fadump values'
+ Parameters
+ "#1" on fadump
+ "#2" nocma fadump
+ "#3" "" kdump
+ "#4" off kdump
+ End
+ It "should return the dump mode correctly"
+ When call get_dump_mode_by_fadump_val "$2"
+ The output should equal "$3"
+ The status should be success
+ End
+ End
+
+ It 'should complain given invalid fadump value'
+ When call get_dump_mode_by_fadump_val /boot/vmlinuz
+ The status should be failure
+ The error should include 'invalid fadump'
+ End
+
+ End
+
+
End
commit 93373c040627f31826d864110413c4e1f72e9b4b
Author: Coiby Xu <coxu(a)redhat.com>
Date: Wed Jan 5 13:48:58 2022 +0800
unit tests: add tests for get_grub_kernel_boot_parameter
This test suite makes use of three features provided by ShellSpec
- funcion-based mock [2]: mock a function by re-defining and exporting it
- parameterized tests [3]: run multiple sets of input against the same
test
- %text directive [4]: similar to heredoc but free of
the indentation issue
Note
1. Describe and Context are aliases for ExampleGroup which a block for
grouping example groups or examples [5]. Describe and Context are used to
improve readability.
2. ShellSpec requires .shellspec file.
[1] https://github.com/dodie/testing-in-bash#detailed-comparision
[2] https://github.com/shellspec/shellspec#function-based-mock
[3] https://github.com/shellspec/shellspec#parameters---parameterized-example
[4] https://github.com/shellspec/shellspec#text---embedded-text
[5] https://github.com/shellspec/shellspec#dsl-syntax
Reviewed-by: Philipp Rudo <prudo(a)redhat.com>
Signed-off-by: Coiby Xu <coxu(a)redhat.com>
diff --git a/.shellspec b/.shellspec
new file mode 100644
index 0000000..e69de29
diff --git a/spec/kdumpctl_general_spec.sh b/spec/kdumpctl_general_spec.sh
new file mode 100644
index 0000000..e1d8698
--- /dev/null
+++ b/spec/kdumpctl_general_spec.sh
@@ -0,0 +1,48 @@
+#!/bin/bash
+Describe 'kdumpctl'
+ Include ./kdumpctl
+
+ Describe 'get_grub_kernel_boot_parameter()'
+ grubby() {
+ %text
+ #|index=1
+ #|kernel="/boot/vmlinuz-5.14.14-200.fc34.x86_64"
+ #|args="crashkernel=11M nvidia-drm.modeset=1 crashkernel=100M ro rhgb quiet crcrashkernel=200M crashkernel=32T-64T:128G,64T-102400T:180G fadump=on"
+ #|root="UUID=45fdf703-3966-401b-b8f7-cf056affd2b0"
+ }
+ DUMMY_PARAM=/boot/vmlinuz
+
+ Context "when given a kernel parameter in different positions"
+ # Test the following cases:
+ # - the kernel parameter in the end
+ # - the kernel parameter in the first
+ # - the kernel parameter is crashkernel (suffix of crcrashkernel)
+ # - the kernel parameter that does not exist
+ # - the kernel parameter doesn't have a value
+ Parameters
+ # parameter answer
+ fadump on
+ nvidia-drm.modeset 1
+ crashkernel 32T-64T:128G,64T-102400T:180G
+ aaaa ""
+ ro ""
+ End
+
+ It 'should retrieve the value succesfully'
+ When call get_grub_kernel_boot_parameter "$DUMMY_PARAM" "$2"
+ The output should equal "$3"
+ End
+ End
+
+ It 'should retrive the last value if multiple <parameter=value> entries exist'
+ When call get_grub_kernel_boot_parameter "$DUMMY_PARAM" crashkernel
+ The output should equal '32T-64T:128G,64T-102400T:180G'
+ End
+
+ It 'should fail when called with kernel_path=ALL'
+ When call get_grub_kernel_boot_parameter ALL ro
+ The status should be failure
+ The error should include "kernel_path=ALL invalid"
+ End
+ End
+End
commit b97310428f336d58028d34f3f3c7a551e47b5c32
Author: Coiby Xu <coxu(a)redhat.com>
Date: Tue Jan 4 14:04:38 2022 +0800
unit tests: prepare for kdumpctl and kdump-lib.sh to be unit-tested
Currently there are two issues with unit-testing the functions defined
in kdumpctl and other shell scripts after sourcing them,
- kdumpctl would call main which requires root permission and would
create single instance lock (/var/lock/kdump)
- kdumpctl and other shell scripts directly source files under /usr/lib/kdump/
When ShellSpec load a script via "Include", it defines the__SOURCED__
variable. By making use of __SOURCED__, we can
1. let kdumpctl not call main when kdumpctl is "Include"d by ShellSpec
2. instruct kdumpctl and kdump-lib.sh to source the files in the repo
when running ShelSpec tests
Note coverage/ is added to .gitignore because ShellSpec generates code
coverage results in this folder.
Reviewed-by: Philipp Rudo <prudo(a)redhat.com>
Signed-off-by: Coiby Xu <coxu(a)redhat.com>
diff --git a/.gitignore b/.gitignore
index 7a38a39..e9c2dd8 100644
--- a/.gitignore
+++ b/.gitignore
@@ -21,3 +21,4 @@
/kexec-tools-2.0.11.tar.xz
/makedumpfile-1.5.9.tar.gz
/kexec-tools-2.0.12.tar.xz
+coverage/
diff --git a/kdump-lib.sh b/kdump-lib.sh
index 5b1656e..557eff6 100755
--- a/kdump-lib.sh
+++ b/kdump-lib.sh
@@ -2,8 +2,11 @@
#
# Kdump common variables and functions
#
-
-. /usr/lib/kdump/kdump-lib-initramfs.sh
+if [[ ${__SOURCED__:+x} ]]; then
+ . ./kdump-lib-initramfs.sh
+else
+ . /lib/kdump/kdump-lib-initramfs.sh
+fi
FADUMP_ENABLED_SYS_NODE="/sys/kernel/fadump_enabled"
diff --git a/kdumpctl b/kdumpctl
index 4d819c2..6188d47 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -32,8 +32,14 @@ fi
[[ $dracutbasedir ]] || dracutbasedir=/usr/lib/dracut
. $dracutbasedir/dracut-functions.sh
-. /lib/kdump/kdump-lib.sh
-. /lib/kdump/kdump-logger.sh
+
+if [[ ${__SOURCED__:+x} ]]; then
+ KDUMP_LIB_PATH=.
+else
+ KDUMP_LIB_PATH=/lib/kdump
+fi
+. $KDUMP_LIB_PATH/kdump-lib.sh
+. $KDUMP_LIB_PATH/kdump-logger.sh
#initiate the kdump logger
if ! dlog_init; then
@@ -1676,11 +1682,6 @@ reset_crashkernel_for_installed_kernel()
fi
}
-if [[ ! -f $KDUMP_CONFIG_FILE ]]; then
- derror "Error: No kdump config file found!"
- exit 1
-fi
-
main()
{
# Determine if the dump mode is kdump or fadump
@@ -1753,6 +1754,15 @@ main()
esac
}
+if [[ ${__SOURCED__:+x} ]]; then
+ return
+fi
+
+if [[ ! -f $KDUMP_CONFIG_FILE ]]; then
+ derror "Error: No kdump config file found!"
+ exit 1
+fi
+
# Other kdumpctl instances will block in queue, until this one exits
single_instance_lock
commit 11140c28a25169837333c5bf7d51cbe17c897025
Author: Coiby Xu <coxu(a)redhat.com>
Date: Mon Apr 11 10:56:46 2022 +0800
Release 2.0.24-1
diff --git a/kexec-tools.spec b/kexec-tools.spec
index 6b7ef14..db6374c 100644
--- a/kexec-tools.spec
+++ b/kexec-tools.spec
@@ -4,8 +4,8 @@
%global mkdf_shortver %(c=%{mkdf_ver}; echo ${c:0:7})
Name: kexec-tools
-Version: 2.0.23
-Release: 5%{?dist}
+Version: 2.0.24
+Release: 1%{?dist}
License: GPLv2
Summary: The kexec/kdump userspace component
@@ -103,7 +103,6 @@ Requires: systemd-udev%{?_isa}
#
# Patches 401 through 500 are meant for s390 kexec-tools enablement
#
-Patch401: ./kexec-tools-2.0.23-s390_handle_R_390_PLT32DBL_reloc_entries_in_machine_apply_elf_rel_.patch
#
# Patches 501 through 600 are meant for ARM kexec-tools enablement
@@ -127,7 +126,6 @@ mkdir -p -m755 kcp
tar -z -x -v -f %{SOURCE9}
tar -z -x -v -f %{SOURCE19}
-%patch401 -p1
%ifarch ppc
%define archdef ARCH=ppc
@@ -407,6 +405,28 @@ fi
%endif
%changelog
+* Mon Apr 11 2022 Coiby <coxu(a)redhat.com> - 2.0.24-1
+- Update kexec-tools to 2.0.24
+- kdumpctl: remove kdump_get_conf_val in save_raw
+- kdumpctl: drop DUMP_TARGET variable
+- kdumpctl: drop SSH_KEY_LOCATION variable
+- kdumpctl: drop SAVE_PATH variable
+- kdumpctl: reduce file operations on kdump.conf
+- kdumpctl: merge check_ssh_config into check_config
+- kdumpctl: simplify propagate_ssh_key
+- kdumpctl: forbid aliases from ssh config
+- kdumpctl: fix comment in check_and_wait_network_ready
+- kdump-lib-initramfs: merge definitions for default ssh key
+- kdumpctl: remove unnecessary uses of $?
+- kdump-lib: fix typo in variable name
+- kdump-capture.service: switch to journal for stdout
+- kdumpctl/estimate: Fix unnecessary warning
+- kdumpctl: sync the $TARGET_INITRD after rebuild
+- try to update the crashkernel in GRUB_ETC_DEFAULT after kexec-tools updates the default crashkernel value
+- address the case where there are multiple values for the same kernel arg
+- update kernel crashkernel in posttrans RPM scriptlet when updating kexec-tools
+- kdump-lib.sh: Check the output of blkid with sed instead of eval
+
* Mon Feb 14 2022 Coiby <coxu(a)redhat.com> - 2.0.23-5
- fix incorrect usage of _get_all_kernels_from_grubby
- fix the mistake of swapping function parameters of read_proc_environ_var
diff --git a/sources b/sources
index 5069108..95c0fc6 100644
--- a/sources
+++ b/sources
@@ -1,3 +1,3 @@
SHA512 (eppic-e8844d3.tar.gz) = d86b9f90c57e694107272d8f71b87f66a30743b9530480fb6f665026bbada4c6b0205a83e40b5383663a945681cfbfcf1ee79469fc219ddf679473c4b2290763
-SHA512 (kexec-tools-2.0.23.tar.xz) = b6e3b967cacc31c434b185d25da4d53c822ae4bbcec26ef9d6cb171f294fdcc80913d381e686a0a41e025187835f4dc088052ff88efe75a021d7624c8b1a1ed8
+SHA512 (kexec-tools-2.0.24.tar.xz) = ef7cf78246e2d729d81a3649791a5a23c385353cc75cbe8ef279616329fdaccc876d614c7f51e1456822a13a11520296070d9897467d24310399909e049c3822
SHA512 (makedumpfile-1.7.0.tar.gz) = 579a1fb79d023a1419fc8612a02a04dda3e3b3d72455566433ab6bec08627aa9a176c55566393a081a7aae3fd0543800196596b25445b21b16346556723e9cf7
commit 55b5c4e2b0105ae5b64ab3a5ea1c1879dc818a03
Author: Philipp Rudo <prudo(a)redhat.com>
Date: Fri Mar 25 15:47:11 2022 +0100
kdumpctl: simplify local_fs_dump_target
Make use of the new ${OPT[]} array and simplify local_fs_dump_target to
remove one more file operations.
While at it rename the local_fs_dump_target to is_local_target
Signed-off-by: Philipp Rudo <prudo(a)redhat.com>
Reviewed-by: Tao Liu <ltao(a)redhat.com>
Reviewed-by: Coiby Xu <coxu(a)redhat.com>
diff --git a/kdumpctl b/kdumpctl
index 82e8574..4d819c2 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -850,27 +850,22 @@ save_raw()
return 0
}
-local_fs_dump_target()
+is_local_target()
{
- local _target
-
- if _target=$(grep -E "^ext[234]|^xfs|^btrfs|^minix" /etc/kdump.conf); then
- echo "$_target" | awk '{print $2}'
- fi
+ [[ ${OPT[_fstype]} =~ ^ext[234]|^xfs|^btrfs|^minix ]]
}
path_to_be_relabeled()
{
- local _path _target _mnt="/" _rmnt
+ local _path _mnt="/" _rmnt
if is_user_configured_dump_target; then
if is_mount_in_dracut_args; then
return
fi
- _target=$(local_fs_dump_target)
- if [[ -n $_target ]]; then
- _mnt=$(get_mntpoint_from_target "$_target")
+ if is_local_target; then
+ _mnt=$(get_mntpoint_from_target "${OPT[_target]}")
if ! is_mounted "$_mnt"; then
return
fi
commit ac5968218f4d4d86d5ad217c0912a81e985c5893
Author: Philipp Rudo <prudo(a)redhat.com>
Date: Fri Mar 25 15:47:10 2022 +0100
kdumpctl: remove kdump_get_conf_val in save_raw
With the introduction of ${OPT[fstype]} this call to kdump_get_conf_val
can be removed now as well.
Signed-off-by: Philipp Rudo <prudo(a)redhat.com>
Reviewed-by: Tao Liu <ltao(a)redhat.com>
Reviewed-by: Coiby Xu <coxu(a)redhat.com>
diff --git a/kdumpctl b/kdumpctl
index bfba442..82e8574 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -819,8 +819,9 @@ save_raw()
{
local raw_target
- raw_target=$(kdump_get_conf_val raw)
- [[ -z $raw_target ]] && return 0
+ [[ ${OPT[_fstype]} == raw ]] || return 0
+
+ raw_target=${OPT[_target]}
[[ -b $raw_target ]] || {
derror "raw partition $raw_target not found"
return 1
commit 5118daf2ff9f2283782ea38e4b99cf9c307c2324
Author: Philipp Rudo <prudo(a)redhat.com>
Date: Fri Mar 25 15:47:09 2022 +0100
kdumpctl: drop DUMP_TARGET variable
The variable is only used for ssh dump targets. Furthermore it is
identical to the value stored in ${OPT[_target]}. Thus drop DUMP_TARGET and
use ${OPT[_target]} instead.
In order to be able to distinguish between the different target types
introduce the internal ${OPT[_fstype]}.
Signed-off-by: Philipp Rudo <prudo(a)redhat.com>
Reviewed-by: Tao Liu <ltao(a)redhat.com>
Reviewed-by: Coiby Xu <coxu(a)redhat.com>
diff --git a/kdumpctl b/kdumpctl
index c5afedb..bfba442 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -10,7 +10,6 @@ MKDUMPRD="/sbin/mkdumprd -f"
MKFADUMPRD="/sbin/mkfadumprd"
DRACUT_MODULES_FILE="/usr/lib/dracut/modules.txt"
INITRD_CHECKSUM_LOCATION="/boot/.fadump_initrd_checksum"
-DUMP_TARGET=""
DEFAULT_INITRD=""
DEFAULT_INITRD_BAK=""
KDUMP_INITRD=""
@@ -196,7 +195,7 @@ _set_config()
fi
if [[ -n ${OPT[$opt]} ]]; then
- if [[ $opt == _target ]]; then
+ if [[ $opt == _target ]] || [[ $opt == _fstype ]]; then
derror "More than one dump targets specified"
else
derror "Duplicated kdump config value of option $opt"
@@ -216,6 +215,7 @@ parse_config()
derror 'Multiple mount targets specified in one "dracut_args".'
return 1
fi
+ _set_config _fstype "$(get_dracut_args_fstype "$config_val")" || return 1
_set_config _target "$(get_dracut_args_target "$config_val")" || return 1
fi
;;
@@ -223,15 +223,13 @@ parse_config()
if [[ -d "/proc/device-tree/ibm,opal/dump" ]]; then
dwarn "WARNING: Won't capture opalcore when 'raw' dump target is used."
fi
+ _set_config _fstype "$config_opt" || return 1
config_opt=_target
;;
- ext[234] | minix | btrfs | xfs | nfs )
+ ext[234] | minix | btrfs | xfs | nfs | ssh)
+ _set_config _fstype "$config_opt" || return 1
config_opt=_target
;;
- ssh)
- config_opt=_target
- DUMP_TARGET=$config_val
- ;;
sshkey)
if [[ -z $config_val ]]; then
derror "Invalid kdump config value for option '$config_opt'"
@@ -691,12 +689,12 @@ check_ssh_config()
{
local target
- [[ -n $DUMP_TARGET ]] || return 0
+ [[ "${OPT[_fstype]}" == ssh ]] || return 0
- [[ $DUMP_TARGET =~ .*@.* ]] || return 1
- target=$(ssh -G "$DUMP_TARGET" | sed -n -e "s/^hostname[[:space:]]\+\([^[:space:]]*\).*$/\1/p")
- if [[ ${DUMP_TARGET#*@} != "$target" ]]; then
- derror "Invalid ssh destination $DUMP_TARGET provided."
+ target=$(ssh -G "${OPT[_target]}" | sed -n -e "s/^hostname[[:space:]]\+\([^[:space:]]*\).*$/\1/p")
+ [[ ${OPT[_target]} =~ .*@.* ]] || return 1
+ if [[ ${OPT[_target]#*@} != "$target" ]]; then
+ derror "Invalid ssh destination ${OPT[_target]} provided."
return 1
fi
@@ -715,25 +713,25 @@ check_and_wait_network_ready()
local retval
local errmsg
- [[ -n $DUMP_TARGET ]] || return 0
+ [[ "${OPT[_fstype]}" == ssh ]] || return 0
start_time=$(date +%s)
while true; do
- errmsg=$(ssh -i "${OPT[sshkey]}" -o BatchMode=yes "$DUMP_TARGET" mkdir -p "${OPT[path]}" 2>&1)
+ errmsg=$(ssh -i "${OPT[sshkey]}" -o BatchMode=yes "${OPT[_target]}" mkdir -p "${OPT[path]}" 2>&1)
retval=$?
# ssh exits with the exit status of the remote command or with 255 if an error occurred
if [[ $retval -eq 0 ]]; then
return 0
elif [[ $retval -ne 255 ]]; then
- derror "Could not create $DUMP_TARGET:${OPT[path]}, you should check the privilege on server side"
+ derror "Could not create ${OPT[_target]}:${OPT[path]}, you should check the privilege on server side"
return 1
fi
# if server removes the authorized_keys or, no /root/.ssh/kdump_id_rsa
ddebug "$errmsg"
if echo "$errmsg" | grep -q "Permission denied\|No such file or directory\|Host key verification failed"; then
- derror "Could not create $DUMP_TARGET:${OPT[path]}, you probably need to run \"kdumpctl propagate\""
+ derror "Could not create ${OPT[_target]}:${OPT[path]}, you probably need to run \"kdumpctl propagate\""
return 1
fi
@@ -751,7 +749,7 @@ check_and_wait_network_ready()
sleep 1
done
- dinfo "Could not create $DUMP_TARGET:${OPT[path]}, ipaddr is not ready yet. You should check network connection"
+ dinfo "Could not create ${OPT[_target]}:${OPT[path]}, ipaddr is not ready yet. You should check network connection"
return 1
}
@@ -761,7 +759,7 @@ propagate_ssh_key()
parse_config || return 1
- if [[ -z $DUMP_TARGET ]] ; then
+ if [[ ${OPT[_fstype]} != ssh ]] ; then
derror "No ssh destination defined in $KDUMP_CONFIG_FILE."
derror "Please verify that $KDUMP_CONFIG_FILE contains 'ssh <user>@<host>' and that it is properly formatted."
exit 1
@@ -778,9 +776,9 @@ propagate_ssh_key()
dinfo "done."
fi
- SSH_USER=${DUMP_TARGET%@*}
- SSH_SERVER=${DUMP_TARGET#*@}
- if ssh-copy-id -i "$KEYFILE" "$DUMP_TARGET"; then
+ SSH_USER=${OPT[_target]%@*}
+ SSH_SERVER=${OPT[_target]#*@}
+ if ssh-copy-id -i "$KEYFILE" "${OPT[_target]}"; then
dinfo "$KEYFILE has been added to ~$SSH_USER/.ssh/authorized_keys on $SSH_SERVER"
return 0
else
commit a859abe3652c1eea75b847e6f6f93033b478a4d3
Author: Philipp Rudo <prudo(a)redhat.com>
Date: Fri Mar 25 15:47:08 2022 +0100
kdumpctl: drop SSH_KEY_LOCATION variable
The variable is only used for ssh dump targets. Furthermore it is
identical to the value stored in ${OPT[sshkey]}. Thus drop
SSH_KEY_LOCATION and use ${OPT[sshkey]} instead.
Signed-off-by: Philipp Rudo <prudo(a)redhat.com>
Reviewed-by: Tao Liu <ltao(a)redhat.com>
Reviewed-by: Coiby Xu <coxu(a)redhat.com>
diff --git a/kdumpctl b/kdumpctl
index 876561e..c5afedb 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -9,7 +9,6 @@ KDUMP_LOG_PATH="/var/log"
MKDUMPRD="/sbin/mkdumprd -f"
MKFADUMPRD="/sbin/mkfadumprd"
DRACUT_MODULES_FILE="/usr/lib/dracut/modules.txt"
-SSH_KEY_LOCATION=$DEFAULT_SSHKEY
INITRD_CHECKSUM_LOCATION="/boot/.fadump_initrd_checksum"
DUMP_TARGET=""
DEFAULT_INITRD=""
@@ -238,9 +237,10 @@ parse_config()
derror "Invalid kdump config value for option '$config_opt'"
return 1
elif [[ -f $config_val ]]; then
- SSH_KEY_LOCATION=$(/usr/bin/readlink -m "$config_val")
+ config_val=$(/usr/bin/readlink -m "$config_val")
else
- dwarn "WARNING: '$config_val' doesn't exist, using default value '$SSH_KEY_LOCATION'"
+ dwarn "WARNING: '$config_val' doesn't exist, using default value '$DEFAULT_SSHKEY'"
+ config_val=$DEFAULT_SSHKEY
fi
;;
path | core_collector | kdump_post | kdump_pre | extra_bins | extra_modules | failure_action | default | final_action | force_rebuild | force_no_rebuild | fence_kdump_args | fence_kdump_nodes | auto_reset_crashkernel) ;;
@@ -262,6 +262,7 @@ parse_config()
done <<< "$(kdump_read_conf)"
OPT[path]=${OPT[path]:-$DEFAULT_PATH}
+ OPT[sshkey]=${OPT[sshkey]:-$DEFAULT_SSHKEY}
check_failure_action_config || return 1
check_final_action_config || return 1
@@ -718,7 +719,7 @@ check_and_wait_network_ready()
start_time=$(date +%s)
while true; do
- errmsg=$(ssh -i "$SSH_KEY_LOCATION" -o BatchMode=yes "$DUMP_TARGET" mkdir -p "${OPT[path]}" 2>&1)
+ errmsg=$(ssh -i "${OPT[sshkey]}" -o BatchMode=yes "$DUMP_TARGET" mkdir -p "${OPT[path]}" 2>&1)
retval=$?
# ssh exits with the exit status of the remote command or with 255 if an error occurred
@@ -766,7 +767,7 @@ propagate_ssh_key()
exit 1
fi
- local KEYFILE=$SSH_KEY_LOCATION
+ local KEYFILE=${OPT[sshkey]}
#Check to see if we already created key, if not, create it.
if [[ -f $KEYFILE ]]; then
commit 0460f0a7686334a14c5b17ef00721ad25c54324b
Author: Philipp Rudo <prudo(a)redhat.com>
Date: Fri Mar 25 15:47:07 2022 +0100
kdumpctl: drop SAVE_PATH variable
The variable is only used for ssh dump targets. Furthermore it is
identical to the value stored in ${OPT[path]}. Thus drop SAVE_PATH and
use ${OPT[path]} instead.
Also make sure that ${OPT[path]} is always set to the default value when
no entry in kdump.conf is found.
Signed-off-by: Philipp Rudo <prudo(a)redhat.com>
Reviewed-by: Tao Liu <ltao(a)redhat.com>
Reviewed-by: Coiby Xu <coxu(a)redhat.com>
diff --git a/kdumpctl b/kdumpctl
index 0b57384..876561e 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -9,7 +9,6 @@ KDUMP_LOG_PATH="/var/log"
MKDUMPRD="/sbin/mkdumprd -f"
MKFADUMPRD="/sbin/mkfadumprd"
DRACUT_MODULES_FILE="/usr/lib/dracut/modules.txt"
-SAVE_PATH=/var/crash
SSH_KEY_LOCATION=$DEFAULT_SSHKEY
INITRD_CHECKSUM_LOCATION="/boot/.fadump_initrd_checksum"
DUMP_TARGET=""
@@ -244,10 +243,7 @@ parse_config()
dwarn "WARNING: '$config_val' doesn't exist, using default value '$SSH_KEY_LOCATION'"
fi
;;
- path)
- SAVE_PATH=$config_val
- ;;
- core_collector | kdump_post | kdump_pre | extra_bins | extra_modules | failure_action | default | final_action | force_rebuild | force_no_rebuild | fence_kdump_args | fence_kdump_nodes | auto_reset_crashkernel) ;;
+ path | core_collector | kdump_post | kdump_pre | extra_bins | extra_modules | failure_action | default | final_action | force_rebuild | force_no_rebuild | fence_kdump_args | fence_kdump_nodes | auto_reset_crashkernel) ;;
net | options | link_delay | disk_timeout | debug_mem_level | blacklist)
derror "Deprecated kdump config option: $config_opt. Refer to kdump.conf manpage for alternatives."
@@ -265,6 +261,8 @@ parse_config()
_set_config "$config_opt" "$config_val" || return 1
done <<< "$(kdump_read_conf)"
+ OPT[path]=${OPT[path]:-$DEFAULT_PATH}
+
check_failure_action_config || return 1
check_final_action_config || return 1
check_fence_kdump_config || return 1
@@ -720,21 +718,21 @@ check_and_wait_network_ready()
start_time=$(date +%s)
while true; do
- errmsg=$(ssh -i "$SSH_KEY_LOCATION" -o BatchMode=yes "$DUMP_TARGET" mkdir -p "$SAVE_PATH" 2>&1)
+ errmsg=$(ssh -i "$SSH_KEY_LOCATION" -o BatchMode=yes "$DUMP_TARGET" mkdir -p "${OPT[path]}" 2>&1)
retval=$?
# ssh exits with the exit status of the remote command or with 255 if an error occurred
if [[ $retval -eq 0 ]]; then
return 0
elif [[ $retval -ne 255 ]]; then
- derror "Could not create $DUMP_TARGET:$SAVE_PATH, you should check the privilege on server side"
+ derror "Could not create $DUMP_TARGET:${OPT[path]}, you should check the privilege on server side"
return 1
fi
# if server removes the authorized_keys or, no /root/.ssh/kdump_id_rsa
ddebug "$errmsg"
if echo "$errmsg" | grep -q "Permission denied\|No such file or directory\|Host key verification failed"; then
- derror "Could not create $DUMP_TARGET:$SAVE_PATH, you probably need to run \"kdumpctl propagate\""
+ derror "Could not create $DUMP_TARGET:${OPT[path]}, you probably need to run \"kdumpctl propagate\""
return 1
fi
@@ -752,7 +750,7 @@ check_and_wait_network_ready()
sleep 1
done
- dinfo "Could not create $DUMP_TARGET:$SAVE_PATH, ipaddr is not ready yet. You should check network connection"
+ dinfo "Could not create $DUMP_TARGET:${OPT[path]}, ipaddr is not ready yet. You should check network connection"
return 1
}
@@ -820,7 +818,6 @@ check_current_status()
save_raw()
{
- local kdump_dir
local raw_target
raw_target=$(kdump_get_conf_val raw)
@@ -834,13 +831,8 @@ save_raw()
dwarn "Warning: Detected '$check_fs' signature on $raw_target, data loss is expected."
return 0
fi
- kdump_dir=${OPT[path]}
- if [[ -z ${kdump_dir} ]]; then
- coredir="/var/crash/$(date +"%Y-%m-%d-%H:%M")"
- else
- coredir="${kdump_dir}/$(date +"%Y-%m-%d-%H:%M")"
- fi
+ coredir="${OPT[path]}/$(date +"%Y-%m-%d-%H:%M")"
mkdir -p "$coredir"
[[ -d $coredir ]] || {
derror "failed to create $coredir"
commit edb1d04425605db53637f698422017b609efe2b4
Author: Philipp Rudo <prudo(a)redhat.com>
Date: Fri Mar 25 15:47:06 2022 +0100
kdumpctl: reduce file operations on kdump.conf
Every call to kdump_get_conf_val parses kdump.conf although the file has
already been parsed in check_config. Thus store the values parsed in
check_config in an array and use them later instead of re-parsing the
file over and over again.
While at it rename check_config to parse_config.
Signed-off-by: Philipp Rudo <prudo(a)redhat.com>
Reviewed-by: Tao Liu <ltao(a)redhat.com>
Reviewed-by: Coiby Xu <coxu(a)redhat.com>
diff --git a/kdumpctl b/kdumpctl
index 85ea7aa..0b57384 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -27,6 +27,8 @@ standard_kexec_args="-d -p"
# Some default values in case /etc/sysconfig/kdump doesn't include
KDUMP_COMMANDLINE_REMOVE="hugepages hugepagesz slub_debug"
+declare -A OPT
+
if [[ -f /etc/sysconfig/kdump ]]; then
. /etc/sysconfig/kdump
fi
@@ -185,9 +187,29 @@ restore_default_initrd()
fi
}
-check_config()
+_set_config()
+{
+ local opt=$1
+ local val=$2
+
+ if [[ -z $val ]]; then
+ derror "Invalid kdump config value for option '$opt'"
+ return 1
+ fi
+
+ if [[ -n ${OPT[$opt]} ]]; then
+ if [[ $opt == _target ]]; then
+ derror "More than one dump targets specified"
+ else
+ derror "Duplicated kdump config value of option $opt"
+ fi
+ return 1
+ fi
+ OPT[$opt]="$val"
+}
+
+parse_config()
{
- local -A _opt_rec
while read -r config_opt config_val; do
case "$config_opt" in
dracut_args)
@@ -196,7 +218,7 @@ check_config()
derror 'Multiple mount targets specified in one "dracut_args".'
return 1
fi
- config_opt=_target
+ _set_config _target "$(get_dracut_args_target "$config_val")" || return 1
fi
;;
raw)
@@ -240,20 +262,7 @@ check_config()
;;
esac
- if [[ -z $config_val ]]; then
- derror "Invalid kdump config value for option '$config_opt'"
- return 1
- fi
-
- if [[ -n ${_opt_rec[$config_opt]} ]]; then
- if [[ $config_opt == _target ]]; then
- derror "More than one dump targets specified"
- else
- derror "Duplicated kdump config value of option $config_opt"
- fi
- return 1
- fi
- _opt_rec[$config_opt]="$config_val"
+ _set_config "$config_opt" "$config_val" || return 1
done <<< "$(kdump_read_conf)"
check_failure_action_config || return 1
@@ -321,8 +330,8 @@ check_files_modified()
#also rebuild when Pacemaker cluster conf is changed and fence kdump is enabled.
modified_files=$(get_pcs_cluster_modified_files)
- EXTRA_BINS=$(kdump_get_conf_val kdump_post)
- CHECK_FILES=$(kdump_get_conf_val kdump_pre)
+ EXTRA_BINS=${OPT[kdump_post]}
+ CHECK_FILES=${OPT[kdump_pre]}
HOOKS="/etc/kdump/post.d/ /etc/kdump/pre.d/"
if [[ -d /etc/kdump/post.d ]]; then
for file in /etc/kdump/post.d/*; do
@@ -339,17 +348,17 @@ check_files_modified()
done
fi
HOOKS="$HOOKS $POST_FILES $PRE_FILES"
- CORE_COLLECTOR=$(kdump_get_conf_val core_collector | awk '{print $1}')
+ CORE_COLLECTOR=$(echo "${OPT[core_collector]}" | awk '{print $1}')
CORE_COLLECTOR=$(type -P "$CORE_COLLECTOR")
# POST_FILES and PRE_FILES are already checked against executable, need not to check again.
EXTRA_BINS="$EXTRA_BINS $CHECK_FILES"
- CHECK_FILES=$(kdump_get_conf_val extra_bins)
+ CHECK_FILES=${OPT[extra_bins]}
EXTRA_BINS="$EXTRA_BINS $CHECK_FILES"
files="$KDUMP_CONFIG_FILE $KDUMP_KERNEL $EXTRA_BINS $CORE_COLLECTOR"
[[ -e /etc/fstab ]] && files="$files /etc/fstab"
# Check for any updated extra module
- EXTRA_MODULES="$(kdump_get_conf_val extra_modules)"
+ EXTRA_MODULES="${OPT[extra_modules]}"
if [[ -n $EXTRA_MODULES ]]; then
if [[ -e /lib/modules/$KDUMP_KERNELVER/modules.dep ]]; then
files="$files /lib/modules/$KDUMP_KERNELVER/modules.dep"
@@ -541,14 +550,14 @@ check_rebuild()
setup_initrd || return 1
- force_no_rebuild=$(kdump_get_conf_val force_no_rebuild)
+ force_no_rebuild=${OPT[force_no_rebuild]}
force_no_rebuild=${force_no_rebuild:-0}
if [[ $force_no_rebuild != "0" ]] && [[ $force_no_rebuild != "1" ]]; then
derror "Error: force_no_rebuild value is invalid"
return 1
fi
- force_rebuild=$(kdump_get_conf_val force_rebuild)
+ force_rebuild=${OPT[force_rebuild]}
force_rebuild=${force_rebuild:-0}
if [[ $force_rebuild != "0" ]] && [[ $force_rebuild != "1" ]]; then
derror "Error: force_rebuild value is invalid"
@@ -751,7 +760,7 @@ propagate_ssh_key()
{
local SSH_USER SSH_SERVER
- check_config || return 1
+ parse_config || return 1
if [[ -z $DUMP_TARGET ]] ; then
derror "No ssh destination defined in $KDUMP_CONFIG_FILE."
@@ -825,7 +834,7 @@ save_raw()
dwarn "Warning: Detected '$check_fs' signature on $raw_target, data loss is expected."
return 0
fi
- kdump_dir=$(kdump_get_conf_val path)
+ kdump_dir=${OPT[path]}
if [[ -z ${kdump_dir} ]]; then
coredir="/var/crash/$(date +"%Y-%m-%d-%H:%M")"
else
@@ -911,7 +920,7 @@ check_fence_kdump_config()
hostname=$(hostname)
ipaddrs=$(hostname -I)
- nodes=$(kdump_get_conf_val "fence_kdump_nodes")
+ nodes=${OPT[fence_kdump_nodes]}
for node in $nodes; do
if [[ $node == "$hostname" ]]; then
@@ -964,8 +973,8 @@ check_failure_action_config()
local failure_action
local option="failure_action"
- default_option=$(kdump_get_conf_val default)
- failure_action=$(kdump_get_conf_val failure_action)
+ default_option=${OPT[default]}
+ failure_action=${OPT[failure_action]}
if [[ -z $failure_action ]] && [[ -z $default_option ]]; then
return 0
@@ -994,7 +1003,7 @@ check_final_action_config()
{
local final_action
- final_action=$(kdump_get_conf_val final_action)
+ final_action=${OPT[final_action]}
if [[ -z $final_action ]]; then
return 0
else
@@ -1017,7 +1026,7 @@ start()
return 1
fi
- if ! check_config; then
+ if ! parse_config; then
derror "Starting kdump: [FAILED]"
return 1
fi
@@ -1153,7 +1162,7 @@ stop()
rebuild()
{
- check_config || return 1
+ parse_config || return 1
check_and_wait_network_ready || return 1
setup_initrd || return 1
commit 4adf6d3cc85811d47ddc90c89a6f47b699350410
Author: Philipp Rudo <prudo(a)redhat.com>
Date: Fri Mar 25 15:47:05 2022 +0100
kdumpctl: merge check_ssh_config into check_config
check_config and check_ssh_config both parse /etc/kdump.conf and are
usually used together. The difference between both is that
check_ssh_config does some extra checks on the format of the provided
ssh destination but ignores invalid or deprecated options in the config.
Thus merge check_ssh_config into check_config. Leave the additional
checks on the ssh destination in check_ssh_config but treat it like the
checks done for e.g. the failure_action.
This slightly changes the behavior of 'kdumpctl propagate', which now
fails if kdump.conf contains an invalid value unrelated to ssh. This
change in behavior isn't problematic because 'kdumpctl propagate' always
needs to be followed by a 'kdumpctl start' to have a working kdump
environment. For the situations where 'propagate' fails now the 'start'
would have failed in the past. So the failure only moved one step ahead
in the sequence.
While at it drop check_ssh_target and call check_and_wait_network_ready
directly.
Signed-off-by: Philipp Rudo <prudo(a)redhat.com>
Reviewed-by: Tao Liu <ltao(a)redhat.com>
Reviewed-by: Coiby Xu <coxu(a)redhat.com>
diff --git a/kdumpctl b/kdumpctl
index e6d5066..85ea7aa 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -205,10 +205,27 @@ check_config()
fi
config_opt=_target
;;
- ext[234] | minix | btrfs | xfs | nfs | ssh)
+ ext[234] | minix | btrfs | xfs | nfs )
config_opt=_target
;;
- sshkey | path | core_collector | kdump_post | kdump_pre | extra_bins | extra_modules | failure_action | default | final_action | force_rebuild | force_no_rebuild | fence_kdump_args | fence_kdump_nodes | auto_reset_crashkernel) ;;
+ ssh)
+ config_opt=_target
+ DUMP_TARGET=$config_val
+ ;;
+ sshkey)
+ if [[ -z $config_val ]]; then
+ derror "Invalid kdump config value for option '$config_opt'"
+ return 1
+ elif [[ -f $config_val ]]; then
+ SSH_KEY_LOCATION=$(/usr/bin/readlink -m "$config_val")
+ else
+ dwarn "WARNING: '$config_val' doesn't exist, using default value '$SSH_KEY_LOCATION'"
+ fi
+ ;;
+ path)
+ SAVE_PATH=$config_val
+ ;;
+ core_collector | kdump_post | kdump_pre | extra_bins | extra_modules | failure_action | default | final_action | force_rebuild | force_no_rebuild | fence_kdump_args | fence_kdump_nodes | auto_reset_crashkernel) ;;
net | options | link_delay | disk_timeout | debug_mem_level | blacklist)
derror "Deprecated kdump config option: $config_opt. Refer to kdump.conf manpage for alternatives."
@@ -242,6 +259,7 @@ check_config()
check_failure_action_config || return 1
check_final_action_config || return 1
check_fence_kdump_config || return 1
+ check_ssh_config || return 1
return 0
}
@@ -665,29 +683,8 @@ check_ssh_config()
{
local target
- while read -r config_opt config_val; do
- case "$config_opt" in
- sshkey)
- # remove inline comments after the end of a directive.
- if [[ -f $config_val ]]; then
- # canonicalize the path
- SSH_KEY_LOCATION=$(/usr/bin/readlink -m "$config_val")
- else
- dwarn "WARNING: '$config_val' doesn't exist, using default value '$SSH_KEY_LOCATION'"
- fi
- ;;
- path)
- SAVE_PATH=$config_val
- ;;
- ssh)
- DUMP_TARGET=$config_val
- ;;
- *) ;;
-
- esac
- done <<< "$(kdump_read_conf)"
+ [[ -n $DUMP_TARGET ]] || return 0
- [[ -n $DUMP_TARGET ]] || return 1
[[ $DUMP_TARGET =~ .*@.* ]] || return 1
target=$(ssh -G "$DUMP_TARGET" | sed -n -e "s/^hostname[[:space:]]\+\([^[:space:]]*\).*$/\1/p")
if [[ ${DUMP_TARGET#*@} != "$target" ]]; then
@@ -710,6 +707,8 @@ check_and_wait_network_ready()
local retval
local errmsg
+ [[ -n $DUMP_TARGET ]] || return 0
+
start_time=$(date +%s)
while true; do
errmsg=$(ssh -i "$SSH_KEY_LOCATION" -o BatchMode=yes "$DUMP_TARGET" mkdir -p "$SAVE_PATH" 2>&1)
@@ -748,16 +747,13 @@ check_and_wait_network_ready()
return 1
}
-check_ssh_target()
-{
- check_and_wait_network_ready
-}
-
propagate_ssh_key()
{
local SSH_USER SSH_SERVER
- if ! check_ssh_config; then
+ check_config || return 1
+
+ if [[ -z $DUMP_TARGET ]] ; then
derror "No ssh destination defined in $KDUMP_CONFIG_FILE."
derror "Please verify that $KDUMP_CONFIG_FILE contains 'ssh <user>@<host>' and that it is properly formatted."
exit 1
@@ -1040,11 +1036,9 @@ start()
return 0
fi
- if check_ssh_config; then
- if ! check_ssh_target; then
- derror "Starting kdump: [FAILED]"
- return 1
- fi
+ if ! check_and_wait_network_ready; then
+ derror "Starting kdump: [FAILED]"
+ return 1
fi
if ! check_rebuild; then
@@ -1160,12 +1154,7 @@ stop()
rebuild()
{
check_config || return 1
-
- if check_ssh_config; then
- if ! check_ssh_target; then
- return 1
- fi
- fi
+ check_and_wait_network_ready || return 1
setup_initrd || return 1
commit e3fa3678404e161be27914b91c69693613b1fcfe
Author: Philipp Rudo <prudo(a)redhat.com>
Date: Fri Mar 25 15:47:04 2022 +0100
kdumpctl: simplify propagate_ssh_key
The function has multiple problems:
1) SSH_{USER,SERVER} aren't defined local
2) Weird use of cut and sed to parse the DUMP_TARGET for the user and
host although check_ssh_config guarantees that it has the format
<user>@<host>.
3) Unnecessary use of a variable for the return value
4) Weird behavior to first unpack the DUMP_TARGET to SSH_USER and
SSH_SERVER and then putting it back together again
5) Definition of variable errmsg that is only used once but breaks
grep-ability of error message.
6) Wrong order when redirecting output of ssh-keygen, see SC2069 [1]
Fix them now.
While at it also improve the error messages in the function.
[1] https://www.shellcheck.net/wiki/SC2069
Signed-off-by: Philipp Rudo <prudo(a)redhat.com>
Reviewed-by: Tao Liu <ltao(a)redhat.com>
Reviewed-by: Coiby Xu <coxu(a)redhat.com>
diff --git a/kdumpctl b/kdumpctl
index 8ad6e4c..e6d5066 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -755,35 +755,32 @@ check_ssh_target()
propagate_ssh_key()
{
+ local SSH_USER SSH_SERVER
+
if ! check_ssh_config; then
- derror "No ssh config specified in $KDUMP_CONFIG_FILE. Can't propagate"
+ derror "No ssh destination defined in $KDUMP_CONFIG_FILE."
+ derror "Please verify that $KDUMP_CONFIG_FILE contains 'ssh <user>@<host>' and that it is properly formatted."
exit 1
fi
local KEYFILE=$SSH_KEY_LOCATION
- local errmsg="Failed to propagate ssh key"
#Check to see if we already created key, if not, create it.
if [[ -f $KEYFILE ]]; then
dinfo "Using existing keys..."
else
dinfo "Generating new ssh keys... "
- /usr/bin/ssh-keygen -t rsa -f "$KEYFILE" -N "" 2>&1 > /dev/null
+ /usr/bin/ssh-keygen -t rsa -f "$KEYFILE" -N "" &> /dev/null
dinfo "done."
fi
- #now find the target ssh user and server to contact.
- SSH_USER=$(echo "$DUMP_TARGET" | cut -d@ -f1)
- SSH_SERVER=$(echo "$DUMP_TARGET" | sed -e's/\(.*(a)\)\(.*$\)/\2/')
-
- #now send the found key to the found server
- ssh-copy-id -i "$KEYFILE" "$SSH_USER@$SSH_SERVER"
- RET=$?
- if [[ $RET == 0 ]]; then
+ SSH_USER=${DUMP_TARGET%@*}
+ SSH_SERVER=${DUMP_TARGET#*@}
+ if ssh-copy-id -i "$KEYFILE" "$DUMP_TARGET"; then
dinfo "$KEYFILE has been added to ~$SSH_USER/.ssh/authorized_keys on $SSH_SERVER"
return 0
else
- derror "$errmsg, $KEYFILE failed in transfer to $SSH_SERVER"
+ derror "Failed to propagate ssh key, could not transfer $KEYFILE to $SSH_SERVER"
exit 1
fi
}
commit b802dbff9f0da8b5cd6eebf28dd3e7fd207cc45c
Author: Philipp Rudo <prudo(a)redhat.com>
Date: Fri Mar 25 15:47:03 2022 +0100
kdumpctl: forbid aliases from ssh config
For ssh targets kdumpctl only verifies that the config value has the
correct <user>@<host> format itself. For all other tests, e.g. if the
destination can be reached, it relies on ssh. This allows users to
provide a <host> that isn't the proper hostname but an alias defined in
the ssh_config without failing the tests. If this is done
dracut-module-setup.sh:kdump_get_remote_ip will fail to obtain the
targets ip address. This failure is not detected and thus will not fail
the initramfs creation. The resulting initramfs however doesn't have the
necessary information for setting up the network and thus will fail to
boot.
Prevent the use of alias hostnames by verifying that the given hostname
is the same one ssh would use after parsing the ssh_config.
Note: Don't use getent ahosts to verify that the given host can be
resolved as this requires the network to be up which cannot be
guaranteed when the kdump.conf is parsed.
Signed-off-by: Philipp Rudo <prudo(a)redhat.com>
Reviewed-by: Tao Liu <ltao(a)redhat.com>
Reviewed-by: Coiby Xu <coxu(a)redhat.com>
diff --git a/kdumpctl b/kdumpctl
index 7d40f76..8ad6e4c 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -663,7 +663,7 @@ load_kdump()
check_ssh_config()
{
- local SSH_TARGET
+ local target
while read -r config_opt config_val; do
case "$config_opt" in
@@ -687,11 +687,14 @@ check_ssh_config()
esac
done <<< "$(kdump_read_conf)"
- #make sure they've configured kdump.conf for ssh dumps
- SSH_TARGET=$(echo -n "$DUMP_TARGET" | sed -n '/.*@/p')
- if [[ -z $SSH_TARGET ]]; then
+ [[ -n $DUMP_TARGET ]] || return 1
+ [[ $DUMP_TARGET =~ .*@.* ]] || return 1
+ target=$(ssh -G "$DUMP_TARGET" | sed -n -e "s/^hostname[[:space:]]\+\([^[:space:]]*\).*$/\1/p")
+ if [[ ${DUMP_TARGET#*@} != "$target" ]]; then
+ derror "Invalid ssh destination $DUMP_TARGET provided."
return 1
fi
+
return 0
}
commit 247b3dd297f1ee2224af2d3b838019af428c387e
Author: Philipp Rudo <prudo(a)redhat.com>
Date: Fri Mar 25 15:47:02 2022 +0100
kdumpctl: fix comment in check_and_wait_network_ready
The time out was increased to 180 seconds in 680c0d3 ("kdumpctl:
distinguish the failed reason of ssh"). Update the comment to reflect
that change.
Signed-off-by: Philipp Rudo <prudo(a)redhat.com>
Reviewed-by: Tao Liu <ltao(a)redhat.com>
Reviewed-by: Coiby Xu <coxu(a)redhat.com>
diff --git a/kdumpctl b/kdumpctl
index 7b01cd3..7d40f76 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -734,7 +734,7 @@ check_and_wait_network_ready()
cur=$(date +%s)
diff=$((cur - start_time))
- # 60s time out
+ # time out after 180s
if [[ $diff -gt 180 ]]; then
break
fi
commit 7cd3f232d50c76bb5c6bf0b3175cc2c36c2f3351
Author: Philipp Rudo <prudo(a)redhat.com>
Date: Fri Mar 25 15:47:01 2022 +0100
kdump-lib-initramfs: merge definitions for default ssh key
There are currently three identical definitions for the default ssh key.
Combine them into one in kdump-lib-initramfs.sh.
Signed-off-by: Philipp Rudo <prudo(a)redhat.com>
Reviewed-by: Tao Liu <ltao(a)redhat.com>
Reviewed-by: Coiby Xu <coxu(a)redhat.com>
diff --git a/dracut-kdump.sh b/dracut-kdump.sh
index b69bc98..b17455a 100755
--- a/dracut-kdump.sh
+++ b/dracut-kdump.sh
@@ -22,7 +22,7 @@ FAILURE_ACTION="systemctl reboot -f"
DATEDIR=$(date +%Y-%m-%d-%T)
HOST_IP='127.0.0.1'
DUMP_INSTRUCTION=""
-SSH_KEY_LOCATION="/root/.ssh/kdump_id_rsa"
+SSH_KEY_LOCATION=$DEFAULT_SSHKEY
DD_BLKSIZE=512
FINAL_ACTION="systemctl reboot -f"
KDUMP_PRE=""
diff --git a/kdump-lib-initramfs.sh b/kdump-lib-initramfs.sh
index 9be0fe9..84e6bf7 100755
--- a/kdump-lib-initramfs.sh
+++ b/kdump-lib-initramfs.sh
@@ -4,6 +4,7 @@
# not be the default shell. Any code added must be POSIX compliant.
DEFAULT_PATH="/var/crash/"
+DEFAULT_SSHKEY="/root/.ssh/kdump_id_rsa"
KDUMP_CONFIG_FILE="/etc/kdump.conf"
FENCE_KDUMP_CONFIG_FILE="/etc/sysconfig/fence_kdump"
FENCE_KDUMP_SEND="/usr/libexec/fence_kdump_send"
diff --git a/kdumpctl b/kdumpctl
index 35fd6e0..7b01cd3 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -10,7 +10,7 @@ MKDUMPRD="/sbin/mkdumprd -f"
MKFADUMPRD="/sbin/mkfadumprd"
DRACUT_MODULES_FILE="/usr/lib/dracut/modules.txt"
SAVE_PATH=/var/crash
-SSH_KEY_LOCATION="/root/.ssh/kdump_id_rsa"
+SSH_KEY_LOCATION=$DEFAULT_SSHKEY
INITRD_CHECKSUM_LOCATION="/boot/.fadump_initrd_checksum"
DUMP_TARGET=""
DEFAULT_INITRD=""
diff --git a/mkdumprd b/mkdumprd
index 5996d50..3e250e0 100644
--- a/mkdumprd
+++ b/mkdumprd
@@ -22,7 +22,7 @@ if ! dlog_init; then
exit 1
fi
-SSH_KEY_LOCATION="/root/.ssh/kdump_id_rsa"
+SSH_KEY_LOCATION=$DEFAULT_SSHKEY
SAVE_PATH=$(get_save_path)
OVERRIDE_RESETTABLE=0
commit b49083126fcdd5be8cb7d84e0048ac2adddb6aed
Author: Philipp Rudo <prudo(a)redhat.com>
Date: Fri Mar 25 15:47:00 2022 +0100
kdumpctl: remove unnecessary uses of $?
Signed-off-by: Philipp Rudo <prudo(a)redhat.com>
Reviewed-by: Tao Liu <ltao(a)redhat.com>
Reviewed-by: Coiby Xu <coxu(a)redhat.com>
diff --git a/kdumpctl b/kdumpctl
index b7922a6..35fd6e0 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -86,7 +86,6 @@ rebuild_fadump_initrd()
check_earlykdump_is_enabled()
{
grep -q -w "rd.earlykdump" /proc/cmdline
- return $?
}
rebuild_kdump_initrd()
@@ -117,8 +116,6 @@ rebuild_initrd()
else
rebuild_kdump_initrd
fi
-
- return $?
}
#$1: the files to be checked with IFS=' '
@@ -584,7 +581,6 @@ check_rebuild()
dinfo "Rebuilding $TARGET_INITRD"
rebuild_initrd
- return $?
}
# On ppc64le LPARs, the keys trusted by firmware do not end up in
@@ -815,8 +811,6 @@ check_current_status()
else
check_current_kdump_status
fi
-
- return $?
}
save_raw()
@@ -945,7 +939,6 @@ check_dump_feasibility()
fi
check_kdump_feasibility
- return $?
}
start_fadump()
@@ -967,8 +960,6 @@ start_dump()
else
load_kdump
fi
-
- return $?
}
check_failure_action_config()
@@ -1077,7 +1068,7 @@ reload()
if [[ $DEFAULT_DUMP_MODE == "fadump" ]]; then
reload_fadump
- return $?
+ return
else
if ! stop_kdump; then
derror "Stopping kdump: [FAILED]"
@@ -1141,7 +1132,7 @@ reload_fadump()
# to handle such scenario.
if stop_fadump; then
start_fadump
- return $?
+ return
fi
fi
@@ -1180,7 +1171,6 @@ rebuild()
dinfo "Rebuilding $TARGET_INITRD"
rebuild_initrd
- return $?
}
do_estimate()
@@ -1787,5 +1777,3 @@ single_instance_lock
exec 9<&-
main "$@"
)
-
-exit $?
commit aa9bb8f8cef734fb1f6ab36ccaaa8936edb4f467
Author: Philipp Rudo <prudo(a)redhat.com>
Date: Fri Mar 25 15:46:59 2022 +0100
kdump-lib: fix typo in variable name
in prepare_kdump_bootinfo s/defaut/default/.
While at it declare it with the other local variables as local.
Signed-off-by: Philipp Rudo <prudo(a)redhat.com>
Reviewed-by: Tao Liu <ltao(a)redhat.com>
Reviewed-by: Coiby Xu <coxu(a)redhat.com>
diff --git a/kdump-lib.sh b/kdump-lib.sh
index 4ed5035..5b1656e 100755
--- a/kdump-lib.sh
+++ b/kdump-lib.sh
@@ -640,7 +640,7 @@ prepare_kexec_args()
prepare_kdump_bootinfo()
{
local boot_img boot_imglist boot_dirlist boot_initrdlist
- local machine_id
+ local machine_id dir img default_initrd_base var_target_initrd_dir
if [[ -z $KDUMP_KERNELVER ]]; then
KDUMP_KERNELVER="$(uname -r)"
@@ -677,8 +677,8 @@ prepare_kdump_bootinfo()
boot_initrdlist="initramfs-$KDUMP_KERNELVER.img initrd"
for initrd in $boot_initrdlist; do
if [[ -f "$KDUMP_BOOTDIR/$initrd" ]]; then
- defaut_initrd_base="$initrd"
- DEFAULT_INITRD="$KDUMP_BOOTDIR/$defaut_initrd_base"
+ default_initrd_base="$initrd"
+ DEFAULT_INITRD="$KDUMP_BOOTDIR/$default_initrd_base"
break
fi
done
@@ -686,12 +686,12 @@ prepare_kdump_bootinfo()
# Create kdump initrd basename from default initrd basename
# initramfs-5.7.9-200.fc32.x86_64.img => initramfs-5.7.9-200.fc32.x86_64kdump.img
# initrd => initrdkdump
- if [[ -z $defaut_initrd_base ]]; then
+ if [[ -z $default_initrd_base ]]; then
kdump_initrd_base=initramfs-${KDUMP_KERNELVER}kdump.img
- elif [[ $defaut_initrd_base == *.* ]]; then
- kdump_initrd_base=${defaut_initrd_base%.*}kdump.${DEFAULT_INITRD##*.}
+ elif [[ $default_initrd_base == *.* ]]; then
+ kdump_initrd_base=${default_initrd_base%.*}kdump.${DEFAULT_INITRD##*.}
else
- kdump_initrd_base=${defaut_initrd_base}kdump
+ kdump_initrd_base=${default_initrd_base}kdump
fi
# Place kdump initrd in $(/var/lib/kdump) if $(KDUMP_BOOTDIR) not writable
commit 5947707682e7de478aa1e1b41006ce50f84699cc
Author: Philipp Rudo <prudo(a)redhat.com>
Date: Fri Mar 25 15:46:58 2022 +0100
kdump-capture.service: switch to journal for stdout
Using syslog for StandardOutput in a service file was deprecated in
systemd v246 with commit f3dc6af20f ("core: automatically update
StandardOuput=syslog to =journal (and similar for StandardError=)").
Thus the following warnings are printed in the crash kernel when
creating a dump.
systemd[1]: /usr/lib/systemd/system/kdump-capture.service:23: Standard output type syslog is obsolete, automatically updating to journal. Please update your unit file, and consider removing the setting altogether.
systemd[1]: /usr/lib/systemd/system/kdump-capture.service:24: Standard output type syslog+console is obsolete, automatically updating to journal+console. Please update your unit file, and consider removing the setting altogether.
Fix this by redirecting the stdout and stderr to the journal.
Signed-off-by: Philipp Rudo <prudo(a)redhat.com>
Reviewed-by: Tao Liu <ltao(a)redhat.com>
Reviewed-by: Coiby Xu <coxu(a)redhat.com>
diff --git a/dracut-kdump-capture.service b/dracut-kdump-capture.service
index 3f20aba..7109169 100644
--- a/dracut-kdump-capture.service
+++ b/dracut-kdump-capture.service
@@ -20,8 +20,8 @@ Environment=NEWROOT=/sysroot
Type=oneshot
ExecStart=/bin/kdump.sh
StandardInput=null
-StandardOutput=syslog
-StandardError=syslog+console
+StandardOutput=journal
+StandardError=journal+console
KillMode=process
RemainAfterExit=yes
commit 8736aa5bb359e0fccbb07919e49f68c22299c55a
Author: Philipp Rudo <prudo(a)redhat.com>
Date: Fri Mar 25 16:19:40 2022 +0100
kdumpctl/estimate: Fix unnecessary warning
do_estimate prints the warning that the reserved crashkernel is lower
than the recommended one even then when both values are identical. This
might cause confusion. So omit printing the warning when both values are
equal.
Signed-off-by: Philipp Rudo <prudo(a)redhat.com>
Acked-by: Coiby Xu <coxu(a)redhat.com>
diff --git a/kdumpctl b/kdumpctl
index 1869753..b7922a6 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -1270,7 +1270,7 @@ do_estimate()
done
fi
- if [[ $reserved_size -le $recommended_size ]]; then
+ if [[ $reserved_size -lt $recommended_size ]]; then
echo "WARNING: Current crashkernel size is lower than recommended size $((recommended_size / size_mb))M."
fi
}
commit 7141d044c8880815f308e61f612b710b7bc8a9a3
Author: Lichen Liu <lichliu(a)redhat.com>
Date: Tue Mar 1 13:09:00 2022 +0800
kdumpctl: sync the $TARGET_INITRD after rebuild
There is a system-wide sync call at the end of mkdumprd, move it to
kdumpctl after rebuild initrd and add another one for mkfadumprd.
Sync only the $TARGET_INITRD to avoid a system-wide sync taking too
long on a system with high disk activity.
Also update the sync in kdumpctl:restore_default_initrd which will
mv the $DEFAULT_INITRD_BAK to $DEFAULT_INITRD.
Signed-off-by: Lichen Liu <lichliu(a)redhat.com>
Reviewed-by: Philipp Rudo <prudo(a)redhat.com>
diff --git a/kdumpctl b/kdumpctl
index ac6ffeb..1869753 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -79,6 +79,7 @@ rebuild_fadump_initrd()
return 1
fi
+ sync -f "$TARGET_INITRD"
return 0
}
@@ -100,6 +101,7 @@ rebuild_kdump_initrd()
dwarn "Tips: If early kdump is enabled, also require rebuilding the system initramfs to make the changes take effect for early kdump."
fi
+ sync -f "$TARGET_INITRD"
return 0
}
@@ -180,7 +182,7 @@ restore_default_initrd()
rm -f $INITRD_CHECKSUM_LOCATION
if mv "$DEFAULT_INITRD_BAK" "$DEFAULT_INITRD"; then
derror "Restoring original initrd as fadump mode is disabled."
- sync
+ sync -f "$DEFAULT_INITRD"
fi
fi
fi
diff --git a/mkdumprd b/mkdumprd
index 593ec77..5996d50 100644
--- a/mkdumprd
+++ b/mkdumprd
@@ -458,7 +458,3 @@ if ! is_fadump_capable; then
fi
dracut "${dracut_args[@]}" "$@"
-
-_rc=$?
-sync
-exit $_rc
commit 6d4062a936694b7cab7e0c536414b4d5b6ab8668
Author: Coiby Xu <coxu(a)redhat.com>
Date: Wed Feb 16 09:42:54 2022 +0800
try to update the crashkernel in GRUB_ETC_DEFAULT after kexec-tools updates the default crashkernel value
If GRUB_ETC_DEFAULT use crashkernel=auto or
crashkernel=OLD_DEFAULT_CRASHKERNEL, it should be updated as well.
Add a helper function to read kernel cmdline parameter from
GRUB_ETC_DEFAULT. This function is used to read kernel cmdline
parameter like fadump or crashkernel.
Reviewed-by: Philipp Rudo <prudo(a)redhat.com>
diff --git a/kdumpctl b/kdumpctl
index 1c94405..ac6ffeb 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -1444,6 +1444,16 @@ _update_kernel_arg_in_grub_etc_default()
}" "$GRUB_ETC_DEFAULT"
}
+# Read the kernel arg in default grub conf.
+
+# Note reading a kernel parameter that doesn't have a value isn't supported.
+#
+# $1: the name of the kernel command line parameter
+_read_kernel_arg_in_grub_etc_default()
+{
+ sed -n -E "s/^GRUB_CMDLINE_LINUX=.*[[:space:]\"]${1}=([^[:space:]\"]*).*$/\1/p" "$GRUB_ETC_DEFAULT"
+}
+
reset_crashkernel()
{
local _opt _val _dump_mode _fadump_val _reboot _grubby_kernel_path _kernel _kernels
@@ -1577,6 +1587,34 @@ reset_crashkernel()
fi
}
+# update the crashkernel value in GRUB_ETC_DEFAULT if necessary
+#
+# called by reset_crashkernel_after_update and inherit its array variable
+# _crashkernel_vals
+update_crashkernel_in_grub_etc_default_after_update()
+{
+ local _crashkernel _fadump_val
+ local _dump_mode _old_default_crashkernel _new_default_crashkernel
+
+ _crashkernel=$(_read_kernel_arg_in_grub_etc_default crashkernel)
+
+ if [[ -z $_crashkernel ]]; then
+ return
+ fi
+
+ _fadump_val=$(_read_kernel_arg_in_grub_etc_default fadump)
+ _dump_mode=$(get_dump_mode_by_fadump_val "$_fadump_val")
+
+ _old_default_crashkernel=${_crashkernel_vals[old_${_dump_mode}]}
+ _new_default_crashkernel=${_crashkernel_vals[new_${_dump_mode}]}
+
+ if [[ $_crashkernel == auto ]] ||
+ [[ $_crashkernel == "$_old_default_crashkernel" &&
+ $_new_default_crashkernel != "$_old_default_crashkernel" ]]; then
+ _update_kernel_arg_in_grub_etc_default crashkernel "$_new_default_crashkernel"
+ fi
+}
+
# shellcheck disable=SC2154 # false positive when dereferencing an array
reset_crashkernel_after_update()
{
@@ -1605,6 +1643,8 @@ reset_crashkernel_after_update()
fi
fi
done
+
+ update_crashkernel_in_grub_etc_default_after_update
}
# read the value of an environ variable from given environ file path
commit 37f4f2c1f6f1304e1b58604a788c57c51508eead
Author: Coiby Xu <coxu(a)redhat.com>
Date: Tue Feb 15 13:24:19 2022 +0800
address the case where there are multiple values for the same kernel arg
There is the case where there are multiple entries of the same parameter on
the command line, e.g.
GRUB_CMDLINE_LINUX="crashkernel=110M crashkernel=220M fadump=on crashkernel=330M".
In such an situation _update_kernel_cmdline_in_grub_etc_default only
updates/removes the last entry which is usually not what you want as the
kernel (for crashkernel) takes the last entry it can find.
Thus make sure the case with multiple entries of the same parameter is
handled properly by removing all occurrences of given parameter first.
Note
1. sed command group and conditional control has been used to get rid of
grep.
2. Fully supporting kernel cmdline as documented in
Documentation/admin-guide/kernel-parameters.rst is complex and in
foreseeable future a full implementation is not needed. So simply
document the unsupported cases instead.
Fixes: 140da74 ("rewrite reset_crashkernel to support fadump and to used by RPM scriptlet")
Reported-by: Philipp Rudo <prudo(a)redhat.com>
Suggested-by: Philipp Rudo <prudo(a)redhat.com>
Reviewed-by: Philipp Rudo <prudo(a)redhat.com>
diff --git a/kdumpctl b/kdumpctl
index 9fd76ac..1c94405 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -1399,25 +1399,49 @@ _get_all_kernels_from_grubby()
}
GRUB_ETC_DEFAULT="/etc/default/grub"
-# modify the kernel command line parameter in default grub conf
+# Update a kernel parameter in default grub conf
+#
+# If a value is specified, it will be inserted in the end. Otherwise it
+# would remove given kernel parameter.
+#
+# Note this function doesn't address the following cases,
+# 1. The kernel ignores everything on the command line after a '--'. So
+# simply adding the new entry to the end will fail if the cmdline
+# contains a --.
+# 2. If the value for a parameter contains spaces it can be quoted using
+# double quotes, for example param="value with spaces". This will
+# break the [^[:space:]\"] regex for the value.
+# 3. Dashes and underscores in the parameter name are equivalent. So
+# some_parameter and some-parameter are identical.
+# 4. Some parameters, e.g. efivar_ssdt, can be given multiple times.
+# 5. Some kernel parameters, e.g. quiet, doesn't have value
#
# $1: the name of the kernel command line parameter
-# $2: new value. If empty, the parameter would be removed
-_update_kernel_cmdline_in_grub_etc_default()
+# $2: new value. If empty, given parameter would be removed
+_update_kernel_arg_in_grub_etc_default()
{
- local _para=$1 _val=$2 _para_val _regex
+ local _para=$1 _val=$2 _para_val
if [[ -n $_val ]]; then
_para_val="$_para=$_val"
fi
- _regex='^(GRUB_CMDLINE_LINUX=.*)([[:space:]"])'"$_para"'=[^[:space:]"]*(.*)$'
- if grep -q -E "$_regex" "$GRUB_ETC_DEFAULT"; then
- sed -i -E 's/'"$_regex"'/\1\2'"$_para_val"'\3/' "$GRUB_ETC_DEFAULT"
- elif [[ -n $_para_val ]]; then
- # If the kernel parameter doesn't exist, put it in the first
- sed -i -E 's/^(GRUB_CMDLINE_LINUX=")/\1'"$_para_val"' /' "$GRUB_ETC_DEFAULT"
- fi
+ # Update the command line /etc/default/grub, i.e.
+ # on the line that starts with 'GRUB_CMDLINE_LINUX=',
+ # 1) remove $para=$val if the it's the first arg
+ # 2) remove all occurences of $para=$val
+ # 3) insert $_para_val to end
+ # 4) remove duplicate spaces left over by 1) or 2) or 3)
+ # 5) remove space at the beginning of the string left over by 1) or 2) or 3)
+ # 6) remove space at the end of the string left over by 1) or 2) or 3)
+ sed -i -E "/^GRUB_CMDLINE_LINUX=/ {
+ s/\"${_para}=[^[:space:]\"]*/\"/g;
+ s/[[:space:]]+${_para}=[^[:space:]\"]*/ /g;
+ s/\"$/ ${_para_val}\"/
+ s/[[:space:]]+/ /g;
+ s/(\")[[:space:]]+/\1/g;
+ s/[[:space:]]+(\")/\1/g;
+ }" "$GRUB_ETC_DEFAULT"
}
reset_crashkernel()
@@ -1496,10 +1520,12 @@ reset_crashkernel()
# - set the dump mode as kdump for non-ppc64le cases
# - retrieved the default crashkernel value for given dump mode
if [[ $_grubby_kernel_path == ALL && -n $_dump_mode ]]; then
- _update_kernel_cmdline_in_grub_etc_default crashkernel "$_crashkernel"
+ _update_kernel_arg_in_grub_etc_default crashkernel "$_crashkernel"
# remove the fadump if fadump is disabled
- [[ $_fadump_val == off ]] && _fadump_val=""
- _update_kernel_cmdline_in_grub_etc_default fadump "$_fadump_val"
+ if [[ $_fadump_val == off ]]; then
+ _fadump_val=""
+ fi
+ _update_kernel_arg_in_grub_etc_default fadump "$_fadump_val"
fi
# If kernel-path not specified, either
commit 311b5b100b512134cddb189f46c8bb85d74f9275
Author: Coiby Xu <coxu(a)redhat.com>
Date: Fri Feb 11 13:11:17 2022 +0800
update kernel crashkernel in posttrans RPM scriptlet when updating kexec-tools
When doing in-place upgrading using leapp on x86_64, kdumpcl can't
acquire instance lock when running in %post RPM scriplet on x86_64,
localhost upgrade[1306]: /bin/kdumpctl: line 49: /var/lock/kdump: No such file or directory
localhost upgrade[1306]: kdump: Create file lock failed
and running "touch /var/lock/dkump" also fails with
"No such file or directory". Thus kdumpctl can't be run in %post
scriptlet. But kdumpctl can be run in %posttrans RPM scriplet.
Besides, it's better to update crashkernel after the kernel has been
updated. So let's update kernel crashkernel in the %posttrans
scriptlet which will be run in the end of a transaction i.e. after
the kernel has been updated.
Note for %posttrans scriptlet, "$1 == 1" means both installing a new
package and upgrading a package.
[1] https://github.com/apptainer/singularity/issues/2386#issuecomment-474747054
Reported-by: Jie Li <jieli(a)redhat.com>
Signed-off-by: Coiby Xu <coxu(a)redhat.com>
Reviewed-by: Philipp Rudo <prudo(a)redhat.com>
diff --git a/kexec-tools.spec b/kexec-tools.spec
index ac134da..6b7ef14 100644
--- a/kexec-tools.spec
+++ b/kexec-tools.spec
@@ -305,19 +305,6 @@ then
mv /etc/sysconfig/kdump.new /etc/sysconfig/kdump
fi
-# try to reset kernel crashkernel value to new default value when upgrading
-# the package
-if ! grep -qs "ostree" /proc/cmdline && [ $1 == 2 ]; then
- kdumpctl reset-crashkernel-after-update
- rm /tmp/old_default_crashkernel 2>/dev/null
-%ifarch ppc64 ppc64le
- rm /tmp/old_default_crashkernel_fadump 2>/dev/null
-%endif
- # dnf would complain about the exit code not being 0. To keep it happy,
- # always return 0
- :
-fi
-
%postun
%systemd_postun_with_restart kdump.service
@@ -350,6 +337,21 @@ do
fi
done
+%posttrans
+# try to reset kernel crashkernel value to new default value when upgrading
+# the package
+if ! grep -qs "ostree" /proc/cmdline && [ $1 == 1 ]; then
+ kdumpctl reset-crashkernel-after-update
+ rm /tmp/old_default_crashkernel 2>/dev/null
+%ifarch ppc64 ppc64le
+ rm /tmp/old_default_crashkernel_fadump 2>/dev/null
+%endif
+ # dnf would complain about the exit code not being 0. To keep it happy,
+ # always return 0
+ :
+fi
+
+
%files
/usr/sbin/kexec
%ifarch %{ix86} x86_64 ppc64 s390x ppc64le aarch64
commit 2bbc7512a2f2cf953ea047f54bd590d4d285b658
Author: Tao Liu <ltao(a)redhat.com>
Date: Wed Feb 16 14:26:38 2022 +0800
kdump-lib.sh: Check the output of blkid with sed instead of eval
Previously the output of blkid is not checked. If the output
is empty, the eval will report the following error message:
/lib/kdump/kdump-lib.sh: eval: line 925: syntax error near unexpected token `;'
/lib/kdump/kdump-lib.sh: eval: line 925: `; echo $TYPE'
For example, we can observe such a failing when blkid is invoked
against a lvm thinpool block device:
$ blkid -u filesystem,crypto -o export -- "/dev/block/253\:2"
$ echo $?
2
$ udevadm info /dev/block/253\:2|grep S\:
S: mapper/vg00-thinpoll_tmeta
In this patch, we will use sed instead of eval, to output the
fstype of block device if any.
Signed-off-by: Tao Liu <ltao(a)redhat.com>
Reviewed-by: Philipp Rudo <prudo(a)redhat.com>
diff --git a/kdump-lib.sh b/kdump-lib.sh
index 3e912cc..4ed5035 100755
--- a/kdump-lib.sh
+++ b/kdump-lib.sh
@@ -885,7 +885,8 @@ get_luks_crypt_dev()
[[ -b /dev/block/$1 ]] || return 1
- _type=$(eval "$(blkid -u filesystem,crypto -o export -- "/dev/block/$1"); echo \$TYPE")
+ _type=$(blkid -u filesystem,crypto -o export -- "/dev/block/$1" | \
+ sed -n -E "s/^TYPE=(.*)$/\1/p")
[[ $_type == "crypto_LUKS" ]] && echo "$1"
for _x in "/sys/dev/block/$1/slaves/"*; do
commit 59fcb8ae5b13d776f5a1966173b57d6404699aae
Author: Coiby Xu <coxu(a)redhat.com>
Date: Mon Feb 14 12:07:08 2022 +0800
Release 2.0.23-5
Signed-off-by: Coiby Xu <coxu(a)redhat.com>
diff --git a/kexec-tools.spec b/kexec-tools.spec
index 1750db0..ac134da 100644
--- a/kexec-tools.spec
+++ b/kexec-tools.spec
@@ -5,7 +5,7 @@
Name: kexec-tools
Version: 2.0.23
-Release: 4%{?dist}
+Release: 5%{?dist}
License: GPLv2
Summary: The kexec/kdump userspace component
@@ -405,6 +405,10 @@ done
%endif
%changelog
+* Mon Feb 14 2022 Coiby <coxu(a)redhat.com> - 2.0.23-5
+- fix incorrect usage of _get_all_kernels_from_grubby
+- fix the mistake of swapping function parameters of read_proc_environ_var
+
* Wed Jan 26 2022 Coiby <coxu(a)redhat.com> - 2.0.23-4
- fix broken kdump_get_arch_recommend_size
- remove the upper bound of 102400T for the range in default crashkernel
commit 41b8f9528c8ed89c68ad59750c18f032b5675a06
Author: Coiby Xu <coxu(a)redhat.com>
Date: Wed Feb 9 08:04:39 2022 +0800
fix incorrect usage of _get_all_kernels_from_grubby
It's found that the kernel cmdline crashkernel=auto doesn't get updated
when upgrading kexec-tools. This happens because _get_all_kernels_from_grubby
is called with no argument by reset_crashkernel_after_update. When retrieving
all kernel paths on the system, "grubby --info ALL" should be used. Fix this
error by passing "ALL" argument.
Fixes: 0adb0f4 ("try to reset kernel crashkernel when kexec-tools updates the default crashkernel value")
Reported-by: Jie Li <jieli(a)redhat.com>
Signed-off-by: Coiby Xu <coxu(a)redhat.com>
Reviewed-by: Tao Liu <ltao(a)redhat.com>
diff --git a/kdumpctl b/kdumpctl
index bf74c75..9fd76ac 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -1382,6 +1382,11 @@ _valid_grubby_kernel_path()
[[ -n "$1" ]] && grubby --info="$1" > /dev/null 2>&1
}
+# return all the kernel paths given a grubby kernel-path
+#
+# $1: kernel path accepted by grubby, e.g. DEFAULT, ALL,
+# /boot/vmlinuz-`uname -r`
+# return: kernel paths separated by space
_get_all_kernels_from_grubby()
{
local _kernels _line _kernel_path _grubby_kernel_path=$1
@@ -1557,7 +1562,7 @@ reset_crashkernel_after_update()
_crashkernel_vals[new_kdump]=$(get_default_crashkernel kdump)
_crashkernel_vals[new_fadump]=$(get_default_crashkernel fadump)
- for _kernel in $(_get_all_kernels_from_grubby); do
+ for _kernel in $(_get_all_kernels_from_grubby ALL); do
_crashkernel=$(get_grub_kernel_boot_parameter "$_kernel" crashkernel)
if [[ $_crashkernel == auto ]]; then
reset_crashkernel "--kernel=$_kernel"
commit 5111c01334046dd4176d4446075b02106fb9db4a
Author: Coiby Xu <coxu(a)redhat.com>
Date: Mon Feb 7 08:08:01 2022 +0800
fix the mistake of swapping function parameters of read_proc_environ_var
_is_osbuild fails because it expects the 1st and 2nd function parameter
to be the environment variable and environ file path respectively. Fix
it by swapping the parameters in read_proc_environ_var.
Note the osbuild environ file path is defined in _OSBUILD_ENVIRON_PATH
so _is_osbuild can be unit-tested by overwriting _OSBUILD_ENVIRON_PATH.
Fixes: 6a3ce83 ("fix the error of parsing the container environ variable for osbuild")
Signed-off-by: Coiby Xu <coxu(a)redhat.com>
Reviewed-by: Pingfan Liu <piliu(a)redhat.com>
diff --git a/kdumpctl b/kdumpctl
index 3ccfa97..bf74c75 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -1580,15 +1580,19 @@ reset_crashkernel_after_update()
#
# The environment variable entries in /proc/[pid]/environ are separated
# by null bytes instead of by spaces.
+#
+# $1: environment variable
+# $2: environ file path
read_proc_environ_var()
{
- local _environ_path=$1 _var=$2
+ local _var=$1 _environ_path=$2
sed -n -E "s/.*(^|\x00)${_var}=([^\x00]*).*/\2/p" < "$_environ_path"
}
+_OSBUILD_ENVIRON_PATH='/proc/1/environ'
_is_osbuild()
{
- [[ $(read_proc_environ_var container /proc/1/environ) == bwrap-osbuild ]]
+ [[ $(read_proc_environ_var container "$_OSBUILD_ENVIRON_PATH") == bwrap-osbuild ]]
}
reset_crashkernel_for_installed_kernel()
commit d6298a1dec83aa83df19cd994d7ace976822d3b9
Author: Coiby Xu <coxu(a)redhat.com>
Date: Wed Jan 26 15:10:50 2022 +0800
Release 2.0.23-4
diff --git a/kexec-tools.spec b/kexec-tools.spec
index aabb369..1750db0 100644
--- a/kexec-tools.spec
+++ b/kexec-tools.spec
@@ -5,7 +5,7 @@
Name: kexec-tools
Version: 2.0.23
-Release: 3%{?dist}
+Release: 4%{?dist}
License: GPLv2
Summary: The kexec/kdump userspace component
@@ -405,6 +405,16 @@ done
%endif
%changelog
+* Wed Jan 26 2022 Coiby <coxu(a)redhat.com> - 2.0.23-4
+- fix broken kdump_get_arch_recommend_size
+- remove the upper bound of 102400T for the range in default crashkernel
+- fix the error of parsing the container environ variable for osbuild
+- s390: handle R_390_PLT32DBL reloc entries in machine_apply_elf_rel()
+- Revert "Remove trace_buf_size and trace_event from the kernel bootparameters of the kdump kernel"
+- spec: only install mkfadumprd for ppc
+- selftest: Add early kdump test
+- selftest: run-test.sh: wait for subprocess instead of kill it
+
* Thu Jan 20 2022 Fedora Release Engineering <releng(a)fedoraproject.org> - 2.0.23-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
commit 2df55984f66bc2a67c881eab0e33139d2ddc0461
Author: Coiby Xu <coxu(a)redhat.com>
Date: Wed Jan 26 08:48:18 2022 +0800
fix broken kdump_get_arch_recommend_size
shellcheck finds the following problem,
$ shellcheck kdump-lib.sh
In kdump-lib.sh line 876:
get_recommend_size "$sys_mem" "$ck_cmdline"
^---------^ SC2154: ck_cmdline is referenced but not assigned (did you mean '_ck_cmdline'?).
s/ck_cmdline/_ck_cmdline to fix kdump_get_arch_recommend_size.
Note s/sys_mem/_sys_mem as well to make the changes consistent.
Fixes: 105c016 ("factor out kdump_get_arch_recommend_crashkernel")
Signed-off-by: Coiby Xu <coxu(a)redhat.com>
Acked-by: Tao Liu <ltao(a)redhat.com>
diff --git a/kdump-lib.sh b/kdump-lib.sh
index c6bdd2e..3e912cc 100755
--- a/kdump-lib.sh
+++ b/kdump-lib.sh
@@ -864,16 +864,16 @@ kdump_get_arch_recommend_crashkernel()
# $1: kernel version, if not set, will defaults to $(uname -r)
kdump_get_arch_recommend_size()
{
- local _ck_cmdline
+ local _ck_cmdline _sys_mem
if ! [[ -r "/proc/iomem" ]]; then
echo "Error, can not access /proc/iomem."
return 1
fi
- sys_mem=$(get_system_size)
+ _sys_mem=$(get_system_size)
_ck_cmdline=$(kdump_get_arch_recommend_crashkernel)
_ck_cmdline=${_ck_cmdline//-:/-102400T:}
- get_recommend_size "$sys_mem" "$ck_cmdline"
+ get_recommend_size "$_sys_mem" "$_ck_cmdline"
}
# Print all underlying crypt devices of a block device
commit c67a836cde781fecc8b785128132f4c8c2fd0190
Author: Coiby Xu <coxu(a)redhat.com>
Date: Tue Jan 25 16:16:58 2022 +0800
remove the upper bound of 102400T for the range in default crashkernel
This patch makes the default crashkernel value consistent with previous
one.
Fixes: 105c016 ("factor out kdump_get_arch_recommend_crashkernel")
Signed-off-by: Coiby Xu <coxu(a)redhat.com>
Reviewed-by: Philipp Rudo <prudo(a)redhat.com>
diff --git a/kdump-lib.sh b/kdump-lib.sh
index 3256581..c6bdd2e 100755
--- a/kdump-lib.sh
+++ b/kdump-lib.sh
@@ -857,7 +857,6 @@ kdump_get_arch_recommend_crashkernel()
fi
fi
- _ck_cmdline=${_ck_cmdline//-:/-102400T:}
echo -n "$_ck_cmdline"
}
@@ -873,6 +872,7 @@ kdump_get_arch_recommend_size()
fi
sys_mem=$(get_system_size)
_ck_cmdline=$(kdump_get_arch_recommend_crashkernel)
+ _ck_cmdline=${_ck_cmdline//-:/-102400T:}
get_recommend_size "$sys_mem" "$ck_cmdline"
}
commit 6a3ce83a60c7107112d576223175410b180a41a0
Author: Coiby Xu <coxu(a)redhat.com>
Date: Wed Jan 19 11:16:29 2022 +0800
fix the error of parsing the container environ variable for osbuild
The environment variable entries in /proc/[pid]/environ are separated by
null bytes instead of by spaces. Update the sed regex to fix this issue.
Note that,
1. this patch also fixes a issue which is kdumpctl would try to reset
crashkernel even osbuild has provided custom crashkernel value.
2. kernel hook 92-crashkernel.install installed by kexec-tools is
guaranteed to be ran by kernel-install. kexec-tools doesn't recommend
kernel so there is no guarantee kernel is installed after kexec-tools.
But dnf invokes kernel-install in the posttrans scriptlet (of kernel-core)
which is always ran after all packages including kexec-tools and kernel
in a dnf transaction.
3. To be able to do unit tests, the logic of reading environment variable
has been extracted as a separate function.
Fixes: ddd428a ("set up kernel crashkernel for osbuild in kernel hook")
Signed-off-by: Coiby Xu <coxu(a)redhat.com>
Reviewed-by: Pingfan Liu <piliu(a)redhat.com>
Reviewed-by: Philipp Rudo <prudo(a)redhat.com>
diff --git a/kdumpctl b/kdumpctl
index 8107487..3ccfa97 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -1576,9 +1576,19 @@ reset_crashkernel_after_update()
done
}
+# read the value of an environ variable from given environ file path
+#
+# The environment variable entries in /proc/[pid]/environ are separated
+# by null bytes instead of by spaces.
+read_proc_environ_var()
+{
+ local _environ_path=$1 _var=$2
+ sed -n -E "s/.*(^|\x00)${_var}=([^\x00]*).*/\2/p" < "$_environ_path"
+}
+
_is_osbuild()
{
- [[ $(sed -n -E 's/.*(^|\s)container=(\S*).*/\2/p' < /proc/1/environ) == bwrap-osbuild ]]
+ [[ $(read_proc_environ_var container /proc/1/environ) == bwrap-osbuild ]]
}
reset_crashkernel_for_installed_kernel()
@@ -1590,8 +1600,10 @@ reset_crashkernel_for_installed_kernel()
exit 1
fi
- if _is_osbuild && ! grep -qs crashkernel= /etc/kernel/cmdline; then
- reset_crashkernel "--kernel=$_installed_kernel"
+ if _is_osbuild; then
+ if ! grep -qs crashkernel= /etc/kernel/cmdline; then
+ reset_crashkernel "--kernel=$_installed_kernel"
+ fi
return
fi
commit ca5a33855ff637d53c70e71282e73f3c67d85c86
Author: Philipp Rudo <prudo(a)redhat.com>
Date: Tue Jan 25 10:54:49 2022 +0100
s390: handle R_390_PLT32DBL reloc entries in machine_apply_elf_rel()
Resolves: bz2025860
Upstream: git.kernel.org/pub/scm/utils/kernel/kexec/kexec-tools.git
commit 186e7b0752d8fce1618fa37519671c834c46340e
Author: Alexander Egorenkov <egorenar(a)linux.ibm.com>
Date: Wed Dec 15 18:48:53 2021 +0100
s390: handle R_390_PLT32DBL reloc entries in machine_apply_elf_rel()
Starting with gcc 11.3, the C compiler will generate PLT-relative function
calls even if they are local and do not require it. Later on during linking,
the linker will replace all PLT-relative calls to local functions with
PC-relative ones. Unfortunately, the purgatory code of kexec/kdump is
not being linked as a regular executable or shared library would have been,
and therefore, all PLT-relative addresses remain in the generated purgatory
object code unresolved. This in turn lets kexec-tools fail with
"Unknown rela relocation: 0x14 0x73c0901c" for such relocation types.
Furthermore, the clang C compiler has always behaved like described above
and this commit should fix the purgatory code built with the latter.
Because the purgatory code is no regular executable or shared library,
contains only calls to local functions and has no PLT, all R_390_PLT32DBL
relocation entries can be resolved just like a R_390_PC32DBL one.
* https://refspecs.linuxfoundation.org/ELF/zSeries/lzsabi0_zSeries/x1633.ht...
Relocation entries of purgatory code generated with gcc 11.3
------------------------------------------------------------
$ readelf -r purgatory/purgatory.o
Relocation section '.rela.text' at offset 0x6e8 contains 27 entries:
Offset Info Type Sym. Value Sym. Name + Addend
00000000000c 000300000013 R_390_PC32DBL 0000000000000000 .data + 2
00000000001a 001000000014 R_390_PLT32DBL 0000000000000000 sha256_starts + 2
000000000030 001100000014 R_390_PLT32DBL 0000000000000000 sha256_update + 2
000000000046 001200000014 R_390_PLT32DBL 0000000000000000 sha256_finish + 2
000000000050 000300000013 R_390_PC32DBL 0000000000000000 .data + 102
00000000005a 001300000014 R_390_PLT32DBL 0000000000000000 memcmp + 2
...
000000000118 001600000014 R_390_PLT32DBL 0000000000000000 setup_arch + 2
00000000011e 000300000013 R_390_PC32DBL 0000000000000000 .data + 2
00000000012c 000f00000014 R_390_PLT32DBL 0000000000000000 verify_sha256_digest + 2
000000000142 001700000014 R_390_PLT32DBL 0000000000000000
post_verification[...] + 2
Relocation entries of purgatory code generated with gcc 11.2
------------------------------------------------------------
$ readelf -r purgatory/purgatory.o
Relocation section '.rela.text' at offset 0x6e8 contains 27 entries:
Offset Info Type Sym. Value Sym. Name + Addend
00000000000e 000300000013 R_390_PC32DBL 0000000000000000 .data + 2
00000000001c 001000000013 R_390_PC32DBL 0000000000000000 sha256_starts + 2
000000000036 001100000013 R_390_PC32DBL 0000000000000000 sha256_update + 2
000000000048 001200000013 R_390_PC32DBL 0000000000000000 sha256_finish + 2
000000000052 000300000013 R_390_PC32DBL 0000000000000000 .data + 102
00000000005c 001300000013 R_390_PC32DBL 0000000000000000 memcmp + 2
...
00000000011a 001600000013 R_390_PC32DBL 0000000000000000 setup_arch + 2
000000000120 000300000013 R_390_PC32DBL 0000000000000000 .data + 122
000000000130 000f00000013 R_390_PC32DBL 0000000000000000 verify_sha256_digest + 2
000000000146 001700000013 R_390_PC32DBL 0000000000000000 post_verification[...] + 2
Corresponding s390 kernel discussion:
* https://lore.kernel.org/linux-s390/20211208105801.188140-1-egorenar@linux...
Signed-off-by: Alexander Egorenkov <egorenar(a)linux.ibm.com>
Reported-by: Tao Liu <ltao(a)redhat.com>
Suggested-by: Philipp Rudo <prudo(a)redhat.com>
Reviewed-by: Philipp Rudo <prudo(a)redhat.com>
[hca(a)linux.ibm.com: changed commit message as requested by Philipp Rudo]
Signed-off-by: Heiko Carstens <hca(a)linux.ibm.com>
Signed-off-by: Simon Horman <horms(a)verge.net.au>
v2:
- Moved patch 601 -> 401
Signed-off-by: Philipp Rudo <prudo(a)redhat.com>
Acked-by: Coiby Xu <coxu(a)redhat.com>
diff --git a/kexec-tools-2.0.23-s390_handle_R_390_PLT32DBL_reloc_entries_in_machine_apply_elf_rel_.patch b/kexec-tools-2.0.23-s390_handle_R_390_PLT32DBL_reloc_entries_in_machine_apply_elf_rel_.patch
new file mode 100644
index 0000000..10bc5ef
--- /dev/null
+++ b/kexec-tools-2.0.23-s390_handle_R_390_PLT32DBL_reloc_entries_in_machine_apply_elf_rel_.patch
@@ -0,0 +1,95 @@
+commit 186e7b0752d8fce1618fa37519671c834c46340e
+Author: Alexander Egorenkov <egorenar(a)linux.ibm.com>
+Date: Wed Dec 15 18:48:53 2021 +0100
+
+ s390: handle R_390_PLT32DBL reloc entries in machine_apply_elf_rel()
+
+ Starting with gcc 11.3, the C compiler will generate PLT-relative function
+ calls even if they are local and do not require it. Later on during linking,
+ the linker will replace all PLT-relative calls to local functions with
+ PC-relative ones. Unfortunately, the purgatory code of kexec/kdump is
+ not being linked as a regular executable or shared library would have been,
+ and therefore, all PLT-relative addresses remain in the generated purgatory
+ object code unresolved. This in turn lets kexec-tools fail with
+ "Unknown rela relocation: 0x14 0x73c0901c" for such relocation types.
+
+ Furthermore, the clang C compiler has always behaved like described above
+ and this commit should fix the purgatory code built with the latter.
+
+ Because the purgatory code is no regular executable or shared library,
+ contains only calls to local functions and has no PLT, all R_390_PLT32DBL
+ relocation entries can be resolved just like a R_390_PC32DBL one.
+
+ * https://refspecs.linuxfoundation.org/ELF/zSeries/lzsabi0_zSeries/x1633.ht...
+
+ Relocation entries of purgatory code generated with gcc 11.3
+ ------------------------------------------------------------
+
+ $ readelf -r purgatory/purgatory.o
+
+ Relocation section '.rela.text' at offset 0x6e8 contains 27 entries:
+ Offset Info Type Sym. Value Sym. Name + Addend
+ 00000000000c 000300000013 R_390_PC32DBL 0000000000000000 .data + 2
+ 00000000001a 001000000014 R_390_PLT32DBL 0000000000000000 sha256_starts + 2
+ 000000000030 001100000014 R_390_PLT32DBL 0000000000000000 sha256_update + 2
+ 000000000046 001200000014 R_390_PLT32DBL 0000000000000000 sha256_finish + 2
+ 000000000050 000300000013 R_390_PC32DBL 0000000000000000 .data + 102
+ 00000000005a 001300000014 R_390_PLT32DBL 0000000000000000 memcmp + 2
+ ...
+ 000000000118 001600000014 R_390_PLT32DBL 0000000000000000 setup_arch + 2
+ 00000000011e 000300000013 R_390_PC32DBL 0000000000000000 .data + 2
+ 00000000012c 000f00000014 R_390_PLT32DBL 0000000000000000 verify_sha256_digest + 2
+ 000000000142 001700000014 R_390_PLT32DBL 0000000000000000
+ post_verification[...] + 2
+
+ Relocation entries of purgatory code generated with gcc 11.2
+ ------------------------------------------------------------
+
+ $ readelf -r purgatory/purgatory.o
+
+ Relocation section '.rela.text' at offset 0x6e8 contains 27 entries:
+ Offset Info Type Sym. Value Sym. Name + Addend
+ 00000000000e 000300000013 R_390_PC32DBL 0000000000000000 .data + 2
+ 00000000001c 001000000013 R_390_PC32DBL 0000000000000000 sha256_starts + 2
+ 000000000036 001100000013 R_390_PC32DBL 0000000000000000 sha256_update + 2
+ 000000000048 001200000013 R_390_PC32DBL 0000000000000000 sha256_finish + 2
+ 000000000052 000300000013 R_390_PC32DBL 0000000000000000 .data + 102
+ 00000000005c 001300000013 R_390_PC32DBL 0000000000000000 memcmp + 2
+ ...
+ 00000000011a 001600000013 R_390_PC32DBL 0000000000000000 setup_arch + 2
+ 000000000120 000300000013 R_390_PC32DBL 0000000000000000 .data + 122
+ 000000000130 000f00000013 R_390_PC32DBL 0000000000000000 verify_sha256_digest + 2
+ 000000000146 001700000013 R_390_PC32DBL 0000000000000000 post_verification[...] + 2
+
+ Corresponding s390 kernel discussion:
+ * https://lore.kernel.org/linux-s390/20211208105801.188140-1-egorenar@linux...
+
+ Signed-off-by: Alexander Egorenkov <egorenar(a)linux.ibm.com>
+ Reported-by: Tao Liu <ltao(a)redhat.com>
+ Suggested-by: Philipp Rudo <prudo(a)redhat.com>
+ Reviewed-by: Philipp Rudo <prudo(a)redhat.com>
+ [hca(a)linux.ibm.com: changed commit message as requested by Philipp Rudo]
+ Signed-off-by: Heiko Carstens <hca(a)linux.ibm.com>
+ Signed-off-by: Simon Horman <horms(a)verge.net.au>
+
+diff --git a/kexec/arch/s390/kexec-elf-rel-s390.c b/kexec/arch/s390/kexec-elf-rel-s390.c
+index a5e1b73455785ae3bc3aa72b3beee13ae202e82f..91ba86a9991dad4271b834fc3b24861c40309e52 100644
+--- a/kexec/arch/s390/kexec-elf-rel-s390.c
++++ b/kexec/arch/s390/kexec-elf-rel-s390.c
+@@ -56,6 +56,7 @@ void machine_apply_elf_rel(struct mem_ehdr *UNUSED(ehdr),
+ case R_390_PC16: /* PC relative 16 bit. */
+ case R_390_PC16DBL: /* PC relative 16 bit shifted by 1. */
+ case R_390_PC32DBL: /* PC relative 32 bit shifted by 1. */
++ case R_390_PLT32DBL: /* 32 bit PC rel. PLT shifted by 1. */
+ case R_390_PC32: /* PC relative 32 bit. */
+ case R_390_PC64: /* PC relative 64 bit. */
+ val -= address;
+@@ -63,7 +64,7 @@ void machine_apply_elf_rel(struct mem_ehdr *UNUSED(ehdr),
+ *(unsigned short *) loc = val;
+ else if (r_type == R_390_PC16DBL)
+ *(unsigned short *) loc = val >> 1;
+- else if (r_type == R_390_PC32DBL)
++ else if (r_type == R_390_PC32DBL || r_type == R_390_PLT32DBL)
+ *(unsigned int *) loc = val >> 1;
+ else if (r_type == R_390_PC32)
+ *(unsigned int *) loc = val;
diff --git a/kexec-tools.spec b/kexec-tools.spec
index 0ef93f9..aabb369 100644
--- a/kexec-tools.spec
+++ b/kexec-tools.spec
@@ -103,6 +103,7 @@ Requires: systemd-udev%{?_isa}
#
# Patches 401 through 500 are meant for s390 kexec-tools enablement
#
+Patch401: ./kexec-tools-2.0.23-s390_handle_R_390_PLT32DBL_reloc_entries_in_machine_apply_elf_rel_.patch
#
# Patches 501 through 600 are meant for ARM kexec-tools enablement
@@ -126,6 +127,8 @@ mkdir -p -m755 kcp
tar -z -x -v -f %{SOURCE9}
tar -z -x -v -f %{SOURCE19}
+%patch401 -p1
+
%ifarch ppc
%define archdef ARCH=ppc
%endif
commit 99de77bba7ff7668edab3da723aad7c1c8395b5f
Author: Tao Liu <ltao(a)redhat.com>
Date: Fri Jan 21 16:08:47 2022 +0800
Revert "Remove trace_buf_size and trace_event from the kernel bootparameters of the kdump kernel"
There is a mechanism to keep memory consumption minimum, i.e. equal
to trace_buf_size=1, until tracing by ftrace is actually started:
tracing: keep ring buffer to minimum size till used
https://github.com/torvalds/linux/commit/73c5162aa362a543793f4a957c6c536d...
Since ftrace is usually never used in the kdump 2nd kernel, the kdump
2nd kernel behaves in the same way with or without trace_buf_size=1.
So the issue which the patch want to solve never exists. Let's revert
the patch for better maintainance and avoid confusion.
ref link: https://bugzilla.redhat.com/show_bug.cgi?id=2034501#c20
This reverts commit f39000f.
Signed-off-by: Tao Liu <ltao(a)redhat.com>
Acked-by: Coiby Xu <coxu(a)redhat.com>
diff --git a/kdump-lib.sh b/kdump-lib.sh
index 0e64f22..3256581 100755
--- a/kdump-lib.sh
+++ b/kdump-lib.sh
@@ -782,10 +782,6 @@ prepare_cmdline()
fi
done
- # Remove trace_buf_size, trace_event
- cmdline=$(remove_cmdline_param "$cmdline" trace_buf_size trace_event)
- cmdline="${cmdline} trace_buf_size=1"
-
echo "$cmdline"
}
commit 748eb3a2a6b41bc74748f1f1845b91b77548e1d8
Author: Kairui Song <kasong(a)tencent.com>
Date: Sun Jan 9 18:03:35 2022 +0800
spec: only install mkfadumprd for ppc
fadump is a ppc only feature, mkfadumprd is only needed for fadump, drop
it for other arch.
Reviewed-by: Philipp Rudo <prudo(a)redhat.com>
Signed-off-by: Kairui Song <kasong(a)tencent.com>
diff --git a/kexec-tools.spec b/kexec-tools.spec
index a1fbb97..0ef93f9 100644
--- a/kexec-tools.spec
+++ b/kexec-tools.spec
@@ -188,7 +188,6 @@ SYSCONFIG=$RPM_SOURCE_DIR/kdump.sysconfig.%{_target_cpu}
install -m 644 $SYSCONFIG $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/kdump
install -m 755 %{SOURCE7} $RPM_BUILD_ROOT/usr/sbin/mkdumprd
-install -m 755 %{SOURCE32} $RPM_BUILD_ROOT/usr/sbin/mkfadumprd
install -m 644 %{SOURCE8} $RPM_BUILD_ROOT%{_sysconfdir}/kdump.conf
install -m 644 kexec/kexec.8 $RPM_BUILD_ROOT%{_mandir}/man8/kexec.8
install -m 644 %{SOURCE12} $RPM_BUILD_ROOT%{_mandir}/man8/mkdumprd.8
@@ -197,6 +196,7 @@ install -m 755 %{SOURCE20} $RPM_BUILD_ROOT%{_prefix}/lib/kdump/kdump-lib.sh
install -m 755 %{SOURCE23} $RPM_BUILD_ROOT%{_prefix}/lib/kdump/kdump-lib-initramfs.sh
install -m 755 %{SOURCE31} $RPM_BUILD_ROOT%{_prefix}/lib/kdump/kdump-logger.sh
%ifarch ppc64 ppc64le
+install -m 755 %{SOURCE32} $RPM_BUILD_ROOT/usr/sbin/mkfadumprd
install -m 755 %{SOURCE35} $RPM_BUILD_ROOT%{_prefix}/lib/kdump/kdump-migrate-action.sh
install -m 755 %{SOURCE36} $RPM_BUILD_ROOT%{_prefix}/lib/kdump/kdump-restart.sh
%endif
@@ -352,8 +352,10 @@ done
%ifarch %{ix86} x86_64 ppc64 s390x ppc64le aarch64
/usr/sbin/makedumpfile
%endif
-/usr/sbin/mkdumprd
+%ifarch ppc64 ppc64le
/usr/sbin/mkfadumprd
+%endif
+/usr/sbin/mkdumprd
/usr/sbin/vmcore-dmesg
%{_bindir}/*
%{_datadir}/kdump
commit aa9e70349b9c1735a52549f863efc9b3dd87f94c
Author: Tao Liu <ltao(a)redhat.com>
Date: Thu Dec 30 11:26:43 2021 +0800
selftest: Add early kdump test
This patch will introduce early kdump test.
It reuses the code of nfs kdump test, in order to setup 2 seperated VMs,
one(the client) for trigger the early kdump and crash, the other(the server)
for saving vmcore and check if vmcore exists. In order to minimize the
repetted code, a soft link is made to copy the same server side code.
Signed-off-by: Tao Liu <ltao(a)redhat.com>
Acked-by: Coiby Xu <coxu(a)redhat.com>
diff --git a/tests/scripts/testcases/nfs-early-kdump/0-server.sh b/tests/scripts/testcases/nfs-early-kdump/0-server.sh
new file mode 120000
index 0000000..3f888ce
--- /dev/null
+++ b/tests/scripts/testcases/nfs-early-kdump/0-server.sh
@@ -0,0 +1 @@
+../nfs-kdump/0-server.sh
\ No newline at end of file
diff --git a/tests/scripts/testcases/nfs-early-kdump/1-client.sh b/tests/scripts/testcases/nfs-early-kdump/1-client.sh
new file mode 100755
index 0000000..dfef4d8
--- /dev/null
+++ b/tests/scripts/testcases/nfs-early-kdump/1-client.sh
@@ -0,0 +1,46 @@
+# Executed before VM starts
+on_build() {
+ img_inst_pkg "nfs-utils"
+ img_add_qemu_cmd "-nic socket,connect=127.0.0.1:8010,mac=52:54:00:12:34:57"
+}
+
+on_test() {
+ local boot_count=$(get_test_boot_count)
+ local nfs_server=192.168.77.1
+ local earlykdump_path="/usr/lib/dracut/modules.d/99earlykdump/early-kdump.sh"
+ local tmp_file="/tmp/.tmp-file"
+
+ if [[ ! -f $earlykdump_path ]]; then
+ test_failed "early-kdump.sh not exist!"
+ fi
+
+ if [ $boot_count -eq 1 ]; then
+ cat << EOF > /etc/kdump.conf
+nfs $nfs_server:/srv/nfs
+core_collector makedumpfile -l --message-level 7 -d 31
+final_action poweroff
+EOF
+
+ while ! ping -c 1 $nfs_server -W 1; do
+ sleep 1
+ done
+
+ kdumpctl start \
+ || test_failed "Failed to start kdump"
+ grubby --update-kernel=ALL --args=rd.earlykdump
+
+ cat << EOF > $tmp_file
+echo 1 > /proc/sys/kernel/sysrq
+echo c > /proc/sysrq-trigger
+EOF
+ sed -i "/early_kdump_load$/r $tmp_file" $earlykdump_path
+ dracut -f --add earlykdump
+ kdumpctl restart \
+ || test_failed "Failed to start earlykdump"
+
+ sync
+ reboot
+ else
+ test_failed "Unexpected reboot"
+ fi
+}
commit f4ab396574c7842ccbb366e95f8445e44e2b5f0f
Author: Tao Liu <ltao(a)redhat.com>
Date: Thu Dec 30 11:26:42 2021 +0800
selftest: run-test.sh: wait for subprocess instead of kill it
When run tests with 2 VMs, for example nfs/ssh kdump tests, client VM will do the
crash and dump, server VM will do vmcore saving and if-vmcore-exists
check.
Previously, when client VM finishes running, run-test.sh will kill the lead background
process, and then check if server VM has outputted "TEST PASSED" or "TEST FAILED" string.
However it didn't wait for server VM to finish. As a result, the server VM's final
outputs are not collected and checked, leaving the test result as "TEST RESULT NOT FOUND"
sometimes.
For example, the following is the pstree status of $(jobs -p) before it
gets killed. We can see the server VM is still running:
run-test.sh,172455 /root/kexec-tools/tests/scripts/run-test.sh --console nfs-early-kdump
└─run-test.sh,172457 /root/kexec-tools/tests/scripts/run-test.sh --console...
└─timeout,172480 --foreground 10m /root/kexec-tools/tests/scripts/run-qemu...
└─qemu-system-x86,172481 -enable-kvm -cpu host -nodefaults...
├─{qemu-system-x86},172489
├─{qemu-system-x86},172492
├─{qemu-system-x86},172493
├─{qemu-system-x86},172628
└─{qemu-system-x86},172629
In this patch, we will wait for $(jobs -p) to finish, in order to get
the complete output of test results.
Signed-off-by: Tao Liu <ltao(a)redhat.com>
Acked-by: Coiby Xu <coxu(a)redhat.com>
diff --git a/tests/scripts/run-test.sh b/tests/scripts/run-test.sh
index c3e94a3..1501db4 100755
--- a/tests/scripts/run-test.sh
+++ b/tests/scripts/run-test.sh
@@ -140,7 +140,7 @@ for test_case in $testcases; do
if [ $console -eq 1 ]; then
run_test_sync $script | tee $(get_test_console_file $script)
- [ -n "$(jobs -p)" ] && kill $(jobs -p)
+ [ -n "$(jobs -p)" ] && wait $(jobs -p)
else
$(run_test_sync $script > $(get_test_console_file $script)) &
watch_test_outputs $test_outputs
commit bb380a92fa65e69a2303cd8c99d47165faa39112
Author: Fedora Release Engineering <releng(a)fedoraproject.org>
Date: Thu Jan 20 14:26:44 2022 +0000
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng(a)fedoraproject.org>
diff --git a/kexec-tools.spec b/kexec-tools.spec
index 9f7118b..a1fbb97 100644
--- a/kexec-tools.spec
+++ b/kexec-tools.spec
@@ -5,7 +5,7 @@
Name: kexec-tools
Version: 2.0.23
-Release: 2%{?dist}
+Release: 3%{?dist}
License: GPLv2
Summary: The kexec/kdump userspace component
@@ -400,6 +400,9 @@ done
%endif
%changelog
+* Thu Jan 20 2022 Fedora Release Engineering <releng(a)fedoraproject.org> - 2.0.23-3
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
+
* Thu Jan 13 2022 Coiby <coxu(a)redhat.com> - 2.0.23-2
- fix "kdump: Invalid kdump config option auto_reset_crashkernel" error
- use grep -s to suppress error messages about nonexistent or unreadable files
commit c480be7ccf8d63bed81f167bb4da7645f68c52a7
Author: Pingfan Liu <piliu(a)redhat.com>
Date: Wed Jan 12 19:24:26 2022 +0800
spec: add hostname.rpm into Recommends list
kexec-tools runs hostname binary in the case of fence_kdump. Since this
is a trival dependency and should not block the kexec-tools installation
if non-existent, using weak-dependency to resolve it.
Signed-off-by: Pingfan Liu <piliu(a)redhat.com>
Acked-by: Tao Liu <ltao(a)redhat.com>
diff --git a/kexec-tools.spec b/kexec-tools.spec
index 849d09c..9f7118b 100644
--- a/kexec-tools.spec
+++ b/kexec-tools.spec
@@ -72,6 +72,7 @@ Requires: dracut-squash >= 050
Requires: ethtool
Recommends: zstd
Recommends: grubby
+Recommends: hostname
BuildRequires: make
BuildRequires: zlib-devel elfutils-devel glib2-devel bzip2-devel ncurses-devel bison flex lzo-devel snappy-devel libzstd-devel
BuildRequires: pkgconfig intltool gettext
commit 72ef6929a6e309b0c9ded72442075a6ec773beb3
Author: Pingfan Liu <piliu(a)redhat.com>
Date: Tue Jan 18 10:42:00 2022 +0800
move variable FENCE_KDUMP_SEND from kdump-lib.sh to kdump-lib-initramfs.sh
Since kdump-lib-initramfs.sh is included by kdump-lib.sh, and
FENCE_KDUMP_SEND is used by both 1st and 2nd kernel, moving
FENCE_KDUMP_SEND from kdump-lib.sh to kdump-lib-initramfs.sh.
Signed-off-by: Pingfan Liu <piliu(a)redhat.com>
Acked-by: Tao Liu <ltao(a)redhat.com>
diff --git a/kdump-lib-initramfs.sh b/kdump-lib-initramfs.sh
index c1fd75f..9be0fe9 100755
--- a/kdump-lib-initramfs.sh
+++ b/kdump-lib-initramfs.sh
@@ -5,6 +5,8 @@
DEFAULT_PATH="/var/crash/"
KDUMP_CONFIG_FILE="/etc/kdump.conf"
+FENCE_KDUMP_CONFIG_FILE="/etc/sysconfig/fence_kdump"
+FENCE_KDUMP_SEND="/usr/libexec/fence_kdump_send"
# Read kdump config in well formated style
kdump_read_conf()
diff --git a/kdump-lib.sh b/kdump-lib.sh
index ca086d7..0e64f22 100755
--- a/kdump-lib.sh
+++ b/kdump-lib.sh
@@ -5,8 +5,6 @@
. /usr/lib/kdump/kdump-lib-initramfs.sh
-FENCE_KDUMP_CONFIG_FILE="/etc/sysconfig/fence_kdump"
-FENCE_KDUMP_SEND="/usr/libexec/fence_kdump_send"
FADUMP_ENABLED_SYS_NODE="/sys/kernel/fadump_enabled"
is_fadump_capable()
commit 1e569fd8a88ea146ca31bd0ac467fe657521f9eb
Author: Coiby Xu <coxu(a)redhat.com>
Date: Thu Jan 13 14:41:03 2022 +0800
Release 2.0.23-2
diff --git a/kexec-tools.spec b/kexec-tools.spec
index 7419723..849d09c 100644
--- a/kexec-tools.spec
+++ b/kexec-tools.spec
@@ -5,7 +5,7 @@
Name: kexec-tools
Version: 2.0.23
-Release: 1%{?dist}
+Release: 2%{?dist}
License: GPLv2
Summary: The kexec/kdump userspace component
@@ -399,6 +399,34 @@ done
%endif
%changelog
+* Thu Jan 13 2022 Coiby <coxu(a)redhat.com> - 2.0.23-2
+- fix "kdump: Invalid kdump config option auto_reset_crashkernel" error
+- use grep -s to suppress error messages about nonexistent or unreadable files
+- kdump-lib.sh: Escape '|' for 'failure_action|default' in is_dump_to_rootfs
+- Set zstd as the default compression method for kdump initrd
+- (origin/auto_reset_crashkernel, auto_reset_crashkernel) update crashkernel-howto
+- set up kernel crashkernel for osbuild in kernel hook
+- reset kernel crashkernel for the special case where the kernel is updated right after kexec-tools
+- try to reset kernel crashkernel when kexec-tools updates the default crashkernel value
+- introduce the auto_reset_crashkernel option to kdump.conf
+- rewrite reset_crashkernel to support fadump and to used by RPM scriptlet
+- fix incorrect usage of rpm-ostree to update kernel command line parameters
+- add helper functions to get kernel path by kernel release and the path of current running kernel
+- add helper functions to get dump mode
+- add a helper function to read kernel cmdline parameter from grubby --info
+- provide kdumpctl get-default-crashkernel for kdump_anaconda_addon and RPM scriptlet
+- factor out kdump_get_arch_recommend_crashkernel
+- update default crashkernel value
+- kdumpctl: remove some legacy code
+- dracut-early-kdump-module-setup.sh: install xargs and kdump-lib-initramfs.sh
+- ppc64/ppc64le: drop cpu online rule in 40-redhat.rules in kdump initramfs
+- kdump/ppc64: suppress the error message "Could not find a registered notification tool" from servicelog_notify
+- add keytuils as a weak dependency for POWER
+- Document/kexec-kdump-howto.txt: improve notes for kdump_pre and kdump_post scripts
+- sysconfig: make kexec_file_load as default option on ppc64le
+- sysconfig: make kexec_file_load as default option on aarch64
+- Enable zstd compression for makedumpfile in kexec-tools.spec
+
* Mon Nov 18 2021 Coiby <coxu(a)redhat.com> - 2.0.23-1
- Update kexec-tools to 2.0.23
- Rebase makedumpfile to 1.7.0
commit 7de4a0d6c87375d6b980fce323e17e637296c0b0
Author: Tao Liu <ltao(a)redhat.com>
Date: Mon Jan 10 21:51:16 2022 +0800
Set zstd as recommented for kexec-tools
This patch will make zstd as recommended instead of required for
kexec-tools. If zstd command/package is unavaliable, it can failback to invoke
gzip when making kdump initramfs.
Fixes: 0311f6e ("Set zstd as the default compression method for kdump initrd")
Signed-off-by: Tao Liu <ltao(a)redhat.com>
Acked-by: Coiby Xu <coxu(a)redhat.com>
diff --git a/kdump-lib.sh b/kdump-lib.sh
index 1db55fd..ca086d7 100755
--- a/kdump-lib.sh
+++ b/kdump-lib.sh
@@ -31,6 +31,11 @@ is_squash_available()
done
}
+is_zstd_command_available()
+{
+ [[ -x "$(command -v zstd)" ]]
+}
+
perror_exit()
{
derror "$@"
diff --git a/kexec-tools.spec b/kexec-tools.spec
index dffcce0..7419723 100644
--- a/kexec-tools.spec
+++ b/kexec-tools.spec
@@ -70,7 +70,7 @@ Requires: dracut >= 050
Requires: dracut-network >= 050
Requires: dracut-squash >= 050
Requires: ethtool
-Requires: zstd
+Recommends: zstd
Recommends: grubby
BuildRequires: make
BuildRequires: zlib-devel elfutils-devel glib2-devel bzip2-devel ncurses-devel bison flex lzo-devel snappy-devel libzstd-devel
diff --git a/mkdumprd b/mkdumprd
index 9c26ecc..593ec77 100644
--- a/mkdumprd
+++ b/mkdumprd
@@ -432,7 +432,12 @@ done <<< "$(kdump_read_conf)"
handle_default_dump_target
if ! have_compression_in_dracut_args; then
- add_dracut_arg "--compress" "zstd"
+ # Here zstd is set as the default compression method. If squash module
+ # is available for dracut, libzstd will be used by mksquashfs. If
+ # squash module is unavailable, command zstd will be used instead.
+ if is_squash_available || is_zstd_command_available; then
+ add_dracut_arg "--compress" "zstd"
+ fi
fi
if [[ -n $extra_modules ]]; then
diff --git a/mkfadumprd b/mkfadumprd
index 16fdacc..86dfcee 100644
--- a/mkfadumprd
+++ b/mkfadumprd
@@ -62,8 +62,11 @@ if is_squash_available; then
_dracut_isolate_args+=(--add squash)
fi
+# Same as setting zstd in mkdumprd
if ! have_compression_in_dracut_args; then
- _dracut_isolate_args+=(--compress zstd)
+ if is_squash_available || is_zstd_command_available; then
+ _dracut_isolate_args+=(--compress zstd)
+ fi
fi
if ! dracut --force --quiet "${_dracut_isolate_args[@]}" "$@" "$TARGET_INITRD"; then
commit ae0cbdf34a51b6b7f12d11f62d45339130750d01
Author: Coiby Xu <coxu(a)redhat.com>
Date: Fri Jan 7 10:45:40 2022 +0800
fix "kdump: Invalid kdump config option auto_reset_crashkernel" error
kdumpctl only accepts a specified set of options. Add
auto_reset_crashkernel to this set.
Fixes: 73ced7f ("introduce the auto_reset_crashkernel option to kdump.conf")
Signed-off-by: Coiby Xu <coxu(a)redhat.com>
Acked-by: Tao Liu <ltao(a)redhat.com>
diff --git a/kdumpctl b/kdumpctl
index 331af2f..8107487 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -209,7 +209,7 @@ check_config()
ext[234] | minix | btrfs | xfs | nfs | ssh)
config_opt=_target
;;
- sshkey | path | core_collector | kdump_post | kdump_pre | extra_bins | extra_modules | failure_action | default | final_action | force_rebuild | force_no_rebuild | fence_kdump_args | fence_kdump_nodes) ;;
+ sshkey | path | core_collector | kdump_post | kdump_pre | extra_bins | extra_modules | failure_action | default | final_action | force_rebuild | force_no_rebuild | fence_kdump_args | fence_kdump_nodes | auto_reset_crashkernel) ;;
net | options | link_delay | disk_timeout | debug_mem_level | blacklist)
derror "Deprecated kdump config option: $config_opt. Refer to kdump.conf manpage for alternatives."
commit d5c31605f364e258fdef60e8482498941644ad6a
Author: Coiby Xu <coxu(a)redhat.com>
Date: Thu Jan 6 09:48:17 2022 +0800
use grep -s to suppress error messages about nonexistent or unreadable files
When a file doesn't exist or isn't readable, grep complains as follows,
grep: /proc/cmdline: No such file or directory
grep: /etc/kernel/cmdline: No such file or directory
/proc/cmdline doesn't exist when installing package for an OS image and
/etc/kernel/cmdline may not exist if osbuild doesn't want set custom
kernel cmdline.
Use "-s" to suppress the error messages.
Fixes: 0adb0f4 ("try to reset kernel crashkernel when kexec-tools updates the default crashkernel value")
Fixes: ddd428a ("set up kernel crashkernel for osbuild in kernel hook")
Signed-off-by: Coiby Xu <coxu(a)redhat.com>
Acked-by: Tao Liu <ltao(a)redhat.com>
diff --git a/kdumpctl b/kdumpctl
index a17bb34..331af2f 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -1590,7 +1590,7 @@ reset_crashkernel_for_installed_kernel()
exit 1
fi
- if _is_osbuild && ! grep -q crashkernel= /etc/kernel/cmdline; then
+ if _is_osbuild && ! grep -qs crashkernel= /etc/kernel/cmdline; then
reset_crashkernel "--kernel=$_installed_kernel"
return
fi
diff --git a/kexec-tools.spec b/kexec-tools.spec
index 381a13d..dffcce0 100644
--- a/kexec-tools.spec
+++ b/kexec-tools.spec
@@ -261,7 +261,7 @@ mv $RPM_BUILD_ROOT/etc/kdump-adv-conf/kdump_dracut_modules/* $RPM_BUILD_ROOT/%{d
%pre
# save the old default crashkernel values to /tmp/ when upgrading the package
-if ! grep -q "ostree" /proc/cmdline && [ $1 == 2 ] && grep -q get-default-crashkernel /usr/bin/kdumpctl; then
+if ! grep -qs "ostree" /proc/cmdline && [ $1 == 2 ] && grep -q get-default-crashkernel /usr/bin/kdumpctl; then
kdumpctl get-default-crashkernel kdump > /tmp/old_default_crashkernel 2>/dev/null
%ifarch ppc64 ppc64le
kdumpctl get-default-crashkernel fadump > /tmp/old_default_crashkernel_fadump 2>/dev/null
@@ -303,7 +303,7 @@ fi
# try to reset kernel crashkernel value to new default value when upgrading
# the package
-if ! grep -q "ostree" /proc/cmdline && [ $1 == 2 ]; then
+if ! grep -qs "ostree" /proc/cmdline && [ $1 == 2 ]; then
kdumpctl reset-crashkernel-after-update
rm /tmp/old_default_crashkernel 2>/dev/null
%ifarch ppc64 ppc64le
commit 2bd59ee156ee7646e4c9fcacb72667e016e07ffe
Author: Tao Liu <ltao(a)redhat.com>
Date: Thu Jan 6 11:46:54 2022 +0800
kdump-lib.sh: Escape '|' for 'failure_action|default' in is_dump_to_rootfs
The '|' in 'failure_action|default' should be replaced with '\|' when
passed to kdump_get_conf_val function. Because '|' needs to be escaped
to mean OR operation in sed regex, otherwise it will consider
'failure_action|default' as a whole string.
Fixes: ab1ef78 ("kdump-lib.sh: use kdump_get_conf_val to read config values")
v1 -> v2:
Rephased the commit message.
Replaced " with '.
Signed-off-by: Tao Liu <ltao(a)redhat.com>
Acked-by: Coiby Xu <coxu(a)redhat.com>
diff --git a/kdump-lib.sh b/kdump-lib.sh
index 2d0e061..1db55fd 100755
--- a/kdump-lib.sh
+++ b/kdump-lib.sh
@@ -108,7 +108,7 @@ get_block_dump_target()
is_dump_to_rootfs()
{
- [[ $(kdump_get_conf_val "failure_action|default") == dump_to_rootfs ]]
+ [[ $(kdump_get_conf_val 'failure_action\|default') == dump_to_rootfs ]]
}
get_failure_action_target()
commit 0311f6e25bec9994de2c6b156b5a568583aa8aae
Author: Tao Liu <ltao(a)redhat.com>
Date: Wed Jan 5 17:42:12 2022 +0800
Set zstd as the default compression method for kdump initrd
zstd has better compression ratio and time consumption balance.
When no customized compression method specified in kdump.conf,
we will use zstd as the default compression method.
**The test method:
I installed kexec-tools with and without the patch, executing the following
command for 4 times, and calculate the averange time:
$ rm -f /boot/initramfs-*kdump.img && time kdumpctl rebuild && \
ls -ail /boot/initramfs-*kdump.img
**The test result:
Bare metal x86_64 machine:
dracut with squash module
zlib lzo xz lz4 zstd
real 10.6282 11.0398 11.395 8.6424 10.1676
user 9.8932 11.9072 14.2304 2.8286 8.6468
sys 3.523 3.4626 3.6028 3.5 3.4942
size of
kdump.img 30575616 31419392 27102208 36666368 29236224
dracut without squash module
zlib lzo xz lz4 zstd
real 9.509 19.4876 11.6724 9.0338 10.267
user 10.6028 14.516 17.8662 4.0476 9.0936
sys 2.942 2.9184 3.0662 2.9232 3.0662
size of
kdump.img 19247949 19958120 14505056 21112544 17007764
PowerVM hosted ppc64le VM:
dracut with squash module | dracut without sqaush module
zlib zstd | zlib zstd
real 10.6742 10.7572 | 9.7676 10.5722
user 18.754 19.8338 | 20.7932 13.179
sys 1.8358 1.864 | 1.637 1.663
|
size of |
kdump.img 36917248 35467264 | 21441323 19007108
**discussion
zstd has a better compression ratio and time consumption balance.
v1 -> v2:
Use kdump_get_conf_val() to get dracut_args values of kdump.conf
v2 -> v3:
Attached testing benchmark
v3 -> v4:
Re-measured and re-attached the testing benchmark of x86_64 and ppc64le.
Changed regex '.*[[:space:]]' to '(^|[[:space:]])'
v4 -> v5:
Attacked lzo/xz/lz4 testing benchmark.
v5 -> v6:
Add zstd as required in kexec-tools.spec
Hello Coiby, you may use "RELEASE=34 make test-run", for
CONFIG_RD_ZSTD is enabled since fc-cloud-34
Acked-by: Coiby Xu <coxu(a)redhat.com>
Signed-off-by: Tao Liu <ltao(a)redhat.com>
diff --git a/kdump-lib.sh b/kdump-lib.sh
index b28db44..2d0e061 100755
--- a/kdump-lib.sh
+++ b/kdump-lib.sh
@@ -443,6 +443,12 @@ is_wdt_active()
return 1
}
+have_compression_in_dracut_args()
+{
+ [[ "$(kdump_get_conf_val dracut_args)" =~ \
+ (^|[[:space:]])--(gzip|bzip2|lzma|xz|lzo|lz4|zstd|no-compress|compress)([[:space:]]|$) ]]
+}
+
# If "dracut_args" contains "--mount" information, use it
# directly without any check(users are expected to ensure
# its correctness).
diff --git a/kexec-tools.spec b/kexec-tools.spec
index b2a0e20..381a13d 100644
--- a/kexec-tools.spec
+++ b/kexec-tools.spec
@@ -70,6 +70,7 @@ Requires: dracut >= 050
Requires: dracut-network >= 050
Requires: dracut-squash >= 050
Requires: ethtool
+Requires: zstd
Recommends: grubby
BuildRequires: make
BuildRequires: zlib-devel elfutils-devel glib2-devel bzip2-devel ncurses-devel bison flex lzo-devel snappy-devel libzstd-devel
diff --git a/mkdumprd b/mkdumprd
index d87d588..9c26ecc 100644
--- a/mkdumprd
+++ b/mkdumprd
@@ -431,6 +431,10 @@ done <<< "$(kdump_read_conf)"
handle_default_dump_target
+if ! have_compression_in_dracut_args; then
+ add_dracut_arg "--compress" "zstd"
+fi
+
if [[ -n $extra_modules ]]; then
add_dracut_arg "--add-drivers" "$extra_modules"
fi
diff --git a/mkfadumprd b/mkfadumprd
index b890f83..16fdacc 100644
--- a/mkfadumprd
+++ b/mkfadumprd
@@ -62,6 +62,10 @@ if is_squash_available; then
_dracut_isolate_args+=(--add squash)
fi
+if ! have_compression_in_dracut_args; then
+ _dracut_isolate_args+=(--compress zstd)
+fi
+
if ! dracut --force --quiet "${_dracut_isolate_args[@]}" "$@" "$TARGET_INITRD"; then
perror_exit "mkfadumprd: failed to setup '$TARGET_INITRD' with dump capture capability"
fi
commit 0e162120b61c9b29a5ecbe7f3e447484b0a27b39
Author: Coiby Xu <coxu(a)redhat.com>
Date: Mon Dec 13 12:44:14 2021 +0800
update crashkernel-howto
Update crashkernel-howto since crashkernel.default has been removed. The
documentation is also simplified as a result.
Reviewed-by: Pingfan Liu <piliu(a)redhat.com>
Reviewed-by: Philipp Rudo <prudo(a)redhat.com>
Signed-off-by: Coiby Xu <coxu(a)redhat.com>
diff --git a/crashkernel-howto.txt b/crashkernel-howto.txt
index 20f50e0..1ba79ab 100644
--- a/crashkernel-howto.txt
+++ b/crashkernel-howto.txt
@@ -13,13 +13,14 @@ kdump after you updated the `crashkernel=` value or changed the dump target.
Default crashkernel value
=========================
-Latest kernel packages include a `crashkernel.default` file installed in kernel
-modules folder, available as:
+Latest kexec-tools provides "kdumpctl get-default-crashkernel" to retrieve
+the default crashkernel value,
- /usr/lib/modules/<kernel>/crashkernel.default
+ $ echo $(kdumpctl get-default-crashkernel)
+ 1G-4G:192M,4G-64G:256M,64G-102400T:512M
-The content of the file will be taken as the default value of 'crashkernel=', or
-take this file as a reference for setting crashkernel value manually.
+It will be taken as the default value of 'crashkernel=', you can use
+this value as a reference for setting crashkernel value manually.
New installed system
@@ -27,7 +28,7 @@ New installed system
Anaconda is the OS installer which sets all the kernel boot cmdline on a newly
installed system. If kdump is enabled during Anaconda installation, Anaconda
-will use the `crashkernel.default` file as the default `crashkernel=` value on
+will use the default crashkernel value as the default `crashkernel=` value on
the newly installed system.
Users can override the value during Anaconda installation manually.
@@ -36,20 +37,11 @@ Users can override the value during Anaconda installation manually.
Auto update of crashkernel boot parameter
=========================================
-Following context in this section assumes all kernel packages have a
-`crashkernel.default` file bundled, which is true for the latest official kernel
-packages. For kexec-tools behavior with a kernel that doesn't have a
-`crashkernel.default` file, please refer to the “Custom Kernel” section of this
-doc.
-
-When `crashkernel=` is using the default value, kexec-tools will need to update
-the `crashkernel=` value of new installed kernels, since the default value may
-change in new kernel packages.
-
-kexec-tools does so by adding a kernel installation hook, which gets triggered
-every time a new kernel is installed, so kexec-tools can do necessary checks and
-updates.
-
+A new release of kexec-tools could update the default crashkernel value.
+By default, kexec-tools would reset crashkernel to the new default value if it
+detects old default crashkernel value is used by installed kernels. If you don't
+want kexec-tools to update the old default crashkernel to the new default
+crashkernel, you can change auto_reset_crashkernel to no in kdump.conf.
Supported Bootloaders
---------------------
@@ -59,92 +51,13 @@ on `grubby`. If other boot loaders are used, the user will have to update the
`crashkernel=` value manually.
-Updating kernel package
------------------------
-
-When a new version of package kernel is released in the official repository, the
-package will always come with a `crashkernel.default` file bundled. Kexec-tools
-will act with following rules:
-
-If current boot kernel is using the default `crashkernel=` boot param value from
-its `crashkernel.default` file, then kexec-tools will update new installed
-kernel’s `crashkernel=` boot param using the value from the new installed
-kernel’s `crashkernel.default` file. This ensures `crashkernel=` is always using
-the latest default value.
-
-If current boot kernel's `crashkernel=` value is set to a non-default value, the
-new installed kernel simply inherits this value.
-
-On systems using GRUB2 as the bootloader, each kernel has its own boot entry,
-making it possible to set different `crashkernel=` boot param values for
-different kernels. So kexec-tools won’t touch any already installed kernel's
-boot param, only new installed kernel's `crashkernel=` boot param value will be
-updated.
-
-But some utilities like `grub2-mkconfig` and `grubby` can override all boot
-entry's boot params with the boot params value from the GRUB config file
-`/etc/defaults/grub`, so kexec-tools will also update the GRUB config file in
-case old `crashkernel=` value overrides new installed kernel’s boot param.
-
-
-Downgrading kernel package
---------------------------
-
-When upgrading a kernel package, kexec-tools may update the `crashkernel=` value
-in GRUB2 config file to the new value. So when downgrading the kernel package,
-kexec-tools will also try to revert that update by setting GRUB2 config file’s
-`crashkernel=` value back to the default value in the older kernel package. This
-will only occur when the GRUB2 config file is using the default `crashkernel=`
-value.
-
-
-Custom kernel
-=============
-
-To make auto crashkernel update more robust, kexec-tools will try to keep
-tracking the default 'crashkernel=` value with kernels that don’t have a
-`crashkernel.default` file, such kernels are referred to as “custom kernel” in
-this doc. This is only a best-effort support to make it easier debugging and
-testing the system.
-
-When installing a custom kernel that doesn’t have a `crashkernel.default` file,
-the `crashkernel=` value will be simply inherited from the current boot kernel.
-
-When installing a new official kernel package and current boot kernel is a
-custom kernel, since the boot kernel doesn’t have a `crashkernel.default` file,
-kexec-tools will iterate installed kernels and check if the boot kernel
-inherited the default value from any other existing kernels’
-`crashkernel.default` file. If a matching `crashkernel.default` file is found,
-kexec-tools will update the new installed kernel `crashkernel=` boot param using
-the value from the new installed kernel’s `crashkernel.default` file, ensures
-the auto crashkernel value update won’t break over one or two custom kernel
-installations.
-
-It is possible that the auto crashkernel value update will fail when custom
-kernels are used. One example is a custom kernel inheriting the default
-`crashkernel=` value from an older official kernel package, but later that
-kernel package is uninstalled. So when booted with the custom kernel,
-kexec-tools can't determine if the boot kernel is inheriting a default
-`crashkernel=` value from any official build. In such a case, please refer to
-the "Reset crashkernel to default value" section of this doc.
-
-
Reset crashkernel to default value
==================================
kexec-tools only perform the auto update of crashkernel value when it can
confirm the boot kernel's crashkernel value is using its corresponding default
-value or inherited from any installed kernel.
-
-kexec-tools may fail to determine if the boot kernel is using default
-crashkernel value in some use cases:
-- kexec-tools package is absent during a kernel package upgrade, and the new
- kernel package’s `crashkernel.default` value has changed.
-- Custom kernel is used and the kernel it inherits `crashkernel=` value from is
- uninstalled.
-
-So it's recommended to reset the crashkernel value if users have uninstalled
-kexec-tools or using a custom kernel.
+value and auto_reset_crashkernel=yes in kdump.conf. In other cases, the user
+can reset the crashkernel value by themselves.
Reset using kdumpctl
--------------------
@@ -152,21 +65,23 @@ Reset using kdumpctl
To make it easier to reset the `crashkernel=` kernel cmdline to this default
value properly, `kdumpctl` also provides a sub-command:
- `kdumpctl reset-crashkernel [<kernel version>]`
+ `kdumpctl reset-crashkernel [--kernel=path_to_kernel] [--reboot]`
This command will read from the `crashkernel.default` file and reset
bootloader's kernel cmdline to the default value. It will also update bootloader
config if the bootloader has a standalone config file. User will have to reboot
-the machine after this command to make it take effect.
+the machine after this command to make it take effect if --reboot is not specified.
+For ppc64le, an optional "[--fadump=[on|off|nocma]]" can also be specified to toggle
+FADump on/off.
Reset manually
--------------
To reset the crashkernel value manually, it's recommended to use utils like
`grubby`. A one liner script for resetting `crashkernel=` value of all installed
-kernels to current boot kernel's crashkernel.default` is:
+kernels to current boot kernel's crashkernel.default` is:
- grubby --update-kernel ALL --args "$(cat /usr/lib/modules/$(uname -r)/crashkernel.default)"
+ grubby --update-kernel ALL --args "crashkernel=$(kdumpctl get-default-crashkernel)"
Estimate crashkernel
====================
commit ddd428a1d0d72bee2a8459b1a81541bcd0676873
Author: Coiby Xu <coxu(a)redhat.com>
Date: Wed Dec 15 21:45:18 2021 +0800
set up kernel crashkernel for osbuild in kernel hook
osbuild is a tool to build OS images. It uses bwrap to install packages
inside a sandbox/container. Since the kernel package recommends
kexec-tools which in turn recommends grubby, the installation order would
be grubby -> kexec-tools -> kernel. So we can use the kernel hook
92-crashkernel.install provided by kexec-tools to set up kernel
crashkernel for the target OS image. But in osbuild's case, there is no
current running kernel and running `uname -r` in the container/sandbox
actually returns the host kernel release. To set up kernel crashkernel for
the OS image built by osbuild, a different logic is needed.
We will check if kernel hook is running inside the osbuild container
then set up kernel crashkernel only if osbuild hasn't specified a
custome value. osbuild exposes [1] the container=bwrap-osbuild environment
variable. According to [2], the environment variable is not inherited down
the process tree, so we need to check /proc/1/environ to detect this
environment variable to tell if the kernel hook is running inside a
bwrap-osbuild container. After that we need to know if osbuild wants to use
custom crashkernel value. This is done by checking if /etc/kernel/cmdline
has crashkernel set [3]. /etc/kernel/cmdline is written before packages
are installed.
[1] https://github.com/osbuild/osbuild/pull/926
[2] https://systemd.io/CONTAINER_INTERFACE/
[3] https://bugzilla.redhat.com/show_bug.cgi?id=2024976#c5
Reviewed-by: Pingfan Liu <piliu(a)redhat.com>
Reviewed-by: Philipp Rudo <prudo(a)redhat.com>
Signed-off-by: Coiby Xu <coxu(a)redhat.com>
diff --git a/kdumpctl b/kdumpctl
index 66eefa5..a17bb34 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -1576,6 +1576,11 @@ reset_crashkernel_after_update()
done
}
+_is_osbuild()
+{
+ [[ $(sed -n -E 's/.*(^|\s)container=(\S*).*/\2/p' < /proc/1/environ) == bwrap-osbuild ]]
+}
+
reset_crashkernel_for_installed_kernel()
{
local _installed_kernel _running_kernel _crashkernel _crashkernel_running
@@ -1585,6 +1590,11 @@ reset_crashkernel_for_installed_kernel()
exit 1
fi
+ if _is_osbuild && ! grep -q crashkernel= /etc/kernel/cmdline; then
+ reset_crashkernel "--kernel=$_installed_kernel"
+ return
+ fi
+
if ! _running_kernel=$(_get_current_running_kernel_path); then
derror "Couldn't find current running kernel"
exit
commit 5e8c751c39a5ec9d10009cba1c2bd554a5763b90
Author: Coiby Xu <coxu(a)redhat.com>
Date: Thu Dec 2 17:19:50 2021 +0800
reset kernel crashkernel for the special case where the kernel is updated right after kexec-tools
When kexec-tools updates the default crashkernel value, it will try to
reset the existing installed kernels including the currently running
kernel. So the running kernel could have different kernel cmdline
parameters from /proc/cmdline. When installing a kernel after updating
kexec-tools, /usr/lib/kernel/install.d/20-grub.install would be called
by kernel-install [1] which would use /proc/cmdline to set up new kernel's
cmdline. To address this special case, reset the new kernel's crashkernel
and fadump value to the value that would be used by running kernel after
rebooting by the installation hook. One side effect of this commit is it
would reset the installed kernel's crashkernel even currently running kernel
don't use the default crashkernel value after rebooting. But I think this
side effect is a benefit for the user.
The implementation depends on kernel-install which run the scripts in
/usr/lib/kernel/install.d passing the following arguments,
add KERNEL-VERSION $BOOT/MACHINE-ID/KERNEL-VERSION/ KERNEL-IMAGE [INITRD-FILE ...]
An concrete example is given as follows,
add 5.11.12-300.fc34.x86_64 /boot/e986846f63134c7295458cf36300ba5b/5.11.12-300.fc34.x86_64 /lib/modules/5.11.12-300.fc34.x86_64/vmlinuz
kernel-install could be started by the kernel package's RPM scriplet [2].
As mentioned in previous commit "try to reset kernel crashkernel when
kexec-tools updates the default crashkernel value", kdumpctl has difficulty
running in RPM scriptlet fore CoreOS. But rpm-ostree ignores all kernel hooks,
there is no need to disable the kernel hook for CoreOS/Atomic/Silverblue. But a
collaboration between rpm-ostree and kexec-tools is needed [3] to take care
of this special case.
Note the crashkernel.default support is dropped.
[1] https://www.freedesktop.org/software/systemd/man/kernel-install.html
[2] https://src.fedoraproject.org/rpms/kernel/blob/rawhide/f/kernel.spec#_2680
[3] https://github.com/coreos/rpm-ostree/issues/2894
Reviewed-by: Pingfan Liu <piliu(a)redhat.com>
Reviewed-by: Philipp Rudo <prudo(a)redhat.com>
Signed-off-by: Coiby Xu <coxu(a)redhat.com>
diff --git a/92-crashkernel.install b/92-crashkernel.install
index 78365ff..1d67a13 100755
--- a/92-crashkernel.install
+++ b/92-crashkernel.install
@@ -5,142 +5,9 @@ KERNEL_VERSION="$2"
KDUMP_INITRD_DIR_ABS="$3"
KERNEL_IMAGE="$4"
-grub_etc_default="/etc/default/grub"
-
-ver_lt() {
- [[ "$(echo -e "$1\n$2" | sort -V)" == $1$'\n'* ]] && [[ $1 != "$2" ]]
-}
-
-# Read crashkernel= value in /etc/default/grub
-get_grub_etc_ck() {
- [[ -e $grub_etc_default ]] && \
- sed -n -e "s/^GRUB_CMDLINE_LINUX=.*\(crashkernel=[^\ \"]*\)[\ \"].*$/\1/p" $grub_etc_default
-}
-
-# Read crashkernel.default value of specified kernel
-get_ck_default() {
- ck_file="/usr/lib/modules/$1/crashkernel.default"
- [[ -f "$ck_file" ]] && cat "$ck_file"
-}
-
-# Iterate installed kernels, find the kernel with the highest version that has a
-# valid crashkernel.default file, exclude current installing/removing kernel
-#
-# $1: a string representing a crashkernel= cmdline. If given, will also check the
-# content of crashkernel.default, only crashkernel.default with the same value will match
-get_highest_ck_default_kver() {
- for kernel in $(find /usr/lib/modules -maxdepth 1 -mindepth 1 -printf "%f\n" | sort --version-sort -r); do
- [[ $kernel == "$KERNEL_VERSION" ]] && continue
- [[ -s "/usr/lib/modules/$kernel/crashkernel.default" ]] || continue
-
- echo "$kernel"
- return 0
- done
-
- return 1
-}
-
-set_grub_ck() {
- sed -i -e "s/^\(GRUB_CMDLINE_LINUX=.*\)crashkernel=[^\ \"]*\([\ \"].*\)$/\1$1\2/" "$grub_etc_default"
-}
-
-# Set specified kernel's crashkernel cmdline value
-set_kernel_ck() {
- kernel=$1
- ck_cmdline=$2
-
- entry=$(grubby --info ALL | grep "^kernel=.*$kernel")
- entry=${entry#kernel=}
- entry=${entry#\"}
- entry=${entry%\"}
-
- if [[ -z "$entry" ]]; then
- echo "$0: failed to find boot entry for kernel $kernel"
- return 1
- fi
-
- [[ -f /etc/zipl.conf ]] && zipl_arg="--zipl"
- grubby --args "$ck_cmdline" --update-kernel "$entry" $zipl_arg
- [[ $zipl_arg ]] && zipl > /dev/null ||:
-}
-
case "$COMMAND" in
add)
- # - If current boot kernel is using default crashkernel value, update
- # installing kernel's crashkernel value to its default value,
- # - If intalling a higher version kernel, and /etc/default/grub's
- # crashkernel value is using default value, update it to installing
- # kernel's default value.
- inst_ck_default=$(get_ck_default "$KERNEL_VERSION")
- # If installing kernel doesn't have crashkernel.default, just exit.
- [[ -z "$inst_ck_default" ]] && exit 0
-
- boot_kernel=$(uname -r)
- boot_ck_cmdline=$(sed -n -e "s/^.*\(crashkernel=\S*\).*$/\1/p" /proc/cmdline)
- highest_ck_default_kver=$(get_highest_ck_default_kver)
- highest_ck_default=$(get_ck_default "$highest_ck_default_kver")
-
- # Try update /etc/default/grub if present, else grub2-mkconfig could
- # override crashkernel value.
- grub_etc_ck=$(get_grub_etc_ck)
- if [[ -n "$grub_etc_ck" ]]; then
- if [[ -z "$highest_ck_default_kver" ]]; then
- # None of installed kernel have a crashkernel.default,
- # check for 'crashkernel=auto' in case of legacy kernel
- [[ "$grub_etc_ck" == "crashkernel=auto" ]] && \
- set_grub_ck "$inst_ck_default"
- else
- # There is a valid crashkernel.default, check if installing kernel
- # have a higher version and grub config is using default value
- ver_lt "$highest_ck_default_kver" "$KERNEL_VERSION" && \
- [[ "$grub_etc_ck" == "$highest_ck_default" ]] && \
- [[ "$grub_etc_ck" != "$inst_ck_default" ]] && \
- set_grub_ck "$inst_ck_default"
- fi
- fi
-
- # Exit if crashkernel is not used in current cmdline
- [[ -z $boot_ck_cmdline ]] && exit 0
-
- # Get current boot kernel's default value
- boot_ck_default=$(get_ck_default "$boot_kernel")
- if [[ $boot_ck_cmdline == "crashkernel=auto" ]]; then
- # Legacy RHEL kernel defaults to "auto"
- boot_ck_default="$boot_ck_cmdline"
- fi
-
- # If boot kernel doesn't have a crashkernel.default, check
- # if it's using any installed kernel's crashkernel.default
- if [[ -z $boot_ck_default ]]; then
- [[ $(get_highest_ck_default_kver "$boot_ck_cmdline") ]] && boot_ck_default="$boot_ck_cmdline"
- fi
-
- # If boot kernel is using a default crashkernel, update
- # installing kernel's crashkernel to new default value
- if [[ "$boot_ck_cmdline" != "$inst_ck_default" ]] && [[ "$boot_ck_cmdline" == "$boot_ck_default" ]]; then
- set_kernel_ck "$KERNEL_VERSION" "$inst_ck_default"
- fi
-
- exit 0
- ;;
-remove)
- # If grub default value is upgraded when this kernel was installed, try downgrade it
- grub_etc_ck=$(get_grub_etc_ck)
- [[ $grub_etc_ck ]] || exit 0
-
- removing_ck_conf=$(get_ck_default "$KERNEL_VERSION")
- [[ $removing_ck_conf ]] || exit 0
-
- highest_ck_default_kver=$(get_highest_ck_default_kver) || exit 0
- highest_ck_default=$(get_ck_default "$highest_ck_default_kver")
- [[ $highest_ck_default ]] || exit 0
-
- if ver_lt "$highest_ck_default_kver" "$KERNEL_VERSION"; then
- if [[ $grub_etc_ck == "$removing_ck_conf" ]] && [[ $grub_etc_ck != "$highest_ck_default" ]]; then
- set_grub_ck "$highest_ck_default"
- fi
- fi
-
+ kdumpctl reset-crashkernel-for-installed_kernel "$KERNEL_VERSION"
exit 0
;;
esac
diff --git a/kdumpctl b/kdumpctl
index 07e6f8b..66eefa5 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -1576,6 +1576,32 @@ reset_crashkernel_after_update()
done
}
+reset_crashkernel_for_installed_kernel()
+{
+ local _installed_kernel _running_kernel _crashkernel _crashkernel_running
+ local _dump_mode_running _fadump_val_running
+
+ if ! _installed_kernel=$(_find_kernel_path_by_release "$1"); then
+ exit 1
+ fi
+
+ if ! _running_kernel=$(_get_current_running_kernel_path); then
+ derror "Couldn't find current running kernel"
+ exit
+ fi
+
+ _crashkernel=$(get_grub_kernel_boot_parameter "$_installed_kernel" crashkernel)
+ _crashkernel_running=$(get_grub_kernel_boot_parameter "$_running_kernel" crashkernel)
+ _dump_mode_running=$(get_dump_mode_by_kernel "$_running_kernel")
+ _fadump_val_running=$(get_grub_kernel_boot_parameter "$_kernel" fadump)
+
+ if [[ $_crashkernel != "$_crashkernel_running" ]]; then
+ if _update_grub "$_installed_kernel" "$_crashkernel_running" "$_dump_mode_running" "$_fadump_val_running"; then
+ echo "kexec-tools has reset $_installed_kernel to use the new default crashkernel value $_crashkernel_running"
+ fi
+ fi
+}
+
if [[ ! -f $KDUMP_CONFIG_FILE ]]; then
derror "Error: No kdump config file found!"
exit 1
@@ -1641,6 +1667,11 @@ main()
reset_crashkernel_after_update
fi
;;
+ reset-crashkernel-for-installed_kernel)
+ if [[ $(kdump_get_conf_val auto_reset_crashkernel) != no ]]; then
+ reset_crashkernel_for_installed_kernel "$2"
+ fi
+ ;;
*)
dinfo $"Usage: $0 {estimate|start|stop|status|restart|reload|rebuild|reset-crashkernel|propagate|showmem}"
exit 1
commit 0adb0f4a8c4c69ba54171f0113a4fbfc1729900f
Author: Coiby Xu <coxu(a)redhat.com>
Date: Wed Dec 1 15:33:13 2021 +0800
try to reset kernel crashkernel when kexec-tools updates the default crashkernel value
kexec-tools could update the default crashkernel value.
When auto_reset_crashkernel=yes, reset kernel to new crashkernel
value in the following two cases,
- crashkernel=auto is found in the kernel cmdline
- the kernel crashkernel was previously set by kexec-tools i.e.
the kernel is using old default crashkernel value
To tell if the user is using a custom value for the kernel crashkernel
or not, we assume the user would never use the default crashkernel value
as custom value. When kexec-tools gets updated,
1. save the default crashkernel value of the older package to
/tmp/crashkernel (for POWER system, /tmp/crashkernel_fadump is saved
as well).
2. If auto_reset_crashkernel=yes, iterate all installed kernels.
For each kernel, compare its crashkernel value with the old
default crashkernel and reset it if yes
The implementation makes use of two RPM scriptlets [2],
- %pre is run before a package is installed so we can use it to save
old default crashkernel value
- %post is run after a package installed so we can use it to try to reset
kernel crashkernel
There are several problems when running kdumpctl in the RPM scripts
for CoreOS/Atomic/Silverblue, for example, the lock can't be acquired by
kdumpctl, "rpm-ostree kargs" can't be run and etc.. So don't enable this
feature for CoreOS/Atomic/Silverblue.
Note latest shellcheck (0.8.0) gives false positives about the
associative array as of this commit. And Fedora's shellcheck is 0.7.2
and can't even correctly parse the shell code because of the associative
array.
[1] https://github.com/koalaman/shellcheck/issues/2399
[2] https://docs.fedoraproject.org/en-US/packaging-guidelines/Scriptlets/
Reviewed-by: Pingfan Liu <piliu(a)redhat.com>
Reviewed-by: Philipp Rudo <prudo(a)redhat.com>
Signed-off-by: Coiby Xu <coxu(a)redhat.com>
diff --git a/kdumpctl b/kdumpctl
index 1518e5c..07e6f8b 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -1546,6 +1546,36 @@ reset_crashkernel()
fi
}
+# shellcheck disable=SC2154 # false positive when dereferencing an array
+reset_crashkernel_after_update()
+{
+ local _kernel _crashkernel _dump_mode _fadump_val _old_default_crashkernel _new_default_crashkernel
+ declare -A _crashkernel_vals
+
+ _crashkernel_vals[old_kdump]=$(cat /tmp/old_default_crashkernel 2> /dev/null)
+ _crashkernel_vals[old_fadump]=$(cat /tmp/old_default_crashkernel_fadump 2> /dev/null)
+ _crashkernel_vals[new_kdump]=$(get_default_crashkernel kdump)
+ _crashkernel_vals[new_fadump]=$(get_default_crashkernel fadump)
+
+ for _kernel in $(_get_all_kernels_from_grubby); do
+ _crashkernel=$(get_grub_kernel_boot_parameter "$_kernel" crashkernel)
+ if [[ $_crashkernel == auto ]]; then
+ reset_crashkernel "--kernel=$_kernel"
+ elif [[ -n $_crashkernel ]]; then
+ _dump_mode=$(get_dump_mode_by_kernel "$_kernel")
+ _old_default_crashkernel=${_crashkernel_vals[old_${_dump_mode}]}
+ _new_default_crashkernel=${_crashkernel_vals[new_${_dump_mode}]}
+ if [[ $_crashkernel == "$_old_default_crashkernel" ]] &&
+ [[ $_new_default_crashkernel != "$_old_default_crashkernel" ]]; then
+ _fadump_val=$(get_grub_kernel_boot_parameter "$_kernel" fadump)
+ if _update_grub "$_kernel" "$_new_default_crashkernel" "$_dump_mode" "$_fadump_val"; then
+ echo "For kernel=$_kernel, crashkernel=$_new_default_crashkernel now."
+ fi
+ fi
+ fi
+ done
+}
+
if [[ ! -f $KDUMP_CONFIG_FILE ]]; then
derror "Error: No kdump config file found!"
exit 1
@@ -1606,6 +1636,11 @@ main()
shift
reset_crashkernel "$@"
;;
+ reset-crashkernel-after-update)
+ if [[ $(kdump_get_conf_val auto_reset_crashkernel) != no ]]; then
+ reset_crashkernel_after_update
+ fi
+ ;;
*)
dinfo $"Usage: $0 {estimate|start|stop|status|restart|reload|rebuild|reset-crashkernel|propagate|showmem}"
exit 1
diff --git a/kexec-tools.spec b/kexec-tools.spec
index ab7f41f..b2a0e20 100644
--- a/kexec-tools.spec
+++ b/kexec-tools.spec
@@ -258,6 +258,15 @@ chmod 755 $RPM_BUILD_ROOT/etc/kdump-adv-conf/kdump_dracut_modules/99zz-fadumpini
mkdir -p $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/
mv $RPM_BUILD_ROOT/etc/kdump-adv-conf/kdump_dracut_modules/* $RPM_BUILD_ROOT/%{dracutlibdir}/modules.d/
+%pre
+# save the old default crashkernel values to /tmp/ when upgrading the package
+if ! grep -q "ostree" /proc/cmdline && [ $1 == 2 ] && grep -q get-default-crashkernel /usr/bin/kdumpctl; then
+ kdumpctl get-default-crashkernel kdump > /tmp/old_default_crashkernel 2>/dev/null
+%ifarch ppc64 ppc64le
+ kdumpctl get-default-crashkernel fadump > /tmp/old_default_crashkernel_fadump 2>/dev/null
+%endif
+fi
+
%post
# Initial installation
%systemd_post kdump.service
@@ -291,6 +300,19 @@ then
mv /etc/sysconfig/kdump.new /etc/sysconfig/kdump
fi
+# try to reset kernel crashkernel value to new default value when upgrading
+# the package
+if ! grep -q "ostree" /proc/cmdline && [ $1 == 2 ]; then
+ kdumpctl reset-crashkernel-after-update
+ rm /tmp/old_default_crashkernel 2>/dev/null
+%ifarch ppc64 ppc64le
+ rm /tmp/old_default_crashkernel_fadump 2>/dev/null
+%endif
+ # dnf would complain about the exit code not being 0. To keep it happy,
+ # always return 0
+ :
+fi
+
%postun
%systemd_postun_with_restart kdump.service
commit 73ced7f451a725f4a2f7db5f0e1c6e7918538204
Author: Coiby Xu <coxu(a)redhat.com>
Date: Mon Nov 15 15:45:59 2021 +0800
introduce the auto_reset_crashkernel option to kdump.conf
This option will determine whether to reset kernel crashkernel
to new default value or not when kexec-tools updates the default
crashkernel value and existing kernels using the old default kernel
crashkernel value. Default to yes.
Reviewed-by: Pingfan Liu <piliu(a)redhat.com>
Reviewed-by: Philipp Rudo <prudo(a)redhat.com>
Signed-off-by: Coiby Xu <coxu(a)redhat.com>
diff --git a/kdump.conf b/kdump.conf
index dea2e94..d4fc78b 100644
--- a/kdump.conf
+++ b/kdump.conf
@@ -11,6 +11,12 @@
#
# Supported options:
#
+# auto_reset_crashkernel <yes|no>
+# - whether to reset kernel crashkernel to new default value
+# or not when kexec-tools updates the default crashkernel value and
+# existing kernels using the old default kernel crashkernel value.
+# The default value is yes.
+#
# raw <partition>
# - Will dd /proc/vmcore into <partition>.
# Use persistent device names for partition devices,
@@ -170,6 +176,7 @@
#ssh user(a)my.server.com
#ssh user@2001:db8::1:2:3:4
#sshkey /root/.ssh/kdump_id_rsa
+auto_reset_crashkernel yes
path /var/crash
core_collector makedumpfile -l --message-level 7 -d 31
#core_collector scp
diff --git a/kdump.conf.5 b/kdump.conf.5
index 6e6cafa..e3e9900 100644
--- a/kdump.conf.5
+++ b/kdump.conf.5
@@ -26,6 +26,12 @@ understand how this configuration file affects the behavior of kdump.
.SH OPTIONS
+.B auto_reset_crashkernel <yes|no>
+.RS
+determine whether to reset kernel crashkernel to new default value
+or not when kexec-tools updates the default crashkernel value and
+existing kernels using the old default kernel crashkernel value
+
.B raw <partition>
.RS
Will dd /proc/vmcore into <partition>. Use persistent device names for
commit 140da74a340f872b2579fc75b50a36fe7015c0ba
Author: Coiby Xu <coxu(a)redhat.com>
Date: Wed Dec 1 13:39:40 2021 +0800
rewrite reset_crashkernel to support fadump and to used by RPM scriptlet
Rewrite kdumpctl reset-crashkernel KERNEL_PATH as
kdumpctl reset-crashkernel [--fadump=[on|off|nocma]] [--kernel=path_to_kernel] [--reboot]
This interface would reset a specific kernel to the default crashkernel value
given the kernel path. And it also supports grubby's syntax so there are the
following special cases,
- if --kernel not specified,
- use KDUMP_KERNELVER if it's defined in /etc/sysconfig/kdump
- otherwise use current running kernel, i.e. `uname -r`
- if --kernel=DEFAULT, the default boot kernel is chosen
- if --kernel=ALL, all kernels would have its crashkernel reset to the
default value and the /etc/default/grub is updated as well
--fadump=[on|off|nocma] toggles fadump on/off for the kernel provided
in KERNEL_PATH. If --fadump is omitted, the dump mode is determined by
parsing the kernel command line for the kernel(s) to update.
CoreOS/Atomic/Silverblue needs to be treated as a special case because,
- "rpm-ostree kargs" is used to manage kernel command line parameters
so --kernel doesn't make sense and there is no need to find current
running kernel
- "rpm-ostree kargs" itself would prompt the user to reboot the system
after modify the kernel command line parameter
- POWER is not supported so we can assume the dump mode is always kdump
This interface will also be called by kexec-tools RPM scriptlets [1]
to reset crashkernel.
Note the support of crashkenrel.default is dropped.
[1] https://docs.fedoraproject.org/en-US/packaging-guidelines/Scriptlets/
Reviewed-by: Pingfan Liu <piliu(a)redhat.com>
Reviewed-by: Philipp Rudo <prudo(a)redhat.com>
Signed-off-by: Coiby Xu <coxu(a)redhat.com>
diff --git a/kdumpctl b/kdumpctl
index dd87693..1518e5c 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -1355,38 +1355,194 @@ _get_current_running_kernel_path()
fi
}
-reset_crashkernel()
+_update_grub()
{
- local kernel=$1 entry crashkernel_default
- local grub_etc_default="/etc/default/grub"
+ local _kernel_path=$1 _crashkernel=$2 _dump_mode=$3 _fadump_val=$4
- [[ -z $kernel ]] && kernel=$(uname -r)
- crashkernel_default=$(cat "/usr/lib/modules/$kernel/crashkernel.default" 2> /dev/null)
+ if is_atomic; then
+ if rpm-ostree kargs | grep -q "crashkernel="; then
+ rpm-ostree kargs --replace="crashkernel=$_crashkernel"
+ else
+ rpm-ostree kargs --append="crashkernel=$_crashkernel"
+ fi
+ else
+ [[ -f /etc/zipl.conf ]] && zipl_arg="--zipl"
+ grubby --args "crashkernel=$_crashkernel" --update-kernel "$_kernel_path" $zipl_arg
+ if [[ $_dump_mode == kdump ]]; then
+ grubby --remove-args="fadump" --update-kernel "$_kernel_path"
+ else
+ grubby --args="fadump=$_fadump_val" --update-kernel "$_kernel_path"
+ fi
+ fi
+ [[ $zipl_arg ]] && zipl > /dev/null
+}
- if [[ -z $crashkernel_default ]]; then
- derror "$kernel doesn't have a crashkernel.default"
- exit 1
+_valid_grubby_kernel_path()
+{
+ [[ -n "$1" ]] && grubby --info="$1" > /dev/null 2>&1
+}
+
+_get_all_kernels_from_grubby()
+{
+ local _kernels _line _kernel_path _grubby_kernel_path=$1
+
+ for _line in $(grubby --info "$_grubby_kernel_path" | grep "^kernel="); do
+ _kernel_path=$(_filter_grubby_kernel_str "$_line")
+ _kernels="$_kernels $_kernel_path"
+ done
+ echo -n "$_kernels"
+}
+
+GRUB_ETC_DEFAULT="/etc/default/grub"
+# modify the kernel command line parameter in default grub conf
+#
+# $1: the name of the kernel command line parameter
+# $2: new value. If empty, the parameter would be removed
+_update_kernel_cmdline_in_grub_etc_default()
+{
+ local _para=$1 _val=$2 _para_val _regex
+
+ if [[ -n $_val ]]; then
+ _para_val="$_para=$_val"
fi
+ _regex='^(GRUB_CMDLINE_LINUX=.*)([[:space:]"])'"$_para"'=[^[:space:]"]*(.*)$'
+ if grep -q -E "$_regex" "$GRUB_ETC_DEFAULT"; then
+ sed -i -E 's/'"$_regex"'/\1\2'"$_para_val"'\3/' "$GRUB_ETC_DEFAULT"
+ elif [[ -n $_para_val ]]; then
+ # If the kernel parameter doesn't exist, put it in the first
+ sed -i -E 's/^(GRUB_CMDLINE_LINUX=")/\1'"$_para_val"' /' "$GRUB_ETC_DEFAULT"
+ fi
+}
+
+reset_crashkernel()
+{
+ local _opt _val _dump_mode _fadump_val _reboot _grubby_kernel_path _kernel _kernels
+ local _old_crashkernel _new_crashkernel _new_dump_mode _crashkernel_changed
+ local _new_fadump_val _old_fadump_val _what_is_updated
+
+ for _opt in "$@"; do
+ case "$_opt" in
+ --fadump=*)
+ _val=${_opt#*=}
+ if _dump_mode=$(get_dump_mode_by_fadump_val $_val); then
+ _fadump_val=$_val
+ else
+ derror "failed to determine dump mode"
+ exit
+ fi
+ ;;
+ --kernel=*)
+ _val=${_opt#*=}
+ if ! _valid_grubby_kernel_path $_val; then
+ derror "Invalid $_opt, please specify a valid kernel path, ALL or DEFAULT"
+ exit
+ fi
+ _grubby_kernel_path=$_val
+ ;;
+ --reboot)
+ _reboot=yes
+ ;;
+ *)
+ derror "$_opt not recognized"
+ exit 1
+ ;;
+ esac
+ done
+
+ # 1. CoreOS uses "rpm-ostree kargs" instead of grubby to manage kernel command
+ # line. --kernel=ALL doesn't make sense for CoreOS.
+ # 2. CoreOS doesn't support POWER so the dump mode is always kdump.
+ # 3. "rpm-ostree kargs" would prompt the user to reboot the system after
+ # modifying the kernel command line so there is no need for kexec-tools
+ # to repeat it.
if is_atomic; then
- if rpm-ostree kargs | grep -q "crashkernel="; then
- rpm-ostree kargs --replace="crashkernel=$crashkernel_default"
- else
- rpm-ostree kargs --append="crashkernel=$crashkernel_default"
+ _old_crashkernel=$(rpm-ostree kargs | sed -n -E 's/.*(^|\s)crashkernel=(\S*).*/\2/p')
+ _new_dump_mode=kdump
+ _new_crashkernel=$(kdump_get_arch_recommend_crashkernel "$_new_dump_mode")
+ if [[ $_old_crashkernel != "$_new_crashkernel" ]]; then
+ _update_grub "" "$_new_crashkernel" "$_new_dump_mode" ""
+ if [[ $_reboot == yes ]]; then
+ systemctl reboot
+ fi
fi
+ return
+ fi
+
+ # For non-ppc64le systems, the dump mode is always kdump since only ppc64le
+ # has FADump.
+ if [[ -z $_dump_mode && $(uname -m) != ppc64le ]]; then
+ _dump_mode=kdump
+ _fadump_val=off
+ fi
+
+ # If the dump mode is determined, we can also know the default crashkernel value
+ if [[ -n $_dump_mode ]]; then
+ _crashkernel=$(kdump_get_arch_recommend_crashkernel "$_dump_mode")
+ fi
+
+ # If --kernel-path=ALL, update GRUB_CMDLINE_LINUX in /etc/default/grub.
+ #
+ # An exception case is when the ppc64le user doesn't specify the fadump value.
+ # In this case, the dump mode would be determined by parsing the kernel
+ # command line of the kernel(s) to be updated thus don't update GRUB_CMDLINE_LINUX.
+ #
+ # The following code has been simplified because of what has been done early,
+ # - set the dump mode as kdump for non-ppc64le cases
+ # - retrieved the default crashkernel value for given dump mode
+ if [[ $_grubby_kernel_path == ALL && -n $_dump_mode ]]; then
+ _update_kernel_cmdline_in_grub_etc_default crashkernel "$_crashkernel"
+ # remove the fadump if fadump is disabled
+ [[ $_fadump_val == off ]] && _fadump_val=""
+ _update_kernel_cmdline_in_grub_etc_default fadump "$_fadump_val"
+ fi
+
+ # If kernel-path not specified, either
+ # - use KDUMP_KERNELVER if it's defined
+ # - use current running kernel
+ if [[ -z $_grubby_kernel_path ]]; then
+ if [[ -z $KDUMP_KERNELVER ]] ||
+ ! _kernel_path=$(_find_kernel_path_by_release "$KDUMP_KERNELVER"); then
+ if ! _kernel_path=$(_get_current_running_kernel_path); then
+ derror "no running kernel found"
+ exit 1
+ fi
+ fi
+ _kernels=$_kernel_path
else
- entry=$(grubby --info ALL | grep "^kernel=.*$kernel")
- entry=${entry#kernel=}
- entry=${entry#\"}
- entry=${entry%\"}
+ _kernels=$(_get_all_kernels_from_grubby "$_grubby_kernel_path")
+ fi
- if [[ -f $grub_etc_default ]]; then
- sed -i -e "s/^\(GRUB_CMDLINE_LINUX=.*\)crashkernel=[^\ \"]*\([\ \"].*\)$/\1$crashkernel_default\2/" "$grub_etc_default"
+ for _kernel in $_kernels; do
+ if [[ -z $_dump_mode ]]; then
+ _new_dump_mode=$(get_dump_mode_by_kernel "$_kernel")
+ _new_crashkernel=$(kdump_get_arch_recommend_crashkernel "$_new_dump_mode")
+ _new_fadump_val=$(get_grub_kernel_boot_parameter "$_kernel" fadump)
+ else
+ _new_dump_mode=$_dump_mode
+ _new_crashkernel=$_crashkernel
+ _new_fadump_val=$_fadump_val
fi
- [[ -f /etc/zipl.conf ]] && zipl_arg="--zipl"
- grubby --args "$crashkernel_default" --update-kernel "$entry" $zipl_arg
- [[ $zipl_arg ]] && zipl > /dev/null
+ _old_crashkernel=$(get_grub_kernel_boot_parameter "$_kernel" crashkernel)
+ _old_fadump_val=$(get_grub_kernel_boot_parameter "$_kernel" fadump)
+ if [[ $_old_crashkernel != "$_new_crashkernel" || $_old_fadump_val != "$_new_fadump_val" ]]; then
+ _update_grub "$_kernel" "$_new_crashkernel" "$_new_dump_mode" "$_new_fadump_val"
+ if [[ $_reboot != yes ]]; then
+ if [[ $_old_crashkernel != "$_new_crashkernel" ]]; then
+ _what_is_updated="Updated crashkernel=$_new_crashkernel"
+ else
+ # This case happens only when switching between fadump=on and fadump=nocma
+ _what_is_updated="Updated fadump=$_new_fadump_val"
+ fi
+ dwarn "$_what_is_updated for kernel=$_kernel. Please reboot the system for the change to take effect."
+ fi
+ _crashkernel_changed=yes
+ fi
+ done
+
+ if [[ $_reboot == yes && $_crashkernel_changed == yes ]]; then
+ reboot
fi
}
@@ -1447,7 +1603,8 @@ main()
get_default_crashkernel "$2"
;;
reset-crashkernel)
- reset_crashkernel "$2"
+ shift
+ reset_crashkernel "$@"
;;
*)
dinfo $"Usage: $0 {estimate|start|stop|status|restart|reload|rebuild|reset-crashkernel|propagate|showmem}"
diff --git a/kdumpctl.8 b/kdumpctl.8
index 74be062..067117b 100644
--- a/kdumpctl.8
+++ b/kdumpctl.8
@@ -50,14 +50,19 @@ Estimate a suitable crashkernel value for current machine. This is a
best-effort estimate. It will print a recommanded crashkernel value
based on current kdump setup, and list some details of memory usage.
.TP
-.I reset-crashkernel [KERNEL]
-Reset crashkernel value to default value. kdumpctl will try to read
-from /usr/lib/modules/<KERNEL>/crashkernel.default and reset specified
-kernel's crashkernel cmdline value. If no kernel is
-specified, will reset current running kernel's crashkernel value.
-If /usr/lib/modules/<KERNEL>/crashkernel.default doesn't exist, will
-simply exit return 1.
+.I reset-crashkernel [--kernel=path_to_kernel] [--reboot]
+Reset crashkernel to default value recommended by kexec-tools. If no kernel
+is specified, will reset KDUMP_KERNELVER if it's defined in /etc/sysconfig/kdump
+or current running kernel's crashkernel value if KDUMP_KERNELVER is empty. You can
+also specify --kernel=ALL and --kernel=DEFAULT which have the same meaning as
+grubby's kernel-path=ALL and kernel-path=DEFAULT. ppc64le supports FADump and
+supports an additonal [--fadump=[on|off|nocma]] parameter to toggle FADump
+on/off.
+Note: The memory requirements for kdump varies heavily depending on the
+used hardware and system configuration. Thus the recommended
+crashkernel might not work for your specific setup. Please test if
+kdump works after resetting the crashkernel value.
.SH "SEE ALSO"
.BR kdump.conf (5),
commit 12ecbce359adb621da3e65fed689632a39599ce6
Author: Coiby Xu <coxu(a)redhat.com>
Date: Mon Dec 13 10:57:13 2021 +0800
fix incorrect usage of rpm-ostree to update kernel command line parameters
CoreOS/Atomic/Silverblue use "rpm-ostree kargs" to manage kernel command
line parameters.
Fixes: 86130ec ("kdumpctl: Add kdumpctl reset-crashkernel")
Reviewed-by: Pingfan Liu <piliu(a)redhat.com>
Reviewed-by: Philipp Rudo <prudo(a)redhat.com>
Signed-off-by: Coiby Xu <coxu(a)redhat.com>
diff --git a/kdumpctl b/kdumpctl
index 2ace803..dd87693 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -1370,9 +1370,9 @@ reset_crashkernel()
if is_atomic; then
if rpm-ostree kargs | grep -q "crashkernel="; then
- rpm-ostree --replace="crashkernel=$crashkernel_default"
+ rpm-ostree kargs --replace="crashkernel=$crashkernel_default"
else
- rpm-ostree --append="crashkernel=$crashkernel_default"
+ rpm-ostree kargs --append="crashkernel=$crashkernel_default"
fi
else
entry=$(grubby --info ALL | grep "^kernel=.*$kernel")
commit 945cbbd59b34739c4a6b2f228c33f76e2981a18a
Author: Coiby Xu <coxu(a)redhat.com>
Date: Tue Dec 7 15:16:07 2021 +0800
add helper functions to get kernel path by kernel release and the path of current running kernel
grubby --info=kernel-path or --add-kernel=kernel-path accepts a kernel
path (e.g. /boot/vmlinuz-5.14.14-200.fc34.x86_64) instead of kernel release
(e.g 5.14.14-200.fc34.x86_64). So we need to know the kernel path given
a kernel release. Although for Fedora/RHEL, the kernel path is
"/boot/vmlinuz-<KERNEL_RELEASE>", a path kernel could also be
/boot/<machine-id>/<KERNEL_RELEASE>/vmlinuz. So the most reliable way to
find the kernel path given a kernel release is to use "grubby --info".
For osbuild, a kernel path may not yet exist but it's valid for
"grubby --update-kernel=KERNEL_PATH". For example, "grubby -info" may
output something as follows,
index=0
kernel="/var/cache/osbuild-worker/osbuild-store/tmp/tmp2prywdy5object/tree/boot/vmlinuz-5.15.10-100.fc34.x86_64"
args="ro no_timer_check net.ifnames=0 console=tty1 console=ttyS0,115200n8"
root="UUID=76a22bf4-f153-4541-b6c7-0332c0dfaeac"
initrd="/var/cache/osbuild-worker/osbuild-store/tmp/tmp2prywdy5object/tree/boot/initramfs-5.15.10-100.fc34.x86_64.img"
There is no need to check if path like
/var/cache/osbuild-worker/osbuild-store/tmp/tmp2prywdy5object/tree/boot/vmlinuz-5.15.10-100.fc34.x86_64
physically exists.
Note these helper functions doesn't support CoreOS/Atomic/Silverblue
since grubby isn't used by them.
Reviewed-by: Pingfan Liu <piliu(a)redhat.com>
Reviewed-by: Philipp Rudo <prudo(a)redhat.com>
Signed-off-by: Coiby Xu <coxu(a)redhat.com>
diff --git a/kdumpctl b/kdumpctl
index a72b71b..2ace803 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -1325,6 +1325,36 @@ get_dump_mode_by_kernel()
fi
}
+_filter_grubby_kernel_str()
+{
+ local _grubby_kernel_str=$1
+ echo -n "$_grubby_kernel_str" | sed -n -e 's/^kernel="\(.*\)"/\1/p'
+}
+
+_find_kernel_path_by_release()
+{
+ local _release="$1" _grubby_kernel_str _kernel_path
+ _grubby_kernel_str=$(grubby --info ALL | grep "^kernel=.*$_release")
+ _kernel_path=$(_filter_grubby_kernel_str "$_grubby_kernel_str")
+ if [[ -z $_kernel_path ]]; then
+ derror "kernel $_release doesn't exist"
+ return 1
+ fi
+ echo -n "$_kernel_path"
+}
+
+_get_current_running_kernel_path()
+{
+ local _release _path
+
+ _release=$(uname -r)
+ if _path=$(_find_kernel_path_by_release "$_release"); then
+ echo -n "$_path"
+ else
+ return 1
+ fi
+}
+
reset_crashkernel()
{
local kernel=$1 entry crashkernel_default
commit 3d2079c31cd80741ea6d44eb7f13d7f08be74a94
Author: Coiby Xu <coxu(a)redhat.com>
Date: Wed Dec 1 16:57:15 2021 +0800
add helper functions to get dump mode
Add a helper function to get dump mode. The dump mode would be
- fadump if fadump=on or fadump=nocma
- kdump if fadump=off or empty fadump
Otherwise return 1.
Also add another helper function to return a kernel's dump mode.
Reviewed-by: Pingfan Liu <piliu(a)redhat.com>
Reviewed-by: Philipp Rudo <prudo(a)redhat.com>
Signed-off-by: Coiby Xu <coxu(a)redhat.com>
diff --git a/kdumpctl b/kdumpctl
index 6f6bdd2..a72b71b 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -1291,6 +1291,40 @@ get_grub_kernel_boot_parameter()
grubby --info="$_kernel_path" | sed -En -e "/^args=.*$/{s/^.*(\s|\")${_para}=(\S*).*\"$/\2/p;q}"
}
+# get dump mode by fadump value
+# return
+# - fadump, if fadump=on or fadump=nocma
+# - kdump, if fadump=off or empty fadump, return kdump
+# - error if otherwise
+get_dump_mode_by_fadump_val()
+{
+ local _fadump_val=$1
+
+ if [[ -z $_fadump_val ]] || [[ $_fadump_val == off ]]; then
+ echo -n kdump
+ elif [[ $_fadump_val == on ]] || [[ $_fadump_val == nocma ]]; then
+ echo -n fadump
+ else
+ derror "invalid fadump=$_fadump_val"
+ return 1
+ fi
+}
+
+# get dump mode of a specific kernel
+# based on its fadump kernel cmdline parameter
+get_dump_mode_by_kernel()
+{
+ local _kernel_path=$1 _fadump_val _dump_mode
+
+ _fadump_val=$(get_grub_kernel_boot_parameter "$_kernel_path" fadump)
+ if _dump_mode=$(get_dump_mode_by_fadump_val "$_fadump_val"); then
+ echo -n "$_dump_mode"
+ else
+ derror "failed to get dump mode for kernel $_kernel_path"
+ exit
+ fi
+}
+
reset_crashkernel()
{
local kernel=$1 entry crashkernel_default
commit fb9e6838abef1e3a2ba43966f58a1f146989b148
Author: Coiby Xu <coxu(a)redhat.com>
Date: Tue Nov 16 06:48:40 2021 +0800
add a helper function to read kernel cmdline parameter from grubby --info
This helper function will be used to retrieve the value of kernel
cmdline parameters including crashkernel, fadump, swiotlb and etc.
Suggested-by: Philipp Rudo <prudo(a)redhat.com>
Reviewed-by: Pingfan Liu <piliu(a)redhat.com>
Signed-off-by: Coiby Xu <coxu(a)redhat.com>
diff --git a/kdumpctl b/kdumpctl
index 48aca00..6f6bdd2 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -1280,6 +1280,17 @@ get_default_crashkernel()
kdump_get_arch_recommend_crashkernel "$_dump_mode"
}
+# Read kernel cmdline parameter for a specific kernel
+# $1: kernel path, DEFAULT or kernel path, ALL not accepted
+# $2: kernel cmldine parameter
+get_grub_kernel_boot_parameter()
+{
+ local _kernel_path=$1 _para=$2
+
+ [[ $_kernel_path == ALL ]] && derror "kernel_path=ALL invalid for get_grub_kernel_boot_parameter" && return 1
+ grubby --info="$_kernel_path" | sed -En -e "/^args=.*$/{s/^.*(\s|\")${_para}=(\S*).*\"$/\2/p;q}"
+}
+
reset_crashkernel()
{
local kernel=$1 entry crashkernel_default
commit 796d0f6fd2932fd7c009f4517133b1a9c39501e5
Author: Coiby Xu <coxu(a)redhat.com>
Date: Tue Nov 16 12:23:02 2021 +0800
provide kdumpctl get-default-crashkernel for kdump_anaconda_addon and RPM scriptlet
Provide "kdumpctl get-default-crashkernel" for kdump_anaconda_addon
so crashkernel.default isn't needed.
When fadump is on, kdump_anaconda_addon would need to specify the dump
mode, i.e. "kdumpctl get-default-crashkernel fadump".
This interface would also be used by RPM scriptlet [1] to fetch default
crashkernel value.
[1] https://docs.fedoraproject.org/en-US/packaging-guidelines/Scriptlets/
Reviewed-by: Pingfan Liu <piliu(a)redhat.com>
Reviewed-by: Philipp Rudo <prudo(a)redhat.com>
Signed-off-by: Coiby Xu <coxu(a)redhat.com>
diff --git a/kdumpctl b/kdumpctl
index ed2b963..48aca00 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -1273,6 +1273,13 @@ do_estimate()
fi
}
+get_default_crashkernel()
+{
+ local _dump_mode=$1
+
+ kdump_get_arch_recommend_crashkernel "$_dump_mode"
+}
+
reset_crashkernel()
{
local kernel=$1 entry crashkernel_default
@@ -1361,6 +1368,9 @@ main()
estimate)
do_estimate
;;
+ get-default-crashkernel)
+ get_default_crashkernel "$2"
+ ;;
reset-crashkernel)
reset_crashkernel "$2"
;;
commit 105c01691ac200e7ce71795b2f41b64dd6cf3b58
Author: Coiby Xu <coxu(a)redhat.com>
Date: Tue Nov 16 11:26:31 2021 +0800
factor out kdump_get_arch_recommend_crashkernel
Factor out kdump_get_arch_recommend_crashkernel to prepare for
kdump-anaconda-plugin for example to retrieve the default crashkernel
value.
Note the support of crashkenrel.default is dropped.
Reviewed-by: Pingfan Liu <piliu(a)redhat.com>
Reviewed-by: Philipp Rudo <prudo(a)redhat.com>
Signed-off-by: Coiby Xu <coxu(a)redhat.com>
diff --git a/kdump-lib.sh b/kdump-lib.sh
index b8f6c96..b28db44 100755
--- a/kdump-lib.sh
+++ b/kdump-lib.sh
@@ -822,40 +822,52 @@ get_recommend_size()
IFS="$OLDIFS"
}
+# get default crashkernel
+# $1 dump mode, if not specified, dump_mode will be judged by is_fadump_capable
+kdump_get_arch_recommend_crashkernel()
+{
+ local _arch _ck_cmdline _dump_mode
+
+ if [[ -z "$1" ]]; then
+ if is_fadump_capable; then
+ _dump_mode=fadump
+ else
+ _dump_mode=kdump
+ fi
+ else
+ _dump_mode=$1
+ fi
+
+ _arch=$(uname -m)
+
+ if [[ $_arch == "x86_64" ]] || [[ $_arch == "s390x" ]]; then
+ _ck_cmdline="1G-4G:192M,4G-64G:256M,64G-:512M"
+ elif [[ $_arch == "aarch64" ]]; then
+ _ck_cmdline="2G-:448M"
+ elif [[ $_arch == "ppc64le" ]]; then
+ if [[ $_dump_mode == "fadump" ]]; then
+ _ck_cmdline="4G-16G:768M,16G-64G:1G,64G-128G:2G,128G-1T:4G,1T-2T:6G,2T-4T:12G,4T-8T:20G,8T-16T:36G,16T-32T:64G,32T-64T:128G,64T-:180G"
+ else
+ _ck_cmdline="2G-4G:384M,4G-16G:512M,16G-64G:1G,64G-128G:2G,128G-:4G"
+ fi
+ fi
+
+ _ck_cmdline=${_ck_cmdline//-:/-102400T:}
+ echo -n "$_ck_cmdline"
+}
+
# return recommended size based on current system RAM size
# $1: kernel version, if not set, will defaults to $(uname -r)
kdump_get_arch_recommend_size()
{
- local kernel=$1 arch
+ local _ck_cmdline
if ! [[ -r "/proc/iomem" ]]; then
echo "Error, can not access /proc/iomem."
return 1
fi
-
- [[ -z $kernel ]] && kernel=$(uname -r)
- ck_cmdline=$(cat "/usr/lib/modules/$kernel/crashkernel.default" 2> /dev/null)
-
- if [[ -n $ck_cmdline ]]; then
- ck_cmdline=${ck_cmdline#crashkernel=}
- else
- arch=$(lscpu | grep Architecture | awk -F ":" '{ print $2 }' | tr '[:lower:]' '[:upper:]')
- if [[ $arch == "X86_64" ]] || [[ $arch == "S390X" ]]; then
- ck_cmdline="1G-4G:192M,4G-64G:256M,64G-:512M"
- elif [[ $arch == "AARCH64" ]]; then
- ck_cmdline="2G-:448M"
- elif [[ $arch == "PPC64LE" ]]; then
- if is_fadump_capable; then
- ck_cmdline="4G-16G:768M,16G-64G:1G,64G-128G:2G,128G-1T:4G,1T-2T:6G,2T-4T:12G,4T-8T:20G,8T-16T:36G,16T-32T:64G,32T-64T:128G,64T-:180G"
- else
- ck_cmdline="2G-4G:384M,4G-16G:512M,16G-64G:1G,64G-128G:2G,128G-:4G"
- fi
- fi
- fi
-
- ck_cmdline=${ck_cmdline//-:/-102400T:}
sys_mem=$(get_system_size)
-
+ _ck_cmdline=$(kdump_get_arch_recommend_crashkernel)
get_recommend_size "$sys_mem" "$ck_cmdline"
}
commit 34d27c4c308d9eddc35ff2c81bfe3b1cef5749a5
Author: Coiby Xu <coxu(a)redhat.com>
Date: Tue Nov 16 09:12:49 2021 +0800
update default crashkernel value
It has been decided to increase default crashkernel value to reduce the
possibility of OOM.
Fixes: 7b7ddab ("kdump-lib.sh: kdump_get_arch_recommend_size uses crashkernel.default")
Reviewed-by: Pingfan Liu <piliu(a)redhat.com>
Reviewed-by: Philipp Rudo <prudo(a)redhat.com>
Signed-off-by: Coiby Xu <coxu(a)redhat.com>
diff --git a/kdump-lib.sh b/kdump-lib.sh
index 2e2775c..b8f6c96 100755
--- a/kdump-lib.sh
+++ b/kdump-lib.sh
@@ -841,7 +841,7 @@ kdump_get_arch_recommend_size()
else
arch=$(lscpu | grep Architecture | awk -F ":" '{ print $2 }' | tr '[:lower:]' '[:upper:]')
if [[ $arch == "X86_64" ]] || [[ $arch == "S390X" ]]; then
- ck_cmdline="1G-4G:160M,4G-64G:192M,64G-1T:256M,1T-:512M"
+ ck_cmdline="1G-4G:192M,4G-64G:256M,64G-:512M"
elif [[ $arch == "AARCH64" ]]; then
ck_cmdline="2G-:448M"
elif [[ $arch == "PPC64LE" ]]; then
commit 546c81a2050c4d65a95f1bbe563b76a19c13780f
Author: Kairui Song <kasong(a)tencent.com>
Date: Tue Dec 28 14:47:46 2021 +0800
kdumpctl: remove some legacy code
It seems the save_core function and vmcore detection was used a long
time ago when kdump shares same userspace in first and second kernel.
It's now heavily deprecated (only support cp, hardcoded path, dumpoops
no longer exists) and not used.
Now vmcore will never show up in first kernel for both kdump and fadump
case, and kdumpctl is only used in first kernel, so just remove them.
Signed-off-by: Kairui Song <kasong(a)tencent.com>
Acked-by: Coiby Xu <coxu(a)redhat.com>
diff --git a/kdumpctl b/kdumpctl
index 59ec068..ed2b963 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -72,32 +72,6 @@ determine_dump_mode()
ddebug "DEFAULT_DUMP_MODE=$DEFAULT_DUMP_MODE"
}
-save_core()
-{
- coredir="/var/crash/$(date +"%Y-%m-%d-%H:%M")"
-
- mkdir -p "$coredir"
- ddebug "cp --sparse=always /proc/vmcore $coredir/vmcore-incomplete"
- if cp --sparse=always /proc/vmcore "$coredir/vmcore-incomplete"; then
- mv "$coredir/vmcore-incomplete" "$coredir/vmcore"
- dinfo "saved a vmcore to $coredir"
- else
- derror "failed to save a vmcore to $coredir"
- fi
-
- # pass the dmesg to Abrt tool if exists, in order
- # to collect the kernel oops message.
- # https://fedorahosted.org/abrt/
- if [[ -x /usr/bin/dumpoops ]]; then
- ddebug "makedumpfile --dump-dmesg $coredir/vmcore $coredir/dmesg"
- makedumpfile --dump-dmesg "$coredir/vmcore" "$coredir/dmesg" > /dev/null 2>&1
- ddebug "dumpoops -d $coredir/dmesg"
- if dumpoops -d "$coredir/dmesg" > /dev/null 2>&1; then
- dinfo "kernel oops has been collected by abrt tool"
- fi
- fi
-}
-
rebuild_fadump_initrd()
{
if ! $MKFADUMPRD "$DEFAULT_INITRD_BAK" "$TARGET_INITRD" --kver "$KDUMP_KERNELVER"; then
@@ -1346,12 +1320,7 @@ main()
case "$1" in
start)
- if [[ -s /proc/vmcore ]]; then
- save_core
- reboot
- else
- start
- fi
+ start
;;
stop)
stop
commit 004daebefffcc81993413c4d4ce1f501294e3226
Author: Tao Liu <ltao(a)redhat.com>
Date: Sat Dec 18 16:14:44 2021 +0800
dracut-early-kdump-module-setup.sh: install xargs and kdump-lib-initramfs.sh
For earlykdump, kdump-lib-initramfs.sh is sourced by kdump-lib.sh,
however it is not installed in dracut-early-kdump-module-setup.sh. Same
as xargs, which is used by kdump-lib.sh. Otherwise earlykdump will report
file not found errors.
Fixes: a5faa052d4969cb66719d0b795d746449d3c71b7
("kdump-lib-initramfs.sh: prepare to be a POSIX compatible lib")
Fixes: 4f01cb1b0a4e1ea9467e9ace34d14dcb2fbe135a
("kdump-lib.sh: fix variable quoting issue")
Signed-off-by: Tao Liu <ltao(a)redhat.com>
Acked-by: Coiby Xu <coxu(a)redhat.com>
diff --git a/dracut-early-kdump-module-setup.sh b/dracut-early-kdump-module-setup.sh
index 0e46823..0451118 100755
--- a/dracut-early-kdump-module-setup.sh
+++ b/dracut-early-kdump-module-setup.sh
@@ -50,7 +50,9 @@ install() {
inst_binary "/usr/bin/gawk" "/usr/bin/awk"
inst_binary "/usr/bin/logger" "/usr/bin/logger"
inst_binary "/usr/bin/printf" "/usr/bin/printf"
+ inst_binary "/usr/bin/xargs" "/usr/bin/xargs"
inst_script "/lib/kdump/kdump-lib.sh" "/lib/kdump-lib.sh"
+ inst_script "/lib/kdump/kdump-lib-initramfs.sh" "/lib/kdump/kdump-lib-initramfs.sh"
inst_script "/lib/kdump/kdump-logger.sh" "/lib/kdump-logger.sh"
inst_hook cmdline 00 "$moddir/early-kdump.sh"
inst_binary "$KDUMP_KERNEL"
commit 163c02970e4ddcf238b2ac09eadf380744e01ba2
Author: Pingfan Liu <piliu(a)redhat.com>
Date: Mon Dec 20 09:29:02 2021 +0800
ppc64/ppc64le: drop cpu online rule in 40-redhat.rules in kdump initramfs
Onlining secondary cpus breaks kdump completely on KVM on Power hosts
Though we use maxcpus=1 by default but 40-redhat.rules will bring up all
possible cpus by default.
Thus before we get the kernel fix and the systemd rule fix let's remove
the cpu rule in 40-redhat.rules for ppc64/ppc64le kdump initramfs.
This is back ported from RHEL, and original credit goes to Dave Young
<dyoung(a)redhat.com>
Signed-off-by: Pingfan Liu <piliu(a)redhat.com>
Acked-by: Tao Liu <ltao(a)redhat.com>
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh
index 1ea0d95..c319fc2 100755
--- a/dracut-module-setup.sh
+++ b/dracut-module-setup.sh
@@ -1010,11 +1010,29 @@ kdump_install_systemd_conf() {
echo "ForwardToConsole=yes" >> "${initdir}/etc/systemd/journald.conf.d/kdump.conf"
}
+remove_cpu_online_rule() {
+ local file=${initdir}/usr/lib/udev/rules.d/40-redhat.rules
+
+ sed -i '/SUBSYSTEM=="cpu"/d' "$file"
+}
+
install() {
+ local arch
+
kdump_module_init
kdump_install_conf
remove_sysctl_conf
+ # Onlining secondary cpus breaks kdump completely on KVM on Power hosts
+ # Though we use maxcpus=1 by default but 40-redhat.rules will bring up all
+ # possible cpus by default. (rhbz1270174 rhbz1266322)
+ # Thus before we get the kernel fix and the systemd rule fix let's remove
+ # the cpu online rule in kdump initramfs.
+ arch=$(uname -m)
+ if [[ "$arch" = "ppc64le" ]] || [[ "$arch" = "ppc64" ]]; then
+ remove_cpu_online_rule
+ fi
+
if is_ssh_dump_target; then
kdump_install_random_seed
fi
commit f0892eeceb96072822f74e7a9ad491f61867f343
Author: Coiby Xu <coxu(a)redhat.com>
Date: Wed Dec 1 15:37:06 2021 +0800
kdump/ppc64: suppress the error message "Could not find a registered notification tool" from servicelog_notify
When kexec-tools is newly installed, kdump migration action hasn't
registered and the following error could occur,
INF dnf.rpm: Could not find a registered notification tool with the specified command ('/usr/lib/kdump/kdump-migrate-action.sh').
"servicelog_notify --list" could list registered notification tools for
a command but it outputs the above error as well. So simply redirect the
error to /dev/null when running "servicelog_notify --remove".
Fixes: commit 146f66262222e96bca47b691ed243fa5097aa55c
("kdump/ppc64: migration action registration clean up")
Acked-by: Tao Liu <ltao(a)redhat.com>
Acked-by: Hari Bathini <hbathini(a)linux.ibm.com>
Signed-off-by: Coiby Xu <coxu(a)redhat.com>
diff --git a/kexec-tools.spec b/kexec-tools.spec
index dcab391..ab7f41f 100644
--- a/kexec-tools.spec
+++ b/kexec-tools.spec
@@ -265,7 +265,7 @@ mv $RPM_BUILD_ROOT/etc/kdump-adv-conf/kdump_dracut_modules/* $RPM_BUILD_ROOT/%{d
touch /etc/kdump.conf
%ifarch ppc64 ppc64le
-servicelog_notify --remove --command=/usr/lib/kdump/kdump-migrate-action.sh
+servicelog_notify --remove --command=/usr/lib/kdump/kdump-migrate-action.sh 2>/dev/null
servicelog_notify --add --command=/usr/lib/kdump/kdump-migrate-action.sh --match='refcode="#MIGRATE" and serviceable=0' --type=EVENT --method=pairs_stdin
%endif
commit c3c8df3745a711992f1aa952e24eef0790924400
Author: Coiby Xu <coxu(a)redhat.com>
Date: Thu Nov 18 12:26:01 2021 +0800
add keytuils as a weak dependency for POWER
When secureboot is enabled, kdumpctl needs to use keyctl to add/remove
a key to/from the .ima keyring.
Fixes: commit 596fa0a07f089a9dd54cf631124d88653b4d77ec
("kdumpctl: enable secure boot on ppc64le LPARs")
Signed-off-by: Coiby Xu <coxu(a)redhat.com>
diff --git a/kexec-tools.spec b/kexec-tools.spec
index 8efc17a..dcab391 100644
--- a/kexec-tools.spec
+++ b/kexec-tools.spec
@@ -63,6 +63,7 @@ Source201: dracut-fadump-module-setup.sh
%ifarch ppc64 ppc64le
Requires(post): servicelog
+Recommends: keyutils
%endif
Requires(pre): coreutils sed zlib
Requires: dracut >= 050
commit 8cc51f3ab922cad5e857e37440d65466b1b8c2fd
Author: Pingfan Liu <piliu(a)redhat.com>
Date: Mon Nov 15 22:23:42 2021 +0800
Document/kexec-kdump-howto.txt: improve notes for kdump_pre and kdump_post scripts
Signed-off-by: Pingfan Liu <piliu(a)redhat.com>
Acked-by: Coiby Xu <coxu(a)redhat.com>
diff --git a/kdump.conf.5 b/kdump.conf.5
index 2c5a2bc..6e6cafa 100644
--- a/kdump.conf.5
+++ b/kdump.conf.5
@@ -118,8 +118,11 @@ All files under /etc/kdump/post.d are collectively sorted
and executed in lexical order, before binary or script
specified kdump_post parameter is executed.
.PP
-Note that scripts written for use with this directive must use
-the /bin/bash interpreter.
+Note that scripts written for use with this directive must use the /bin/bash
+interpreter. And since these scripts run in kdump enviroment, the reference to
+the storage or network device in the scripts should adhere to the section
+'Supported dump target types and requirements' in kexec-kdump-howto.txt.
+
.RE
.B kdump_pre <binary | script>
@@ -139,8 +142,11 @@ kdump_pre parameter is executed.
Even if the binary or script in /etc/kdump/pre.d directory
returns non 0 exit status, the processing is continued.
.PP
-Note that scripts written for this directive must use
-the /bin/bash interpreter.
+Note that scripts written for use with this directive must use the /bin/bash
+interpreter. And since these scripts run in kdump enviroment, the reference to
+the storage or network device in the scripts should adhere to the section
+'Supported dump target types and requirements' in kexec-kdump-howto.txt.
+
.RE
.B extra_bins <binaries | shell scripts>
diff --git a/kexec-kdump-howto.txt b/kexec-kdump-howto.txt
index 88af607..1aeffc7 100644
--- a/kexec-kdump-howto.txt
+++ b/kexec-kdump-howto.txt
@@ -621,6 +621,9 @@ If /etc/kdump/post.d directory exist, All files in the directory are
collectively sorted and executed in lexical order, before binary or script
specified kdump_post parameter is executed.
+In these scripts, the reference to the storage or network device should adhere
+to the section 'Supported dump target types and requirements'
+
Kdump Pre-Capture Executable
----------------------------
@@ -634,6 +637,9 @@ kdump_pre parameter is executed.
Even if the binary or script in /etc/kdump/pre.d directory returns non 0
exit status, the processing is continued.
+In these scripts, the reference to the storage or network device should adhere
+to the section 'Supported dump target types and requirements'
+
Extra Binaries
--------------
commit c59dfe938e1620b6ad264da0c8a59ed7996418e1
Author: Pingfan Liu <piliu(a)redhat.com>
Date: Thu Oct 21 10:17:02 2021 +0800
sysconfig: make kexec_file_load as default option on ppc64le
Signed-off-by: Pingfan Liu <piliu(a)redhat.com>
Acked-by: Coiby Xu <coxu(a)redhat.com>
diff --git a/kdump.sysconfig.ppc64le b/kdump.sysconfig.ppc64le
index ebb22f6..270a2cf 100644
--- a/kdump.sysconfig.ppc64le
+++ b/kdump.sysconfig.ppc64le
@@ -28,7 +28,7 @@ KDUMP_COMMANDLINE_APPEND="irqpoll maxcpus=1 noirqdistrib reset_devices cgroup_di
#
# Example:
# KEXEC_ARGS="--elf32-core-headers"
-KEXEC_ARGS="--dt-no-old-root"
+KEXEC_ARGS="--dt-no-old-root -s"
#Where to find the boot image
#KDUMP_BOOTDIR="/boot"
commit 960a132c31facf574a6d48dc2d25771aaee56c5f
Author: Pingfan Liu <piliu(a)redhat.com>
Date: Thu Oct 21 10:17:01 2021 +0800
sysconfig: make kexec_file_load as default option on aarch64
Signed-off-by: Pingfan Liu <piliu(a)redhat.com>
Acked-by: Coiby Xu <coxu(a)redhat.com>
diff --git a/kdump.sysconfig.aarch64 b/kdump.sysconfig.aarch64
index fedd3bc..67a2af7 100644
--- a/kdump.sysconfig.aarch64
+++ b/kdump.sysconfig.aarch64
@@ -28,7 +28,7 @@ KDUMP_COMMANDLINE_APPEND="irqpoll nr_cpus=1 reset_devices cgroup_disable=memory
#
# Example:
# KEXEC_ARGS="--elf32-core-headers"
-KEXEC_ARGS=""
+KEXEC_ARGS="-s"
#Where to find the boot image
#KDUMP_BOOTDIR="/boot"
commit 9ffda5bc1c789d00737ebe9b554691d029ecf492
Author: Tao Liu <ltao(a)redhat.com>
Date: Wed Nov 10 16:56:53 2021 +0800
Enable zstd compression for makedumpfile in kexec-tools.spec
The Zstandard (zstd) compression method is not enabled:
$ makedumpfile -v
makedumpfile: version 1.7.0 (released on 8 Nov 2021)
lzo enabled
snappy enabled
zstd disabled
This patch will enable it when building kexec-tools rpm package.
Signed-off-by: Tao Liu <ltao(a)redhat.com>
Acked-by: Coiby Xu <coxu(a)redhat.com>
diff --git a/kexec-tools.spec b/kexec-tools.spec
index 331d61d..8efc17a 100644
--- a/kexec-tools.spec
+++ b/kexec-tools.spec
@@ -71,7 +71,7 @@ Requires: dracut-squash >= 050
Requires: ethtool
Recommends: grubby
BuildRequires: make
-BuildRequires: zlib-devel elfutils-devel glib2-devel bzip2-devel ncurses-devel bison flex lzo-devel snappy-devel
+BuildRequires: zlib-devel elfutils-devel glib2-devel bzip2-devel ncurses-devel bison flex lzo-devel snappy-devel libzstd-devel
BuildRequires: pkgconfig intltool gettext
BuildRequires: systemd-rpm-macros
BuildRequires: automake autoconf libtool
@@ -151,7 +151,7 @@ cp %{SOURCE34} .
make
%ifarch %{ix86} x86_64 ppc64 s390x ppc64le aarch64
make -C eppic-%{eppic_ver}/libeppic
-make -C makedumpfile-%{mkdf_ver} LINKTYPE=dynamic USELZO=on USESNAPPY=on
+make -C makedumpfile-%{mkdf_ver} LINKTYPE=dynamic USELZO=on USESNAPPY=on USEZSTD=on
make -C makedumpfile-%{mkdf_ver} LDFLAGS="$LDFLAGS -I../eppic-%{eppic_ver}/libeppic -L../eppic-%{eppic_ver}/libeppic" eppic_makedumpfile.so
%endif
commit 267a088b2a15af26d431bfb10ae85d4d7fd1f98b
Author: Coiby Xu <coxu(a)redhat.com>
Date: Mon Nov 8 14:09:13 2021 +0800
Release 2.0.23-1
Signed-off-by: Coiby Xu <coxu(a)redhat.com>
diff --git a/kexec-tools.spec b/kexec-tools.spec
index 1f25779..331d61d 100644
--- a/kexec-tools.spec
+++ b/kexec-tools.spec
@@ -4,8 +4,8 @@
%global mkdf_shortver %(c=%{mkdf_ver}; echo ${c:0:7})
Name: kexec-tools
-Version: 2.0.22
-Release: 8%{?dist}
+Version: 2.0.23
+Release: 1%{?dist}
License: GPLv2
Summary: The kexec/kdump userspace component
@@ -375,6 +375,13 @@ done
%endif
%changelog
+* Mon Nov 18 2021 Coiby <coxu(a)redhat.com> - 2.0.23-1
+- Update kexec-tools to 2.0.23
+- Rebase makedumpfile to 1.7.0
+- fix broken extra_bins when installing multiple binaries
+- mkdumprd: drop mountaddr/mountproto nfs mount options
+- selftest: kill VM reliably by recursively kill children processes
+
* Thu Sep 16 2021 Kairui Song <kasong(a)redhat.com> - 2.0.22-8
- 92-crashkernel.install: fix exit code
- dracut-early-kdump.sh: make it POSIX compatible
diff --git a/sources b/sources
index 2a1c797..5069108 100644
--- a/sources
+++ b/sources
@@ -1,3 +1,3 @@
SHA512 (eppic-e8844d3.tar.gz) = d86b9f90c57e694107272d8f71b87f66a30743b9530480fb6f665026bbada4c6b0205a83e40b5383663a945681cfbfcf1ee79469fc219ddf679473c4b2290763
-SHA512 (kexec-tools-2.0.22.tar.xz) = 7580860f272eee5af52139809f12961e5a5d3a65f4e191183ca9c845410425d25818945ac14ed04a60e6ce474dc2656fc6a14041177b0bf703f450820c7d6aba
+SHA512 (kexec-tools-2.0.23.tar.xz) = b6e3b967cacc31c434b185d25da4d53c822ae4bbcec26ef9d6cb171f294fdcc80913d381e686a0a41e025187835f4dc088052ff88efe75a021d7624c8b1a1ed8
SHA512 (makedumpfile-1.7.0.tar.gz) = 579a1fb79d023a1419fc8612a02a04dda3e3b3d72455566433ab6bec08627aa9a176c55566393a081a7aae3fd0543800196596b25445b21b16346556723e9cf7
commit 8b9948df33e48f714409c6fa3af65a72f73416a5
Author: Coiby Xu <coxu(a)redhat.com>
Date: Mon Nov 1 14:13:16 2021 +0800
Update makedumpfile to 1.7.0
Signed-off-by: Coiby Xu <coxu(a)redhat.com>
diff --git a/kexec-tools-2.0.22-makedumpfile-Increase-SECTION_MAP_LAST_BIT-to-5.patch b/kexec-tools-2.0.22-makedumpfile-Increase-SECTION_MAP_LAST_BIT-to-5.patch
deleted file mode 100644
index a59bef1..0000000
--- a/kexec-tools-2.0.22-makedumpfile-Increase-SECTION_MAP_LAST_BIT-to-5.patch
+++ /dev/null
@@ -1,42 +0,0 @@
-From 646456862df8926ba10dd7330abf3bf0f887e1b6 Mon Sep 17 00:00:00 2001
-From: Kazuhito Hagio <k-hagio-ab(a)nec.com>
-Date: Wed, 26 May 2021 14:31:26 +0900
-Subject: [PATCH] Increase SECTION_MAP_LAST_BIT to 5
-
-* Required for kernel 5.12
-
-Kernel commit 1f90a3477df3 ("mm: teach pfn_to_online_page() about
-ZONE_DEVICE section collisions") added a section flag
-(SECTION_TAINT_ZONE_DEVICE) and causes makedumpfile an error on
-some machines like this:
-
- __vtop4_x86_64: Can't get a valid pmd_pte.
- readmem: Can't convert a virtual address(ffffe2bdc2000000) to physical address.
- readmem: type_addr: 0, addr:ffffe2bdc2000000, size:32768
- __exclude_unnecessary_pages: Can't read the buffer of struct page.
- create_2nd_bitmap: Can't exclude unnecessary pages.
-
-Increase SECTION_MAP_LAST_BIT to 5 to fix this. The bit had not
-been used until the change, so we can just increase the value.
-
-Signed-off-by: Kazuhito Hagio <k-hagio-ab(a)nec.com>
----
- makedumpfile.h | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/makedumpfile-1.6.9/makedumpfile.h b/makedumpfile-1.6.9/makedumpfile.h
-index 93aa774..79046f2 100644
---- a/makedumpfile-1.6.9/makedumpfile.h
-+++ b/makedumpfile-1.6.9/makedumpfile.h
-@@ -195,7 +195,7 @@ isAnon(unsigned long mapping)
- * 2. it has been verified that (1UL<<2) was never set, so it is
- * safe to mask that bit off even in old kernels.
- */
--#define SECTION_MAP_LAST_BIT (1UL<<4)
-+#define SECTION_MAP_LAST_BIT (1UL<<5)
- #define SECTION_MAP_MASK (~(SECTION_MAP_LAST_BIT-1))
- #define NR_SECTION_ROOTS() divideup(num_section, SECTIONS_PER_ROOT())
- #define SECTION_NR_TO_PFN(sec) ((sec) << PFN_SECTION_SHIFT())
---
-2.29.2
-
diff --git a/kexec-tools-2.0.22-makedumpfile-check-for-invalid-physical-address-proc-kcore-when-finding-max_paddr.patch b/kexec-tools-2.0.22-makedumpfile-check-for-invalid-physical-address-proc-kcore-when-finding-max_paddr.patch
deleted file mode 100644
index f79ea55..0000000
--- a/kexec-tools-2.0.22-makedumpfile-check-for-invalid-physical-address-proc-kcore-when-finding-max_paddr.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-From 38d921a2ef50ebd36258097553626443ffe27496 Mon Sep 17 00:00:00 2001
-From: Coiby Xu <coxu(a)redhat.com>
-Date: Tue, 15 Jun 2021 18:26:31 +0800
-Subject: [PATCH] check for invalid physical address of /proc/kcore
- when finding max_paddr
-
-Kernel commit 464920104bf7adac12722035bfefb3d772eb04d8 ("/proc/kcore:
-update physical address for kcore ram and text") sets an invalid paddr
-(0xffffffffffffffff = -1) for PT_LOAD segments of not direct mapped
-regions:
-
- $ readelf -l /proc/kcore
- ...
- Program Headers:
- Type Offset VirtAddr PhysAddr
- FileSiz MemSiz Flags Align
- NOTE 0x0000000000000120 0x0000000000000000 0x0000000000000000
- 0x0000000000002320 0x0000000000000000 0x0
- LOAD 0x1000000000010000 0xd000000000000000 0xffffffffffffffff
- ^^^^^^^^^^^^^^^^^^
- 0x0001f80000000000 0x0001f80000000000 RWE 0x10000
-
-makedumpfile uses max_paddr to calculate the number of sections for
-sparse memory model thus wrong number is obtained based on max_paddr
-(-1). This error could lead to the failure of copying /proc/kcore
-for RHEL-8.5 on ppc64le machine [1]:
-
- $ makedumpfile /proc/kcore vmcore1
- get_mem_section: Could not validate mem_section.
- get_mm_sparsemem: Can't get the address of mem_section.
-
- makedumpfile Failed.
-
-Let's check if the phys_start of the segment is a valid physical
-address to fix this problem.
-
-[1] https://bugzilla.redhat.com/show_bug.cgi?id=1965267
-
-Reported-by: Xiaoying Yan <yiyan(a)redhat.com>
-Signed-off-by: Coiby Xu <coxu(a)redhat.com>
----
- elf_info.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/makedumpfile-1.6.9/elf_info.c b/makedumpfile-1.6.9/elf_info.c
-index e8affb7..bc24083 100644
---- a/makedumpfile-1.6.9/elf_info.c
-+++ b/makedumpfile-1.6.9/elf_info.c
-@@ -628,7 +628,7 @@ get_max_paddr(void)
-
- for (i = 0; i < num_pt_loads; i++) {
- pls = &pt_loads[i];
-- if (max_paddr < pls->phys_end)
-+ if (pls->phys_start != NOT_PADDR && max_paddr < pls->phys_end)
- max_paddr = pls->phys_end;
- }
- return max_paddr;
---
-2.29.2
-
diff --git a/kexec-tools-2.0.22-makedumpfile-check-for-invalid-physical-address-proc-kcore-when-making-ELF-dumpfile.patch b/kexec-tools-2.0.22-makedumpfile-check-for-invalid-physical-address-proc-kcore-when-making-ELF-dumpfile.patch
deleted file mode 100644
index 8cf780c..0000000
--- a/kexec-tools-2.0.22-makedumpfile-check-for-invalid-physical-address-proc-kcore-when-making-ELF-dumpfile.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-From 9a6f589d99dcef114c89fde992157f5467028c8f Mon Sep 17 00:00:00 2001
-From: Tao Liu <ltao(a)redhat.com>
-Date: Fri, 18 Jun 2021 18:28:04 +0800
-Subject: [PATCH] check for invalid physical address of /proc/kcore
- when making ELF dumpfile
-
-Previously when executing makedumpfile with -E option against
-/proc/kcore, makedumpfile will fail:
-
- # makedumpfile -E -d 31 /proc/kcore kcore.dump
- ...
- write_elf_load_segment: Can't convert physaddr(ffffffffffffffff) to an offset.
-
- makedumpfile Failed.
-
-It's because /proc/kcore contains PT_LOAD program headers which have
-physaddr (0xffffffffffffffff). With -E option, makedumpfile will
-try to convert the physaddr to an offset and fails.
-
-Skip the PT_LOAD program headers which have such physaddr.
-
-Signed-off-by: Tao Liu <ltao(a)redhat.com>
-Signed-off-by: Kazuhito Hagio <k-hagio-ab(a)nec.com>
----
- makedumpfile.c | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/makedumpfile-1.6.9/makedumpfile.c b/makedumpfile-1.6.9/makedumpfile.c
-index 894c88e..fcb571f 100644
---- a/makedumpfile-1.6.9/makedumpfile.c
-+++ b/makedumpfile-1.6.9/makedumpfile.c
-@@ -7764,7 +7764,7 @@ write_elf_pages_cyclic(struct cache_data *cd_header, struct cache_data *cd_page)
- if (!get_phdr_memory(i, &load))
- return FALSE;
-
-- if (load.p_type != PT_LOAD)
-+ if (load.p_type != PT_LOAD || load.p_paddr == NOT_PADDR)
- continue;
-
- off_memory= load.p_offset;
---
-2.29.2
-
diff --git a/kexec-tools.spec b/kexec-tools.spec
index 5dbf625..1f25779 100644
--- a/kexec-tools.spec
+++ b/kexec-tools.spec
@@ -1,6 +1,6 @@
%global eppic_ver e8844d3793471163ae4a56d8f95897be9e5bd554
%global eppic_shortver %(c=%{eppic_ver}; echo ${c:0:7})
-%global mkdf_ver 1.6.9
+%global mkdf_ver 1.7.0
%global mkdf_shortver %(c=%{mkdf_ver}; echo ${c:0:7})
Name: kexec-tools
@@ -108,9 +108,6 @@ Requires: systemd-udev%{?_isa}
#
# Patches 601 onward are generic patches
#
-Patch601: ./kexec-tools-2.0.22-makedumpfile-Increase-SECTION_MAP_LAST_BIT-to-5.patch
-Patch602: ./kexec-tools-2.0.22-makedumpfile-check-for-invalid-physical-address-proc-kcore-when-finding-max_paddr.patch
-Patch603: ./kexec-tools-2.0.22-makedumpfile-check-for-invalid-physical-address-proc-kcore-when-making-ELF-dumpfile.patch
%description
kexec-tools provides /sbin/kexec binary that facilitates a new
@@ -126,10 +123,6 @@ mkdir -p -m755 kcp
tar -z -x -v -f %{SOURCE9}
tar -z -x -v -f %{SOURCE19}
-%patch601 -p1
-%patch602 -p1
-%patch603 -p1
-
%ifarch ppc
%define archdef ARCH=ppc
%endif
diff --git a/sources b/sources
index 80b4d4e..2a1c797 100644
--- a/sources
+++ b/sources
@@ -1,3 +1,3 @@
SHA512 (eppic-e8844d3.tar.gz) = d86b9f90c57e694107272d8f71b87f66a30743b9530480fb6f665026bbada4c6b0205a83e40b5383663a945681cfbfcf1ee79469fc219ddf679473c4b2290763
SHA512 (kexec-tools-2.0.22.tar.xz) = 7580860f272eee5af52139809f12961e5a5d3a65f4e191183ca9c845410425d25818945ac14ed04a60e6ce474dc2656fc6a14041177b0bf703f450820c7d6aba
-SHA512 (makedumpfile-1.6.9.tar.gz) = 9982985498ae641d390c3b87d92aecd263a502f1a4a9e96e145d86d8778b9e778e4ee98034ef4dbe12ed5586c57278917ea5f3c9ae2989ad1ac051215e03b3d9
+SHA512 (makedumpfile-1.7.0.tar.gz) = 579a1fb79d023a1419fc8612a02a04dda3e3b3d72455566433ab6bec08627aa9a176c55566393a081a7aae3fd0543800196596b25445b21b16346556723e9cf7
commit 6936fbc1b220f35b45b3114f04c6889a2b5e16a2
Author: Coiby Xu <coxu(a)redhat.com>
Date: Mon Nov 1 14:13:16 2021 +0800
fix broken extra_bins when installing multiple binaries
When there more than one binaries, quoting "$val" would make
dracut-install treat multiple binaries as one binary. Take
"extra_bins /usr/sbin/ping /usr/sbin/ip" as an example, the
following error would occur when building initrd,
dracut-install: ERROR: installing '/usr/sbin/ping /usr/sbin/ip'
dracut: FAILED: /usr/lib/dracut/dracut-install -D /var/tmp/dracut.ODrioZ/initramfs -a /usr/sbin/ping /usr/sbin/ip
Fix it by not quoting the variable and bypassing SC2086 shellcheck.
Fixes: commit 86538ca6e2e555caa8cdd2bcfcc3c5e94ac6bf58
("bash scripts: fix variable quoting issue")
Acked-by: Tao Liu <ltao(a)redhat.com>
Signed-off-by: Coiby Xu <coxu(a)redhat.com>
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh
index a5e4b67..1ea0d95 100755
--- a/dracut-module-setup.sh
+++ b/dracut-module-setup.sh
@@ -686,7 +686,8 @@ kdump_install_conf() {
fi
;;
kdump_pre | kdump_post | extra_bins)
- dracut_install "$_val"
+ # shellcheck disable=SC2086
+ dracut_install $_val
;;
core_collector)
dracut_install "${_val%%[[:blank:]]*}"
commit 727251e52efe833b8bb428b5567fca34f8c74b3d
Author: Tao Liu <ltao at redhat.com>
Date: Tue Oct 26 22:03:28 2021 +0800
mkdumprd: drop mountaddr/mountproto nfs mount options
nfs service will append extra mount options to kernel mount options.
Such as mountaddr/mountproto options. These options only represent
current mounting details of the 1st kernel, but may not appropriate
for the 2nd kernel for the same reason as commit
d4f04afa47dea89ad5ca42ad0b2ddc355ce93a64 ("mkdumprd: drop some nfs
mount options when reading from kernel"). This patch will remove
these options.
Signed-off-by: Tao Liu <ltao(a)redhat.com>
Acked-by: Coiby Xu <coxu(a)redhat.com>
diff --git a/mkdumprd b/mkdumprd
index c6cb001..d87d588 100644
--- a/mkdumprd
+++ b/mkdumprd
@@ -70,8 +70,8 @@ to_mount()
if [[ $_fstype == "nfs"* ]]; then
_pdev=$_target
- _sed_cmd+='s/,addr=[^,]*//;'
- _sed_cmd+='s/,proto=[^,]*//;'
+ _sed_cmd+='s/,\(mount\)\?addr=[^,]*//g;'
+ _sed_cmd+='s/,\(mount\)\?proto=[^,]*//g;'
_sed_cmd+='s/,clientaddr=[^,]*//;'
else
# for non-nfs _target converting to use udev persistent name
commit 294c965ca36927fc082402716d81abc24aa48e59
Author: Coiby Xu <coxu(a)redhat.com>
Date: Mon Jun 21 09:18:11 2021 +0800
selftest: kill VM reliably by recursively kill children processes
qemu is launched in nested subprocess and can't be killed by simply
killing the job ids,
PID Command
2269634 │ ├─ sshd: root [priv]
2269637 │ │ └─ sshd: root@pts/0
2269638 │ │ └─ -bash
2269744 │ │ └─ make test-run V=1
2273117 │ │ └─ /bin/bash /root/kexec-tools-300/tests/scripts/run-test.sh
2273712 │ │ ├─ /bin/bash /root/kexec-tools-300/tests/scripts/run-test.sh
2273714 │ │ │ └─ /bin/bash /root/kexec-tools-300/tests/scripts/run-test.sh
2273737 │ │ │ └─ timeout --foreground 10m /root/kexec-tools-300/tests/scripts/run-qemu -nodefaults -nographic -smp 2 -m 768M -monitor no
2273738 │ │ │ └─ /usr/bin/qemu-system-x86_64 -enable-kvm -cpu host -nodefaults -nographic -smp 2 -m 768M -monitor none -serial stdio
2273746 │ │ │ ├─ /usr/bin/qemu-system-x86_64 -enable-kvm -cpu host -nodefaults -nographic -smp 2 -m 768M -monitor none -serial std
2273797 │ │ ├─ /bin/bash /root/kexec-tools-300/tests/scripts/run-test.sh
2273798 │ │ │ └─ /bin/bash /root/kexec-tools-300/tests/scripts/run-test.sh
2273831 │ │ │ └─ timeout --foreground 10m /root/kexec-tools-300/tests/scripts/run-qemu -nodefaults -nographic -smp 2 -m 768M -monitor no
2273832 │ │ │ └─ /usr/bin/qemu-system-x86_64 -enable-kvm -cpu host -nodefaults -nographic -smp 2 -m 768M -monitor none -serial stdio
2273840 │ │ │ ├─ /usr/bin/qemu-system-x86_64 -enable-kvm -cpu host -nodefaults -nographic -smp 2 -m 768M -monitor none -serial std
This led to the error "qemu-system-x86_64: can't bind ip=0.0.0.0 to
socket: Address already in use".
This patch will kill qemu by killing all the children of the job id.
Signed-off-by: Coiby Xu <coxu(a)redhat.com>
Acked-by: Kairui Song <kasong(a)redhat.com>
diff --git a/tests/scripts/run-test.sh b/tests/scripts/run-test.sh
index a68504d..c3e94a3 100755
--- a/tests/scripts/run-test.sh
+++ b/tests/scripts/run-test.sh
@@ -1,9 +1,38 @@
#!/bin/bash
+_kill_if_valid_pid() {
+ local _pid="$1"
+ if ps -p "$_pid" > /dev/null
+ then
+ kill "$_pid"
+ fi
+}
+
+_recursive_kill() {
+ local _pid="$1"
+ local _children _child
+
+ _children=$(pgrep -P "$_pid")
+ if [ -n "$_children" ]; then
+ for _child in $_children
+ do
+ _recursive_kill "$_child"
+ _kill_if_valid_pid "$_child"
+ done
+ fi
+ _kill_if_valid_pid "$_pid"
+}
+
_kill_all_jobs() {
local _jobs=$(jobs -r -p)
+ local _job
- [ -n "$_jobs" ] && kill $_jobs
+ if [ -n "$_jobs" ]; then
+ for _job in $_jobs
+ do
+ _recursive_kill "$_job"
+ done
+ fi
}
trap '
@@ -121,7 +150,7 @@ for test_case in $testcases; do
[ $? -ne 0 ] && ret=$(expr $ret + 1)
results[$test_case]="$res"
-
+ _kill_all_jobs
echo -e "-------- Test finished: $test_case $res --------"
for script in $scripts; do
script="$testdir/$script"
diff --git a/tests/scripts/test-lib.sh b/tests/scripts/test-lib.sh
index f8a2249..8b24b2a 100644
--- a/tests/scripts/test-lib.sh
+++ b/tests/scripts/test-lib.sh
@@ -146,8 +146,7 @@ watch_test_outputs() {
ret=$?
if [ $ret -ne 255 ]; then
- # Test finished, kill VMs
- kill $(jobs -p)
+ # Test finished
break 2
fi
done
commit 6ea954d5182a7cbd42e0888e0c09ef9770eb9e88
Author: Kairui Song <kasong(a)redhat.com>
Date: Thu Sep 16 23:46:28 2021 +0800
Release 2.0.22-8
Signed-off-by: Kairui Song <kasong(a)redhat.com>
diff --git a/kexec-tools.spec b/kexec-tools.spec
index f71ff81..5dbf625 100644
--- a/kexec-tools.spec
+++ b/kexec-tools.spec
@@ -5,7 +5,7 @@
Name: kexec-tools
Version: 2.0.22
-Release: 7%{?dist}
+Release: 8%{?dist}
License: GPLv2
Summary: The kexec/kdump userspace component
@@ -382,6 +382,64 @@ done
%endif
%changelog
+* Thu Sep 16 2021 Kairui Song <kasong(a)redhat.com> - 2.0.22-8
+- 92-crashkernel.install: fix exit code
+- dracut-early-kdump.sh: make it POSIX compatible
+- Add header comment for POSIX compliant scripts
+- mkdumprd: allow using dash
+- kdump-logger.sh: make it POSIX compatible
+- kdump-lib.sh: reformat with shfmt
+- kdump-lib.sh: declare and assign separately
+- kdump-lib.sh: fix variable quoting issue
+- kdump-lib.sh: fix a few ambiguous or redundant code
+- kdump-lib.sh: fix arithmetic operation syntax
+- kdump-lib.sh: remove useless echo and cat
+- kdump-lib.sh: rework nmcli related functions
+- kdump-lib.sh: replace '[ ]' with '[[ ]]' and get rid of legacy ``
+- kdump-lib-initramfs.sh: make it POSIX compatible
+- dracut-kdump.sh: reformat with shfmt
+- dracut-kdump.sh: make it POSIX compatible
+- dracut-kdump.sh: POSIX doesn't support pipefail
+- dracut-kdump.sh: Use stat instead of ls to get vmcore size
+- dracut-kdump.sh: simplify dump_ssh
+- dracut-kdump.sh: remove add_dump_code
+- dracut-kdump.sh: don't put KDUMP_SCRIPT_DIR in PATH
+- kdump-lib-initramfs.sh: move dump related functions to kdump.sh
+- Merge kdump-error-handler.sh into kdump.sh
+- kdump-lib-initramfs.sh: prepare to be a POSIX compatible lib
+- bash scripts: reformat with shfmt
+- bash scripts: declare and assign separately
+- bash scripts: fix redundant exit code check
+- bash scripts: fix variable quoting issue
+- bash scripts: replace '[ ]' with '[[ ]]' for bash scripts
+- bash scripts: use $(...) notation instead of legacy `...`
+- bash scripts: always use "read -r"
+- bash scripts: get rid of unnecessary sed calls
+- bash scripts: get rid of expr and let
+- bash scripts: remove useless cat
+- dracut-module-setup.sh: remove surrounding $() for subshell
+- dracut-module-setup.sh: make iscsi check fail early if cd failed
+- dracut-module-setup.sh: fix a loop over ls issue
+- dracut-module-setup.sh: fix a ambiguous variable reference
+- dracut-module-setup.sh: use "*" to expend array as string
+- dracut-module-setup.sh: fix _bondoptions wrong references
+- dracut-module-setup.sh: remove an unused variable
+- dracut-module-setup.sh: rework kdump_get_ip_route_field
+- mkfadumprd: make _dracut_isolate_args an array
+- mkdumprd: use array to store ssh arguments in mkdir_save_path_ssh
+- mkdumprd: remove an awk call in get_fs_size
+- mkdumprd: fix multiple issues with get_ssh_size
+- mkdumprd: remove some redundant echo
+- mkdumprd: make dracut_args an array again
+- mkdumprd: use kdump_get_conf_val to read config values
+- kdumpctl: refine grep usage
+- kdumpctl: fix fragile loops over find output
+- kdumpctl: use kdump_get_conf_val to read config values
+- kdump-lib.sh: use kdump_get_conf_val to read config values
+- kdump-lib.sh: add a config value retrive helper
+- kdump-lib.sh: add a config format and read helper
+- Add a .editorconfig file
+
* Tue Aug 31 2021 Adam Williamson <awilliam(a)redhat.com> - 2.0.22-7
- Don't exit 1 from 92-crashkernel.install if zipl is absent (#1993505)
commit f6e6aa45518aab0bfbbe8fa4fc94eb3f33036aa1
Author: Kairui Song <kasong(a)redhat.com>
Date: Wed Sep 1 17:38:50 2021 +0800
92-crashkernel.install: fix exit code
The return value of set_ck_kernel or set_grub_ck is wrongly being used
as the exit code. This hook should exit with 0 or it may result in
unexpected behavior of kernel-install.
Signed-off-by: Kairui Song <kasong(a)redhat.com>
Acked-by: Pingfan Liu <piliu(a)redhat.com>
diff --git a/92-crashkernel.install b/92-crashkernel.install
index de5b2fb..78365ff 100755
--- a/92-crashkernel.install
+++ b/92-crashkernel.install
@@ -120,8 +120,9 @@ add)
if [[ "$boot_ck_cmdline" != "$inst_ck_default" ]] && [[ "$boot_ck_cmdline" == "$boot_ck_default" ]]; then
set_kernel_ck "$KERNEL_VERSION" "$inst_ck_default"
fi
- ;;
+ exit 0
+ ;;
remove)
# If grub default value is upgraded when this kernel was installed, try downgrade it
grub_etc_ck=$(get_grub_etc_ck)
@@ -139,5 +140,7 @@ remove)
set_grub_ck "$highest_ck_default"
fi
fi
+
+ exit 0
;;
esac
commit 4c39ad9a0c9808a9b791a3e446d0b209ceccdc5e
Author: Kairui Song <kasong(a)redhat.com>
Date: Mon Sep 13 16:40:25 2021 +0800
dracut-early-kdump.sh: make it POSIX compatible
Refactor and remove bash only syntax.
Signed-off-by: Kairui Song <kasong(a)redhat.com>
Acked-by: Philipp Rudo <prudo(a)redhat.com>
diff --git a/dracut-early-kdump.sh b/dracut-early-kdump.sh
index 129841e..45ee6dc 100755
--- a/dracut-early-kdump.sh
+++ b/dracut-early-kdump.sh
@@ -14,9 +14,8 @@ EARLY_KEXEC_ARGS=""
. /lib/kdump-lib.sh
. /lib/kdump-logger.sh
-#initiate the kdump logger
-dlog_init
-if [ $? -ne 0 ]; then
+# initiate the kdump logger
+if ! dlog_init; then
echo "failed to initiate the kdump logger."
exit 1
fi
@@ -30,8 +29,7 @@ prepare_parameters()
early_kdump_load()
{
- check_kdump_feasibility
- if [ $? -ne 0 ]; then
+ if ! check_kdump_feasibility; then
return 1
fi
@@ -40,8 +38,7 @@ early_kdump_load()
return 1
fi
- check_current_kdump_status
- if [ $? == 0 ]; then
+ if check_current_kdump_status; then
return 1
fi
@@ -61,10 +58,9 @@ early_kdump_load()
--command-line=$EARLY_KDUMP_CMDLINE --initrd=$EARLY_KDUMP_INITRD \
$EARLY_KDUMP_KERNEL"
- $KEXEC ${EARLY_KEXEC_ARGS} $standard_kexec_args \
+ if $KEXEC $EARLY_KEXEC_ARGS $standard_kexec_args \
--command-line="$EARLY_KDUMP_CMDLINE" \
- --initrd=$EARLY_KDUMP_INITRD $EARLY_KDUMP_KERNEL
- if [ $? == 0 ]; then
+ --initrd=$EARLY_KDUMP_INITRD $EARLY_KDUMP_KERNEL; then
dinfo "kexec: loaded early-kdump kernel"
return 0
else
commit ee337c6f497a92a12848a85dcce468c1a4bcd14f
Author: Kairui Song <kasong(a)redhat.com>
Date: Mon Sep 13 03:38:14 2021 +0800
Add header comment for POSIX compliant scripts
To make things cleaner and more human readable, add a short comment for
the POSIX scripts.
Signed-off-by: Kairui Song <kasong(a)redhat.com>
Acked-by: Philipp Rudo <prudo(a)redhat.com>
diff --git a/dracut-kdump.sh b/dracut-kdump.sh
index 969ea94..b69bc98 100755
--- a/dracut-kdump.sh
+++ b/dracut-kdump.sh
@@ -1,7 +1,7 @@
#!/bin/sh
#
-# The main kdump routine in capture kernel
-#
+# The main kdump routine in capture kernel, bash may not be the
+# default shell. Any code added must be POSIX compliant.
. /lib/dracut-lib.sh
. /lib/kdump-logger.sh
diff --git a/kdump-lib-initramfs.sh b/kdump-lib-initramfs.sh
index 0cdb465..c1fd75f 100755
--- a/kdump-lib-initramfs.sh
+++ b/kdump-lib-initramfs.sh
@@ -1,7 +1,7 @@
#!/bin/sh
#
-# Function and variables used in initramfs environment, POSIX compatible
-#
+# The code in this file will be used in initramfs environment, bash may
+# not be the default shell. Any code added must be POSIX compliant.
DEFAULT_PATH="/var/crash/"
KDUMP_CONFIG_FILE="/etc/kdump.conf"
diff --git a/kdump-logger.sh b/kdump-logger.sh
index 98c4eea..3fd433d 100755
--- a/kdump-logger.sh
+++ b/kdump-logger.sh
@@ -34,6 +34,8 @@
# First of all you have to start with dlog_init() function which initializes
# required variables. Don't call any other logging function before that one!
#
+# The code in this file might be run in an environment without bash.
+# Any code added must be POSIX compliant.
# Define vairables for the log levels in this module.
kdump_stdloglvl=""
commit 4b4d045b8c0a7d7bf9d09b5b29bc81885e63ed2b
Author: Kairui Song <kasong(a)redhat.com>
Date: Wed Aug 11 19:55:19 2021 +0800
mkdumprd: allow using dash
All non-POSIX syntax in second kernel are gone, tested on Fedora 34
with latest dracut, dash now works fine.
Signed-off-by: Kairui Song <kasong(a)redhat.com>
Acked-by: Philipp Rudo <prudo(a)redhat.com>
diff --git a/mkdumprd b/mkdumprd
index eebbbe1..c6cb001 100644
--- a/mkdumprd
+++ b/mkdumprd
@@ -27,7 +27,7 @@ SAVE_PATH=$(get_save_path)
OVERRIDE_RESETTABLE=0
extra_modules=""
-dracut_args=(--add kdumpbase --quiet --hostonly --hostonly-cmdline --hostonly-i18n --hostonly-mode strict -o "plymouth dash resume ifcfg earlykdump")
+dracut_args=(--add kdumpbase --quiet --hostonly --hostonly-cmdline --hostonly-i18n --hostonly-mode strict -o "plymouth resume ifcfg earlykdump")
MKDUMPRD_TMPDIR="$(mktemp -d -t mkdumprd.XXXXXX)"
[ -d "$MKDUMPRD_TMPDIR" ] || perror_exit "dracut: mktemp -p -d -t dracut.XXXXXX failed."
commit 8cd57e5565142553b1fe739afe90723359b18498
Author: Kairui Song <kasong(a)redhat.com>
Date: Wed Aug 11 19:19:59 2021 +0800
kdump-logger.sh: make it POSIX compatible
Refactor to remove some bash only syntax.
Signed-off-by: Kairui Song <kasong(a)redhat.com>
Acked-by: Philipp Rudo <prudo(a)redhat.com>
diff --git a/kdump-logger.sh b/kdump-logger.sh
index 370e5e8..98c4eea 100755
--- a/kdump-logger.sh
+++ b/kdump-logger.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
#
# This comes from the dracut-logger.sh
#
@@ -53,11 +53,12 @@ fi
#
get_kdump_loglvl()
{
- (type -p getarg) && kdump_sysloglvl=$(getarg rd.kdumploglvl)
+ [ -f /lib/dracut-lib.sh ] && kdump_sysloglvl=$(getarg rd.kdumploglvl)
[ -z "$kdump_sysloglvl" ] && return 1;
- (type -p isdigit) && isdigit $kdump_sysloglvl
- [ $? -ne 0 ] && return 1;
+ if [ -f /lib/dracut-lib.sh ] && ! isdigit "$kdump_sysloglvl"; then
+ return 1
+ fi
return 0
}
@@ -83,11 +84,10 @@ check_loglvl()
# @retval 0 on success.
#
dlog_init() {
- local ret=0; local errmsg
+ ret=0
if [ -s /proc/vmcore ];then
- get_kdump_loglvl
- if [ $? -ne 0 ];then
+ if ! get_kdump_loglvl; then
logger -t "kdump[$$]" -p warn -- "Kdump is using the default log level(3)."
kdump_sysloglvl=3
fi
@@ -104,8 +104,7 @@ dlog_init() {
[ -z "$kdump_kmsgloglvl" ] && kdump_kmsgloglvl=0
for loglvl in "$kdump_stdloglvl" "$kdump_kmsgloglvl" "$kdump_sysloglvl"; do
- check_loglvl "$loglvl"
- if [ $? -ne 0 ]; then
+ if ! check_loglvl "$loglvl"; then
echo "Illegal log level: $kdump_stdloglvl $kdump_kmsgloglvl $kdump_sysloglvl"
return 1
fi
@@ -114,21 +113,21 @@ dlog_init() {
# Skip initialization if it's already done.
[ -n "$kdump_maxloglvl" ] && return 0
- if [[ $UID -ne 0 ]]; then
+ if [ "$UID" -ne 0 ]; then
kdump_kmsgloglvl=0
kdump_sysloglvl=0
fi
- if [[ $kdump_sysloglvl -gt 0 ]]; then
- if [[ -d /run/systemd/journal ]] \
- && type -P systemd-cat &>/dev/null \
- && systemctl --quiet is-active systemd-journald.socket &>/dev/null; then
+ if [ "$kdump_sysloglvl" -gt 0 ]; then
+ if [ -d /run/systemd/journal ] \
+ && systemd-cat --version 1>/dev/null 2>&1 \
+ && systemctl --quiet is-active systemd-journald.socket 1>/dev/null 2>&1; then
readonly _systemdcatfile="/var/tmp/systemd-cat"
- mkfifo "$_systemdcatfile" &>/dev/null
+ mkfifo "$_systemdcatfile" 1>/dev/null 2>&1
readonly _dlogfd=15
systemd-cat -t 'kdump' --level-prefix=true <"$_systemdcatfile" &
exec 15>"$_systemdcatfile"
- elif ! [ -S /dev/log -a -w /dev/log ] || ! command -v logger >/dev/null; then
+ elif ! [ -S /dev/log ] && [ -w /dev/log ] || ! command -v logger >/dev/null; then
# We cannot log to syslog, so turn this facility off.
kdump_kmsgloglvl=$kdump_sysloglvl
kdump_sysloglvl=0
@@ -137,31 +136,31 @@ dlog_init() {
fi
fi
- local lvl; local maxloglvl_l=0
- for lvl in $kdump_stdloglvl $kdump_sysloglvl $kdump_kmsgloglvl; do
- [[ $lvl -gt $maxloglvl_l ]] && maxloglvl_l=$lvl
+ kdump_maxloglvl=0
+ for _dlog_lvl in $kdump_stdloglvl $kdump_sysloglvl $kdump_kmsgloglvl; do
+ [ $_dlog_lvl -gt $kdump_maxloglvl ] && kdump_maxloglvl=$_dlog_lvl
done
- readonly kdump_maxloglvl=$maxloglvl_l
+ readonly kdump_maxloglvl
export kdump_maxloglvl
- if [[ $kdump_stdloglvl -lt 4 ]] && [[ $kdump_kmsgloglvl -lt 4 ]] && [[ $kdump_sysloglvl -lt 4 ]]; then
+ if [ $kdump_stdloglvl -lt 4 ] && [ $kdump_kmsgloglvl -lt 4 ] && [ $kdump_sysloglvl -lt 4 ]; then
unset ddebug
ddebug() { :; };
fi
- if [[ $kdump_stdloglvl -lt 3 ]] && [[ $kdump_kmsgloglvl -lt 3 ]] && [[ $kdump_sysloglvl -lt 3 ]]; then
+ if [ $kdump_stdloglvl -lt 3 ] && [ $kdump_kmsgloglvl -lt 3 ] && [ $kdump_sysloglvl -lt 3 ]; then
unset dinfo
dinfo() { :; };
fi
- if [[ $kdump_stdloglvl -lt 2 ]] && [[ $kdump_kmsgloglvl -lt 2 ]] && [[ $kdump_sysloglvl -lt 2 ]]; then
+ if [ $kdump_stdloglvl -lt 2 ] && [ $kdump_kmsgloglvl -lt 2 ] && [ $kdump_sysloglvl -lt 2 ]; then
unset dwarn
dwarn() { :; };
unset dwarning
dwarning() { :; };
fi
- if [[ $kdump_stdloglvl -lt 1 ]] && [[ $kdump_kmsgloglvl -lt 1 ]] && [[ $kdump_sysloglvl -lt 1 ]]; then
+ if [ $kdump_stdloglvl -lt 1 ] && [ $kdump_kmsgloglvl -lt 1 ] && [ $kdump_sysloglvl -lt 1 ]; then
unset derror
derror() { :; };
fi
@@ -173,7 +172,7 @@ dlog_init() {
## @brief Converts numeric level to logger priority defined by POSIX.2.
#
-# @param lvl Numeric logging level in range from 1 to 4.
+# @param $1: Numeric logging level in range from 1 to 4.
# @retval 1 if @a lvl is out of range.
# @retval 0 if @a lvl is correct.
# @result Echoes logger priority.
@@ -189,7 +188,7 @@ _lvl2syspri() {
## @brief Converts logger numeric level to syslog log level
#
-# @param lvl Numeric logging level in range from 1 to 4.
+# @param $1: Numeric logging level in range from 1 to 4.
# @retval 1 if @a lvl is out of range.
# @retval 0 if @a lvl is correct.
# @result Echoes kernel console numeric log level
@@ -209,27 +208,25 @@ _lvl2syspri() {
#
# @see /usr/include/sys/syslog.h
_dlvl2syslvl() {
- local lvl
-
case "$1" in
- 1) lvl=3;;
- 2) lvl=4;;
- 3) lvl=6;;
- 4) lvl=7;;
+ 1) set -- 3;;
+ 2) set -- 4;;
+ 3) set -- 6;;
+ 4) set -- 7;;
*) return 1;;
esac
# The number is constructed by multiplying the facility by 8 and then
# adding the level.
# About The Syslog Protocol, please refer to the RFC5424 for more details.
- echo $((24+$lvl))
+ echo $((24 + $1))
}
## @brief Prints to stderr, to syslog and/or /dev/kmsg given message with
# given level (priority).
#
-# @param lvl Numeric logging level.
-# @param msg Message.
+# @param $1: Numeric logging level.
+# @param $2: Message.
# @retval 0 It's always returned, even if logging failed.
#
# @note This function is not supposed to be called manually. Please use
@@ -251,27 +248,24 @@ _dlvl2syslvl() {
# - @c INFO to @c info
# - @c DEBUG to @c debug
_do_dlog() {
- local lvl="$1"; shift
- local msg="$*"
+ [ "$1" -le $kdump_stdloglvl ] && printf -- 'kdump: %s\n' "$2" >&2
- [[ $lvl -le $kdump_stdloglvl ]] && printf -- 'kdump: %s\n' "$msg" >&2
-
- if [[ $lvl -le $kdump_sysloglvl ]]; then
- if [[ "$_dlogfd" ]]; then
- printf -- "<%s>%s\n" "$(($(_dlvl2syslvl $lvl) & 7))" "$msg" >&$_dlogfd
+ if [ "$1" -le $kdump_sysloglvl ]; then
+ if [ "$_dlogfd" ]; then
+ printf -- "<%s>%s\n" "$(($(_dlvl2syslvl "$1") & 7))" "$2" 1>&$_dlogfd
else
- logger -t "kdump[$$]" -p $(_lvl2syspri $lvl) -- "$msg"
+ logger -t "kdump[$$]" -p "$(_lvl2syspri "$1")" -- "$2"
fi
fi
- [[ $lvl -le $kdump_kmsgloglvl ]] && \
- echo "<$(_dlvl2syslvl $lvl)>kdump[$$] $msg" >/dev/kmsg
+ [ "$1" -le $kdump_kmsgloglvl ] && \
+ echo "<$(_dlvl2syslvl "$1")>kdump[$$] $2" >/dev/kmsg
}
## @brief Internal helper function for _do_dlog()
#
-# @param lvl Numeric logging level.
-# @param msg Message.
+# @param $1: Numeric logging level.
+# @param $2 [...]: Message.
# @retval 0 It's always returned, even if logging failed.
#
# @note This function is not supposed to be called manually. Please use
@@ -286,12 +280,13 @@ _do_dlog() {
# echo "This is a warning" | dwarn
dlog() {
[ -z "$kdump_maxloglvl" ] && return 0
- [[ $1 -le $kdump_maxloglvl ]] || return 0
+ [ "$1" -le "$kdump_maxloglvl" ] || return 0
- if [[ $# -gt 1 ]]; then
- _do_dlog "$@"
+ if [ $# -gt 1 ]; then
+ _dlog_lvl=$1; shift
+ _do_dlog "$_dlog_lvl" "$*"
else
- while read line || [ -n "$line" ]; do
+ while read -r line || [ -n "$line" ]; do
_do_dlog "$1" "$line"
done
fi
@@ -304,7 +299,9 @@ dlog() {
ddebug() {
set +x
dlog 4 "$@"
- [ -n "$debug" ] && set -x || :
+ if [ -n "$debug" ]; then
+ set -x
+ fi
}
## @brief Logs message at INFO level (3)
@@ -314,7 +311,9 @@ ddebug() {
dinfo() {
set +x
dlog 3 "$@"
- [ -n "$debug" ] && set -x || :
+ if [ -n "$debug" ]; then
+ set -x
+ fi
}
## @brief Logs message at WARN level (2)
@@ -324,7 +323,9 @@ dinfo() {
dwarn() {
set +x
dlog 2 "$@"
- [ -n "$debug" ] && set -x || :
+ if [ -n "$debug" ]; then
+ set -x
+ fi
}
## @brief It's an alias to dwarn() function.
@@ -334,7 +335,9 @@ dwarn() {
dwarning() {
set +x
dwarn "$@"
- [ -n "$debug" ] && set -x || :
+ if [ -n "$debug" ]; then
+ set -x
+ fi
}
## @brief Logs message at ERROR level (1)
@@ -344,5 +347,7 @@ dwarning() {
derror() {
set +x
dlog 1 "$@"
- [ -n "$debug" ] && set -x || :
+ if [ -n "$debug" ]; then
+ set -x
+ fi
}
commit 4cdce1f48915c1f46ef01af4b50d000c5858cbdf
Author: Kairui Song <kasong(a)redhat.com>
Date: Tue Sep 14 03:09:30 2021 +0800
kdump-lib.sh: reformat with shfmt
This is a batch update done with:
shfmt -s -w kdump-lib.sh
Clean up code style and reduce code base size, no behaviour change.
Signed-off-by: Kairui Song <kasong(a)redhat.com>
Acked-by: Philipp Rudo <prudo(a)redhat.com>
diff --git a/kdump-lib.sh b/kdump-lib.sh
index ac36592..2e2775c 100755
--- a/kdump-lib.sh
+++ b/kdump-lib.sh
@@ -11,137 +11,141 @@ FADUMP_ENABLED_SYS_NODE="/sys/kernel/fadump_enabled"
is_fadump_capable()
{
- # Check if firmware-assisted dump is enabled
- # if no, fallback to kdump check
- if [[ -f $FADUMP_ENABLED_SYS_NODE ]]; then
- rc=$(<$FADUMP_ENABLED_SYS_NODE)
- [[ $rc -eq 1 ]] && return 0
- fi
- return 1
+ # Check if firmware-assisted dump is enabled
+ # if no, fallback to kdump check
+ if [[ -f $FADUMP_ENABLED_SYS_NODE ]]; then
+ rc=$(< $FADUMP_ENABLED_SYS_NODE)
+ [[ $rc -eq 1 ]] && return 0
+ fi
+ return 1
}
-is_squash_available() {
- for kmodule in squashfs overlay loop; do
- if [[ -z "$KDUMP_KERNELVER" ]]; then
- modprobe --dry-run $kmodule &>/dev/null || return 1
- else
- modprobe -S "$KDUMP_KERNELVER" --dry-run $kmodule &>/dev/null || return 1
- fi
- done
+is_squash_available()
+{
+ for kmodule in squashfs overlay loop; do
+ if [[ -z $KDUMP_KERNELVER ]]; then
+ modprobe --dry-run $kmodule &> /dev/null || return 1
+ else
+ modprobe -S "$KDUMP_KERNELVER" --dry-run $kmodule &> /dev/null || return 1
+ fi
+ done
}
-perror_exit() {
- derror "$@"
- exit 1
+perror_exit()
+{
+ derror "$@"
+ exit 1
}
# Check if fence kdump is configured in Pacemaker cluster
is_pcs_fence_kdump()
{
- # no pcs or fence_kdump_send executables installed?
- type -P pcs > /dev/null || return 1
- [[ -x $FENCE_KDUMP_SEND ]] || return 1
+ # no pcs or fence_kdump_send executables installed?
+ type -P pcs > /dev/null || return 1
+ [[ -x $FENCE_KDUMP_SEND ]] || return 1
- # fence kdump not configured?
- (pcs cluster cib | grep 'type="fence_kdump"') &> /dev/null || return 1
+ # fence kdump not configured?
+ (pcs cluster cib | grep 'type="fence_kdump"') &> /dev/null || return 1
}
# Check if fence_kdump is configured using kdump options
is_generic_fence_kdump()
{
- [[ -x $FENCE_KDUMP_SEND ]] || return 1
+ [[ -x $FENCE_KDUMP_SEND ]] || return 1
- [[ $(kdump_get_conf_val fence_kdump_nodes) ]]
+ [[ $(kdump_get_conf_val fence_kdump_nodes) ]]
}
-to_dev_name() {
- local dev="${1//\"/}"
+to_dev_name()
+{
+ local dev="${1//\"/}"
- case "$dev" in
- UUID=*)
- blkid -U "${dev#UUID=}"
- ;;
- LABEL=*)
- blkid -L "${dev#LABEL=}"
- ;;
- *)
- echo "$dev"
- esac
+ case "$dev" in
+ UUID=*)
+ blkid -U "${dev#UUID=}"
+ ;;
+ LABEL=*)
+ blkid -L "${dev#LABEL=}"
+ ;;
+ *)
+ echo "$dev"
+ ;;
+ esac
}
is_user_configured_dump_target()
{
- [[ $(kdump_get_conf_val "ext[234]\|xfs\|btrfs\|minix\|raw\|nfs\|ssh") ]] || is_mount_in_dracut_args
+ [[ $(kdump_get_conf_val "ext[234]\|xfs\|btrfs\|minix\|raw\|nfs\|ssh") ]] || is_mount_in_dracut_args
}
get_user_configured_dump_disk()
{
- local _target
+ local _target
- _target=$(kdump_get_conf_val "ext[234]\|xfs\|btrfs\|minix\|raw")
- [[ -n "$_target" ]] && echo "$_target" && return
+ _target=$(kdump_get_conf_val "ext[234]\|xfs\|btrfs\|minix\|raw")
+ [[ -n $_target ]] && echo "$_target" && return
- _target=$(get_dracut_args_target "$(kdump_get_conf_val "dracut_args")")
- [[ -b "$_target" ]] && echo "$_target"
+ _target=$(get_dracut_args_target "$(kdump_get_conf_val "dracut_args")")
+ [[ -b $_target ]] && echo "$_target"
}
get_block_dump_target()
{
- local _target _path
+ local _target _path
- if is_ssh_dump_target || is_nfs_dump_target; then
- return
- fi
+ if is_ssh_dump_target || is_nfs_dump_target; then
+ return
+ fi
- _target=$(get_user_configured_dump_disk)
- [[ -n "$_target" ]] && to_dev_name "$_target" && return
+ _target=$(get_user_configured_dump_disk)
+ [[ -n $_target ]] && to_dev_name "$_target" && return
- # Get block device name from local save path
- _path=$(get_save_path)
- _target=$(get_target_from_path "$_path")
- [[ -b "$_target" ]] && to_dev_name "$_target"
+ # Get block device name from local save path
+ _path=$(get_save_path)
+ _target=$(get_target_from_path "$_path")
+ [[ -b $_target ]] && to_dev_name "$_target"
}
is_dump_to_rootfs()
{
- [[ $(kdump_get_conf_val "failure_action|default") == dump_to_rootfs ]]
+ [[ $(kdump_get_conf_val "failure_action|default") == dump_to_rootfs ]]
}
get_failure_action_target()
{
- local _target
+ local _target
- if is_dump_to_rootfs; then
- # Get rootfs device name
- _target=$(get_root_fs_device)
- [[ -b "$_target" ]] && to_dev_name "$_target" && return
- # Then, must be nfs root
- echo "nfs"
- fi
+ if is_dump_to_rootfs; then
+ # Get rootfs device name
+ _target=$(get_root_fs_device)
+ [[ -b $_target ]] && to_dev_name "$_target" && return
+ # Then, must be nfs root
+ echo "nfs"
+ fi
}
# Get kdump targets(including root in case of dump_to_rootfs).
get_kdump_targets()
{
- local _target _root
- local kdump_targets
+ local _target _root
+ local kdump_targets
- _target=$(get_block_dump_target)
- if [[ -n "$_target" ]]; then
- kdump_targets=$_target
- elif is_ssh_dump_target; then
- kdump_targets="ssh"
- else
- kdump_targets="nfs"
- fi
+ _target=$(get_block_dump_target)
+ if [[ -n $_target ]]; then
+ kdump_targets=$_target
+ elif is_ssh_dump_target; then
+ kdump_targets="ssh"
+ else
+ kdump_targets="nfs"
+ fi
- # Add the root device if dump_to_rootfs is specified.
- _root=$(get_failure_action_target)
- if [[ -n "$_root" ]] && [[ "$kdump_targets" != "$_root" ]]; then
- kdump_targets="$kdump_targets $_root"
- fi
+ # Add the root device if dump_to_rootfs is specified.
+ _root=$(get_failure_action_target)
+ if [[ -n $_root ]] && [[ $kdump_targets != "$_root" ]]; then
+ kdump_targets="$kdump_targets $_root"
+ fi
- echo "$kdump_targets"
+ echo "$kdump_targets"
}
# Return the bind mount source path, return the path itself if it's not bind mounted
@@ -158,128 +162,128 @@ get_kdump_targets()
# part is the bind mounted directory which quotes by bracket "[]".
get_bind_mount_source()
{
- local _mnt _path _src _opt _fstype
- local _fsroot _src_nofsroot
+ local _mnt _path _src _opt _fstype
+ local _fsroot _src_nofsroot
- _mnt=$(df "$1" | tail -1 | awk '{print $NF}')
- _path=${1#$_mnt}
+ _mnt=$(df "$1" | tail -1 | awk '{print $NF}')
+ _path=${1#$_mnt}
- _src=$(get_mount_info SOURCE target "$_mnt" -f)
- _opt=$(get_mount_info OPTIONS target "$_mnt" -f)
- _fstype=$(get_mount_info FSTYPE target "$_mnt" -f)
+ _src=$(get_mount_info SOURCE target "$_mnt" -f)
+ _opt=$(get_mount_info OPTIONS target "$_mnt" -f)
+ _fstype=$(get_mount_info FSTYPE target "$_mnt" -f)
- # bind mount in fstab
- if [[ -d "$_src" ]] && [[ "$_fstype" = none ]] && (echo "$_opt" | grep -q "\bbind\b"); then
- echo "$_src$_path" && return
- fi
+ # bind mount in fstab
+ if [[ -d $_src ]] && [[ $_fstype == none ]] && (echo "$_opt" | grep -q "\bbind\b"); then
+ echo "$_src$_path" && return
+ fi
- # direct mount
- _src_nofsroot=$(get_mount_info SOURCE target "$_mnt" -v -f)
- if [[ $_src_nofsroot = "$_src" ]]; then
- echo "$_mnt$_path" && return
- fi
+ # direct mount
+ _src_nofsroot=$(get_mount_info SOURCE target "$_mnt" -v -f)
+ if [[ $_src_nofsroot == "$_src" ]]; then
+ echo "$_mnt$_path" && return
+ fi
- _fsroot=${_src#${_src_nofsroot}[}
- _fsroot=${_fsroot%]}
- _mnt=$(get_mount_info TARGET source "$_src_nofsroot" -f)
+ _fsroot=${_src#${_src_nofsroot}[}
+ _fsroot=${_fsroot%]}
+ _mnt=$(get_mount_info TARGET source "$_src_nofsroot" -f)
- # for btrfs, _fsroot will also contain the subvol value as well, strip it
- if [[ "$_fstype" = btrfs ]]; then
- local _subvol
- _subvol=${_opt#*subvol=}
- _subvol=${_subvol%,*}
- _fsroot=${_fsroot#$_subvol}
- fi
- echo "$_mnt$_fsroot$_path"
+ # for btrfs, _fsroot will also contain the subvol value as well, strip it
+ if [[ $_fstype == btrfs ]]; then
+ local _subvol
+ _subvol=${_opt#*subvol=}
+ _subvol=${_subvol%,*}
+ _fsroot=${_fsroot#$_subvol}
+ fi
+ echo "$_mnt$_fsroot$_path"
}
get_mntopt_from_target()
{
- get_mount_info OPTIONS source "$1" -f
+ get_mount_info OPTIONS source "$1" -f
}
# Get the path where the target will be mounted in kdump kernel
# $1: kdump target device
get_kdump_mntpoint_from_target()
{
- local _mntpoint
-
- _mntpoint=$(get_mntpoint_from_target "$1")
- # mount under /sysroot if dump to root disk or mount under
- # mount under /kdumproot if dump target is not mounted in first kernel
- # mount under /kdumproot/$_mntpoint in other cases in 2nd kernel.
- # systemd will be in charge to umount it.
- if [[ -z "$_mntpoint" ]];then
- _mntpoint="/kdumproot"
- else
- if [[ "$_mntpoint" = "/" ]];then
- _mntpoint="/sysroot"
- else
- _mntpoint="/kdumproot/$_mntpoint"
- fi
- fi
-
- # strip duplicated "/"
- echo $_mntpoint | tr -s "/"
-}
-
-kdump_get_persistent_dev() {
- local dev="${1//\"/}"
-
- case "$dev" in
- UUID=*)
- dev=$(blkid -U "${dev#UUID=}")
- ;;
- LABEL=*)
- dev=$(blkid -L "${dev#LABEL=}")
- ;;
- esac
- echo $(get_persistent_dev "$dev")
+ local _mntpoint
+
+ _mntpoint=$(get_mntpoint_from_target "$1")
+ # mount under /sysroot if dump to root disk or mount under
+ # mount under /kdumproot if dump target is not mounted in first kernel
+ # mount under /kdumproot/$_mntpoint in other cases in 2nd kernel.
+ # systemd will be in charge to umount it.
+ if [[ -z $_mntpoint ]]; then
+ _mntpoint="/kdumproot"
+ else
+ if [[ $_mntpoint == "/" ]]; then
+ _mntpoint="/sysroot"
+ else
+ _mntpoint="/kdumproot/$_mntpoint"
+ fi
+ fi
+
+ # strip duplicated "/"
+ echo $_mntpoint | tr -s "/"
+}
+
+kdump_get_persistent_dev()
+{
+ local dev="${1//\"/}"
+
+ case "$dev" in
+ UUID=*)
+ dev=$(blkid -U "${dev#UUID=}")
+ ;;
+ LABEL=*)
+ dev=$(blkid -L "${dev#LABEL=}")
+ ;;
+ esac
+ echo $(get_persistent_dev "$dev")
}
is_atomic()
{
- grep -q "ostree" /proc/cmdline
+ grep -q "ostree" /proc/cmdline
}
# get ip address or hostname from nfs/ssh config value
get_remote_host()
{
- local _config_val=$1
+ local _config_val=$1
- # ipv6 address in kdump.conf is around with "[]",
- # factor out the ipv6 address
- _config_val=${_config_val#*@}
- _config_val=${_config_val%:/*}
- _config_val=${_config_val#[}
- _config_val=${_config_val%]}
- echo "$_config_val"
+ # ipv6 address in kdump.conf is around with "[]",
+ # factor out the ipv6 address
+ _config_val=${_config_val#*@}
+ _config_val=${_config_val%:/*}
+ _config_val=${_config_val#[}
+ _config_val=${_config_val%]}
+ echo "$_config_val"
}
is_hostname()
{
- local _hostname
+ local _hostname
- _hostname=$(echo "$1" | grep ":")
- if [[ -n "$_hostname" ]]; then
- return 1
- fi
- echo "$1" | grep -q "[a-zA-Z]"
+ _hostname=$(echo "$1" | grep ":")
+ if [[ -n $_hostname ]]; then
+ return 1
+ fi
+ echo "$1" | grep -q "[a-zA-Z]"
}
# Copied from "/etc/sysconfig/network-scripts/network-functions"
get_hwaddr()
{
- if [[ -f "/sys/class/net/$1/address" ]]; then
- awk '{ print toupper($0) }' < "/sys/class/net/$1/address"
- elif [[ -d "/sys/class/net/$1" ]]; then
- LC_ALL="" LANG="" ip -o link show "$1" 2>/dev/null | \
- awk '{ print toupper(gensub(/.*link\/[^ ]* ([[:alnum:]:]*).*/,
+ if [[ -f "/sys/class/net/$1/address" ]]; then
+ awk '{ print toupper($0) }' < "/sys/class/net/$1/address"
+ elif [[ -d "/sys/class/net/$1" ]]; then
+ LC_ALL="" LANG="" ip -o link show "$1" 2> /dev/null |
+ awk '{ print toupper(gensub(/.*link\/[^ ]* ([[:alnum:]:]*).*/,
"\\1", 1)); }'
- fi
+ fi
}
-
# Get value by a field using "nmcli -g"
# Usage: get_nmcli_value_by_field <field> <nmcli command>
#
@@ -292,16 +296,16 @@ get_hwaddr()
# bond.options "mode=balance-rr"
get_nmcli_value_by_field()
{
- LANG=C nmcli --get-values "$@"
+ LANG=C nmcli --get-values "$@"
}
# Get nmcli field value of an connection apath (a D-Bus active connection path)
# Usage: get_nmcli_field_by_apath <field> <apath>
get_nmcli_field_by_conpath()
{
- local _field=$1 _apath=$2
+ local _field=$1 _apath=$2
- get_nmcli_value_by_field "$_field" connection show "$_apath"
+ get_nmcli_value_by_field "$_field" connection show "$_apath"
}
# Get nmcli connection apath (a D-Bus active connection path ) by ifname
@@ -310,129 +314,133 @@ get_nmcli_field_by_conpath()
# $ nmcli connection show $apath
get_nmcli_connection_apath_by_ifname()
{
- local _ifname=$1
+ local _ifname=$1
- get_nmcli_value_by_field "GENERAL.CON-PATH" device show "$_ifname"
+ get_nmcli_value_by_field "GENERAL.CON-PATH" device show "$_ifname"
}
get_ifcfg_by_device()
{
- grep -E -i -l "^[[:space:]]*DEVICE=\"*${1}\"*[[:space:]]*$" \
- /etc/sysconfig/network-scripts/ifcfg-* 2>/dev/null | head -1
+ grep -E -i -l "^[[:space:]]*DEVICE=\"*${1}\"*[[:space:]]*$" \
+ /etc/sysconfig/network-scripts/ifcfg-* 2> /dev/null | head -1
}
get_ifcfg_by_hwaddr()
{
- grep -E -i -l "^[[:space:]]*HWADDR=\"*${1}\"*[[:space:]]*$" \
- /etc/sysconfig/network-scripts/ifcfg-* 2>/dev/null | head -1
+ grep -E -i -l "^[[:space:]]*HWADDR=\"*${1}\"*[[:space:]]*$" \
+ /etc/sysconfig/network-scripts/ifcfg-* 2> /dev/null | head -1
}
get_ifcfg_by_uuid()
{
- grep -E -i -l "^[[:space:]]*UUID=\"*${1}\"*[[:space:]]*$" \
- /etc/sysconfig/network-scripts/ifcfg-* 2>/dev/null | head -1
+ grep -E -i -l "^[[:space:]]*UUID=\"*${1}\"*[[:space:]]*$" \
+ /etc/sysconfig/network-scripts/ifcfg-* 2> /dev/null | head -1
}
get_ifcfg_by_name()
{
- grep -E -i -l "^[[:space:]]*NAME=\"*${1}\"*[[:space:]]*$" \
- /etc/sysconfig/network-scripts/ifcfg-* 2>/dev/null | head -1
+ grep -E -i -l "^[[:space:]]*NAME=\"*${1}\"*[[:space:]]*$" \
+ /etc/sysconfig/network-scripts/ifcfg-* 2> /dev/null | head -1
}
is_nm_running()
{
- [[ "$(LANG=C nmcli -t --fields running general status 2>/dev/null)" = "running" ]]
+ [[ "$(LANG=C nmcli -t --fields running general status 2> /dev/null)" == "running" ]]
}
is_nm_handling()
{
- LANG=C nmcli -t --fields device,state dev status 2>/dev/null \
- | grep -q "^\(${1}:connected\)\|\(${1}:connecting.*\)$"
+ LANG=C nmcli -t --fields device,state dev status 2> /dev/null |
+ grep -q "^\(${1}:connected\)\|\(${1}:connecting.*\)$"
}
# $1: netdev name
get_ifcfg_nmcli()
{
- local nm_uuid nm_name
- local ifcfg_file
+ local nm_uuid nm_name
+ local ifcfg_file
- # Get the active nmcli config name of $1
- if is_nm_running && is_nm_handling "${1}" ; then
- # The configuration "uuid" and "name" generated by nm is wrote to
- # the ifcfg file as "UUID=<nm_uuid>" and "NAME=<nm_name>".
- nm_uuid=$(LANG=C nmcli -t --fields uuid,device c show --active 2>/dev/null \
- | grep "${1}" | head -1 | cut -d':' -f1)
- nm_name=$(LANG=C nmcli -t --fields name,device c show --active 2>/dev/null \
- | grep "${1}" | head -1 | cut -d':' -f1)
- ifcfg_file=$(get_ifcfg_by_uuid "${nm_uuid}")
- [[ -z "${ifcfg_file}" ]] && ifcfg_file=$(get_ifcfg_by_name "${nm_name}")
- fi
+ # Get the active nmcli config name of $1
+ if is_nm_running && is_nm_handling "${1}"; then
+ # The configuration "uuid" and "name" generated by nm is wrote to
+ # the ifcfg file as "UUID=<nm_uuid>" and "NAME=<nm_name>".
+ nm_uuid=$(LANG=C nmcli -t --fields uuid,device c show --active 2> /dev/null |
+ grep "${1}" | head -1 | cut -d':' -f1)
+ nm_name=$(LANG=C nmcli -t --fields name,device c show --active 2> /dev/null |
+ grep "${1}" | head -1 | cut -d':' -f1)
+ ifcfg_file=$(get_ifcfg_by_uuid "${nm_uuid}")
+ [[ -z ${ifcfg_file} ]] && ifcfg_file=$(get_ifcfg_by_name "${nm_name}")
+ fi
- echo -n "${ifcfg_file}"
+ echo -n "${ifcfg_file}"
}
# $1: netdev name
get_ifcfg_legacy()
{
- local ifcfg_file hwaddr
+ local ifcfg_file hwaddr
- ifcfg_file="/etc/sysconfig/network-scripts/ifcfg-${1}"
- [[ -f "${ifcfg_file}" ]] && echo -n "${ifcfg_file}" && return
+ ifcfg_file="/etc/sysconfig/network-scripts/ifcfg-${1}"
+ [[ -f ${ifcfg_file} ]] && echo -n "${ifcfg_file}" && return
- ifcfg_file=$(get_ifcfg_by_name "${1}")
- [[ -f "${ifcfg_file}" ]] && echo -n "${ifcfg_file}" && return
+ ifcfg_file=$(get_ifcfg_by_name "${1}")
+ [[ -f ${ifcfg_file} ]] && echo -n "${ifcfg_file}" && return
- hwaddr=$(get_hwaddr "${1}")
- if [[ -n "$hwaddr" ]]; then
- ifcfg_file=$(get_ifcfg_by_hwaddr "${hwaddr}")
- [[ -f "${ifcfg_file}" ]] && echo -n "${ifcfg_file}" && return
- fi
+ hwaddr=$(get_hwaddr "${1}")
+ if [[ -n $hwaddr ]]; then
+ ifcfg_file=$(get_ifcfg_by_hwaddr "${hwaddr}")
+ [[ -f ${ifcfg_file} ]] && echo -n "${ifcfg_file}" && return
+ fi
- ifcfg_file=$(get_ifcfg_by_device "${1}")
+ ifcfg_file=$(get_ifcfg_by_device "${1}")
- echo -n "${ifcfg_file}"
+ echo -n "${ifcfg_file}"
}
# $1: netdev name
# Return the ifcfg file whole name(including the path) of $1 if any.
-get_ifcfg_filename() {
- local ifcfg_file
+get_ifcfg_filename()
+{
+ local ifcfg_file
- ifcfg_file=$(get_ifcfg_nmcli "${1}")
- if [[ -z "${ifcfg_file}" ]]; then
- ifcfg_file=$(get_ifcfg_legacy "${1}")
- fi
+ ifcfg_file=$(get_ifcfg_nmcli "${1}")
+ if [[ -z ${ifcfg_file} ]]; then
+ ifcfg_file=$(get_ifcfg_legacy "${1}")
+ fi
- echo -n "${ifcfg_file}"
+ echo -n "${ifcfg_file}"
}
# returns 0 when omission of a module is desired in dracut_args
# returns 1 otherwise
-is_dracut_mod_omitted() {
- local dracut_args dracut_mod=$1
+is_dracut_mod_omitted()
+{
+ local dracut_args dracut_mod=$1
- set -- $(kdump_get_conf_val dracut_args)
- while [ $# -gt 0 ]; do
- case $1 in
- -o|--omit)
- [[ " ${2//[^[:alnum:]]/ } " == *" $dracut_mod "* ]] && return 0
- esac
- shift
- done
+ set -- $(kdump_get_conf_val dracut_args)
+ while [ $# -gt 0 ]; do
+ case $1 in
+ -o | --omit)
+ [[ " ${2//[^[:alnum:]]/ } " == *" $dracut_mod "* ]] && return 0
+ ;;
+ esac
+ shift
+ done
- return 1
+ return 1
}
-is_wdt_active() {
- local active
+is_wdt_active()
+{
+ local active
- [[ -d /sys/class/watchdog ]] || return 1
- for dir in /sys/class/watchdog/*; do
- [[ -f "$dir/state" ]] || continue
- active=$(< "$dir/state")
- [[ "$active" = "active" ]] && return 0
- done
- return 1
+ [[ -d /sys/class/watchdog ]] || return 1
+ for dir in /sys/class/watchdog/*; do
+ [[ -f "$dir/state" ]] || continue
+ active=$(< "$dir/state")
+ [[ $active == "active" ]] && return 0
+ done
+ return 1
}
# If "dracut_args" contains "--mount" information, use it
@@ -440,45 +448,45 @@ is_wdt_active() {
# its correctness).
is_mount_in_dracut_args()
{
- [[ " $(kdump_get_conf_val dracut_args)" =~ .*[[:space:]]--mount[=[:space:]].* ]]
+ [[ " $(kdump_get_conf_val dracut_args)" =~ .*[[:space:]]--mount[=[:space:]].* ]]
}
check_crash_mem_reserved()
{
- local mem_reserved
+ local mem_reserved
- mem_reserved=$(</sys/kernel/kexec_crash_size)
- if [[ $mem_reserved -eq 0 ]]; then
- derror "No memory reserved for crash kernel"
- return 1
- fi
+ mem_reserved=$(< /sys/kernel/kexec_crash_size)
+ if [[ $mem_reserved -eq 0 ]]; then
+ derror "No memory reserved for crash kernel"
+ return 1
+ fi
- return 0
+ return 0
}
check_kdump_feasibility()
{
- if [[ ! -e /sys/kernel/kexec_crash_loaded ]]; then
- derror "Kdump is not supported on this kernel"
- return 1
- fi
- check_crash_mem_reserved
- return $?
+ if [[ ! -e /sys/kernel/kexec_crash_loaded ]]; then
+ derror "Kdump is not supported on this kernel"
+ return 1
+ fi
+ check_crash_mem_reserved
+ return $?
}
check_current_kdump_status()
{
- if [[ ! -f /sys/kernel/kexec_crash_loaded ]];then
- derror "Perhaps CONFIG_CRASH_DUMP is not enabled in kernel"
- return 1
- fi
+ if [[ ! -f /sys/kernel/kexec_crash_loaded ]]; then
+ derror "Perhaps CONFIG_CRASH_DUMP is not enabled in kernel"
+ return 1
+ fi
- rc=$(</sys/kernel/kexec_crash_loaded)
- if [[ $rc == 1 ]]; then
- return 0
- else
- return 1
- fi
+ rc=$(< /sys/kernel/kexec_crash_loaded)
+ if [[ $rc == 1 ]]; then
+ return 0
+ else
+ return 1
+ fi
}
# remove_cmdline_param <kernel cmdline> <param1> [<param2>] ... [<paramN>]
@@ -486,17 +494,17 @@ check_current_kdump_status()
# For each "arg" in the removing params list, "arg" and "arg=xxx" will be removed if exists.
remove_cmdline_param()
{
- local cmdline=$1
- shift
+ local cmdline=$1
+ shift
- for arg in "$@"; do
- cmdline=$(echo "$cmdline" | \
- sed -e "s/\b$arg=[^ ]*//g" \
- -e "s/^$arg\b//g" \
- -e "s/[[:space:]]$arg\b//g" \
- -e "s/\s\+/ /g")
- done
- echo "$cmdline"
+ for arg in "$@"; do
+ cmdline=$(echo "$cmdline" |
+ sed -e "s/\b$arg=[^ ]*//g" \
+ -e "s/^$arg\b//g" \
+ -e "s/[[:space:]]$arg\b//g" \
+ -e "s/\s\+/ /g")
+ done
+ echo "$cmdline"
}
#
@@ -505,12 +513,12 @@ remove_cmdline_param()
#
get_bootcpu_apicid()
{
- awk ' \
+ awk ' \
BEGIN { CPU = "-1"; } \
$1=="processor" && $2==":" { CPU = $NF; } \
CPU=="0" && /^apicid/ { print $NF; } \
- ' \
- /proc/cpuinfo
+ ' \
+ /proc/cpuinfo
}
#
@@ -519,22 +527,22 @@ get_bootcpu_apicid()
#
append_cmdline()
{
- local cmdline=$1
- local newstr=${cmdline/$2/""}
+ local cmdline=$1
+ local newstr=${cmdline/$2/""}
- # unchanged str implies argument wasn't there
- if [[ "$cmdline" == "$newstr" ]]; then
- cmdline="${cmdline} ${2}=${3}"
- fi
+ # unchanged str implies argument wasn't there
+ if [[ $cmdline == "$newstr" ]]; then
+ cmdline="${cmdline} ${2}=${3}"
+ fi
- echo "$cmdline"
+ echo "$cmdline"
}
# This function check iomem and determines if we have more than
# 4GB of ram available. Returns 1 if we do, 0 if we dont
need_64bit_headers()
{
- return "$(tail -n 1 /proc/iomem | awk '{ split ($1, r, "-");
+ return "$(tail -n 1 /proc/iomem | awk '{ split ($1, r, "-");
print (strtonum("0x" r[2]) > strtonum("0xffffffff")); }')"
}
@@ -549,39 +557,39 @@ need_64bit_headers()
# Assume efivars is mounted at /sys/firmware/efi/efivars.
is_secure_boot_enforced()
{
- local secure_boot_file setup_mode_file
- local secure_boot_byte setup_mode_byte
+ local secure_boot_file setup_mode_file
+ local secure_boot_byte setup_mode_byte
- # On powerpc, secure boot is enforced if:
- # host secure boot: /ibm,secure-boot/os-secureboot-enforcing DT property exists
- # guest secure boot: /ibm,secure-boot >= 2
- if [[ -f /proc/device-tree/ibm,secureboot/os-secureboot-enforcing ]]; then
+ # On powerpc, secure boot is enforced if:
+ # host secure boot: /ibm,secure-boot/os-secureboot-enforcing DT property exists
+ # guest secure boot: /ibm,secure-boot >= 2
+ if [[ -f /proc/device-tree/ibm,secureboot/os-secureboot-enforcing ]]; then
return 0
- fi
- if [[ -f /proc/device-tree/ibm,secure-boot ]] && \
- [[ $(lsprop /proc/device-tree/ibm,secure-boot | tail -1) -ge 2 ]]; then
+ fi
+ if [[ -f /proc/device-tree/ibm,secure-boot ]] &&
+ [[ $(lsprop /proc/device-tree/ibm,secure-boot | tail -1) -ge 2 ]]; then
return 0
- fi
+ fi
- # Detect secure boot on x86 and arm64
- secure_boot_file=$(find /sys/firmware/efi/efivars -name "SecureBoot-*" 2>/dev/null)
- setup_mode_file=$(find /sys/firmware/efi/efivars -name "SetupMode-*" 2>/dev/null)
+ # Detect secure boot on x86 and arm64
+ secure_boot_file=$(find /sys/firmware/efi/efivars -name "SecureBoot-*" 2> /dev/null)
+ setup_mode_file=$(find /sys/firmware/efi/efivars -name "SetupMode-*" 2> /dev/null)
- if [[ -f "$secure_boot_file" ]] && [[ -f "$setup_mode_file" ]]; then
- secure_boot_byte=$(hexdump -v -e '/1 "%d\ "' "$secure_boot_file" | cut -d' ' -f 5)
- setup_mode_byte=$(hexdump -v -e '/1 "%d\ "' "$setup_mode_file" | cut -d' ' -f 5)
+ if [[ -f $secure_boot_file ]] && [[ -f $setup_mode_file ]]; then
+ secure_boot_byte=$(hexdump -v -e '/1 "%d\ "' "$secure_boot_file" | cut -d' ' -f 5)
+ setup_mode_byte=$(hexdump -v -e '/1 "%d\ "' "$setup_mode_file" | cut -d' ' -f 5)
- if [[ "$secure_boot_byte" = "1" ]] && [[ "$setup_mode_byte" = "0" ]]; then
- return 0
- fi
- fi
+ if [[ $secure_boot_byte == "1" ]] && [[ $setup_mode_byte == "0" ]]; then
+ return 0
+ fi
+ fi
- # Detect secure boot on s390x
- if [[ -e "/sys/firmware/ipl/secure" && "$(</sys/firmware/ipl/secure)" == "1" ]]; then
- return 0
- fi
+ # Detect secure boot on s390x
+ if [[ -e "/sys/firmware/ipl/secure" && "$(< /sys/firmware/ipl/secure)" == "1" ]]; then
+ return 0
+ fi
- return 1
+ return 1
}
#
@@ -590,31 +598,27 @@ is_secure_boot_enforced()
#
prepare_kexec_args()
{
- local kexec_args=$1
- local found_elf_args
-
- ARCH=$(uname -m)
- if [[ "$ARCH" == "i686" ]] || [[ "$ARCH" == "i386" ]]
- then
- need_64bit_headers
- if [[ $? == 1 ]]
- then
- found_elf_args=$(echo "$kexec_args" | grep elf32-core-headers)
- if [[ -n "$found_elf_args" ]]
- then
- dwarn "Warning: elf32-core-headers overrides correct elf64 setting"
- else
- kexec_args="$kexec_args --elf64-core-headers"
- fi
- else
- found_elf_args=$(echo "$kexec_args" | grep elf64-core-headers)
- if [[ -z "$found_elf_args" ]]
- then
- kexec_args="$kexec_args --elf32-core-headers"
- fi
- fi
- fi
- echo "$kexec_args"
+ local kexec_args=$1
+ local found_elf_args
+
+ ARCH=$(uname -m)
+ if [[ $ARCH == "i686" ]] || [[ $ARCH == "i386" ]]; then
+ need_64bit_headers
+ if [[ $? == 1 ]]; then
+ found_elf_args=$(echo "$kexec_args" | grep elf32-core-headers)
+ if [[ -n $found_elf_args ]]; then
+ dwarn "Warning: elf32-core-headers overrides correct elf64 setting"
+ else
+ kexec_args="$kexec_args --elf64-core-headers"
+ fi
+ else
+ found_elf_args=$(echo "$kexec_args" | grep elf64-core-headers)
+ if [[ -z $found_elf_args ]]; then
+ kexec_args="$kexec_args --elf32-core-headers"
+ fi
+ fi
+ fi
+ echo "$kexec_args"
}
#
@@ -626,88 +630,88 @@ prepare_kexec_args()
#
prepare_kdump_bootinfo()
{
- local boot_img boot_imglist boot_dirlist boot_initrdlist
- local machine_id
-
- if [[ -z "$KDUMP_KERNELVER" ]]; then
- KDUMP_KERNELVER="$(uname -r)"
- fi
-
- read -r machine_id < /etc/machine-id
- boot_dirlist=${KDUMP_BOOTDIR:-"/boot /boot/efi /efi /"}
- boot_imglist="$KDUMP_IMG-$KDUMP_KERNELVER$KDUMP_IMG_EXT $machine_id/$KDUMP_KERNELVER/$KDUMP_IMG"
-
- # Use BOOT_IMAGE as reference if possible, strip the GRUB root device prefix in (hd0,gpt1) format
- boot_img="$(sed "s/^BOOT_IMAGE=\((\S*)\)\?\(\S*\) .*/\2/" /proc/cmdline)"
- if [[ -n "$boot_img" ]]; then
- boot_imglist="$boot_img $boot_imglist"
- fi
-
- for dir in $boot_dirlist; do
- for img in $boot_imglist; do
- if [[ -f "$dir/$img" ]]; then
- KDUMP_KERNEL=$(echo "$dir/$img" | tr -s '/')
- break 2
- fi
- done
- done
-
- if ! [[ -e "$KDUMP_KERNEL" ]]; then
- derror "Failed to detect kdump kernel location"
- return 1
- fi
-
- # Set KDUMP_BOOTDIR to where kernel image is stored
- KDUMP_BOOTDIR=$(dirname "$KDUMP_KERNEL")
-
- # Default initrd should just stay aside of kernel image, try to find it in KDUMP_BOOTDIR
- boot_initrdlist="initramfs-$KDUMP_KERNELVER.img initrd"
- for initrd in $boot_initrdlist; do
- if [[ -f "$KDUMP_BOOTDIR/$initrd" ]]; then
- defaut_initrd_base="$initrd"
- DEFAULT_INITRD="$KDUMP_BOOTDIR/$defaut_initrd_base"
- break
- fi
- done
-
- # Create kdump initrd basename from default initrd basename
- # initramfs-5.7.9-200.fc32.x86_64.img => initramfs-5.7.9-200.fc32.x86_64kdump.img
- # initrd => initrdkdump
- if [[ -z "$defaut_initrd_base" ]]; then
- kdump_initrd_base=initramfs-${KDUMP_KERNELVER}kdump.img
- elif [[ $defaut_initrd_base == *.* ]]; then
- kdump_initrd_base=${defaut_initrd_base%.*}kdump.${DEFAULT_INITRD##*.}
- else
- kdump_initrd_base=${defaut_initrd_base}kdump
- fi
-
- # Place kdump initrd in $(/var/lib/kdump) if $(KDUMP_BOOTDIR) not writable
- if [[ ! -w "$KDUMP_BOOTDIR" ]];then
- var_target_initrd_dir="/var/lib/kdump"
- mkdir -p "$var_target_initrd_dir"
- KDUMP_INITRD="$var_target_initrd_dir/$kdump_initrd_base"
- else
- KDUMP_INITRD="$KDUMP_BOOTDIR/$kdump_initrd_base"
- fi
+ local boot_img boot_imglist boot_dirlist boot_initrdlist
+ local machine_id
+
+ if [[ -z $KDUMP_KERNELVER ]]; then
+ KDUMP_KERNELVER="$(uname -r)"
+ fi
+
+ read -r machine_id < /etc/machine-id
+ boot_dirlist=${KDUMP_BOOTDIR:-"/boot /boot/efi /efi /"}
+ boot_imglist="$KDUMP_IMG-$KDUMP_KERNELVER$KDUMP_IMG_EXT $machine_id/$KDUMP_KERNELVER/$KDUMP_IMG"
+
+ # Use BOOT_IMAGE as reference if possible, strip the GRUB root device prefix in (hd0,gpt1) format
+ boot_img="$(sed "s/^BOOT_IMAGE=\((\S*)\)\?\(\S*\) .*/\2/" /proc/cmdline)"
+ if [[ -n $boot_img ]]; then
+ boot_imglist="$boot_img $boot_imglist"
+ fi
+
+ for dir in $boot_dirlist; do
+ for img in $boot_imglist; do
+ if [[ -f "$dir/$img" ]]; then
+ KDUMP_KERNEL=$(echo "$dir/$img" | tr -s '/')
+ break 2
+ fi
+ done
+ done
+
+ if ! [[ -e $KDUMP_KERNEL ]]; then
+ derror "Failed to detect kdump kernel location"
+ return 1
+ fi
+
+ # Set KDUMP_BOOTDIR to where kernel image is stored
+ KDUMP_BOOTDIR=$(dirname "$KDUMP_KERNEL")
+
+ # Default initrd should just stay aside of kernel image, try to find it in KDUMP_BOOTDIR
+ boot_initrdlist="initramfs-$KDUMP_KERNELVER.img initrd"
+ for initrd in $boot_initrdlist; do
+ if [[ -f "$KDUMP_BOOTDIR/$initrd" ]]; then
+ defaut_initrd_base="$initrd"
+ DEFAULT_INITRD="$KDUMP_BOOTDIR/$defaut_initrd_base"
+ break
+ fi
+ done
+
+ # Create kdump initrd basename from default initrd basename
+ # initramfs-5.7.9-200.fc32.x86_64.img => initramfs-5.7.9-200.fc32.x86_64kdump.img
+ # initrd => initrdkdump
+ if [[ -z $defaut_initrd_base ]]; then
+ kdump_initrd_base=initramfs-${KDUMP_KERNELVER}kdump.img
+ elif [[ $defaut_initrd_base == *.* ]]; then
+ kdump_initrd_base=${defaut_initrd_base%.*}kdump.${DEFAULT_INITRD##*.}
+ else
+ kdump_initrd_base=${defaut_initrd_base}kdump
+ fi
+
+ # Place kdump initrd in $(/var/lib/kdump) if $(KDUMP_BOOTDIR) not writable
+ if [[ ! -w $KDUMP_BOOTDIR ]]; then
+ var_target_initrd_dir="/var/lib/kdump"
+ mkdir -p "$var_target_initrd_dir"
+ KDUMP_INITRD="$var_target_initrd_dir/$kdump_initrd_base"
+ else
+ KDUMP_INITRD="$KDUMP_BOOTDIR/$kdump_initrd_base"
+ fi
}
get_watchdog_drvs()
{
- local _wdtdrvs _drv _dir
+ local _wdtdrvs _drv _dir
- for _dir in /sys/class/watchdog/*; do
- # device/modalias will return driver of this device
- [[ -f "$_dir/device/modalias" ]] || continue
- _drv=$(< "$_dir/device/modalias")
- _drv=$(modprobe --set-version "$KDUMP_KERNELVER" -R "$_drv" 2>/dev/null)
- for i in $_drv; do
- if ! [[ " $_wdtdrvs " == *" $i "* ]]; then
- _wdtdrvs="$_wdtdrvs $i"
- fi
- done
- done
+ for _dir in /sys/class/watchdog/*; do
+ # device/modalias will return driver of this device
+ [[ -f "$_dir/device/modalias" ]] || continue
+ _drv=$(< "$_dir/device/modalias")
+ _drv=$(modprobe --set-version "$KDUMP_KERNELVER" -R "$_drv" 2> /dev/null)
+ for i in $_drv; do
+ if ! [[ " $_wdtdrvs " == *" $i "* ]]; then
+ _wdtdrvs="$_wdtdrvs $i"
+ fi
+ done
+ done
- echo "$_wdtdrvs"
+ echo "$_wdtdrvs"
}
#
@@ -716,143 +720,143 @@ get_watchdog_drvs()
# Store the final result in global $KDUMP_COMMANDLINE.
prepare_cmdline()
{
- local cmdline id arg
-
- if [[ -z "$1" ]]; then
- cmdline=$(</proc/cmdline)
- else
- cmdline="$1"
- fi
-
- # These params should always be removed
- cmdline=$(remove_cmdline_param "$cmdline" crashkernel panic_on_warn)
- # These params can be removed configurably
- while read -r arg; do
- cmdline=$(remove_cmdline_param "$cmdline" "$arg")
- done <<< "$(echo "$2" | xargs -n 1 echo)"
-
- # Always remove "root=X", as we now explicitly generate all kinds
- # of dump target mount information including root fs.
- #
- # We do this before KDUMP_COMMANDLINE_APPEND, if one really cares
- # about it(e.g. for debug purpose), then can pass "root=X" using
- # KDUMP_COMMANDLINE_APPEND.
- cmdline=$(remove_cmdline_param "$cmdline" root)
-
- # With the help of "--hostonly-cmdline", we can avoid some interitage.
- cmdline=$(remove_cmdline_param "$cmdline" rd.lvm.lv rd.luks.uuid rd.dm.uuid rd.md.uuid fcoe)
-
- # Remove netroot, rd.iscsi.initiator and iscsi_initiator since
- # we get duplicate entries for the same in case iscsi code adds
- # it as well.
- cmdline=$(remove_cmdline_param "$cmdline" netroot rd.iscsi.initiator iscsi_initiator)
-
- cmdline="${cmdline} $3"
-
- id=$(get_bootcpu_apicid)
- if [[ -n ${id} ]] ; then
- cmdline=$(append_cmdline "$cmdline" disable_cpu_apicid "$id")
- fi
-
- # If any watchdog is used, set it's pretimeout to 0. pretimeout let
- # watchdog panic the kernel first, and reset the system after the
- # panic. If the system is already in kdump, panic is not helpful
- # and only increase the chance of watchdog failure.
- for i in $(get_watchdog_drvs); do
- cmdline+=" $i.pretimeout=0"
-
- if [[ $i == hpwdt ]]; then
- # hpwdt have a special parameter kdumptimeout, is's only suppose
- # to be set to non-zero in first kernel. In kdump, non-zero
- # value could prevent the watchdog from resetting the system.
- cmdline+=" $i.kdumptimeout=0"
- fi
- done
-
- # Remove trace_buf_size, trace_event
- cmdline=$(remove_cmdline_param "$cmdline" trace_buf_size trace_event)
- cmdline="${cmdline} trace_buf_size=1"
-
- echo "$cmdline"
+ local cmdline id arg
+
+ if [[ -z $1 ]]; then
+ cmdline=$(< /proc/cmdline)
+ else
+ cmdline="$1"
+ fi
+
+ # These params should always be removed
+ cmdline=$(remove_cmdline_param "$cmdline" crashkernel panic_on_warn)
+ # These params can be removed configurably
+ while read -r arg; do
+ cmdline=$(remove_cmdline_param "$cmdline" "$arg")
+ done <<< "$(echo "$2" | xargs -n 1 echo)"
+
+ # Always remove "root=X", as we now explicitly generate all kinds
+ # of dump target mount information including root fs.
+ #
+ # We do this before KDUMP_COMMANDLINE_APPEND, if one really cares
+ # about it(e.g. for debug purpose), then can pass "root=X" using
+ # KDUMP_COMMANDLINE_APPEND.
+ cmdline=$(remove_cmdline_param "$cmdline" root)
+
+ # With the help of "--hostonly-cmdline", we can avoid some interitage.
+ cmdline=$(remove_cmdline_param "$cmdline" rd.lvm.lv rd.luks.uuid rd.dm.uuid rd.md.uuid fcoe)
+
+ # Remove netroot, rd.iscsi.initiator and iscsi_initiator since
+ # we get duplicate entries for the same in case iscsi code adds
+ # it as well.
+ cmdline=$(remove_cmdline_param "$cmdline" netroot rd.iscsi.initiator iscsi_initiator)
+
+ cmdline="${cmdline} $3"
+
+ id=$(get_bootcpu_apicid)
+ if [[ -n ${id} ]]; then
+ cmdline=$(append_cmdline "$cmdline" disable_cpu_apicid "$id")
+ fi
+
+ # If any watchdog is used, set it's pretimeout to 0. pretimeout let
+ # watchdog panic the kernel first, and reset the system after the
+ # panic. If the system is already in kdump, panic is not helpful
+ # and only increase the chance of watchdog failure.
+ for i in $(get_watchdog_drvs); do
+ cmdline+=" $i.pretimeout=0"
+
+ if [[ $i == hpwdt ]]; then
+ # hpwdt have a special parameter kdumptimeout, is's only suppose
+ # to be set to non-zero in first kernel. In kdump, non-zero
+ # value could prevent the watchdog from resetting the system.
+ cmdline+=" $i.kdumptimeout=0"
+ fi
+ done
+
+ # Remove trace_buf_size, trace_event
+ cmdline=$(remove_cmdline_param "$cmdline" trace_buf_size trace_event)
+ cmdline="${cmdline} trace_buf_size=1"
+
+ echo "$cmdline"
}
#get system memory size in the unit of GB
get_system_size()
{
- result=$(grep "System RAM" /proc/iomem | awk -F ":" '{ print $1 }' | tr "[:lower:]" "[:upper:]" | paste -sd+)
- result="+$result"
- # replace '-' with '+0x' and '+' with '-0x'
- sum=$(echo "$result" | sed -e 's/-/K0x/g' -e 's/+/-0x/g' -e 's/K/+/g')
- size=$(printf "%d\n" $(($sum)))
- size=$((size / 1024 / 1024 / 1024))
+ result=$(grep "System RAM" /proc/iomem | awk -F ":" '{ print $1 }' | tr "[:lower:]" "[:upper:]" | paste -sd+)
+ result="+$result"
+ # replace '-' with '+0x' and '+' with '-0x'
+ sum=$(echo "$result" | sed -e 's/-/K0x/g' -e 's/+/-0x/g' -e 's/K/+/g')
+ size=$(printf "%d\n" $((sum)))
+ size=$((size / 1024 / 1024 / 1024))
- echo "$size"
+ echo "$size"
}
get_recommend_size()
{
- local mem_size=$1
- local _ck_cmdline=$2
- local OLDIFS="$IFS"
-
- start=${_ck_cmdline: :1}
- if [[ $mem_size -lt $start ]]; then
- echo "0M"
- return
- fi
- IFS=','
- for i in $_ck_cmdline; do
- end=$(echo "$i" | awk -F "-" '{ print $2 }' | awk -F ":" '{ print $1 }')
- recommend=$(echo "$i" | awk -F "-" '{ print $2 }' | awk -F ":" '{ print $2 }')
- size=${end: : -1}
- unit=${end: -1}
- if [[ $unit == 'T' ]]; then
- size=$((size * 1024))
- fi
- if [[ $mem_size -lt $size ]]; then
- echo "$recommend"
- IFS="$OLDIFS"
- return
- fi
- done
- IFS="$OLDIFS"
+ local mem_size=$1
+ local _ck_cmdline=$2
+ local OLDIFS="$IFS"
+
+ start=${_ck_cmdline::1}
+ if [[ $mem_size -lt $start ]]; then
+ echo "0M"
+ return
+ fi
+ IFS=','
+ for i in $_ck_cmdline; do
+ end=$(echo "$i" | awk -F "-" '{ print $2 }' | awk -F ":" '{ print $1 }')
+ recommend=$(echo "$i" | awk -F "-" '{ print $2 }' | awk -F ":" '{ print $2 }')
+ size=${end::-1}
+ unit=${end: -1}
+ if [[ $unit == 'T' ]]; then
+ size=$((size * 1024))
+ fi
+ if [[ $mem_size -lt $size ]]; then
+ echo "$recommend"
+ IFS="$OLDIFS"
+ return
+ fi
+ done
+ IFS="$OLDIFS"
}
# return recommended size based on current system RAM size
# $1: kernel version, if not set, will defaults to $(uname -r)
kdump_get_arch_recommend_size()
{
- local kernel=$1 arch
+ local kernel=$1 arch
- if ! [[ -r "/proc/iomem" ]] ; then
- echo "Error, can not access /proc/iomem."
- return 1
- fi
+ if ! [[ -r "/proc/iomem" ]]; then
+ echo "Error, can not access /proc/iomem."
+ return 1
+ fi
- [[ -z "$kernel" ]] && kernel=$(uname -r)
- ck_cmdline=$(cat "/usr/lib/modules/$kernel/crashkernel.default" 2>/dev/null)
+ [[ -z $kernel ]] && kernel=$(uname -r)
+ ck_cmdline=$(cat "/usr/lib/modules/$kernel/crashkernel.default" 2> /dev/null)
- if [[ -n "$ck_cmdline" ]]; then
- ck_cmdline=${ck_cmdline#crashkernel=}
- else
- arch=$(lscpu | grep Architecture | awk -F ":" '{ print $2 }' | tr '[:lower:]' '[:upper:]')
- if [[ "$arch" = "X86_64" ]] || [[ "$arch" = "S390X" ]]; then
- ck_cmdline="1G-4G:160M,4G-64G:192M,64G-1T:256M,1T-:512M"
- elif [[ "$arch" = "AARCH64" ]]; then
- ck_cmdline="2G-:448M"
- elif [[ "$arch" = "PPC64LE" ]]; then
- if is_fadump_capable; then
- ck_cmdline="4G-16G:768M,16G-64G:1G,64G-128G:2G,128G-1T:4G,1T-2T:6G,2T-4T:12G,4T-8T:20G,8T-16T:36G,16T-32T:64G,32T-64T:128G,64T-:180G"
- else
- ck_cmdline="2G-4G:384M,4G-16G:512M,16G-64G:1G,64G-128G:2G,128G-:4G"
- fi
- fi
- fi
+ if [[ -n $ck_cmdline ]]; then
+ ck_cmdline=${ck_cmdline#crashkernel=}
+ else
+ arch=$(lscpu | grep Architecture | awk -F ":" '{ print $2 }' | tr '[:lower:]' '[:upper:]')
+ if [[ $arch == "X86_64" ]] || [[ $arch == "S390X" ]]; then
+ ck_cmdline="1G-4G:160M,4G-64G:192M,64G-1T:256M,1T-:512M"
+ elif [[ $arch == "AARCH64" ]]; then
+ ck_cmdline="2G-:448M"
+ elif [[ $arch == "PPC64LE" ]]; then
+ if is_fadump_capable; then
+ ck_cmdline="4G-16G:768M,16G-64G:1G,64G-128G:2G,128G-1T:4G,1T-2T:6G,2T-4T:12G,4T-8T:20G,8T-16T:36G,16T-32T:64G,32T-64T:128G,64T-:180G"
+ else
+ ck_cmdline="2G-4G:384M,4G-16G:512M,16G-64G:1G,64G-128G:2G,128G-:4G"
+ fi
+ fi
+ fi
- ck_cmdline=${ck_cmdline//-:/-102400T:}
- sys_mem=$(get_system_size)
+ ck_cmdline=${ck_cmdline//-:/-102400T:}
+ sys_mem=$(get_system_size)
- get_recommend_size "$sys_mem" "$ck_cmdline"
+ get_recommend_size "$sys_mem" "$ck_cmdline"
}
# Print all underlying crypt devices of a block device
@@ -860,18 +864,18 @@ kdump_get_arch_recommend_size()
# $1: the block device to be checked in maj:min format
get_luks_crypt_dev()
{
- local _type
+ local _type
- [[ -b /dev/block/$1 ]] || return 1
+ [[ -b /dev/block/$1 ]] || return 1
- _type=$(eval "$(blkid -u filesystem,crypto -o export -- "/dev/block/$1"); echo \$TYPE")
- [[ $_type == "crypto_LUKS" ]] && echo "$1"
+ _type=$(eval "$(blkid -u filesystem,crypto -o export -- "/dev/block/$1"); echo \$TYPE")
+ [[ $_type == "crypto_LUKS" ]] && echo "$1"
- for _x in "/sys/dev/block/$1/slaves/"*; do
- [[ -f $_x/dev ]] || continue
- [[ $_x/subsystem -ef /sys/class/block ]] || continue
- get_luks_crypt_dev "$(< "$_x/dev")"
- done
+ for _x in "/sys/dev/block/$1/slaves/"*; do
+ [[ -f $_x/dev ]] || continue
+ [[ $_x/subsystem -ef /sys/class/block ]] || continue
+ get_luks_crypt_dev "$(< "$_x/dev")"
+ done
}
# kdump_get_maj_min <device>
@@ -879,90 +883,90 @@ get_luks_crypt_dev()
# Example:
# $ get_maj_min /dev/sda2
# 8:2
-kdump_get_maj_min() {
- local _majmin
- _majmin="$(stat -L -c '%t:%T' "$1" 2> /dev/null)"
- printf "%s" "$((0x${_majmin%:*})):$((0x${_majmin#*:}))"
+kdump_get_maj_min()
+{
+ local _majmin
+ _majmin="$(stat -L -c '%t:%T' "$1" 2> /dev/null)"
+ printf "%s" "$((0x${_majmin%:*})):$((0x${_majmin#*:}))"
}
get_all_kdump_crypt_dev()
{
- local _dev
+ local _dev
- for _dev in $(get_block_dump_target); do
- get_luks_crypt_dev "$(kdump_get_maj_min "$_dev")"
- done
+ for _dev in $(get_block_dump_target); do
+ get_luks_crypt_dev "$(kdump_get_maj_min "$_dev")"
+ done
}
check_vmlinux()
{
- # Use readelf to check if it's a valid ELF
- readelf -h "$1" &>/dev/null || return 1
+ # Use readelf to check if it's a valid ELF
+ readelf -h "$1" &> /dev/null || return 1
}
get_vmlinux_size()
{
- local size=0 _msize
+ local size=0 _msize
- while read -r _msize; do
- size=$(( size + _msize ))
- done <<< "$(readelf -l -W "$1" | awk '/^ LOAD/{print $6}' 2>/dev/stderr)"
+ while read -r _msize; do
+ size=$((size + _msize))
+ done <<< "$(readelf -l -W "$1" | awk '/^ LOAD/{print $6}' 2> /dev/stderr)"
- echo $size
+ echo $size
}
try_decompress()
{
- # The obscure use of the "tr" filter is to work around older versions of
- # "grep" that report the byte offset of the line instead of the pattern.
+ # The obscure use of the "tr" filter is to work around older versions of
+ # "grep" that report the byte offset of the line instead of the pattern.
- # Try to find the header ($1) and decompress from here
- for pos in $(tr "$1\n$2" "\n$2=" < "$4" | grep -abo "^$2")
- do
- if ! type -P "$3" > /dev/null; then
- ddebug "Signiature detected but '$3' is missing, skip this decompressor"
- break
- fi
+ # Try to find the header ($1) and decompress from here
+ for pos in $(tr "$1\n$2" "\n$2=" < "$4" | grep -abo "^$2"); do
+ if ! type -P "$3" > /dev/null; then
+ ddebug "Signiature detected but '$3' is missing, skip this decompressor"
+ break
+ fi
- pos=${pos%%:*}
- tail "-c+$pos" "$img" | $3 > "$5" 2> /dev/null
- if check_vmlinux "$5"; then
- ddebug "Kernel is extracted with '$3'"
- return 0
- fi
- done
+ pos=${pos%%:*}
+ tail "-c+$pos" "$img" | $3 > "$5" 2> /dev/null
+ if check_vmlinux "$5"; then
+ ddebug "Kernel is extracted with '$3'"
+ return 0
+ fi
+ done
- return 1
+ return 1
}
# Borrowed from linux/scripts/extract-vmlinux
get_kernel_size()
{
- # Prepare temp files:
- local tmp img=$1
-
- tmp=$(mktemp /tmp/vmlinux-XXX)
- trap 'rm -f "$tmp"' 0
-
- # Try to check if it's a vmlinux already
- check_vmlinux "$img" && get_vmlinux_size "$img" && return 0
-
- # That didn't work, so retry after decompression.
- try_decompress '\037\213\010' xy gunzip "$img" "$tmp" || \
- try_decompress '\3757zXZ\000' abcde unxz "$img" "$tmp" || \
- try_decompress 'BZh' xy bunzip2 "$img" "$tmp" || \
- try_decompress '\135\0\0\0' xxx unlzma "$img" "$tmp" || \
- try_decompress '\211\114\132' xy 'lzop -d' "$img" "$tmp" || \
- try_decompress '\002!L\030' xxx 'lz4 -d' "$img" "$tmp" || \
- try_decompress '(\265/\375' xxx unzstd "$img" "$tmp"
-
- # Finally check for uncompressed images or objects:
- [[ $? -eq 0 ]] && get_vmlinux_size "$tmp" && return 0
-
- # Fallback to use iomem
- local _size=0 _seg
- while read -r _seg; do
- _size=$(( _size + 0x${_seg#*-} - 0x${_seg%-*} ))
- done <<< "$(grep -E "Kernel (code|rodata|data|bss)" /proc/iomem | cut -d ":" -f 1)"
- echo $_size
+ # Prepare temp files:
+ local tmp img=$1
+
+ tmp=$(mktemp /tmp/vmlinux-XXX)
+ trap 'rm -f "$tmp"' 0
+
+ # Try to check if it's a vmlinux already
+ check_vmlinux "$img" && get_vmlinux_size "$img" && return 0
+
+ # That didn't work, so retry after decompression.
+ try_decompress '\037\213\010' xy gunzip "$img" "$tmp" ||
+ try_decompress '\3757zXZ\000' abcde unxz "$img" "$tmp" ||
+ try_decompress 'BZh' xy bunzip2 "$img" "$tmp" ||
+ try_decompress '\135\0\0\0' xxx unlzma "$img" "$tmp" ||
+ try_decompress '\211\114\132' xy 'lzop -d' "$img" "$tmp" ||
+ try_decompress '\002!L\030' xxx 'lz4 -d' "$img" "$tmp" ||
+ try_decompress '(\265/\375' xxx unzstd "$img" "$tmp"
+
+ # Finally check for uncompressed images or objects:
+ [[ $? -eq 0 ]] && get_vmlinux_size "$tmp" && return 0
+
+ # Fallback to use iomem
+ local _size=0 _seg
+ while read -r _seg; do
+ _size=$((_size + 0x${_seg#*-} - 0x${_seg%-*}))
+ done <<< "$(grep -E "Kernel (code|rodata|data|bss)" /proc/iomem | cut -d ":" -f 1)"
+ echo $_size
}
commit 20089dddd5b2dcf233483e3b5b8142f33e5ab7f1
Author: Kairui Song <kasong(a)redhat.com>
Date: Wed Sep 8 03:48:19 2021 +0800
kdump-lib.sh: declare and assign separately
See: https://github.com/koalaman/shellcheck/wiki/SC2155
Signed-off-by: Kairui Song <kasong(a)redhat.com>
diff --git a/kdump-lib.sh b/kdump-lib.sh
index 64c6e4f..ac36592 100755
--- a/kdump-lib.sh
+++ b/kdump-lib.sh
@@ -158,12 +158,15 @@ get_kdump_targets()
# part is the bind mounted directory which quotes by bracket "[]".
get_bind_mount_source()
{
- local _mnt=$(df "$1" | tail -1 | awk '{print $NF}')
- local _path=${1#$_mnt}
+ local _mnt _path _src _opt _fstype
+ local _fsroot _src_nofsroot
- local _src=$(get_mount_info SOURCE target "$_mnt" -f)
- local _opt=$(get_mount_info OPTIONS target "$_mnt" -f)
- local _fstype=$(get_mount_info FSTYPE target "$_mnt" -f)
+ _mnt=$(df "$1" | tail -1 | awk '{print $NF}')
+ _path=${1#$_mnt}
+
+ _src=$(get_mount_info SOURCE target "$_mnt" -f)
+ _opt=$(get_mount_info OPTIONS target "$_mnt" -f)
+ _fstype=$(get_mount_info FSTYPE target "$_mnt" -f)
# bind mount in fstab
if [[ -d "$_src" ]] && [[ "$_fstype" = none ]] && (echo "$_opt" | grep -q "\bbind\b"); then
@@ -171,12 +174,12 @@ get_bind_mount_source()
fi
# direct mount
- local _src_nofsroot=$(get_mount_info SOURCE target "$_mnt" -v -f)
+ _src_nofsroot=$(get_mount_info SOURCE target "$_mnt" -v -f)
if [[ $_src_nofsroot = "$_src" ]]; then
echo "$_mnt$_path" && return
fi
- local _fsroot=${_src#${_src_nofsroot}[}
+ _fsroot=${_src#${_src_nofsroot}[}
_fsroot=${_fsroot%]}
_mnt=$(get_mount_info TARGET source "$_src_nofsroot" -f)
@@ -199,8 +202,9 @@ get_mntopt_from_target()
# $1: kdump target device
get_kdump_mntpoint_from_target()
{
- local _mntpoint=$(get_mntpoint_from_target "$1")
+ local _mntpoint
+ _mntpoint=$(get_mntpoint_from_target "$1")
# mount under /sysroot if dump to root disk or mount under
# mount under /kdumproot if dump target is not mounted in first kernel
# mount under /kdumproot/$_mntpoint in other cases in 2nd kernel.
@@ -254,8 +258,9 @@ get_remote_host()
is_hostname()
{
- local _hostname=$(echo "$1" | grep ":")
+ local _hostname
+ _hostname=$(echo "$1" | grep ":")
if [[ -n "$_hostname" ]]; then
return 1
fi
@@ -369,7 +374,7 @@ get_ifcfg_nmcli()
# $1: netdev name
get_ifcfg_legacy()
{
- local ifcfg_file
+ local ifcfg_file hwaddr
ifcfg_file="/etc/sysconfig/network-scripts/ifcfg-${1}"
[[ -f "${ifcfg_file}" ]] && echo -n "${ifcfg_file}" && return
@@ -377,7 +382,7 @@ get_ifcfg_legacy()
ifcfg_file=$(get_ifcfg_by_name "${1}")
[[ -f "${ifcfg_file}" ]] && echo -n "${ifcfg_file}" && return
- local hwaddr=$(get_hwaddr "${1}")
+ hwaddr=$(get_hwaddr "${1}")
if [[ -n "$hwaddr" ]]; then
ifcfg_file=$(get_ifcfg_by_hwaddr "${hwaddr}")
[[ -f "${ifcfg_file}" ]] && echo -n "${ifcfg_file}" && return
@@ -621,7 +626,7 @@ prepare_kexec_args()
#
prepare_kdump_bootinfo()
{
- local boot_imglist boot_dirlist boot_initrdlist
+ local boot_img boot_imglist boot_dirlist boot_initrdlist
local machine_id
if [[ -z "$KDUMP_KERNELVER" ]]; then
@@ -633,7 +638,7 @@ prepare_kdump_bootinfo()
boot_imglist="$KDUMP_IMG-$KDUMP_KERNELVER$KDUMP_IMG_EXT $machine_id/$KDUMP_KERNELVER/$KDUMP_IMG"
# Use BOOT_IMAGE as reference if possible, strip the GRUB root device prefix in (hd0,gpt1) format
- local boot_img="$(sed "s/^BOOT_IMAGE=\((\S*)\)\?\(\S*\) .*/\2/" /proc/cmdline)"
+ boot_img="$(sed "s/^BOOT_IMAGE=\((\S*)\)\?\(\S*\) .*/\2/" /proc/cmdline)"
if [[ -n "$boot_img" ]]; then
boot_imglist="$boot_img $boot_imglist"
fi
@@ -855,9 +860,11 @@ kdump_get_arch_recommend_size()
# $1: the block device to be checked in maj:min format
get_luks_crypt_dev()
{
+ local _type
+
[[ -b /dev/block/$1 ]] || return 1
- local _type=$(eval "$(blkid -u filesystem,crypto -o export -- "/dev/block/$1"); echo \$TYPE")
+ _type=$(eval "$(blkid -u filesystem,crypto -o export -- "/dev/block/$1"); echo \$TYPE")
[[ $_type == "crypto_LUKS" ]] && echo "$1"
for _x in "/sys/dev/block/$1/slaves/"*; do
@@ -932,7 +939,9 @@ try_decompress()
get_kernel_size()
{
# Prepare temp files:
- local img=$1 tmp=$(mktemp /tmp/vmlinux-XXX)
+ local tmp img=$1
+
+ tmp=$(mktemp /tmp/vmlinux-XXX)
trap 'rm -f "$tmp"' 0
# Try to check if it's a vmlinux already
commit 4f01cb1b0a4e1ea9467e9ace34d14dcb2fbe135a
Author: Kairui Song <kasong(a)redhat.com>
Date: Mon Sep 13 01:18:04 2021 +0800
kdump-lib.sh: fix variable quoting issue
Fixed quoting issues found by shellcheck, no feature
change. This should fix many errors when there is space
in any shell variables.
And fixed how remove_cmdline_param is being called in prepare_cmdline.
Kernel parameters can have space like: param="spaces in here". So currently
remove_cmdline_param is broken since its args always get split by space.
But prepare_cmdline is expecting remove_cmdline_param to split its args
by space and passing a list of kernel args separated by space as a whole arg.
So fix that by using `xargs` to parse and split the args properly, then
call remove_cmdline_param.
Following quoting related issues are fixed (check the link
for example code and what could go wrong):
https://github.com/koalaman/shellcheck/wiki/SC1007
https://github.com/koalaman/shellcheck/wiki/SC2046
https://github.com/koalaman/shellcheck/wiki/SC2053
https://github.com/koalaman/shellcheck/wiki/SC2060
https://github.com/koalaman/shellcheck/wiki/SC2068
https://github.com/koalaman/shellcheck/wiki/SC2086
Signed-off-by: Kairui Song <kasong(a)redhat.com>
diff --git a/kdump-lib.sh b/kdump-lib.sh
index 6705f27..64c6e4f 100755
--- a/kdump-lib.sh
+++ b/kdump-lib.sh
@@ -25,7 +25,7 @@ is_squash_available() {
if [[ -z "$KDUMP_KERNELVER" ]]; then
modprobe --dry-run $kmodule &>/dev/null || return 1
else
- modprobe -S $KDUMP_KERNELVER --dry-run $kmodule &>/dev/null || return 1
+ modprobe -S "$KDUMP_KERNELVER" --dry-run $kmodule &>/dev/null || return 1
fi
done
}
@@ -79,10 +79,10 @@ get_user_configured_dump_disk()
local _target
_target=$(kdump_get_conf_val "ext[234]\|xfs\|btrfs\|minix\|raw")
- [[ -n "$_target" ]] && echo $_target && return
+ [[ -n "$_target" ]] && echo "$_target" && return
_target=$(get_dracut_args_target "$(kdump_get_conf_val "dracut_args")")
- [[ -b "$_target" ]] && echo $_target
+ [[ -b "$_target" ]] && echo "$_target"
}
get_block_dump_target()
@@ -94,12 +94,12 @@ get_block_dump_target()
fi
_target=$(get_user_configured_dump_disk)
- [[ -n "$_target" ]] && to_dev_name $_target && return
+ [[ -n "$_target" ]] && to_dev_name "$_target" && return
# Get block device name from local save path
_path=$(get_save_path)
- _target=$(get_target_from_path $_path)
- [[ -b "$_target" ]] && to_dev_name $_target
+ _target=$(get_target_from_path "$_path")
+ [[ -b "$_target" ]] && to_dev_name "$_target"
}
is_dump_to_rootfs()
@@ -114,7 +114,7 @@ get_failure_action_target()
if is_dump_to_rootfs; then
# Get rootfs device name
_target=$(get_root_fs_device)
- [[ -b "$_target" ]] && to_dev_name $_target && return
+ [[ -b "$_target" ]] && to_dev_name "$_target" && return
# Then, must be nfs root
echo "nfs"
fi
@@ -158,27 +158,27 @@ get_kdump_targets()
# part is the bind mounted directory which quotes by bracket "[]".
get_bind_mount_source()
{
- local _mnt=$(df $1 | tail -1 | awk '{print $NF}')
+ local _mnt=$(df "$1" | tail -1 | awk '{print $NF}')
local _path=${1#$_mnt}
- local _src=$(get_mount_info SOURCE target $_mnt -f)
- local _opt=$(get_mount_info OPTIONS target $_mnt -f)
- local _fstype=$(get_mount_info FSTYPE target $_mnt -f)
+ local _src=$(get_mount_info SOURCE target "$_mnt" -f)
+ local _opt=$(get_mount_info OPTIONS target "$_mnt" -f)
+ local _fstype=$(get_mount_info FSTYPE target "$_mnt" -f)
# bind mount in fstab
if [[ -d "$_src" ]] && [[ "$_fstype" = none ]] && (echo "$_opt" | grep -q "\bbind\b"); then
- echo $_src$_path && return
+ echo "$_src$_path" && return
fi
# direct mount
- local _src_nofsroot=$(get_mount_info SOURCE target $_mnt -v -f)
- if [[ $_src_nofsroot = $_src ]]; then
- echo $_mnt$_path && return
+ local _src_nofsroot=$(get_mount_info SOURCE target "$_mnt" -v -f)
+ if [[ $_src_nofsroot = "$_src" ]]; then
+ echo "$_mnt$_path" && return
fi
local _fsroot=${_src#${_src_nofsroot}[}
_fsroot=${_fsroot%]}
- _mnt=$(get_mount_info TARGET source $_src_nofsroot -f)
+ _mnt=$(get_mount_info TARGET source "$_src_nofsroot" -f)
# for btrfs, _fsroot will also contain the subvol value as well, strip it
if [[ "$_fstype" = btrfs ]]; then
@@ -187,19 +187,19 @@ get_bind_mount_source()
_subvol=${_subvol%,*}
_fsroot=${_fsroot#$_subvol}
fi
- echo $_mnt$_fsroot$_path
+ echo "$_mnt$_fsroot$_path"
}
get_mntopt_from_target()
{
- get_mount_info OPTIONS source $1 -f
+ get_mount_info OPTIONS source "$1" -f
}
# Get the path where the target will be mounted in kdump kernel
# $1: kdump target device
get_kdump_mntpoint_from_target()
{
- local _mntpoint=$(get_mntpoint_from_target $1)
+ local _mntpoint=$(get_mntpoint_from_target "$1")
# mount under /sysroot if dump to root disk or mount under
# mount under /kdumproot if dump target is not mounted in first kernel
@@ -249,26 +249,26 @@ get_remote_host()
_config_val=${_config_val%:/*}
_config_val=${_config_val#[}
_config_val=${_config_val%]}
- echo $_config_val
+ echo "$_config_val"
}
is_hostname()
{
- local _hostname=$(echo $1 | grep ":")
+ local _hostname=$(echo "$1" | grep ":")
if [[ -n "$_hostname" ]]; then
return 1
fi
- echo $1 | grep -q "[a-zA-Z]"
+ echo "$1" | grep -q "[a-zA-Z]"
}
# Copied from "/etc/sysconfig/network-scripts/network-functions"
get_hwaddr()
{
- if [[ -f "/sys/class/net/${1}/address" ]]; then
- awk '{ print toupper($0) }' < /sys/class/net/${1}/address
- elif [[ -d "/sys/class/net/${1}" ]]; then
- LC_ALL= LANG= ip -o link show ${1} 2>/dev/null | \
+ if [[ -f "/sys/class/net/$1/address" ]]; then
+ awk '{ print toupper($0) }' < "/sys/class/net/$1/address"
+ elif [[ -d "/sys/class/net/$1" ]]; then
+ LC_ALL="" LANG="" ip -o link show "$1" 2>/dev/null | \
awk '{ print toupper(gensub(/.*link\/[^ ]* ([[:alnum:]:]*).*/,
"\\1", 1)); }'
fi
@@ -484,14 +484,14 @@ remove_cmdline_param()
local cmdline=$1
shift
- for arg in $@; do
+ for arg in "$@"; do
cmdline=$(echo "$cmdline" | \
sed -e "s/\b$arg=[^ ]*//g" \
-e "s/^$arg\b//g" \
-e "s/[[:space:]]$arg\b//g" \
-e "s/\s\+/ /g")
done
- echo $cmdline
+ echo "$cmdline"
}
#
@@ -522,7 +522,7 @@ append_cmdline()
cmdline="${cmdline} ${2}=${3}"
fi
- echo $cmdline
+ echo "$cmdline"
}
# This function check iomem and determines if we have more than
@@ -559,12 +559,12 @@ is_secure_boot_enforced()
fi
# Detect secure boot on x86 and arm64
- secure_boot_file=$(find /sys/firmware/efi/efivars -name SecureBoot-* 2>/dev/null)
- setup_mode_file=$(find /sys/firmware/efi/efivars -name SetupMode-* 2>/dev/null)
+ secure_boot_file=$(find /sys/firmware/efi/efivars -name "SecureBoot-*" 2>/dev/null)
+ setup_mode_file=$(find /sys/firmware/efi/efivars -name "SetupMode-*" 2>/dev/null)
if [[ -f "$secure_boot_file" ]] && [[ -f "$setup_mode_file" ]]; then
- secure_boot_byte=$(hexdump -v -e '/1 "%d\ "' $secure_boot_file|cut -d' ' -f 5)
- setup_mode_byte=$(hexdump -v -e '/1 "%d\ "' $setup_mode_file|cut -d' ' -f 5)
+ secure_boot_byte=$(hexdump -v -e '/1 "%d\ "' "$secure_boot_file" | cut -d' ' -f 5)
+ setup_mode_byte=$(hexdump -v -e '/1 "%d\ "' "$setup_mode_file" | cut -d' ' -f 5)
if [[ "$secure_boot_byte" = "1" ]] && [[ "$setup_mode_byte" = "0" ]]; then
return 0
@@ -594,7 +594,7 @@ prepare_kexec_args()
need_64bit_headers
if [[ $? == 1 ]]
then
- found_elf_args=$(echo $kexec_args | grep elf32-core-headers)
+ found_elf_args=$(echo "$kexec_args" | grep elf32-core-headers)
if [[ -n "$found_elf_args" ]]
then
dwarn "Warning: elf32-core-headers overrides correct elf64 setting"
@@ -602,14 +602,14 @@ prepare_kexec_args()
kexec_args="$kexec_args --elf64-core-headers"
fi
else
- found_elf_args=$(echo $kexec_args | grep elf64-core-headers)
+ found_elf_args=$(echo "$kexec_args" | grep elf64-core-headers)
if [[ -z "$found_elf_args" ]]
then
kexec_args="$kexec_args --elf32-core-headers"
fi
fi
fi
- echo $kexec_args
+ echo "$kexec_args"
}
#
@@ -641,7 +641,7 @@ prepare_kdump_bootinfo()
for dir in $boot_dirlist; do
for img in $boot_imglist; do
if [[ -f "$dir/$img" ]]; then
- KDUMP_KERNEL=$(echo $dir/$img | tr -s '/')
+ KDUMP_KERNEL=$(echo "$dir/$img" | tr -s '/')
break 2
fi
done
@@ -653,7 +653,7 @@ prepare_kdump_bootinfo()
fi
# Set KDUMP_BOOTDIR to where kernel image is stored
- KDUMP_BOOTDIR=$(dirname $KDUMP_KERNEL)
+ KDUMP_BOOTDIR=$(dirname "$KDUMP_KERNEL")
# Default initrd should just stay aside of kernel image, try to find it in KDUMP_BOOTDIR
boot_initrdlist="initramfs-$KDUMP_KERNELVER.img initrd"
@@ -694,7 +694,7 @@ get_watchdog_drvs()
# device/modalias will return driver of this device
[[ -f "$_dir/device/modalias" ]] || continue
_drv=$(< "$_dir/device/modalias")
- _drv=$(modprobe --set-version "$KDUMP_KERNELVER" -R $_drv 2>/dev/null)
+ _drv=$(modprobe --set-version "$KDUMP_KERNELVER" -R "$_drv" 2>/dev/null)
for i in $_drv; do
if ! [[ " $_wdtdrvs " == *" $i "* ]]; then
_wdtdrvs="$_wdtdrvs $i"
@@ -702,7 +702,7 @@ get_watchdog_drvs()
done
done
- echo $_wdtdrvs
+ echo "$_wdtdrvs"
}
#
@@ -711,7 +711,7 @@ get_watchdog_drvs()
# Store the final result in global $KDUMP_COMMANDLINE.
prepare_cmdline()
{
- local cmdline id
+ local cmdline id arg
if [[ -z "$1" ]]; then
cmdline=$(</proc/cmdline)
@@ -722,7 +722,9 @@ prepare_cmdline()
# These params should always be removed
cmdline=$(remove_cmdline_param "$cmdline" crashkernel panic_on_warn)
# These params can be removed configurably
- cmdline=$(remove_cmdline_param "$cmdline" "$2")
+ while read -r arg; do
+ cmdline=$(remove_cmdline_param "$cmdline" "$arg")
+ done <<< "$(echo "$2" | xargs -n 1 echo)"
# Always remove "root=X", as we now explicitly generate all kinds
# of dump target mount information including root fs.
@@ -766,20 +768,20 @@ prepare_cmdline()
cmdline=$(remove_cmdline_param "$cmdline" trace_buf_size trace_event)
cmdline="${cmdline} trace_buf_size=1"
- echo ${cmdline}
+ echo "$cmdline"
}
#get system memory size in the unit of GB
get_system_size()
{
- result=$(grep "System RAM" /proc/iomem | awk -F ":" '{ print $1 }' | tr [:lower:] [:upper:] | paste -sd+)
+ result=$(grep "System RAM" /proc/iomem | awk -F ":" '{ print $1 }' | tr "[:lower:]" "[:upper:]" | paste -sd+)
result="+$result"
# replace '-' with '+0x' and '+' with '-0x'
sum=$(echo "$result" | sed -e 's/-/K0x/g' -e 's/+/-0x/g' -e 's/K/+/g')
size=$(printf "%d\n" $(($sum)))
size=$((size / 1024 / 1024 / 1024))
- echo $size
+ echo "$size"
}
get_recommend_size()
@@ -795,15 +797,15 @@ get_recommend_size()
fi
IFS=','
for i in $_ck_cmdline; do
- end=$(echo $i | awk -F "-" '{ print $2 }' | awk -F ":" '{ print $1 }')
- recommend=$(echo $i | awk -F "-" '{ print $2 }' | awk -F ":" '{ print $2 }')
+ end=$(echo "$i" | awk -F "-" '{ print $2 }' | awk -F ":" '{ print $1 }')
+ recommend=$(echo "$i" | awk -F "-" '{ print $2 }' | awk -F ":" '{ print $2 }')
size=${end: : -1}
unit=${end: -1}
if [[ $unit == 'T' ]]; then
size=$((size * 1024))
fi
if [[ $mem_size -lt $size ]]; then
- echo $recommend
+ echo "$recommend"
IFS="$OLDIFS"
return
fi
@@ -855,10 +857,10 @@ get_luks_crypt_dev()
{
[[ -b /dev/block/$1 ]] || return 1
- local _type=$(eval "$(blkid -u filesystem,crypto -o export -- /dev/block/$1); echo \$TYPE")
- [[ $_type == "crypto_LUKS" ]] && echo $1
+ local _type=$(eval "$(blkid -u filesystem,crypto -o export -- "/dev/block/$1"); echo \$TYPE")
+ [[ $_type == "crypto_LUKS" ]] && echo "$1"
- for _x in /sys/dev/block/$1/slaves/*; do
+ for _x in "/sys/dev/block/$1/slaves/"*; do
[[ -f $_x/dev ]] || continue
[[ $_x/subsystem -ef /sys/class/block ]] || continue
get_luks_crypt_dev "$(< "$_x/dev")"
@@ -888,7 +890,7 @@ get_all_kdump_crypt_dev()
check_vmlinux()
{
# Use readelf to check if it's a valid ELF
- readelf -h $1 &>/dev/null || return 1
+ readelf -h "$1" &>/dev/null || return 1
}
get_vmlinux_size()
@@ -910,14 +912,14 @@ try_decompress()
# Try to find the header ($1) and decompress from here
for pos in $(tr "$1\n$2" "\n$2=" < "$4" | grep -abo "^$2")
do
- if ! type -P $3 > /dev/null; then
+ if ! type -P "$3" > /dev/null; then
ddebug "Signiature detected but '$3' is missing, skip this decompressor"
break
fi
pos=${pos%%:*}
- tail -c+$pos "$img" | $3 > $5 2> /dev/null
- if check_vmlinux $5; then
+ tail "-c+$pos" "$img" | $3 > "$5" 2> /dev/null
+ if check_vmlinux "$5"; then
ddebug "Kernel is extracted with '$3'"
return 0
fi
@@ -931,22 +933,22 @@ get_kernel_size()
{
# Prepare temp files:
local img=$1 tmp=$(mktemp /tmp/vmlinux-XXX)
- trap "rm -f $tmp" 0
+ trap 'rm -f "$tmp"' 0
# Try to check if it's a vmlinux already
- check_vmlinux $img && get_vmlinux_size $img && return 0
+ check_vmlinux "$img" && get_vmlinux_size "$img" && return 0
# That didn't work, so retry after decompression.
- try_decompress '\037\213\010' xy gunzip $img $tmp || \
- try_decompress '\3757zXZ\000' abcde unxz $img $tmp || \
- try_decompress 'BZh' xy bunzip2 $img $tmp || \
- try_decompress '\135\0\0\0' xxx unlzma $img $tmp || \
- try_decompress '\211\114\132' xy 'lzop -d' $img $tmp || \
- try_decompress '\002!L\030' xxx 'lz4 -d' $img $tmp || \
- try_decompress '(\265/\375' xxx unzstd $img $tmp
+ try_decompress '\037\213\010' xy gunzip "$img" "$tmp" || \
+ try_decompress '\3757zXZ\000' abcde unxz "$img" "$tmp" || \
+ try_decompress 'BZh' xy bunzip2 "$img" "$tmp" || \
+ try_decompress '\135\0\0\0' xxx unlzma "$img" "$tmp" || \
+ try_decompress '\211\114\132' xy 'lzop -d' "$img" "$tmp" || \
+ try_decompress '\002!L\030' xxx 'lz4 -d' "$img" "$tmp" || \
+ try_decompress '(\265/\375' xxx unzstd "$img" "$tmp"
# Finally check for uncompressed images or objects:
- [[ $? -eq 0 ]] && get_vmlinux_size $tmp && return 0
+ [[ $? -eq 0 ]] && get_vmlinux_size "$tmp" && return 0
# Fallback to use iomem
local _size=0 _seg
commit 319219d23b003310f457e3ba549bf0fa0254d7da
Author: Kairui Song <kasong(a)redhat.com>
Date: Mon Sep 13 01:17:23 2021 +0800
kdump-lib.sh: fix a few ambiguous or redundant code
Fix a few ambiguous syntax issues and remove some unused variables.
Also refactor some code to make it more robust.
Signed-off-by: Kairui Song <kasong(a)redhat.com>
Acked-by: Philipp Rudo <prudo(a)redhat.com>
diff --git a/kdump-lib.sh b/kdump-lib.sh
index aff395b..6705f27 100755
--- a/kdump-lib.sh
+++ b/kdump-lib.sh
@@ -176,7 +176,7 @@ get_bind_mount_source()
echo $_mnt$_path && return
fi
- local _fsroot=${_src#$_src_nofsroot[}
+ local _fsroot=${_src#${_src_nofsroot}[}
_fsroot=${_fsroot%]}
_mnt=$(get_mount_info TARGET source $_src_nofsroot -f)
@@ -621,14 +621,14 @@ prepare_kexec_args()
#
prepare_kdump_bootinfo()
{
- local boot_imglist boot_dirlist boot_initrdlist curr_kver="$(uname -r)"
+ local boot_imglist boot_dirlist boot_initrdlist
local machine_id
if [[ -z "$KDUMP_KERNELVER" ]]; then
KDUMP_KERNELVER="$(uname -r)"
fi
- read machine_id < /etc/machine-id
+ read -r machine_id < /etc/machine-id
boot_dirlist=${KDUMP_BOOTDIR:-"/boot /boot/efi /efi /"}
boot_imglist="$KDUMP_IMG-$KDUMP_KERNELVER$KDUMP_IMG_EXT $machine_id/$KDUMP_KERNELVER/$KDUMP_IMG"
@@ -743,8 +743,8 @@ prepare_cmdline()
cmdline="${cmdline} $3"
id=$(get_bootcpu_apicid)
- if [[ ! -z ${id} ]] ; then
- cmdline=$(append_cmdline "${cmdline}" disable_cpu_apicid ${id})
+ if [[ -n ${id} ]] ; then
+ cmdline=$(append_cmdline "$cmdline" disable_cpu_apicid "$id")
fi
# If any watchdog is used, set it's pretimeout to 0. pretimeout let
@@ -775,7 +775,7 @@ get_system_size()
result=$(grep "System RAM" /proc/iomem | awk -F ":" '{ print $1 }' | tr [:lower:] [:upper:] | paste -sd+)
result="+$result"
# replace '-' with '+0x' and '+' with '-0x'
- sum=$( echo $result | sed -e 's/-/K0x/g' | sed -e 's/+/-0x/g' | sed -e 's/K/+/g' )
+ sum=$(echo "$result" | sed -e 's/-/K0x/g' -e 's/+/-0x/g' -e 's/K/+/g')
size=$(printf "%d\n" $(($sum)))
size=$((size / 1024 / 1024 / 1024))
@@ -788,9 +788,6 @@ get_recommend_size()
local _ck_cmdline=$2
local OLDIFS="$IFS"
- last_sz=""
- last_unit=""
-
start=${_ck_cmdline: :1}
if [[ $mem_size -lt $start ]]; then
echo "0M"
@@ -845,7 +842,7 @@ kdump_get_arch_recommend_size()
fi
fi
- ck_cmdline=$(echo $ck_cmdline | sed -e 's/-:/-102400T:/g')
+ ck_cmdline=${ck_cmdline//-:/-102400T:}
sys_mem=$(get_system_size)
get_recommend_size "$sys_mem" "$ck_cmdline"
@@ -896,11 +893,11 @@ check_vmlinux()
get_vmlinux_size()
{
- local size=0
+ local size=0 _msize
- while read _type _offset _virtaddr _physaddr _fsize _msize _flg _aln; do
+ while read -r _msize; do
size=$(( size + _msize ))
- done <<< $(readelf -l -W $1 | grep "^ LOAD" 2>/dev/stderr)
+ done <<< "$(readelf -l -W "$1" | awk '/^ LOAD/{print $6}' 2>/dev/stderr)"
echo $size
}
@@ -952,9 +949,9 @@ get_kernel_size()
[[ $? -eq 0 ]] && get_vmlinux_size $tmp && return 0
# Fallback to use iomem
- local _size=0
- for _seg in $(grep -E "Kernel (code|rodata|data|bss)" /proc/iomem | cut -d ":" -f 1); do
- _size=$(( _size + 0x${_seg#*-} - 0x${_seg%-*} ))
- done
+ local _size=0 _seg
+ while read -r _seg; do
+ _size=$(( _size + 0x${_seg#*-} - 0x${_seg%-*} ))
+ done <<< "$(grep -E "Kernel (code|rodata|data|bss)" /proc/iomem | cut -d ":" -f 1)"
echo $_size
}
commit c0edb80b8f2d6b859d7f7118942e825d35be5c51
Author: Kairui Song <kasong(a)redhat.com>
Date: Wed Sep 8 13:31:31 2021 +0800
kdump-lib.sh: fix arithmetic operation syntax
Get rid of let, and remove useless '$' on arithmetic variables.
Signed-off-by: Kairui Song <kasong(a)redhat.com>
Acked-by: Philipp Rudo <prudo(a)redhat.com>
diff --git a/kdump-lib.sh b/kdump-lib.sh
index 8624e19..aff395b 100755
--- a/kdump-lib.sh
+++ b/kdump-lib.sh
@@ -777,7 +777,7 @@ get_system_size()
# replace '-' with '+0x' and '+' with '-0x'
sum=$( echo $result | sed -e 's/-/K0x/g' | sed -e 's/+/-0x/g' | sed -e 's/K/+/g' )
size=$(printf "%d\n" $(($sum)))
- let size=$size/1024/1024/1024
+ size=$((size / 1024 / 1024 / 1024))
echo $size
}
@@ -803,7 +803,7 @@ get_recommend_size()
size=${end: : -1}
unit=${end: -1}
if [[ $unit == 'T' ]]; then
- let size=$size*1024
+ size=$((size * 1024))
fi
if [[ $mem_size -lt $size ]]; then
echo $recommend
@@ -899,7 +899,7 @@ get_vmlinux_size()
local size=0
while read _type _offset _virtaddr _physaddr _fsize _msize _flg _aln; do
- size=$(( $size + $_msize ))
+ size=$(( size + _msize ))
done <<< $(readelf -l -W $1 | grep "^ LOAD" 2>/dev/stderr)
echo $size
@@ -954,7 +954,7 @@ get_kernel_size()
# Fallback to use iomem
local _size=0
for _seg in $(grep -E "Kernel (code|rodata|data|bss)" /proc/iomem | cut -d ":" -f 1); do
- _size=$(( $_size + 0x${_seg#*-} - 0x${_seg%-*} ))
+ _size=$(( _size + 0x${_seg#*-} - 0x${_seg%-*} ))
done
echo $_size
}
commit 53813e8b9af280315962ac6656318f94b1daf563
Author: Kairui Song <kasong(a)redhat.com>
Date: Wed Sep 8 02:48:17 2021 +0800
kdump-lib.sh: remove useless echo and cat
Replace echo "$(cmd)" and "var=$(cmd); echo $var" with just `cmd`.
And remove some useless cat.
Signed-off-by: Kairui Song <kasong(a)redhat.com>
Acked-by: Philipp Rudo <prudo(a)redhat.com>
diff --git a/kdump-lib.sh b/kdump-lib.sh
index 24a02b5..8624e19 100755
--- a/kdump-lib.sh
+++ b/kdump-lib.sh
@@ -14,7 +14,7 @@ is_fadump_capable()
# Check if firmware-assisted dump is enabled
# if no, fallback to kdump check
if [[ -f $FADUMP_ENABLED_SYS_NODE ]]; then
- rc=$(cat $FADUMP_ENABLED_SYS_NODE)
+ rc=$(<$FADUMP_ENABLED_SYS_NODE)
[[ $rc -eq 1 ]] && return 0
fi
return 1
@@ -59,13 +59,14 @@ to_dev_name() {
case "$dev" in
UUID=*)
- dev=$(blkid -U "${dev#UUID=}")
+ blkid -U "${dev#UUID=}"
;;
LABEL=*)
- dev=$(blkid -L "${dev#LABEL=}")
+ blkid -L "${dev#LABEL=}"
;;
+ *)
+ echo "$dev"
esac
- echo $dev
}
is_user_configured_dump_target()
@@ -93,12 +94,12 @@ get_block_dump_target()
fi
_target=$(get_user_configured_dump_disk)
- [[ -n "$_target" ]] && echo $(to_dev_name $_target) && return
+ [[ -n "$_target" ]] && to_dev_name $_target && return
# Get block device name from local save path
_path=$(get_save_path)
_target=$(get_target_from_path $_path)
- [[ -b "$_target" ]] && echo $(to_dev_name $_target)
+ [[ -b "$_target" ]] && to_dev_name $_target
}
is_dump_to_rootfs()
@@ -113,7 +114,7 @@ get_failure_action_target()
if is_dump_to_rootfs; then
# Get rootfs device name
_target=$(get_root_fs_device)
- [[ -b "$_target" ]] && echo $(to_dev_name $_target) && return
+ [[ -b "$_target" ]] && to_dev_name $_target && return
# Then, must be nfs root
echo "nfs"
fi
@@ -441,7 +442,7 @@ check_crash_mem_reserved()
{
local mem_reserved
- mem_reserved=$(cat /sys/kernel/kexec_crash_size)
+ mem_reserved=$(</sys/kernel/kexec_crash_size)
if [[ $mem_reserved -eq 0 ]]; then
derror "No memory reserved for crash kernel"
return 1
@@ -467,7 +468,7 @@ check_current_kdump_status()
return 1
fi
- rc=$(cat /sys/kernel/kexec_crash_loaded)
+ rc=$(</sys/kernel/kexec_crash_loaded)
if [[ $rc == 1 ]]; then
return 0
else
@@ -571,7 +572,7 @@ is_secure_boot_enforced()
fi
# Detect secure boot on s390x
- if [[ -e "/sys/firmware/ipl/secure" && "$(cat /sys/firmware/ipl/secure)" == "1" ]]; then
+ if [[ -e "/sys/firmware/ipl/secure" && "$(</sys/firmware/ipl/secure)" == "1" ]]; then
return 0
fi
@@ -632,7 +633,7 @@ prepare_kdump_bootinfo()
boot_imglist="$KDUMP_IMG-$KDUMP_KERNELVER$KDUMP_IMG_EXT $machine_id/$KDUMP_KERNELVER/$KDUMP_IMG"
# Use BOOT_IMAGE as reference if possible, strip the GRUB root device prefix in (hd0,gpt1) format
- local boot_img="$(cat /proc/cmdline | sed "s/^BOOT_IMAGE=\((\S*)\)\?\(\S*\) .*/\2/")"
+ local boot_img="$(sed "s/^BOOT_IMAGE=\((\S*)\)\?\(\S*\) .*/\2/" /proc/cmdline)"
if [[ -n "$boot_img" ]]; then
boot_imglist="$boot_img $boot_imglist"
fi
@@ -713,7 +714,7 @@ prepare_cmdline()
local cmdline id
if [[ -z "$1" ]]; then
- cmdline=$(cat /proc/cmdline)
+ cmdline=$(</proc/cmdline)
else
cmdline="$1"
fi
@@ -771,7 +772,7 @@ prepare_cmdline()
#get system memory size in the unit of GB
get_system_size()
{
- result=$(cat /proc/iomem | grep "System RAM" | awk -F ":" '{ print $1 }' | tr [:lower:] [:upper:] | paste -sd+)
+ result=$(grep "System RAM" /proc/iomem | awk -F ":" '{ print $1 }' | tr [:lower:] [:upper:] | paste -sd+)
result="+$result"
# replace '-' with '+0x' and '+' with '-0x'
sum=$( echo $result | sed -e 's/-/K0x/g' | sed -e 's/+/-0x/g' | sed -e 's/K/+/g' )
@@ -880,11 +881,10 @@ kdump_get_maj_min() {
get_all_kdump_crypt_dev()
{
- local _dev _crypt
+ local _dev
for _dev in $(get_block_dump_target); do
- _crypt=$(get_luks_crypt_dev $(kdump_get_maj_min "$_dev"))
- [[ -n "$_crypt" ]] && echo $_crypt
+ get_luks_crypt_dev "$(kdump_get_maj_min "$_dev")"
done
}
@@ -953,7 +953,7 @@ get_kernel_size()
# Fallback to use iomem
local _size=0
- for _seg in $(cat /proc/iomem | grep -E "Kernel (code|rodata|data|bss)" | cut -d ":" -f 1); do
+ for _seg in $(grep -E "Kernel (code|rodata|data|bss)" /proc/iomem | cut -d ":" -f 1); do
_size=$(( $_size + 0x${_seg#*-} - 0x${_seg%-*} ))
done
echo $_size
commit 58d3e6db3a2f066ea8e48fe9a8c77a6bb8ca7159
Author: Kairui Song <kasong(a)redhat.com>
Date: Wed Sep 8 15:20:42 2021 +0800
kdump-lib.sh: rework nmcli related functions
This fixes word splitting issue with nmcli args. Current kexec-tools
scripts won't call nmcli with correct arguments when there are space in
network interface name.
nmcli expects multiple parameters, but get_nmcli_value_by_field only
accepts two params and depends on shell word splitting to split the
_nm_show_cmd into multiple params, which is very fragile.
So switch the param order, simplified this function and now multiple
params can be used properly.
And get_nmcli_connection_show_cmd_by_ifname returns multiple
nmcli params in a single variable, it depend on shell word splitting to
split the words when calling nmcli. But this is very fragile and break
easily when there are any special character in the connection path.
This function is only introduced to get and cache the nmcli command
which contains the "connection name".
Actually only cache the "connection path" is enough. Callers should
just call get_nmcli_connection_apath_by_ifname to cache the path, and
a new helper get_nmcli_field_by_conpath is introduced here to get value
from nmcli. This way "connection path" can contain any character.
Also get rid of another nmcli_cmd usage in
get_nmcli_connection_apath_by_ifname which stores multiple params in a
single bash variable separated by space.
Signed-off-by: Kairui Song <kasong(a)redhat.com>
Acked-by: Philipp Rudo <prudo(a)redhat.com>
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh
index 80b5582..a5e4b67 100755
--- a/dracut-module-setup.sh
+++ b/dracut-module-setup.sh
@@ -84,14 +84,13 @@ source_ifcfg_file() {
fi
}
-# $1: nmcli connection show output
kdump_setup_dns() {
local _netdev="$1"
- local _nm_show_cmd="$2"
+ local _conpath="$2"
local _nameserver _dns _tmp array
local _dnsfile=${initdir}/etc/cmdline.d/42dns.conf
- _tmp=$(get_nmcli_value_by_field "$_nm_show_cmd" "IP4.DNS")
+ _tmp=$(get_nmcli_field_by_conpath "IP4.DNS" "$_conpath")
# shellcheck disable=SC2206
array=(${_tmp//|/ })
if [[ ${array[*]} ]]; then
@@ -355,7 +354,7 @@ kdump_setup_bridge() {
_dev=${_dev##*/}
_kdumpdev=$_dev
if kdump_is_bond "$_dev"; then
- (kdump_setup_bond "$_dev" "$(get_nmcli_connection_show_cmd_by_ifname "$_dev")") || exit 1
+ (kdump_setup_bond "$_dev" "$(get_nmcli_connection_apath_by_ifname "$_dev")") || exit 1
elif kdump_is_team "$_dev"; then
kdump_setup_team "$_dev"
elif kdump_is_vlan "$_dev"; then
@@ -375,7 +374,7 @@ kdump_setup_bridge() {
# bond=bond0:eth0,eth1:mode=balance-rr
kdump_setup_bond() {
local _netdev="$1"
- local _nm_show_cmd="$2"
+ local _conpath="$2"
local _dev _mac _slaves _kdumpdev _bondoptions
for _dev in $(cat "/sys/class/net/$_netdev/bonding/slaves"); do
_mac=$(kdump_get_perm_addr "$_dev")
@@ -385,7 +384,7 @@ kdump_setup_bond() {
done
echo -n " bond=$_netdev:${_slaves%,}" >> "${initdir}/etc/cmdline.d/42bond.conf"
- _bondoptions=$(get_nmcli_value_by_field "$_nm_show_cmd" "bond.options")
+ _bondoptions=$(get_nmcli_field_by_conpath "bond.options" "$_conpath")
if [[ -z $_bondoptions ]]; then
dwarning "Failed to get bond configuration via nmlci output. Now try sourcing ifcfg script."
@@ -436,7 +435,7 @@ kdump_setup_vlan() {
derror "Vlan over bridge is not supported!"
exit 1
elif kdump_is_bond "$_phydev"; then
- (kdump_setup_bond "$_phydev" "$(get_nmcli_connection_show_cmd_by_ifname "$_phydev")") || exit 1
+ (kdump_setup_bond "$_phydev" "$(get_nmcli_connection_apath_by_ifname "$_phydev")") || exit 1
echo " vlan=$(kdump_setup_ifname "$_netdev"):$_phydev" > "${initdir}/etc/cmdline.d/43vlan.conf"
else
_kdumpdev="$(kdump_setup_ifname "$_phydev")"
@@ -474,18 +473,18 @@ find_online_znet_device() {
# setup s390 znet cmdline
# $1: netdev (ifname)
-# $2: nmcli connection show output
+# $2: nmcli connection path
kdump_setup_znet() {
local _netdev="$1"
- local _nmcli_cmd="$2"
+ local _conpath="$2"
local s390_prefix="802-3-ethernet.s390-"
local _options=""
local NETTYPE
local SUBCHANNELS
- NETTYPE=$(get_nmcli_value_by_field "$_nmcli_cmd" "${s390_prefix}nettype")
- SUBCHANNELS=$(get_nmcli_value_by_field "$_nmcli_cmd" "${s390_prefix}subchannels")
- _options=$(get_nmcli_value_by_field "$_nmcli_cmd" "${s390_prefix}options")
+ NETTYPE=$(get_nmcli_field_by_conpath "${s390_prefix}nettype" "$_conpath")
+ SUBCHANNELS=$(get_nmcli_field_by_conpath "${s390_prefix}subchannels" "$_conpath")
+ _options=$(get_nmcli_field_by_conpath "${s390_prefix}options" "$_conpath")
if [[ -z $NETTYPE || -z $SUBCHANNELS || -z $_options ]]; then
dwarning "Failed to get znet configuration via nmlci output. Now try sourcing ifcfg script."
@@ -532,22 +531,22 @@ kdump_get_remote_ip() {
# initramfs accessing giving destination
# $1: destination host
kdump_install_net() {
- local _destaddr _srcaddr _route _netdev _nm_show_cmd kdumpnic
+ local _destaddr _srcaddr _route _netdev _conpath kdumpnic
local _static _proto _ip_conf _ip_opts _ifname_opts
- local _znet_netdev _nm_show_cmd_znet
+ local _znet_netdev _znet_conpath
_destaddr=$(kdump_get_remote_ip "$1")
_route=$(kdump_get_ip_route "$_destaddr")
_srcaddr=$(kdump_get_ip_route_field "$_route" "src")
_netdev=$(kdump_get_ip_route_field "$_route" "dev")
- _nm_show_cmd=$(get_nmcli_connection_show_cmd_by_ifname "$_netdev")
+ _conpath=$(get_nmcli_connection_apath_by_ifname "$_netdev")
_netmac=$(kdump_get_mac_addr "$_netdev")
kdumpnic=$(kdump_setup_ifname "$_netdev")
_znet_netdev=$(find_online_znet_device)
if [[ -n $_znet_netdev ]]; then
- _nm_show_cmd_znet=$(get_nmcli_connection_show_cmd_by_ifname "$_znet_netdev")
- if ! (kdump_setup_znet "$_znet_netdev" "$_nm_show_cmd_znet"); then
+ _znet_conpath=$(get_nmcli_connection_apath_by_ifname "$_znet_netdev")
+ if ! (kdump_setup_znet "$_znet_netdev" "$_znet_conpath"); then
derror "Failed to set up znet"
exit 1
fi
@@ -577,7 +576,7 @@ kdump_install_net() {
if kdump_is_bridge "$_netdev"; then
kdump_setup_bridge "$_netdev"
elif kdump_is_bond "$_netdev"; then
- (kdump_setup_bond "$_netdev" "$_nm_show_cmd") || exit 1
+ (kdump_setup_bond "$_netdev" "$_conpath") || exit 1
elif kdump_is_team "$_netdev"; then
kdump_setup_team "$_netdev"
elif kdump_is_vlan "$_netdev"; then
@@ -587,7 +586,7 @@ kdump_install_net() {
echo "$_ifname_opts" >> "$_ip_conf"
fi
- kdump_setup_dns "$_netdev" "$_nm_show_cmd"
+ kdump_setup_dns "$_netdev" "$_conpath"
if [[ ! -f ${initdir}/etc/cmdline.d/50neednet.conf ]]; then
# network-manager module needs this parameter
diff --git a/kdump-lib.sh b/kdump-lib.sh
index 0dbf485..24a02b5 100755
--- a/kdump-lib.sh
+++ b/kdump-lib.sh
@@ -275,6 +275,7 @@ get_hwaddr()
# Get value by a field using "nmcli -g"
+# Usage: get_nmcli_value_by_field <field> <nmcli command>
#
# "nmcli --get-values" allows us to retrive value(s) by field, for example,
# nmcli --get-values <field> connection show /org/freedesktop/NetworkManager/ActiveConnection/1
@@ -285,12 +286,16 @@ get_hwaddr()
# bond.options "mode=balance-rr"
get_nmcli_value_by_field()
{
- local _nm_show_cmd=$1
- local _field=$2
+ LANG=C nmcli --get-values "$@"
+}
- local val=$(LANG=C nmcli --get-values $_field $_nm_show_cmd)
+# Get nmcli field value of an connection apath (a D-Bus active connection path)
+# Usage: get_nmcli_field_by_apath <field> <apath>
+get_nmcli_field_by_conpath()
+{
+ local _field=$1 _apath=$2
- echo -n "$val"
+ get_nmcli_value_by_field "$_field" connection show "$_apath"
}
# Get nmcli connection apath (a D-Bus active connection path ) by ifname
@@ -300,25 +305,8 @@ get_nmcli_value_by_field()
get_nmcli_connection_apath_by_ifname()
{
local _ifname=$1
- local _nm_show_cmd="device show $_ifname"
-
- local _apath=$(get_nmcli_value_by_field "$_nm_show_cmd" "GENERAL.CON-PATH")
-
- echo -n "$_apath"
-}
-
-# Get nmcli connection show cmd by ifname
-#
-# "$_apath" is supposed to not contain any chracter that
-# need to be escapded, e.g. space. Otherwise get_nmcli_value_by_field
-# would fail.
-get_nmcli_connection_show_cmd_by_ifname()
-{
- local _ifname="$1"
- local _apath=$(get_nmcli_connection_apath_by_ifname "$_ifname")
- local _nm_show_cmd="connection show $_apath"
- echo -n "$_nm_show_cmd"
+ get_nmcli_value_by_field "GENERAL.CON-PATH" device show "$_ifname"
}
get_ifcfg_by_device()
commit 30090f3a15d266937bba6ef2429876e26b5e92d7
Author: Kairui Song <kasong(a)redhat.com>
Date: Mon Sep 13 01:17:05 2021 +0800
kdump-lib.sh: replace '[ ]' with '[[ ]]' and get rid of legacy ``
Updated file syntax with following command:
sed -i -e 's/\(\s\)\[\s\([^]]*\)\s\]/\1\[\[\ \2 \]\]/g' kdump-lib.sh
(replace '[ ]' with '[[ ]]')
sed -i -e 's/`\([^`]*\)`/\$(\1)/g' kdump-lib.sh
(replace `...` with $(...))
And manually updated [[ ... -a ... ]] and [[ ... -o ... ]] with && and
||.
Signed-off-by: Kairui Song <kasong(a)redhat.com>
Acked-by: Philipp Rudo <prudo(a)redhat.com>
diff --git a/kdump-lib.sh b/kdump-lib.sh
index d7cb40e..0dbf485 100755
--- a/kdump-lib.sh
+++ b/kdump-lib.sh
@@ -13,16 +13,16 @@ is_fadump_capable()
{
# Check if firmware-assisted dump is enabled
# if no, fallback to kdump check
- if [ -f $FADUMP_ENABLED_SYS_NODE ]; then
- rc=`cat $FADUMP_ENABLED_SYS_NODE`
- [ $rc -eq 1 ] && return 0
+ if [[ -f $FADUMP_ENABLED_SYS_NODE ]]; then
+ rc=$(cat $FADUMP_ENABLED_SYS_NODE)
+ [[ $rc -eq 1 ]] && return 0
fi
return 1
}
is_squash_available() {
for kmodule in squashfs overlay loop; do
- if [ -z "$KDUMP_KERNELVER" ]; then
+ if [[ -z "$KDUMP_KERNELVER" ]]; then
modprobe --dry-run $kmodule &>/dev/null || return 1
else
modprobe -S $KDUMP_KERNELVER --dry-run $kmodule &>/dev/null || return 1
@@ -40,7 +40,7 @@ is_pcs_fence_kdump()
{
# no pcs or fence_kdump_send executables installed?
type -P pcs > /dev/null || return 1
- [ -x $FENCE_KDUMP_SEND ] || return 1
+ [[ -x $FENCE_KDUMP_SEND ]] || return 1
# fence kdump not configured?
(pcs cluster cib | grep 'type="fence_kdump"') &> /dev/null || return 1
@@ -49,7 +49,7 @@ is_pcs_fence_kdump()
# Check if fence_kdump is configured using kdump options
is_generic_fence_kdump()
{
- [ -x $FENCE_KDUMP_SEND ] || return 1
+ [[ -x $FENCE_KDUMP_SEND ]] || return 1
[[ $(kdump_get_conf_val fence_kdump_nodes) ]]
}
@@ -59,10 +59,10 @@ to_dev_name() {
case "$dev" in
UUID=*)
- dev=`blkid -U "${dev#UUID=}"`
+ dev=$(blkid -U "${dev#UUID=}")
;;
LABEL=*)
- dev=`blkid -L "${dev#LABEL=}"`
+ dev=$(blkid -L "${dev#LABEL=}")
;;
esac
echo $dev
@@ -78,10 +78,10 @@ get_user_configured_dump_disk()
local _target
_target=$(kdump_get_conf_val "ext[234]\|xfs\|btrfs\|minix\|raw")
- [ -n "$_target" ] && echo $_target && return
+ [[ -n "$_target" ]] && echo $_target && return
_target=$(get_dracut_args_target "$(kdump_get_conf_val "dracut_args")")
- [ -b "$_target" ] && echo $_target
+ [[ -b "$_target" ]] && echo $_target
}
get_block_dump_target()
@@ -93,12 +93,12 @@ get_block_dump_target()
fi
_target=$(get_user_configured_dump_disk)
- [ -n "$_target" ] && echo $(to_dev_name $_target) && return
+ [[ -n "$_target" ]] && echo $(to_dev_name $_target) && return
# Get block device name from local save path
_path=$(get_save_path)
_target=$(get_target_from_path $_path)
- [ -b "$_target" ] && echo $(to_dev_name $_target)
+ [[ -b "$_target" ]] && echo $(to_dev_name $_target)
}
is_dump_to_rootfs()
@@ -113,7 +113,7 @@ get_failure_action_target()
if is_dump_to_rootfs; then
# Get rootfs device name
_target=$(get_root_fs_device)
- [ -b "$_target" ] && echo $(to_dev_name $_target) && return
+ [[ -b "$_target" ]] && echo $(to_dev_name $_target) && return
# Then, must be nfs root
echo "nfs"
fi
@@ -126,7 +126,7 @@ get_kdump_targets()
local kdump_targets
_target=$(get_block_dump_target)
- if [ -n "$_target" ]; then
+ if [[ -n "$_target" ]]; then
kdump_targets=$_target
elif is_ssh_dump_target; then
kdump_targets="ssh"
@@ -136,7 +136,7 @@ get_kdump_targets()
# Add the root device if dump_to_rootfs is specified.
_root=$(get_failure_action_target)
- if [ -n "$_root" -a "$kdump_targets" != "$_root" ]; then
+ if [[ -n "$_root" ]] && [[ "$kdump_targets" != "$_root" ]]; then
kdump_targets="$kdump_targets $_root"
fi
@@ -204,10 +204,10 @@ get_kdump_mntpoint_from_target()
# mount under /kdumproot if dump target is not mounted in first kernel
# mount under /kdumproot/$_mntpoint in other cases in 2nd kernel.
# systemd will be in charge to umount it.
- if [ -z "$_mntpoint" ];then
+ if [[ -z "$_mntpoint" ]];then
_mntpoint="/kdumproot"
else
- if [ "$_mntpoint" = "/" ];then
+ if [[ "$_mntpoint" = "/" ]];then
_mntpoint="/sysroot"
else
_mntpoint="/kdumproot/$_mntpoint"
@@ -223,10 +223,10 @@ kdump_get_persistent_dev() {
case "$dev" in
UUID=*)
- dev=`blkid -U "${dev#UUID=}"`
+ dev=$(blkid -U "${dev#UUID=}")
;;
LABEL=*)
- dev=`blkid -L "${dev#LABEL=}"`
+ dev=$(blkid -L "${dev#LABEL=}")
;;
esac
echo $(get_persistent_dev "$dev")
@@ -253,9 +253,9 @@ get_remote_host()
is_hostname()
{
- local _hostname=`echo $1 | grep ":"`
+ local _hostname=$(echo $1 | grep ":")
- if [ -n "$_hostname" ]; then
+ if [[ -n "$_hostname" ]]; then
return 1
fi
echo $1 | grep -q "[a-zA-Z]"
@@ -264,9 +264,9 @@ is_hostname()
# Copied from "/etc/sysconfig/network-scripts/network-functions"
get_hwaddr()
{
- if [ -f "/sys/class/net/${1}/address" ]; then
+ if [[ -f "/sys/class/net/${1}/address" ]]; then
awk '{ print toupper($0) }' < /sys/class/net/${1}/address
- elif [ -d "/sys/class/net/${1}" ]; then
+ elif [[ -d "/sys/class/net/${1}" ]]; then
LC_ALL= LANG= ip -o link show ${1} 2>/dev/null | \
awk '{ print toupper(gensub(/.*link\/[^ ]* ([[:alnum:]:]*).*/,
"\\1", 1)); }'
@@ -347,7 +347,7 @@ get_ifcfg_by_name()
is_nm_running()
{
- [ "$(LANG=C nmcli -t --fields running general status 2>/dev/null)" = "running" ]
+ [[ "$(LANG=C nmcli -t --fields running general status 2>/dev/null)" = "running" ]]
}
is_nm_handling()
@@ -371,7 +371,7 @@ get_ifcfg_nmcli()
nm_name=$(LANG=C nmcli -t --fields name,device c show --active 2>/dev/null \
| grep "${1}" | head -1 | cut -d':' -f1)
ifcfg_file=$(get_ifcfg_by_uuid "${nm_uuid}")
- [ -z "${ifcfg_file}" ] && ifcfg_file=$(get_ifcfg_by_name "${nm_name}")
+ [[ -z "${ifcfg_file}" ]] && ifcfg_file=$(get_ifcfg_by_name "${nm_name}")
fi
echo -n "${ifcfg_file}"
@@ -383,15 +383,15 @@ get_ifcfg_legacy()
local ifcfg_file
ifcfg_file="/etc/sysconfig/network-scripts/ifcfg-${1}"
- [ -f "${ifcfg_file}" ] && echo -n "${ifcfg_file}" && return
+ [[ -f "${ifcfg_file}" ]] && echo -n "${ifcfg_file}" && return
ifcfg_file=$(get_ifcfg_by_name "${1}")
- [ -f "${ifcfg_file}" ] && echo -n "${ifcfg_file}" && return
+ [[ -f "${ifcfg_file}" ]] && echo -n "${ifcfg_file}" && return
local hwaddr=$(get_hwaddr "${1}")
- if [ -n "$hwaddr" ]; then
+ if [[ -n "$hwaddr" ]]; then
ifcfg_file=$(get_ifcfg_by_hwaddr "${hwaddr}")
- [ -f "${ifcfg_file}" ] && echo -n "${ifcfg_file}" && return
+ [[ -f "${ifcfg_file}" ]] && echo -n "${ifcfg_file}" && return
fi
ifcfg_file=$(get_ifcfg_by_device "${1}")
@@ -405,7 +405,7 @@ get_ifcfg_filename() {
local ifcfg_file
ifcfg_file=$(get_ifcfg_nmcli "${1}")
- if [ -z "${ifcfg_file}" ]; then
+ if [[ -z "${ifcfg_file}" ]]; then
ifcfg_file=$(get_ifcfg_legacy "${1}")
fi
@@ -432,11 +432,11 @@ is_dracut_mod_omitted() {
is_wdt_active() {
local active
- [ -d /sys/class/watchdog ] || return 1
+ [[ -d /sys/class/watchdog ]] || return 1
for dir in /sys/class/watchdog/*; do
- [ -f "$dir/state" ] || continue
+ [[ -f "$dir/state" ]] || continue
active=$(< "$dir/state")
- [ "$active" = "active" ] && return 0
+ [[ "$active" = "active" ]] && return 0
done
return 1
}
@@ -454,7 +454,7 @@ check_crash_mem_reserved()
local mem_reserved
mem_reserved=$(cat /sys/kernel/kexec_crash_size)
- if [ $mem_reserved -eq 0 ]; then
+ if [[ $mem_reserved -eq 0 ]]; then
derror "No memory reserved for crash kernel"
return 1
fi
@@ -464,7 +464,7 @@ check_crash_mem_reserved()
check_kdump_feasibility()
{
- if [ ! -e /sys/kernel/kexec_crash_loaded ]; then
+ if [[ ! -e /sys/kernel/kexec_crash_loaded ]]; then
derror "Kdump is not supported on this kernel"
return 1
fi
@@ -474,13 +474,13 @@ check_kdump_feasibility()
check_current_kdump_status()
{
- if [ ! -f /sys/kernel/kexec_crash_loaded ];then
+ if [[ ! -f /sys/kernel/kexec_crash_loaded ]];then
derror "Perhaps CONFIG_CRASH_DUMP is not enabled in kernel"
return 1
fi
- rc=`cat /sys/kernel/kexec_crash_loaded`
- if [ $rc == 1 ]; then
+ rc=$(cat /sys/kernel/kexec_crash_loaded)
+ if [[ $rc == 1 ]]; then
return 0
else
return 1
@@ -496,11 +496,11 @@ remove_cmdline_param()
shift
for arg in $@; do
- cmdline=`echo $cmdline | \
+ cmdline=$(echo "$cmdline" | \
sed -e "s/\b$arg=[^ ]*//g" \
-e "s/^$arg\b//g" \
-e "s/[[:space:]]$arg\b//g" \
- -e "s/\s\+/ /g"`
+ -e "s/\s\+/ /g")
done
echo $cmdline
}
@@ -529,7 +529,7 @@ append_cmdline()
local newstr=${cmdline/$2/""}
# unchanged str implies argument wasn't there
- if [ "$cmdline" == "$newstr" ]; then
+ if [[ "$cmdline" == "$newstr" ]]; then
cmdline="${cmdline} ${2}=${3}"
fi
@@ -540,8 +540,8 @@ append_cmdline()
# 4GB of ram available. Returns 1 if we do, 0 if we dont
need_64bit_headers()
{
- return `tail -n 1 /proc/iomem | awk '{ split ($1, r, "-"); \
- print (strtonum("0x" r[2]) > strtonum("0xffffffff")); }'`
+ return "$(tail -n 1 /proc/iomem | awk '{ split ($1, r, "-");
+ print (strtonum("0x" r[2]) > strtonum("0xffffffff")); }')"
}
# Check if secure boot is being enforced.
@@ -561,11 +561,11 @@ is_secure_boot_enforced()
# On powerpc, secure boot is enforced if:
# host secure boot: /ibm,secure-boot/os-secureboot-enforcing DT property exists
# guest secure boot: /ibm,secure-boot >= 2
- if [ -f /proc/device-tree/ibm,secureboot/os-secureboot-enforcing ]; then
+ if [[ -f /proc/device-tree/ibm,secureboot/os-secureboot-enforcing ]]; then
return 0
fi
- if [ -f /proc/device-tree/ibm,secure-boot ] && \
- [ $(lsprop /proc/device-tree/ibm,secure-boot | tail -1) -ge 2 ]; then
+ if [[ -f /proc/device-tree/ibm,secure-boot ]] && \
+ [[ $(lsprop /proc/device-tree/ibm,secure-boot | tail -1) -ge 2 ]]; then
return 0
fi
@@ -573,11 +573,11 @@ is_secure_boot_enforced()
secure_boot_file=$(find /sys/firmware/efi/efivars -name SecureBoot-* 2>/dev/null)
setup_mode_file=$(find /sys/firmware/efi/efivars -name SetupMode-* 2>/dev/null)
- if [ -f "$secure_boot_file" ] && [ -f "$setup_mode_file" ]; then
+ if [[ -f "$secure_boot_file" ]] && [[ -f "$setup_mode_file" ]]; then
secure_boot_byte=$(hexdump -v -e '/1 "%d\ "' $secure_boot_file|cut -d' ' -f 5)
setup_mode_byte=$(hexdump -v -e '/1 "%d\ "' $setup_mode_file|cut -d' ' -f 5)
- if [ "$secure_boot_byte" = "1" ] && [ "$setup_mode_byte" = "0" ]; then
+ if [[ "$secure_boot_byte" = "1" ]] && [[ "$setup_mode_byte" = "0" ]]; then
return 0
fi
fi
@@ -599,22 +599,22 @@ prepare_kexec_args()
local kexec_args=$1
local found_elf_args
- ARCH=`uname -m`
- if [ "$ARCH" == "i686" -o "$ARCH" == "i386" ]
+ ARCH=$(uname -m)
+ if [[ "$ARCH" == "i686" ]] || [[ "$ARCH" == "i386" ]]
then
need_64bit_headers
- if [ $? == 1 ]
+ if [[ $? == 1 ]]
then
- found_elf_args=`echo $kexec_args | grep elf32-core-headers`
- if [ -n "$found_elf_args" ]
+ found_elf_args=$(echo $kexec_args | grep elf32-core-headers)
+ if [[ -n "$found_elf_args" ]]
then
dwarn "Warning: elf32-core-headers overrides correct elf64 setting"
else
kexec_args="$kexec_args --elf64-core-headers"
fi
else
- found_elf_args=`echo $kexec_args | grep elf64-core-headers`
- if [ -z "$found_elf_args" ]
+ found_elf_args=$(echo $kexec_args | grep elf64-core-headers)
+ if [[ -z "$found_elf_args" ]]
then
kexec_args="$kexec_args --elf32-core-headers"
fi
@@ -635,7 +635,7 @@ prepare_kdump_bootinfo()
local boot_imglist boot_dirlist boot_initrdlist curr_kver="$(uname -r)"
local machine_id
- if [ -z "$KDUMP_KERNELVER" ]; then
+ if [[ -z "$KDUMP_KERNELVER" ]]; then
KDUMP_KERNELVER="$(uname -r)"
fi
@@ -645,20 +645,20 @@ prepare_kdump_bootinfo()
# Use BOOT_IMAGE as reference if possible, strip the GRUB root device prefix in (hd0,gpt1) format
local boot_img="$(cat /proc/cmdline | sed "s/^BOOT_IMAGE=\((\S*)\)\?\(\S*\) .*/\2/")"
- if [ -n "$boot_img" ]; then
+ if [[ -n "$boot_img" ]]; then
boot_imglist="$boot_img $boot_imglist"
fi
for dir in $boot_dirlist; do
for img in $boot_imglist; do
- if [ -f "$dir/$img" ]; then
+ if [[ -f "$dir/$img" ]]; then
KDUMP_KERNEL=$(echo $dir/$img | tr -s '/')
break 2
fi
done
done
- if ! [ -e "$KDUMP_KERNEL" ]; then
+ if ! [[ -e "$KDUMP_KERNEL" ]]; then
derror "Failed to detect kdump kernel location"
return 1
fi
@@ -669,7 +669,7 @@ prepare_kdump_bootinfo()
# Default initrd should just stay aside of kernel image, try to find it in KDUMP_BOOTDIR
boot_initrdlist="initramfs-$KDUMP_KERNELVER.img initrd"
for initrd in $boot_initrdlist; do
- if [ -f "$KDUMP_BOOTDIR/$initrd" ]; then
+ if [[ -f "$KDUMP_BOOTDIR/$initrd" ]]; then
defaut_initrd_base="$initrd"
DEFAULT_INITRD="$KDUMP_BOOTDIR/$defaut_initrd_base"
break
@@ -687,7 +687,7 @@ prepare_kdump_bootinfo()
kdump_initrd_base=${defaut_initrd_base}kdump
fi
- # Place kdump initrd in `/var/lib/kdump` if `KDUMP_BOOTDIR` not writable
+ # Place kdump initrd in $(/var/lib/kdump) if $(KDUMP_BOOTDIR) not writable
if [[ ! -w "$KDUMP_BOOTDIR" ]];then
var_target_initrd_dir="/var/lib/kdump"
mkdir -p "$var_target_initrd_dir"
@@ -724,7 +724,7 @@ prepare_cmdline()
{
local cmdline id
- if [ -z "$1" ]; then
+ if [[ -z "$1" ]]; then
cmdline=$(cat /proc/cmdline)
else
cmdline="$1"
@@ -754,7 +754,7 @@ prepare_cmdline()
cmdline="${cmdline} $3"
id=$(get_bootcpu_apicid)
- if [ ! -z ${id} ] ; then
+ if [[ ! -z ${id} ]] ; then
cmdline=$(append_cmdline "${cmdline}" disable_cpu_apicid ${id})
fi
@@ -803,7 +803,7 @@ get_recommend_size()
last_unit=""
start=${_ck_cmdline: :1}
- if [ $mem_size -lt $start ]; then
+ if [[ $mem_size -lt $start ]]; then
echo "0M"
return
fi
@@ -813,10 +813,10 @@ get_recommend_size()
recommend=$(echo $i | awk -F "-" '{ print $2 }' | awk -F ":" '{ print $2 }')
size=${end: : -1}
unit=${end: -1}
- if [ $unit == 'T' ]; then
+ if [[ $unit == 'T' ]]; then
let size=$size*1024
fi
- if [ $mem_size -lt $size ]; then
+ if [[ $mem_size -lt $size ]]; then
echo $recommend
IFS="$OLDIFS"
return
@@ -826,28 +826,28 @@ get_recommend_size()
}
# return recommended size based on current system RAM size
-# $1: kernel version, if not set, will defaults to `uname -r`
+# $1: kernel version, if not set, will defaults to $(uname -r)
kdump_get_arch_recommend_size()
{
local kernel=$1 arch
- if ! [ -r "/proc/iomem" ] ; then
+ if ! [[ -r "/proc/iomem" ]] ; then
echo "Error, can not access /proc/iomem."
return 1
fi
- [ -z "$kernel" ] && kernel=$(uname -r)
+ [[ -z "$kernel" ]] && kernel=$(uname -r)
ck_cmdline=$(cat "/usr/lib/modules/$kernel/crashkernel.default" 2>/dev/null)
- if [ -n "$ck_cmdline" ]; then
+ if [[ -n "$ck_cmdline" ]]; then
ck_cmdline=${ck_cmdline#crashkernel=}
else
arch=$(lscpu | grep Architecture | awk -F ":" '{ print $2 }' | tr '[:lower:]' '[:upper:]')
- if [ "$arch" = "X86_64" ] || [ "$arch" = "S390X" ]; then
+ if [[ "$arch" = "X86_64" ]] || [[ "$arch" = "S390X" ]]; then
ck_cmdline="1G-4G:160M,4G-64G:192M,64G-1T:256M,1T-:512M"
- elif [ "$arch" = "AARCH64" ]; then
+ elif [[ "$arch" = "AARCH64" ]]; then
ck_cmdline="2G-:448M"
- elif [ "$arch" = "PPC64LE" ]; then
+ elif [[ "$arch" = "PPC64LE" ]]; then
if is_fadump_capable; then
ck_cmdline="4G-16G:768M,16G-64G:1G,64G-128G:2G,128G-1T:4G,1T-2T:6G,2T-4T:12G,4T-8T:20G,8T-16T:36G,16T-32T:64G,32T-64T:128G,64T-:180G"
else
@@ -923,7 +923,7 @@ try_decompress()
# "grep" that report the byte offset of the line instead of the pattern.
# Try to find the header ($1) and decompress from here
- for pos in `tr "$1\n$2" "\n$2=" < "$4" | grep -abo "^$2"`
+ for pos in $(tr "$1\n$2" "\n$2=" < "$4" | grep -abo "^$2")
do
if ! type -P $3 > /dev/null; then
ddebug "Signiature detected but '$3' is missing, skip this decompressor"
commit 5debf397fef03931c0736d473a55ebcf6dc08380
Author: Kairui Song <kasong(a)redhat.com>
Date: Tue Sep 14 03:04:08 2021 +0800
kdump-lib-initramfs.sh: make it POSIX compatible
POSIX doesn't support keyword local, so add double underscore and prefix
to variable names, and reduce variable usage, to avoid any variable name
conflict.
Also reformat the code with `shfmt -s -w kdump-lib-initramfs.sh`.
Signed-off-by: Kairui Song <kasong(a)redhat.com>
Acked-by: Philipp Rudo <prudo(a)redhat.com>
diff --git a/kdump-lib-initramfs.sh b/kdump-lib-initramfs.sh
index b30b024..0cdb465 100755
--- a/kdump-lib-initramfs.sh
+++ b/kdump-lib-initramfs.sh
@@ -9,124 +9,122 @@ KDUMP_CONFIG_FILE="/etc/kdump.conf"
# Read kdump config in well formated style
kdump_read_conf()
{
- # Following steps are applied in order: strip trailing comment, strip trailing space,
- # strip heading space, match non-empty line, remove duplicated spaces between conf name and value
- [ -f "$KDUMP_CONFIG_FILE" ] && sed -n -e "s/#.*//;s/\s*$//;s/^\s*//;s/\(\S\+\)\s*\(.*\)/\1 \2/p" $KDUMP_CONFIG_FILE
+ # Following steps are applied in order: strip trailing comment, strip trailing space,
+ # strip heading space, match non-empty line, remove duplicated spaces between conf name and value
+ [ -f "$KDUMP_CONFIG_FILE" ] && sed -n -e "s/#.*//;s/\s*$//;s/^\s*//;s/\(\S\+\)\s*\(.*\)/\1 \2/p" $KDUMP_CONFIG_FILE
}
# Retrieves config value defined in kdump.conf
# $1: config name, sed regexp compatible
-kdump_get_conf_val() {
- # For lines matching "^\s*$1\s+", remove matched part (config name including space),
- # remove tailing comment, space, then store in hold space. Print out the hold buffer on last line.
- [ -f "$KDUMP_CONFIG_FILE" ] && \
- sed -n -e "/^\s*\($1\)\s\+/{s/^\s*\($1\)\s\+//;s/#.*//;s/\s*$//;h};\${x;p}" $KDUMP_CONFIG_FILE
+kdump_get_conf_val()
+{
+ # For lines matching "^\s*$1\s+", remove matched part (config name including space),
+ # remove tailing comment, space, then store in hold space. Print out the hold buffer on last line.
+ [ -f "$KDUMP_CONFIG_FILE" ] &&
+ sed -n -e "/^\s*\($1\)\s\+/{s/^\s*\($1\)\s\+//;s/#.*//;s/\s*$//;h};\${x;p}" $KDUMP_CONFIG_FILE
}
is_mounted()
{
- findmnt -k -n $1 &>/dev/null
+ findmnt -k -n "$1" > /dev/null 2>&1
}
+# $1: info type
+# $2: mount source type
+# $3: mount source
+# $4: extra args
get_mount_info()
{
- local _info_type=$1 _src_type=$2 _src=$3; shift 3
- local _info=$(findmnt -k -n -r -o $_info_type --$_src_type $_src $@)
+ __kdump_mnt=$(findmnt -k -n -r -o "$1" "--$2" "$3" $4)
- [ -z "$_info" ] && [ -e "/etc/fstab" ] && _info=$(findmnt -s -n -r -o $_info_type --$_src_type $_src $@)
+ [ -z "$__kdump_mnt" ] && [ -e "/etc/fstab" ] && __kdump_mnt=$(findmnt -s -n -r -o "$1" "--$2" "$3" $4)
- echo $_info
+ echo "$__kdump_mnt"
}
is_ipv6_address()
{
- echo $1 | grep -q ":"
+ echo "$1" | grep -q ":"
}
is_fs_type_nfs()
{
- [ "$1" = "nfs" ] || [ "$1" = "nfs4" ]
+ [ "$1" = "nfs" ] || [ "$1" = "nfs4" ]
}
# If $1 contains dracut_args "--mount", return <filesystem type>
get_dracut_args_fstype()
{
- echo $1 | grep "\-\-mount" | sed "s/.*--mount .\(.*\)/\1/" | cut -d' ' -f3
+ echo $1 | grep "\-\-mount" | sed "s/.*--mount .\(.*\)/\1/" | cut -d' ' -f3
}
# If $1 contains dracut_args "--mount", return <device>
get_dracut_args_target()
{
- echo $1 | grep "\-\-mount" | sed "s/.*--mount .\(.*\)/\1/" | cut -d' ' -f1
+ echo $1 | grep "\-\-mount" | sed "s/.*--mount .\(.*\)/\1/" | cut -d' ' -f1
}
get_save_path()
{
- local _save_path=$(kdump_get_conf_val path)
- [ -z "$_save_path" ] && _save_path=$DEFAULT_PATH
+ __kdump_path=$(kdump_get_conf_val path)
+ [ -z "$__kdump_path" ] && __kdump_path=$DEFAULT_PATH
- # strip the duplicated "/"
- echo $_save_path | tr -s /
+ # strip the duplicated "/"
+ echo "$__kdump_path" | tr -s /
}
get_root_fs_device()
{
- findmnt -k -f -n -o SOURCE /
+ findmnt -k -f -n -o SOURCE /
}
# Return the current underlying device of a path, ignore bind mounts
get_target_from_path()
{
- local _target
-
- _target=$(df $1 2>/dev/null | tail -1 | awk '{print $1}')
- [[ "$_target" == "/dev/root" ]] && [[ ! -e /dev/root ]] && _target=$(get_root_fs_device)
- echo $_target
+ __kdump_target=$(df "$1" 2> /dev/null | tail -1 | awk '{print $1}')
+ [ "$__kdump_target" = "/dev/root" ] && [ ! -e /dev/root ] && __kdump_target=$(get_root_fs_device)
+ echo "$__kdump_target"
}
get_fs_type_from_target()
{
- get_mount_info FSTYPE source $1 -f
+ get_mount_info FSTYPE source "$1" -f
}
get_mntpoint_from_target()
{
- # --source is applied to ensure non-bind mount is returned
- get_mount_info TARGET source $1 -f
+ # --source is applied to ensure non-bind mount is returned
+ get_mount_info TARGET source "$1" -f
}
is_ssh_dump_target()
{
- [[ $(kdump_get_conf_val ssh) == *@* ]]
+ kdump_get_conf_val ssh | grep -q @
}
is_raw_dump_target()
{
- [[ $(kdump_get_conf_val raw) ]]
+ [ -n "$(kdump_get_conf_val raw)" ]
}
is_nfs_dump_target()
{
- if [[ $(kdump_get_conf_val nfs) ]]; then
- return 0;
- fi
-
- if is_fs_type_nfs $(get_dracut_args_fstype "$(kdump_get_conf_val dracut_args)"); then
- return 0
- fi
+ if [ -n "$(kdump_get_conf_val nfs)" ]; then
+ return 0
+ fi
- local _save_path=$(get_save_path)
- local _target=$(get_target_from_path $_save_path)
- local _fstype=$(get_fs_type_from_target $_target)
+ if is_fs_type_nfs "$(get_dracut_args_fstype "$(kdump_get_conf_val dracut_args)")"; then
+ return 0
+ fi
- if is_fs_type_nfs $_fstype; then
- return 0
- fi
+ if is_fs_type_nfs "$(get_fs_type_from_target "$(get_target_from_path "$(get_save_path)")")"; then
+ return 0
+ fi
- return 1
+ return 1
}
is_fs_dump_target()
{
- [[ $(kdump_get_conf_val "ext[234]\|xfs\|btrfs\|minix") ]]
+ [ -n "$(kdump_get_conf_val "ext[234]\|xfs\|btrfs\|minix")" ]
}
commit 7c76611abba248e58172fdf170739a3c0f40e2c6
Author: Kairui Song <kasong(a)redhat.com>
Date: Wed Sep 15 23:10:07 2021 +0800
dracut-kdump.sh: reformat with shfmt
This is done with `shfmt -w -s dracut-kdump.sh`. There is no behaviour
change.
Signed-off-by: Kairui Song <kasong(a)redhat.com>
Acked-by: Philipp Rudo <prudo(a)redhat.com>
diff --git a/dracut-kdump.sh b/dracut-kdump.sh
index 5cd7ad4..969ea94 100755
--- a/dracut-kdump.sh
+++ b/dracut-kdump.sh
@@ -9,8 +9,8 @@
#initiate the kdump logger
if ! dlog_init; then
- echo "failed to initiate the kdump logger."
- exit 1
+ echo "failed to initiate the kdump logger."
+ exit 1
fi
KDUMP_PATH="/var/crash"
@@ -41,541 +41,543 @@ kdump_read_conf > $KDUMP_CONF_PARSED
get_kdump_confs()
{
- while read -r config_opt config_val; do
- # remove inline comments after the end of a directive.
- case "$config_opt" in
- path)
- KDUMP_PATH="$config_val"
- ;;
- core_collector)
- [ -n "$config_val" ] && CORE_COLLECTOR="$config_val"
- ;;
- sshkey)
- if [ -f "$config_val" ]; then
- SSH_KEY_LOCATION=$config_val
- fi
- ;;
- kdump_pre)
- KDUMP_PRE="$config_val"
- ;;
- kdump_post)
- KDUMP_POST="$config_val"
- ;;
- fence_kdump_args)
- FENCE_KDUMP_ARGS="$config_val"
- ;;
- fence_kdump_nodes)
- FENCE_KDUMP_NODES="$config_val"
- ;;
- failure_action|default)
- case $config_val in
- shell)
- FAILURE_ACTION="kdump_emergency_shell"
- ;;
- reboot)
- FAILURE_ACTION="systemctl reboot -f && exit"
- ;;
- halt)
- FAILURE_ACTION="halt && exit"
- ;;
- poweroff)
- FAILURE_ACTION="systemctl poweroff -f && exit"
- ;;
- dump_to_rootfs)
- FAILURE_ACTION="dump_to_rootfs"
- ;;
- esac
- ;;
- final_action)
- case $config_val in
- reboot)
- FINAL_ACTION="systemctl reboot -f"
- ;;
- halt)
- FINAL_ACTION="halt"
- ;;
- poweroff)
- FINAL_ACTION="systemctl poweroff -f"
- ;;
- esac
- ;;
- esac
- done < "$KDUMP_CONF_PARSED"
-
- if [ -z "$CORE_COLLECTOR" ]; then
- CORE_COLLECTOR="$DEFAULT_CORE_COLLECTOR"
- if is_ssh_dump_target || is_raw_dump_target; then
- CORE_COLLECTOR="$CORE_COLLECTOR -F"
- fi
- fi
+ while read -r config_opt config_val; do
+ # remove inline comments after the end of a directive.
+ case "$config_opt" in
+ path)
+ KDUMP_PATH="$config_val"
+ ;;
+ core_collector)
+ [ -n "$config_val" ] && CORE_COLLECTOR="$config_val"
+ ;;
+ sshkey)
+ if [ -f "$config_val" ]; then
+ SSH_KEY_LOCATION=$config_val
+ fi
+ ;;
+ kdump_pre)
+ KDUMP_PRE="$config_val"
+ ;;
+ kdump_post)
+ KDUMP_POST="$config_val"
+ ;;
+ fence_kdump_args)
+ FENCE_KDUMP_ARGS="$config_val"
+ ;;
+ fence_kdump_nodes)
+ FENCE_KDUMP_NODES="$config_val"
+ ;;
+ failure_action | default)
+ case $config_val in
+ shell)
+ FAILURE_ACTION="kdump_emergency_shell"
+ ;;
+ reboot)
+ FAILURE_ACTION="systemctl reboot -f && exit"
+ ;;
+ halt)
+ FAILURE_ACTION="halt && exit"
+ ;;
+ poweroff)
+ FAILURE_ACTION="systemctl poweroff -f && exit"
+ ;;
+ dump_to_rootfs)
+ FAILURE_ACTION="dump_to_rootfs"
+ ;;
+ esac
+ ;;
+ final_action)
+ case $config_val in
+ reboot)
+ FINAL_ACTION="systemctl reboot -f"
+ ;;
+ halt)
+ FINAL_ACTION="halt"
+ ;;
+ poweroff)
+ FINAL_ACTION="systemctl poweroff -f"
+ ;;
+ esac
+ ;;
+ esac
+ done < "$KDUMP_CONF_PARSED"
+
+ if [ -z "$CORE_COLLECTOR" ]; then
+ CORE_COLLECTOR="$DEFAULT_CORE_COLLECTOR"
+ if is_ssh_dump_target || is_raw_dump_target; then
+ CORE_COLLECTOR="$CORE_COLLECTOR -F"
+ fi
+ fi
}
# store the kexec kernel log to a file.
save_log()
{
- dmesg -T > $KDUMP_LOG_FILE
+ dmesg -T > $KDUMP_LOG_FILE
- if command -v journalctl > /dev/null; then
- journalctl -ab >> $KDUMP_LOG_FILE
- fi
- chmod 600 $KDUMP_LOG_FILE
+ if command -v journalctl > /dev/null; then
+ journalctl -ab >> $KDUMP_LOG_FILE
+ fi
+ chmod 600 $KDUMP_LOG_FILE
}
# $1: dump path, must be a mount point
dump_fs()
{
- ddebug "dump_fs _mp=$1"
-
- if ! is_mounted "$1"; then
- dinfo "dump path '$1' is not mounted, trying to mount..."
- if ! mount --target "$1"; then
- derror "failed to dump to '$1', it's not a mount point!"
- return 1
- fi
- fi
-
- # Remove -F in makedumpfile case. We don't want a flat format dump here.
- case $CORE_COLLECTOR in
- *makedumpfile* )
- CORE_COLLECTOR=$(echo "$CORE_COLLECTOR" | sed -e "s/-F//g")
- ;;
- esac
-
- _dump_fs_path=$(echo "$1/$KDUMP_PATH/$HOST_IP-$DATEDIR/" | tr -s /)
- dinfo "saving to $_dump_fs_path"
-
- # Only remount to read-write mode if the dump target is mounted read-only.
- _dump_mnt_op=$(get_mount_info OPTIONS target "$1" -f)
- case $_dump_mnt_op in
- ro* )
- dinfo "Remounting the dump target in rw mode."
- mount -o remount,rw "$1" || return 1
- ;;
- esac
-
- mkdir -p "$_dump_fs_path" || return 1
-
- save_vmcore_dmesg_fs ${DMESG_COLLECTOR} "$_dump_fs_path"
- save_opalcore_fs "$_dump_fs_path"
-
- dinfo "saving vmcore"
- $CORE_COLLECTOR /proc/vmcore "$_dump_fs_path/vmcore-incomplete"
- _dump_exitcode=$?
- if [ $_dump_exitcode -eq 0 ]; then
- mv "$_dump_fs_path/vmcore-incomplete" "$_dump_fs_path/vmcore"
- sync
- dinfo "saving vmcore complete"
- else
- derror "saving vmcore failed, exitcode:$_dump_exitcode"
- fi
-
- dinfo "saving the $KDUMP_LOG_FILE to $_dump_fs_path/"
- save_log
- mv "$KDUMP_LOG_FILE" "$_dump_fs_path/"
- if [ $_dump_exitcode -ne 0 ]; then
- return 1
- fi
-
- # improper kernel cmdline can cause the failure of echo, we can ignore this kind of failure
- return 0
+ ddebug "dump_fs _mp=$1"
+
+ if ! is_mounted "$1"; then
+ dinfo "dump path '$1' is not mounted, trying to mount..."
+ if ! mount --target "$1"; then
+ derror "failed to dump to '$1', it's not a mount point!"
+ return 1
+ fi
+ fi
+
+ # Remove -F in makedumpfile case. We don't want a flat format dump here.
+ case $CORE_COLLECTOR in
+ *makedumpfile*)
+ CORE_COLLECTOR=$(echo "$CORE_COLLECTOR" | sed -e "s/-F//g")
+ ;;
+ esac
+
+ _dump_fs_path=$(echo "$1/$KDUMP_PATH/$HOST_IP-$DATEDIR/" | tr -s /)
+ dinfo "saving to $_dump_fs_path"
+
+ # Only remount to read-write mode if the dump target is mounted read-only.
+ _dump_mnt_op=$(get_mount_info OPTIONS target "$1" -f)
+ case $_dump_mnt_op in
+ ro*)
+ dinfo "Remounting the dump target in rw mode."
+ mount -o remount,rw "$1" || return 1
+ ;;
+ esac
+
+ mkdir -p "$_dump_fs_path" || return 1
+
+ save_vmcore_dmesg_fs ${DMESG_COLLECTOR} "$_dump_fs_path"
+ save_opalcore_fs "$_dump_fs_path"
+
+ dinfo "saving vmcore"
+ $CORE_COLLECTOR /proc/vmcore "$_dump_fs_path/vmcore-incomplete"
+ _dump_exitcode=$?
+ if [ $_dump_exitcode -eq 0 ]; then
+ mv "$_dump_fs_path/vmcore-incomplete" "$_dump_fs_path/vmcore"
+ sync
+ dinfo "saving vmcore complete"
+ else
+ derror "saving vmcore failed, exitcode:$_dump_exitcode"
+ fi
+
+ dinfo "saving the $KDUMP_LOG_FILE to $_dump_fs_path/"
+ save_log
+ mv "$KDUMP_LOG_FILE" "$_dump_fs_path/"
+ if [ $_dump_exitcode -ne 0 ]; then
+ return 1
+ fi
+
+ # improper kernel cmdline can cause the failure of echo, we can ignore this kind of failure
+ return 0
}
# $1: dmesg collector
# $2: dump path
-save_vmcore_dmesg_fs() {
- dinfo "saving vmcore-dmesg.txt to $2"
- if $1 /proc/vmcore > "$2/vmcore-dmesg-incomplete.txt"; then
- mv "$2/vmcore-dmesg-incomplete.txt" "$2/vmcore-dmesg.txt"
- chmod 600 "$2/vmcore-dmesg.txt"
-
- # Make sure file is on disk. There have been instances where later
- # saving vmcore failed and system rebooted without sync and there
- # was no vmcore-dmesg.txt available.
- sync
- dinfo "saving vmcore-dmesg.txt complete"
- else
- if [ -f "$2/vmcore-dmesg-incomplete.txt" ]; then
- chmod 600 "$2/vmcore-dmesg-incomplete.txt"
- fi
- derror "saving vmcore-dmesg.txt failed"
- fi
+save_vmcore_dmesg_fs()
+{
+ dinfo "saving vmcore-dmesg.txt to $2"
+ if $1 /proc/vmcore > "$2/vmcore-dmesg-incomplete.txt"; then
+ mv "$2/vmcore-dmesg-incomplete.txt" "$2/vmcore-dmesg.txt"
+ chmod 600 "$2/vmcore-dmesg.txt"
+
+ # Make sure file is on disk. There have been instances where later
+ # saving vmcore failed and system rebooted without sync and there
+ # was no vmcore-dmesg.txt available.
+ sync
+ dinfo "saving vmcore-dmesg.txt complete"
+ else
+ if [ -f "$2/vmcore-dmesg-incomplete.txt" ]; then
+ chmod 600 "$2/vmcore-dmesg-incomplete.txt"
+ fi
+ derror "saving vmcore-dmesg.txt failed"
+ fi
}
# $1: dump path
-save_opalcore_fs() {
- if [ ! -f $OPALCORE ]; then
- # Check if we are on an old kernel that uses a different path
- if [ -f /sys/firmware/opal/core ]; then
- OPALCORE="/sys/firmware/opal/core"
- else
- return 0
- fi
- fi
-
- dinfo "saving opalcore:$OPALCORE to $1/opalcore"
- if ! cp $OPALCORE "$1/opalcore"; then
- derror "saving opalcore failed"
- return 1
- fi
-
- sync
- dinfo "saving opalcore complete"
- return 0
+save_opalcore_fs()
+{
+ if [ ! -f $OPALCORE ]; then
+ # Check if we are on an old kernel that uses a different path
+ if [ -f /sys/firmware/opal/core ]; then
+ OPALCORE="/sys/firmware/opal/core"
+ else
+ return 0
+ fi
+ fi
+
+ dinfo "saving opalcore:$OPALCORE to $1/opalcore"
+ if ! cp $OPALCORE "$1/opalcore"; then
+ derror "saving opalcore failed"
+ return 1
+ fi
+
+ sync
+ dinfo "saving opalcore complete"
+ return 0
}
dump_to_rootfs()
{
- if [ "$(systemctl status dracut-initqueue | sed -n "s/^\s*Active: \(\S*\)\s.*$/\1/p")" = "inactive" ]; then
- dinfo "Trying to bring up initqueue for rootfs mount"
- systemctl start dracut-initqueue
- fi
-
- dinfo "Clean up dead systemd services"
- systemctl cancel
- dinfo "Waiting for rootfs mount, will timeout after 90 seconds"
- systemctl start --no-block sysroot.mount
-
- _loop=0
- while [ $_loop -lt 90 ] && ! is_mounted /sysroot; do
- sleep 1
- _loop=$((_loop + 1))
- done
-
- if ! is_mounted /sysroot; then
- derror "Failed to mount rootfs"
- return
- fi
-
- ddebug "NEWROOT=$NEWROOT"
- dump_fs $NEWROOT
+ if [ "$(systemctl status dracut-initqueue | sed -n "s/^\s*Active: \(\S*\)\s.*$/\1/p")" = "inactive" ]; then
+ dinfo "Trying to bring up initqueue for rootfs mount"
+ systemctl start dracut-initqueue
+ fi
+
+ dinfo "Clean up dead systemd services"
+ systemctl cancel
+ dinfo "Waiting for rootfs mount, will timeout after 90 seconds"
+ systemctl start --no-block sysroot.mount
+
+ _loop=0
+ while [ $_loop -lt 90 ] && ! is_mounted /sysroot; do
+ sleep 1
+ _loop=$((_loop + 1))
+ done
+
+ if ! is_mounted /sysroot; then
+ derror "Failed to mount rootfs"
+ return
+ fi
+
+ ddebug "NEWROOT=$NEWROOT"
+ dump_fs $NEWROOT
}
kdump_emergency_shell()
{
- ddebug "Switching to kdump emergency shell..."
-
- [ -f /etc/profile ] && . /etc/profile
- export PS1='kdump:${PWD}# '
-
- . /lib/dracut-lib.sh
- if [ -f /dracut-state.sh ]; then
- . /dracut-state.sh 2>/dev/null
- fi
-
- source_conf /etc/conf.d
-
- type plymouth >/dev/null 2>&1 && plymouth quit
-
- source_hook "emergency"
- while read -r _tty rest; do
- (
- echo
- echo
- echo 'Entering kdump emergency mode.'
- echo 'Type "journalctl" to view system logs.'
- echo 'Type "rdsosreport" to generate a sosreport, you can then'
- echo 'save it elsewhere and attach it to a bug report.'
- echo
- echo
- ) > "/dev/$_tty"
- done < /proc/consoles
- sh -i -l
- /bin/rm -f -- /.console_lock
+ ddebug "Switching to kdump emergency shell..."
+
+ [ -f /etc/profile ] && . /etc/profile
+ export PS1='kdump:${PWD}# '
+
+ . /lib/dracut-lib.sh
+ if [ -f /dracut-state.sh ]; then
+ . /dracut-state.sh 2> /dev/null
+ fi
+
+ source_conf /etc/conf.d
+
+ type plymouth > /dev/null 2>&1 && plymouth quit
+
+ source_hook "emergency"
+ while read -r _tty rest; do
+ (
+ echo
+ echo
+ echo 'Entering kdump emergency mode.'
+ echo 'Type "journalctl" to view system logs.'
+ echo 'Type "rdsosreport" to generate a sosreport, you can then'
+ echo 'save it elsewhere and attach it to a bug report.'
+ echo
+ echo
+ ) > "/dev/$_tty"
+ done < /proc/consoles
+ sh -i -l
+ /bin/rm -f -- /.console_lock
}
do_failure_action()
{
- dinfo "Executing failure action $FAILURE_ACTION"
- eval $FAILURE_ACTION
+ dinfo "Executing failure action $FAILURE_ACTION"
+ eval $FAILURE_ACTION
}
do_final_action()
{
- dinfo "Executing final action $FINAL_ACTION"
- eval $FINAL_ACTION
+ dinfo "Executing final action $FINAL_ACTION"
+ eval $FINAL_ACTION
}
do_dump()
{
- eval $DUMP_INSTRUCTION
- _ret=$?
+ eval $DUMP_INSTRUCTION
+ _ret=$?
- if [ $_ret -ne 0 ]; then
- derror "saving vmcore failed"
- fi
+ if [ $_ret -ne 0 ]; then
+ derror "saving vmcore failed"
+ fi
- return $_ret
+ return $_ret
}
do_kdump_pre()
{
- if [ -n "$KDUMP_PRE" ]; then
- "$KDUMP_PRE"
- _ret=$?
- if [ $_ret -ne 0 ]; then
- derror "$KDUMP_PRE exited with $_ret status"
- return $_ret
- fi
- fi
-
- # if any script fails, it just raises warning and continues
- if [ -d /etc/kdump/pre.d ]; then
- for file in /etc/kdump/pre.d/*; do
- "$file"
- _ret=$?
- if [ $_ret -ne 0 ]; then
- derror "$file exited with $_ret status"
- fi
- done
- fi
- return 0
+ if [ -n "$KDUMP_PRE" ]; then
+ "$KDUMP_PRE"
+ _ret=$?
+ if [ $_ret -ne 0 ]; then
+ derror "$KDUMP_PRE exited with $_ret status"
+ return $_ret
+ fi
+ fi
+
+ # if any script fails, it just raises warning and continues
+ if [ -d /etc/kdump/pre.d ]; then
+ for file in /etc/kdump/pre.d/*; do
+ "$file"
+ _ret=$?
+ if [ $_ret -ne 0 ]; then
+ derror "$file exited with $_ret status"
+ fi
+ done
+ fi
+ return 0
}
do_kdump_post()
{
- if [ -d /etc/kdump/post.d ]; then
- for file in /etc/kdump/post.d/*; do
- "$file" "$1"
- _ret=$?
- if [ $_ret -ne 0 ]; then
- derror "$file exited with $_ret status"
- fi
- done
- fi
-
- if [ -n "$KDUMP_POST" ]; then
- "$KDUMP_POST" "$1"
- _ret=$?
- if [ $_ret -ne 0 ]; then
- derror "$KDUMP_POST exited with $_ret status"
- fi
- fi
+ if [ -d /etc/kdump/post.d ]; then
+ for file in /etc/kdump/post.d/*; do
+ "$file" "$1"
+ _ret=$?
+ if [ $_ret -ne 0 ]; then
+ derror "$file exited with $_ret status"
+ fi
+ done
+ fi
+
+ if [ -n "$KDUMP_POST" ]; then
+ "$KDUMP_POST" "$1"
+ _ret=$?
+ if [ $_ret -ne 0 ]; then
+ derror "$KDUMP_POST exited with $_ret status"
+ fi
+ fi
}
# $1: block target, eg. /dev/sda
dump_raw()
{
- [ -b "$1" ] || return 1
+ [ -b "$1" ] || return 1
- dinfo "saving to raw disk $1"
+ dinfo "saving to raw disk $1"
- if ! echo "$CORE_COLLECTOR" | grep -q makedumpfile; then
- _src_size=$(stat --format %s /proc/vmcore)
- _src_size_mb=$((_src_size / 1048576))
- /kdumpscripts/monitor_dd_progress $_src_size_mb &
- fi
+ if ! echo "$CORE_COLLECTOR" | grep -q makedumpfile; then
+ _src_size=$(stat --format %s /proc/vmcore)
+ _src_size_mb=$((_src_size / 1048576))
+ /kdumpscripts/monitor_dd_progress $_src_size_mb &
+ fi
- dinfo "saving vmcore"
- $CORE_COLLECTOR /proc/vmcore | dd of="$1" bs=$DD_BLKSIZE >> /tmp/dd_progress_file 2>&1 || return 1
- sync
+ dinfo "saving vmcore"
+ $CORE_COLLECTOR /proc/vmcore | dd of="$1" bs=$DD_BLKSIZE >> /tmp/dd_progress_file 2>&1 || return 1
+ sync
- dinfo "saving vmcore complete"
- return 0
+ dinfo "saving vmcore complete"
+ return 0
}
# $1: ssh key file
# $2: ssh address in <user>@<host> format
dump_ssh()
{
- _ret=0
- _ssh_opt="-i $1 -o BatchMode=yes -o StrictHostKeyChecking=yes"
- _ssh_dir="$KDUMP_PATH/$HOST_IP-$DATEDIR"
- if is_ipv6_address "$2"; then
- _scp_address=${2%@*}@"[${2#*@}]"
- else
- _scp_address=$2
- fi
-
- dinfo "saving to $2:$_ssh_dir"
-
- cat /var/lib/random-seed > /dev/urandom
- ssh -q $_ssh_opt "$2" mkdir -p "$_ssh_dir" || return 1
-
- save_vmcore_dmesg_ssh "$DMESG_COLLECTOR" "$_ssh_dir" "$_ssh_opt" "$2"
- dinfo "saving vmcore"
-
- save_opalcore_ssh "$_ssh_dir" "$_ssh_opt" "$2" "$_scp_address"
-
- if [ "${CORE_COLLECTOR%%[[:blank:]]*}" = "scp" ]; then
- scp -q $_ssh_opt /proc/vmcore "$_scp_address:$_ssh_dir/vmcore-incomplete"
- _ret=$?
- _vmcore="vmcore"
- else
- $CORE_COLLECTOR /proc/vmcore | ssh $_ssh_opt "$2" "umask 0077 && dd bs=512 of='$_ssh_dir/vmcore-incomplete'"
- _ret=$?
- _vmcore="vmcore.flat"
- fi
-
- if [ $_ret -eq 0 ]; then
- ssh $_ssh_opt "$2" "mv '$_ssh_dir/vmcore-incomplete' '$_ssh_dir/$_vmcore'"
- _ret=$?
- if [ $_ret -ne 0 ]; then
- derror "moving vmcore failed, exitcode:$_ret"
- else
- dinfo "saving vmcore complete"
- fi
- else
- derror "saving vmcore failed, exitcode:$_ret"
- fi
-
- dinfo "saving the $KDUMP_LOG_FILE to $2:$_ssh_dir/"
- save_log
- if ! scp -q $_ssh_opt $KDUMP_LOG_FILE "$_scp_address:$_ssh_dir/"; then
- derror "saving log file failed, _exitcode:$_ret"
- fi
-
- return $_ret
+ _ret=0
+ _ssh_opt="-i $1 -o BatchMode=yes -o StrictHostKeyChecking=yes"
+ _ssh_dir="$KDUMP_PATH/$HOST_IP-$DATEDIR"
+ if is_ipv6_address "$2"; then
+ _scp_address=${2%@*}@"[${2#*@}]"
+ else
+ _scp_address=$2
+ fi
+
+ dinfo "saving to $2:$_ssh_dir"
+
+ cat /var/lib/random-seed > /dev/urandom
+ ssh -q $_ssh_opt "$2" mkdir -p "$_ssh_dir" || return 1
+
+ save_vmcore_dmesg_ssh "$DMESG_COLLECTOR" "$_ssh_dir" "$_ssh_opt" "$2"
+ dinfo "saving vmcore"
+
+ save_opalcore_ssh "$_ssh_dir" "$_ssh_opt" "$2" "$_scp_address"
+
+ if [ "${CORE_COLLECTOR%%[[:blank:]]*}" = "scp" ]; then
+ scp -q $_ssh_opt /proc/vmcore "$_scp_address:$_ssh_dir/vmcore-incomplete"
+ _ret=$?
+ _vmcore="vmcore"
+ else
+ $CORE_COLLECTOR /proc/vmcore | ssh $_ssh_opt "$2" "umask 0077 && dd bs=512 of='$_ssh_dir/vmcore-incomplete'"
+ _ret=$?
+ _vmcore="vmcore.flat"
+ fi
+
+ if [ $_ret -eq 0 ]; then
+ ssh $_ssh_opt "$2" "mv '$_ssh_dir/vmcore-incomplete' '$_ssh_dir/$_vmcore'"
+ _ret=$?
+ if [ $_ret -ne 0 ]; then
+ derror "moving vmcore failed, exitcode:$_ret"
+ else
+ dinfo "saving vmcore complete"
+ fi
+ else
+ derror "saving vmcore failed, exitcode:$_ret"
+ fi
+
+ dinfo "saving the $KDUMP_LOG_FILE to $2:$_ssh_dir/"
+ save_log
+ if ! scp -q $_ssh_opt $KDUMP_LOG_FILE "$_scp_address:$_ssh_dir/"; then
+ derror "saving log file failed, _exitcode:$_ret"
+ fi
+
+ return $_ret
}
# $1: dump path
# $2: ssh opts
# $3: ssh address in <user>@<host> format
# $4: scp address, similar with ssh address but IPv6 addresses are quoted
-save_opalcore_ssh() {
- if [ ! -f $OPALCORE ]; then
- # Check if we are on an old kernel that uses a different path
- if [ -f /sys/firmware/opal/core ]; then
- OPALCORE="/sys/firmware/opal/core"
- else
- return 0
- fi
- fi
-
- dinfo "saving opalcore:$OPALCORE to $3:$1"
-
- if ! scp $2 $OPALCORE "$4:$1/opalcore-incomplete"; then
- derror "saving opalcore failed"
- return 1
- fi
-
- ssh $2 "$3" mv "$1/opalcore-incomplete" "$1/opalcore"
- dinfo "saving opalcore complete"
- return 0
+save_opalcore_ssh()
+{
+ if [ ! -f $OPALCORE ]; then
+ # Check if we are on an old kernel that uses a different path
+ if [ -f /sys/firmware/opal/core ]; then
+ OPALCORE="/sys/firmware/opal/core"
+ else
+ return 0
+ fi
+ fi
+
+ dinfo "saving opalcore:$OPALCORE to $3:$1"
+
+ if ! scp $2 $OPALCORE "$4:$1/opalcore-incomplete"; then
+ derror "saving opalcore failed"
+ return 1
+ fi
+
+ ssh $2 "$3" mv "$1/opalcore-incomplete" "$1/opalcore"
+ dinfo "saving opalcore complete"
+ return 0
}
# $1: dmesg collector
# $2: dump path
# $3: ssh opts
# $4: ssh address in <user>@<host> format
-save_vmcore_dmesg_ssh() {
- dinfo "saving vmcore-dmesg.txt to $4:$2"
- if $1 /proc/vmcore | ssh $3 "$4" "umask 0077 && dd of='$2/vmcore-dmesg-incomplete.txt'"; then
- ssh -q $3 "$4" mv "$2/vmcore-dmesg-incomplete.txt" "$2/vmcore-dmesg.txt"
- dinfo "saving vmcore-dmesg.txt complete"
- else
- derror "saving vmcore-dmesg.txt failed"
- fi
+save_vmcore_dmesg_ssh()
+{
+ dinfo "saving vmcore-dmesg.txt to $4:$2"
+ if $1 /proc/vmcore | ssh $3 "$4" "umask 0077 && dd of='$2/vmcore-dmesg-incomplete.txt'"; then
+ ssh -q $3 "$4" mv "$2/vmcore-dmesg-incomplete.txt" "$2/vmcore-dmesg.txt"
+ dinfo "saving vmcore-dmesg.txt complete"
+ else
+ derror "saving vmcore-dmesg.txt failed"
+ fi
}
get_host_ip()
{
- if is_nfs_dump_target || is_ssh_dump_target
- then
- kdumpnic=$(getarg kdumpnic=)
- if [ -z "$kdumpnic" ]; then
- derror "failed to get kdumpnic!"
- return 1
- fi
- if ! kdumphost=$(ip addr show dev "$kdumpnic" | grep '[ ]*inet'); then
- derror "wrong kdumpnic: $kdumpnic"
- return 1
- fi
- kdumphost=$(echo "$kdumphost" | head -n 1 | awk '{print $2}')
- kdumphost="${kdumphost%%/*}"
- if [ -z "$kdumphost" ]; then
- derror "wrong kdumpnic: $kdumpnic"
- return 1
- fi
- HOST_IP=$kdumphost
- fi
- return 0
+ if is_nfs_dump_target || is_ssh_dump_target; then
+ kdumpnic=$(getarg kdumpnic=)
+ if [ -z "$kdumpnic" ]; then
+ derror "failed to get kdumpnic!"
+ return 1
+ fi
+ if ! kdumphost=$(ip addr show dev "$kdumpnic" | grep '[ ]*inet'); then
+ derror "wrong kdumpnic: $kdumpnic"
+ return 1
+ fi
+ kdumphost=$(echo "$kdumphost" | head -n 1 | awk '{print $2}')
+ kdumphost="${kdumphost%%/*}"
+ if [ -z "$kdumphost" ]; then
+ derror "wrong kdumpnic: $kdumpnic"
+ return 1
+ fi
+ HOST_IP=$kdumphost
+ fi
+ return 0
}
read_kdump_confs()
{
- if [ ! -f "$KDUMP_CONFIG_FILE" ]; then
- derror "$KDUMP_CONFIG_FILE not found"
- return
- fi
-
- get_kdump_confs
-
- # rescan for add code for dump target
- while read -r config_opt config_val;
- do
- # remove inline comments after the end of a directive.
- case "$config_opt" in
- dracut_args)
- config_val=$(get_dracut_args_target "$config_val")
- if [ -n "$config_val" ]; then
- config_val=$(get_mntpoint_from_target "$config_val")
- DUMP_INSTRUCTION="dump_fs $config_val"
- fi
- ;;
- ext[234]|xfs|btrfs|minix|nfs)
- config_val=$(get_mntpoint_from_target "$config_val")
- DUMP_INSTRUCTION="dump_fs $config_val"
- ;;
- raw)
- DUMP_INSTRUCTION="dump_raw $config_val"
- ;;
- ssh)
- DUMP_INSTRUCTION="dump_ssh $SSH_KEY_LOCATION $config_val"
- ;;
- esac
- done < "$KDUMP_CONF_PARSED"
+ if [ ! -f "$KDUMP_CONFIG_FILE" ]; then
+ derror "$KDUMP_CONFIG_FILE not found"
+ return
+ fi
+
+ get_kdump_confs
+
+ # rescan for add code for dump target
+ while read -r config_opt config_val; do
+ # remove inline comments after the end of a directive.
+ case "$config_opt" in
+ dracut_args)
+ config_val=$(get_dracut_args_target "$config_val")
+ if [ -n "$config_val" ]; then
+ config_val=$(get_mntpoint_from_target "$config_val")
+ DUMP_INSTRUCTION="dump_fs $config_val"
+ fi
+ ;;
+ ext[234] | xfs | btrfs | minix | nfs)
+ config_val=$(get_mntpoint_from_target "$config_val")
+ DUMP_INSTRUCTION="dump_fs $config_val"
+ ;;
+ raw)
+ DUMP_INSTRUCTION="dump_raw $config_val"
+ ;;
+ ssh)
+ DUMP_INSTRUCTION="dump_ssh $SSH_KEY_LOCATION $config_val"
+ ;;
+ esac
+ done < "$KDUMP_CONF_PARSED"
}
fence_kdump_notify()
{
- if [ -n "$FENCE_KDUMP_NODES" ]; then
- # shellcheck disable=SC2086
- $FENCE_KDUMP_SEND $FENCE_KDUMP_ARGS $FENCE_KDUMP_NODES &
- fi
+ if [ -n "$FENCE_KDUMP_NODES" ]; then
+ # shellcheck disable=SC2086
+ $FENCE_KDUMP_SEND $FENCE_KDUMP_ARGS $FENCE_KDUMP_NODES &
+ fi
}
if [ "$1" = "--error-handler" ]; then
- get_kdump_confs
- do_failure_action
- do_final_action
+ get_kdump_confs
+ do_failure_action
+ do_final_action
- exit $?
+ exit $?
fi
# continue here only if we have to save dump.
if [ -f /etc/fadump.initramfs ] && [ ! -f /proc/device-tree/rtas/ibm,kernel-dump ] && [ ! -f /proc/device-tree/ibm,opal/dump/mpipl-boot ]; then
- exit 0
+ exit 0
fi
read_kdump_confs
fence_kdump_notify
if ! get_host_ip; then
- derror "get_host_ip exited with non-zero status!"
- exit 1
+ derror "get_host_ip exited with non-zero status!"
+ exit 1
fi
if [ -z "$DUMP_INSTRUCTION" ]; then
- DUMP_INSTRUCTION="dump_fs $NEWROOT"
+ DUMP_INSTRUCTION="dump_fs $NEWROOT"
fi
if ! do_kdump_pre; then
- derror "kdump_pre script exited with non-zero status!"
- do_final_action
- # During systemd service to reboot the machine, stop this shell script running
- exit 1
+ derror "kdump_pre script exited with non-zero status!"
+ do_final_action
+ # During systemd service to reboot the machine, stop this shell script running
+ exit 1
fi
make_trace_mem "kdump saving vmcore" '1:shortmem' '2+:mem' '3+:slab'
do_dump
DUMP_RETVAL=$?
if ! do_kdump_post $DUMP_RETVAL; then
- derror "kdump_post script exited with non-zero status!"
+ derror "kdump_post script exited with non-zero status!"
fi
if [ $DUMP_RETVAL -ne 0 ]; then
- exit 1
+ exit 1
fi
do_final_action
commit b1339c3b8a006f95d8414c6e113fbec78bc03123
Author: Kairui Song <kasong(a)redhat.com>
Date: Wed Aug 18 21:06:52 2021 +0800
dracut-kdump.sh: make it POSIX compatible
POSIX doesn't support keyword `local`, so this commit reduced variable usage.
Heredoc ("<<<") operation is also not supported, so kdump.conf is now pre-parse
into a temp file. Also fixes many POSIX syntax errors.
Signed-off-by: Kairui Song <kasong(a)redhat.com>
Acked-by: Philipp Rudo <prudo(a)redhat.com>
diff --git a/dracut-kdump.sh b/dracut-kdump.sh
index 3c1b080..5cd7ad4 100755
--- a/dracut-kdump.sh
+++ b/dracut-kdump.sh
@@ -8,8 +8,7 @@
. /lib/kdump-lib-initramfs.sh
#initiate the kdump logger
-dlog_init
-if [ $? -ne 0 ]; then
+if ! dlog_init; then
echo "failed to initiate the kdump logger."
exit 1
fi
@@ -20,7 +19,7 @@ CORE_COLLECTOR=""
DEFAULT_CORE_COLLECTOR="makedumpfile -l --message-level 7 -d 31"
DMESG_COLLECTOR="/sbin/vmcore-dmesg"
FAILURE_ACTION="systemctl reboot -f"
-DATEDIR=`date +%Y-%m-%d-%T`
+DATEDIR=$(date +%Y-%m-%d-%T)
HOST_IP='127.0.0.1'
DUMP_INSTRUCTION=""
SSH_KEY_LOCATION="/root/.ssh/kdump_id_rsa"
@@ -30,6 +29,7 @@ KDUMP_PRE=""
KDUMP_POST=""
NEWROOT="/sysroot"
OPALCORE="/sys/firmware/opal/mpipl/core"
+KDUMP_CONF_PARSED="/tmp/kdump.conf.$$"
# POSIX doesn't have pipefail, only apply when using bash
# shellcheck disable=SC3040
@@ -37,10 +37,11 @@ OPALCORE="/sys/firmware/opal/mpipl/core"
DUMP_RETVAL=0
+kdump_read_conf > $KDUMP_CONF_PARSED
+
get_kdump_confs()
{
- while read -r config_opt config_val;
- do
+ while read -r config_opt config_val; do
# remove inline comments after the end of a directive.
case "$config_opt" in
path)
@@ -99,7 +100,7 @@ get_kdump_confs()
esac
;;
esac
- done <<< "$(kdump_read_conf)"
+ done < "$KDUMP_CONF_PARSED"
if [ -z "$CORE_COLLECTOR" ]; then
CORE_COLLECTOR="$DEFAULT_CORE_COLLECTOR"
@@ -120,56 +121,58 @@ save_log()
chmod 600 $KDUMP_LOG_FILE
}
-# dump_fs <mount point>
+# $1: dump path, must be a mount point
dump_fs()
{
- local _exitcode
- local _mp=$1
- local _op=$(get_mount_info OPTIONS target $_mp -f)
- ddebug "dump_fs _mp=$_mp _opts=$_op"
-
- if ! is_mounted "$_mp"; then
- dinfo "dump path \"$_mp\" is not mounted, trying to mount..."
- mount --target $_mp
- if [ $? -ne 0 ]; then
- derror "failed to dump to \"$_mp\", it's not a mount point!"
+ ddebug "dump_fs _mp=$1"
+
+ if ! is_mounted "$1"; then
+ dinfo "dump path '$1' is not mounted, trying to mount..."
+ if ! mount --target "$1"; then
+ derror "failed to dump to '$1', it's not a mount point!"
return 1
fi
fi
# Remove -F in makedumpfile case. We don't want a flat format dump here.
- [[ $CORE_COLLECTOR = *makedumpfile* ]] && CORE_COLLECTOR=`echo $CORE_COLLECTOR | sed -e "s/-F//g"`
-
- local _dump_path=$(echo "$_mp/$KDUMP_PATH/$HOST_IP-$DATEDIR/" | tr -s /)
+ case $CORE_COLLECTOR in
+ *makedumpfile* )
+ CORE_COLLECTOR=$(echo "$CORE_COLLECTOR" | sed -e "s/-F//g")
+ ;;
+ esac
- dinfo "saving to $_dump_path"
+ _dump_fs_path=$(echo "$1/$KDUMP_PATH/$HOST_IP-$DATEDIR/" | tr -s /)
+ dinfo "saving to $_dump_fs_path"
# Only remount to read-write mode if the dump target is mounted read-only.
- if [[ "$_op" = "ro"* ]]; then
- dinfo "Remounting the dump target in rw mode."
- mount -o remount,rw $_mp || return 1
- fi
+ _dump_mnt_op=$(get_mount_info OPTIONS target "$1" -f)
+ case $_dump_mnt_op in
+ ro* )
+ dinfo "Remounting the dump target in rw mode."
+ mount -o remount,rw "$1" || return 1
+ ;;
+ esac
- mkdir -p $_dump_path || return 1
+ mkdir -p "$_dump_fs_path" || return 1
- save_vmcore_dmesg_fs ${DMESG_COLLECTOR} "$_dump_path"
- save_opalcore_fs "$_dump_path"
+ save_vmcore_dmesg_fs ${DMESG_COLLECTOR} "$_dump_fs_path"
+ save_opalcore_fs "$_dump_fs_path"
dinfo "saving vmcore"
- $CORE_COLLECTOR /proc/vmcore $_dump_path/vmcore-incomplete
- _exitcode=$?
- if [ $_exitcode -eq 0 ]; then
- mv $_dump_path/vmcore-incomplete $_dump_path/vmcore
+ $CORE_COLLECTOR /proc/vmcore "$_dump_fs_path/vmcore-incomplete"
+ _dump_exitcode=$?
+ if [ $_dump_exitcode -eq 0 ]; then
+ mv "$_dump_fs_path/vmcore-incomplete" "$_dump_fs_path/vmcore"
sync
dinfo "saving vmcore complete"
else
- derror "saving vmcore failed, _exitcode:$_exitcode"
+ derror "saving vmcore failed, exitcode:$_dump_exitcode"
fi
- dinfo "saving the $KDUMP_LOG_FILE to $_dump_path/"
+ dinfo "saving the $KDUMP_LOG_FILE to $_dump_fs_path/"
save_log
- mv $KDUMP_LOG_FILE $_dump_path/
- if [ $_exitcode -ne 0 ]; then
+ mv "$KDUMP_LOG_FILE" "$_dump_fs_path/"
+ if [ $_dump_exitcode -ne 0 ]; then
return 1
fi
@@ -177,16 +180,13 @@ dump_fs()
return 0
}
+# $1: dmesg collector
+# $2: dump path
save_vmcore_dmesg_fs() {
- local _dmesg_collector=$1
- local _path=$2
-
- dinfo "saving vmcore-dmesg.txt to ${_path}"
- $_dmesg_collector /proc/vmcore > ${_path}/vmcore-dmesg-incomplete.txt
- _exitcode=$?
- if [ $_exitcode -eq 0 ]; then
- mv ${_path}/vmcore-dmesg-incomplete.txt ${_path}/vmcore-dmesg.txt
- chmod 600 ${_path}/vmcore-dmesg.txt
+ dinfo "saving vmcore-dmesg.txt to $2"
+ if $1 /proc/vmcore > "$2/vmcore-dmesg-incomplete.txt"; then
+ mv "$2/vmcore-dmesg-incomplete.txt" "$2/vmcore-dmesg.txt"
+ chmod 600 "$2/vmcore-dmesg.txt"
# Make sure file is on disk. There have been instances where later
# saving vmcore failed and system rebooted without sync and there
@@ -194,16 +194,15 @@ save_vmcore_dmesg_fs() {
sync
dinfo "saving vmcore-dmesg.txt complete"
else
- if [ -f ${_path}/vmcore-dmesg-incomplete.txt ]; then
- chmod 600 ${_path}/vmcore-dmesg-incomplete.txt
+ if [ -f "$2/vmcore-dmesg-incomplete.txt" ]; then
+ chmod 600 "$2/vmcore-dmesg-incomplete.txt"
fi
derror "saving vmcore-dmesg.txt failed"
fi
}
+# $1: dump path
save_opalcore_fs() {
- local _path=$1
-
if [ ! -f $OPALCORE ]; then
# Check if we are on an old kernel that uses a different path
if [ -f /sys/firmware/opal/core ]; then
@@ -213,9 +212,8 @@ save_opalcore_fs() {
fi
fi
- dinfo "saving opalcore:$OPALCORE to ${_path}/opalcore"
- cp $OPALCORE ${_path}/opalcore
- if [ $? -ne 0 ]; then
+ dinfo "saving opalcore:$OPALCORE to $1/opalcore"
+ if ! cp $OPALCORE "$1/opalcore"; then
derror "saving opalcore failed"
return 1
fi
@@ -228,7 +226,7 @@ save_opalcore_fs() {
dump_to_rootfs()
{
- if [[ $(systemctl status dracut-initqueue | sed -n "s/^\s*Active: \(\S*\)\s.*$/\1/p") == "inactive" ]]; then
+ if [ "$(systemctl status dracut-initqueue | sed -n "s/^\s*Active: \(\S*\)\s.*$/\1/p")" = "inactive" ]; then
dinfo "Trying to bring up initqueue for rootfs mount"
systemctl start dracut-initqueue
fi
@@ -270,7 +268,7 @@ kdump_emergency_shell()
type plymouth >/dev/null 2>&1 && plymouth quit
source_hook "emergency"
- while read _tty rest; do
+ while read -r _tty rest; do
(
echo
echo
@@ -280,7 +278,7 @@ kdump_emergency_shell()
echo 'save it elsewhere and attach it to a bug report.'
echo
echo
- ) > /dev/$_tty
+ ) > "/dev/$_tty"
done < /proc/consoles
sh -i -l
/bin/rm -f -- /.console_lock
@@ -297,10 +295,9 @@ do_final_action()
dinfo "Executing final action $FINAL_ACTION"
eval $FINAL_ACTION
}
+
do_dump()
{
- local _ret
-
eval $DUMP_INSTRUCTION
_ret=$?
@@ -313,8 +310,6 @@ do_dump()
do_kdump_pre()
{
- local _ret
-
if [ -n "$KDUMP_PRE" ]; then
"$KDUMP_PRE"
_ret=$?
@@ -339,8 +334,6 @@ do_kdump_pre()
do_kdump_post()
{
- local _ret
-
if [ -d /etc/kdump/post.d ]; then
for file in /etc/kdump/post.d/*; do
"$file" "$1"
@@ -360,97 +353,86 @@ do_kdump_post()
fi
}
+# $1: block target, eg. /dev/sda
dump_raw()
{
- local _raw=$1
-
- [ -b "$_raw" ] || return 1
+ [ -b "$1" ] || return 1
- dinfo "saving to raw disk $_raw"
+ dinfo "saving to raw disk $1"
- if ! $(echo -n $CORE_COLLECTOR|grep -q makedumpfile); then
+ if ! echo "$CORE_COLLECTOR" | grep -q makedumpfile; then
_src_size=$(stat --format %s /proc/vmcore)
- _src_size_mb=$(($_src_size / 1048576))
+ _src_size_mb=$((_src_size / 1048576))
/kdumpscripts/monitor_dd_progress $_src_size_mb &
fi
dinfo "saving vmcore"
- $CORE_COLLECTOR /proc/vmcore | dd of=$_raw bs=$DD_BLKSIZE >> /tmp/dd_progress_file 2>&1 || return 1
+ $CORE_COLLECTOR /proc/vmcore | dd of="$1" bs=$DD_BLKSIZE >> /tmp/dd_progress_file 2>&1 || return 1
sync
dinfo "saving vmcore complete"
return 0
}
+# $1: ssh key file
+# $2: ssh address in <user>@<host> format
dump_ssh()
{
- local _ret=0
- local _exitcode=0 _exitcode2=0
- local _opt="-i $1 -o BatchMode=yes -o StrictHostKeyChecking=yes"
- local _dir="$KDUMP_PATH/$HOST_IP-$DATEDIR"
- local _host=$2
- local _vmcore="vmcore"
-
- if is_ipv6_address "$_host"; then
- _scp_address=${_host%@*}@"[${_host#*@}]"
+ _ret=0
+ _ssh_opt="-i $1 -o BatchMode=yes -o StrictHostKeyChecking=yes"
+ _ssh_dir="$KDUMP_PATH/$HOST_IP-$DATEDIR"
+ if is_ipv6_address "$2"; then
+ _scp_address=${2%@*}@"[${2#*@}]"
else
- _scp_address=$_host
+ _scp_address=$2
fi
- dinfo "saving to $_host:$_dir"
+ dinfo "saving to $2:$_ssh_dir"
cat /var/lib/random-seed > /dev/urandom
- ssh -q $_opt $_host mkdir -p $_dir || return 1
+ ssh -q $_ssh_opt "$2" mkdir -p "$_ssh_dir" || return 1
- save_vmcore_dmesg_ssh ${DMESG_COLLECTOR} ${_dir} "${_opt}" "$_host"
+ save_vmcore_dmesg_ssh "$DMESG_COLLECTOR" "$_ssh_dir" "$_ssh_opt" "$2"
dinfo "saving vmcore"
- save_opalcore_ssh ${_dir} "${_opt}" "$_host" "$_scp_address"
+ save_opalcore_ssh "$_ssh_dir" "$_ssh_opt" "$2" "$_scp_address"
if [ "${CORE_COLLECTOR%%[[:blank:]]*}" = "scp" ]; then
- scp -q $_opt /proc/vmcore "$_scp_address:$_dir/vmcore-incomplete"
- _exitcode=$?
+ scp -q $_ssh_opt /proc/vmcore "$_scp_address:$_ssh_dir/vmcore-incomplete"
+ _ret=$?
+ _vmcore="vmcore"
else
- $CORE_COLLECTOR /proc/vmcore | ssh $_opt $_host "umask 0077 && dd bs=512 of=$_dir/vmcore-incomplete"
- _exitcode=$?
+ $CORE_COLLECTOR /proc/vmcore | ssh $_ssh_opt "$2" "umask 0077 && dd bs=512 of='$_ssh_dir/vmcore-incomplete'"
+ _ret=$?
_vmcore="vmcore.flat"
fi
- if [ $_exitcode -eq 0 ]; then
- ssh $_opt $_host "mv $_dir/vmcore-incomplete $_dir/$_vmcore"
- _exitcode2=$?
- if [ $_exitcode2 -ne 0 ]; then
- derror "moving vmcore failed, _exitcode:$_exitcode2"
+ if [ $_ret -eq 0 ]; then
+ ssh $_ssh_opt "$2" "mv '$_ssh_dir/vmcore-incomplete' '$_ssh_dir/$_vmcore'"
+ _ret=$?
+ if [ $_ret -ne 0 ]; then
+ derror "moving vmcore failed, exitcode:$_ret"
else
dinfo "saving vmcore complete"
fi
else
- derror "saving vmcore failed, _exitcode:$_exitcode"
+ derror "saving vmcore failed, exitcode:$_ret"
fi
- dinfo "saving the $KDUMP_LOG_FILE to $_host:$_dir/"
+ dinfo "saving the $KDUMP_LOG_FILE to $2:$_ssh_dir/"
save_log
- scp -q $_opt $KDUMP_LOG_FILE "$_scp_address:$_dir/"
- _ret=$?
- if [ $_ret -ne 0 ]; then
+ if ! scp -q $_ssh_opt $KDUMP_LOG_FILE "$_scp_address:$_ssh_dir/"; then
derror "saving log file failed, _exitcode:$_ret"
fi
- if [ $_exitcode -ne 0 ] || [ $_exitcode2 -ne 0 ];then
- return 1
- fi
-
- return 0
+ return $_ret
}
+# $1: dump path
+# $2: ssh opts
+# $3: ssh address in <user>@<host> format
+# $4: scp address, similar with ssh address but IPv6 addresses are quoted
save_opalcore_ssh() {
- local _path=$1
- local _opts="$2"
- local _location=$3
- local _scp_address=$4
-
- ddebug "_path=$_path _opts=$_opts _location=$_location"
-
if [ ! -f $OPALCORE ]; then
# Check if we are on an old kernel that uses a different path
if [ -f /sys/firmware/opal/core ]; then
@@ -460,31 +442,26 @@ save_opalcore_ssh() {
fi
fi
- dinfo "saving opalcore:$OPALCORE to $_location:$_path"
+ dinfo "saving opalcore:$OPALCORE to $3:$1"
- scp $_opts $OPALCORE $_scp_address:$_path/opalcore-incomplete
- if [ $? -ne 0 ]; then
+ if ! scp $2 $OPALCORE "$4:$1/opalcore-incomplete"; then
derror "saving opalcore failed"
- return 1
+ return 1
fi
- ssh $_opts $_location mv $_path/opalcore-incomplete $_path/opalcore
+ ssh $2 "$3" mv "$1/opalcore-incomplete" "$1/opalcore"
dinfo "saving opalcore complete"
return 0
}
+# $1: dmesg collector
+# $2: dump path
+# $3: ssh opts
+# $4: ssh address in <user>@<host> format
save_vmcore_dmesg_ssh() {
- local _dmesg_collector=$1
- local _path=$2
- local _opts="$3"
- local _location=$4
-
- dinfo "saving vmcore-dmesg.txt to $_location:$_path"
- $_dmesg_collector /proc/vmcore | ssh $_opts $_location "umask 0077 && dd of=$_path/vmcore-dmesg-incomplete.txt"
- _exitcode=$?
-
- if [ $_exitcode -eq 0 ]; then
- ssh -q $_opts $_location mv $_path/vmcore-dmesg-incomplete.txt $_path/vmcore-dmesg.txt
+ dinfo "saving vmcore-dmesg.txt to $4:$2"
+ if $1 /proc/vmcore | ssh $3 "$4" "umask 0077 && dd of='$2/vmcore-dmesg-incomplete.txt'"; then
+ ssh -q $3 "$4" mv "$2/vmcore-dmesg-incomplete.txt" "$2/vmcore-dmesg.txt"
dinfo "saving vmcore-dmesg.txt complete"
else
derror "saving vmcore-dmesg.txt failed"
@@ -493,17 +470,24 @@ save_vmcore_dmesg_ssh() {
get_host_ip()
{
- local _host
if is_nfs_dump_target || is_ssh_dump_target
then
kdumpnic=$(getarg kdumpnic=)
- [ -z "$kdumpnic" ] && derror "failed to get kdumpnic!" && return 1
- _host=`ip addr show dev $kdumpnic|grep '[ ]*inet'`
- [ $? -ne 0 ] && derror "wrong kdumpnic: $kdumpnic" && return 1
- _host=`echo $_host | head -n 1 | cut -d' ' -f2`
- _host="${_host%%/*}"
- [ -z "$_host" ] && derror "wrong kdumpnic: $kdumpnic" && return 1
- HOST_IP=$_host
+ if [ -z "$kdumpnic" ]; then
+ derror "failed to get kdumpnic!"
+ return 1
+ fi
+ if ! kdumphost=$(ip addr show dev "$kdumpnic" | grep '[ ]*inet'); then
+ derror "wrong kdumpnic: $kdumpnic"
+ return 1
+ fi
+ kdumphost=$(echo "$kdumphost" | head -n 1 | awk '{print $2}')
+ kdumphost="${kdumphost%%/*}"
+ if [ -z "$kdumphost" ]; then
+ derror "wrong kdumpnic: $kdumpnic"
+ return 1
+ fi
+ HOST_IP=$kdumphost
fi
return 0
}
@@ -518,7 +502,7 @@ read_kdump_confs()
get_kdump_confs
# rescan for add code for dump target
- while read config_opt config_val;
+ while read -r config_opt config_val;
do
# remove inline comments after the end of a directive.
case "$config_opt" in
@@ -540,12 +524,13 @@ read_kdump_confs()
DUMP_INSTRUCTION="dump_ssh $SSH_KEY_LOCATION $config_val"
;;
esac
- done <<< "$(kdump_read_conf)"
+ done < "$KDUMP_CONF_PARSED"
}
fence_kdump_notify()
{
if [ -n "$FENCE_KDUMP_NODES" ]; then
+ # shellcheck disable=SC2086
$FENCE_KDUMP_SEND $FENCE_KDUMP_ARGS $FENCE_KDUMP_NODES &
fi
}
@@ -566,8 +551,7 @@ fi
read_kdump_confs
fence_kdump_notify
-get_host_ip
-if [ $? -ne 0 ]; then
+if ! get_host_ip; then
derror "get_host_ip exited with non-zero status!"
exit 1
fi
@@ -576,8 +560,7 @@ if [ -z "$DUMP_INSTRUCTION" ]; then
DUMP_INSTRUCTION="dump_fs $NEWROOT"
fi
-do_kdump_pre
-if [ $? -ne 0 ]; then
+if ! do_kdump_pre; then
derror "kdump_pre script exited with non-zero status!"
do_final_action
# During systemd service to reboot the machine, stop this shell script running
@@ -587,8 +570,7 @@ make_trace_mem "kdump saving vmcore" '1:shortmem' '2+:mem' '3+:slab'
do_dump
DUMP_RETVAL=$?
-do_kdump_post $DUMP_RETVAL
-if [ $? -ne 0 ]; then
+if ! do_kdump_post $DUMP_RETVAL; then
derror "kdump_post script exited with non-zero status!"
fi
commit 725027b735e6f27e51572c570b34c0c7186203ef
Author: Kairui Song <kasong(a)redhat.com>
Date: Thu Aug 12 02:55:32 2021 +0800
dracut-kdump.sh: POSIX doesn't support pipefail
Set pipefail will cause POSIX shell to exit with failure. So only do
that in bash.
Signed-off-by: Kairui Song <kasong(a)redhat.com>
Acked-by: Philipp Rudo <prudo(a)redhat.com>
diff --git a/dracut-kdump.sh b/dracut-kdump.sh
index 25972e4..3c1b080 100755
--- a/dracut-kdump.sh
+++ b/dracut-kdump.sh
@@ -31,7 +31,10 @@ KDUMP_POST=""
NEWROOT="/sysroot"
OPALCORE="/sys/firmware/opal/mpipl/core"
-set -o pipefail
+# POSIX doesn't have pipefail, only apply when using bash
+# shellcheck disable=SC3040
+[ -n "$BASH" ] && set -o pipefail
+
DUMP_RETVAL=0
get_kdump_confs()
commit b1c794a2cf1a4ed6c8fc2588d1e03ffcde07813c
Author: Kairui Song <kasong(a)redhat.com>
Date: Tue Sep 14 03:00:48 2021 +0800
dracut-kdump.sh: Use stat instead of ls to get vmcore size
ls output is fragile, so use stat instead.
Signed-off-by: Kairui Song <kasong(a)redhat.com>
Acked-by: Philipp Rudo <prudo(a)redhat.com>
diff --git a/dracut-kdump.sh b/dracut-kdump.sh
index b92854e..25972e4 100755
--- a/dracut-kdump.sh
+++ b/dracut-kdump.sh
@@ -366,7 +366,7 @@ dump_raw()
dinfo "saving to raw disk $_raw"
if ! $(echo -n $CORE_COLLECTOR|grep -q makedumpfile); then
- _src_size=`ls -l /proc/vmcore | cut -d' ' -f5`
+ _src_size=$(stat --format %s /proc/vmcore)
_src_size_mb=$(($_src_size / 1048576))
/kdumpscripts/monitor_dd_progress $_src_size_mb &
fi
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh
index d6011ee..80b5582 100755
--- a/dracut-module-setup.sh
+++ b/dracut-module-setup.sh
@@ -1029,6 +1029,7 @@ install() {
inst "/bin/head" "/bin/head"
inst "/bin/awk" "/bin/awk"
inst "/bin/sed" "/bin/sed"
+ inst "/bin/stat" "/bin/stat"
inst "/sbin/makedumpfile" "/sbin/makedumpfile"
inst "/sbin/vmcore-dmesg" "/sbin/vmcore-dmesg"
inst "/usr/bin/printf" "/sbin/printf"
commit 7a9823b42e13cb9ff535009f28f89d197b14bbb0
Author: Kairui Song <kasong(a)redhat.com>
Date: Tue Aug 3 13:23:26 2021 +0800
dracut-kdump.sh: simplify dump_ssh
There is a workaround for `scp` that it expects IPv6 address to be
quoted with [ ... ], only apply the workaround once and store the
updated `scp` address to reuse it.
Signed-off-by: Kairui Song <kasong(a)redhat.com>
Acked-by: Philipp Rudo <prudo(a)redhat.com>
diff --git a/dracut-kdump.sh b/dracut-kdump.sh
index 7cfa31b..b92854e 100755
--- a/dracut-kdump.sh
+++ b/dracut-kdump.sh
@@ -387,29 +387,25 @@ dump_ssh()
local _dir="$KDUMP_PATH/$HOST_IP-$DATEDIR"
local _host=$2
local _vmcore="vmcore"
- local _ipv6_addr="" _username=""
+
+ if is_ipv6_address "$_host"; then
+ _scp_address=${_host%@*}@"[${_host#*@}]"
+ else
+ _scp_address=$_host
+ fi
dinfo "saving to $_host:$_dir"
cat /var/lib/random-seed > /dev/urandom
ssh -q $_opt $_host mkdir -p $_dir || return 1
- save_vmcore_dmesg_ssh ${DMESG_COLLECTOR} ${_dir} "${_opt}" $_host
- save_opalcore_ssh ${_dir} "${_opt}" $_host
-
+ save_vmcore_dmesg_ssh ${DMESG_COLLECTOR} ${_dir} "${_opt}" "$_host"
dinfo "saving vmcore"
- if is_ipv6_address "$_host"; then
- _username=${_host%@*}
- _ipv6_addr="[${_host#*@}]"
- fi
+ save_opalcore_ssh ${_dir} "${_opt}" "$_host" "$_scp_address"
if [ "${CORE_COLLECTOR%%[[:blank:]]*}" = "scp" ]; then
- if [ -n "$_username" ] && [ -n "$_ipv6_addr" ]; then
- scp -q $_opt /proc/vmcore "$_username@$_ipv6_addr:$_dir/vmcore-incomplete"
- else
- scp -q $_opt /proc/vmcore "$_host:$_dir/vmcore-incomplete"
- fi
+ scp -q $_opt /proc/vmcore "$_scp_address:$_dir/vmcore-incomplete"
_exitcode=$?
else
$CORE_COLLECTOR /proc/vmcore | ssh $_opt $_host "umask 0077 && dd bs=512 of=$_dir/vmcore-incomplete"
@@ -431,11 +427,7 @@ dump_ssh()
dinfo "saving the $KDUMP_LOG_FILE to $_host:$_dir/"
save_log
- if [ -n "$_username" ] && [ -n "$_ipv6_addr" ]; then
- scp -q $_opt $KDUMP_LOG_FILE "$_username@$_ipv6_addr:$_dir/"
- else
- scp -q $_opt $KDUMP_LOG_FILE "$_host:$_dir/"
- fi
+ scp -q $_opt $KDUMP_LOG_FILE "$_scp_address:$_dir/"
_ret=$?
if [ $_ret -ne 0 ]; then
derror "saving log file failed, _exitcode:$_ret"
@@ -452,7 +444,7 @@ save_opalcore_ssh() {
local _path=$1
local _opts="$2"
local _location=$3
- local _user_name="" _ipv6addr=""
+ local _scp_address=$4
ddebug "_path=$_path _opts=$_opts _location=$_location"
@@ -465,18 +457,9 @@ save_opalcore_ssh() {
fi
fi
- if is_ipv6_address "$_host"; then
- _user_name=${_location%@*}
- _ipv6addr="[${_location#*@}]"
- fi
-
dinfo "saving opalcore:$OPALCORE to $_location:$_path"
- if [ -n "$_user_name" ] && [ -n "$_ipv6addr" ]; then
- scp $_opts $OPALCORE $_user_name@$_ipv6addr:$_path/opalcore-incomplete
- else
- scp $_opts $OPALCORE $_location:$_path/opalcore-incomplete
- fi
+ scp $_opts $OPALCORE $_scp_address:$_path/opalcore-incomplete
if [ $? -ne 0 ]; then
derror "saving opalcore failed"
return 1
commit 8f89e890713c382c88a7e00420ef3b98c2dc708d
Author: Kairui Song <kasong(a)redhat.com>
Date: Mon Aug 2 01:25:17 2021 +0800
dracut-kdump.sh: remove add_dump_code
`add_dump_code "<op>"` is just `DUMP_INSTRUCTION="<op>"`, no need a
extra wrapper for that.
Signed-off-by: Kairui Song <kasong(a)redhat.com>
Acked-by: Philipp Rudo <prudo(a)redhat.com>
diff --git a/dracut-kdump.sh b/dracut-kdump.sh
index 54e9713..7cfa31b 100755
--- a/dracut-kdump.sh
+++ b/dracut-kdump.sh
@@ -36,9 +36,7 @@ DUMP_RETVAL=0
get_kdump_confs()
{
- local config_opt config_val
-
- while read config_opt config_val;
+ while read -r config_opt config_val;
do
# remove inline comments after the end of a directive.
case "$config_opt" in
@@ -359,11 +357,6 @@ do_kdump_post()
fi
}
-add_dump_code()
-{
- DUMP_INSTRUCTION=$1
-}
-
dump_raw()
{
local _raw=$1
@@ -547,18 +540,18 @@ read_kdump_confs()
config_val=$(get_dracut_args_target "$config_val")
if [ -n "$config_val" ]; then
config_val=$(get_mntpoint_from_target "$config_val")
- add_dump_code "dump_fs $config_val"
+ DUMP_INSTRUCTION="dump_fs $config_val"
fi
;;
ext[234]|xfs|btrfs|minix|nfs)
config_val=$(get_mntpoint_from_target "$config_val")
- add_dump_code "dump_fs $config_val"
+ DUMP_INSTRUCTION="dump_fs $config_val"
;;
raw)
- add_dump_code "dump_raw $config_val"
+ DUMP_INSTRUCTION="dump_raw $config_val"
;;
ssh)
- add_dump_code "dump_ssh $SSH_KEY_LOCATION $config_val"
+ DUMP_INSTRUCTION="dump_ssh $SSH_KEY_LOCATION $config_val"
;;
esac
done <<< "$(kdump_read_conf)"
@@ -594,7 +587,7 @@ if [ $? -ne 0 ]; then
fi
if [ -z "$DUMP_INSTRUCTION" ]; then
- add_dump_code "dump_fs $NEWROOT"
+ DUMP_INSTRUCTION="dump_fs $NEWROOT"
fi
do_kdump_pre
commit 0675edbadb2320b8809aa8751b356ccafc78d857
Author: Kairui Song <kasong(a)redhat.com>
Date: Mon Aug 2 01:19:44 2021 +0800
dracut-kdump.sh: don't put KDUMP_SCRIPT_DIR in PATH
monitor_dd_progress is the only extra binary in KDUMP_SCRIPT_DIR, no
need to change PATH environment variable, just call it directly.
Signed-off-by: Kairui Song <kasong(a)redhat.com>
Acked-by: Philipp Rudo <prudo(a)redhat.com>
diff --git a/dracut-kdump.sh b/dracut-kdump.sh
index a785ab9..54e9713 100755
--- a/dracut-kdump.sh
+++ b/dracut-kdump.sh
@@ -24,7 +24,6 @@ DATEDIR=`date +%Y-%m-%d-%T`
HOST_IP='127.0.0.1'
DUMP_INSTRUCTION=""
SSH_KEY_LOCATION="/root/.ssh/kdump_id_rsa"
-KDUMP_SCRIPT_DIR="/kdumpscripts"
DD_BLKSIZE=512
FINAL_ACTION="systemctl reboot -f"
KDUMP_PRE=""
@@ -35,8 +34,6 @@ OPALCORE="/sys/firmware/opal/mpipl/core"
set -o pipefail
DUMP_RETVAL=0
-export PATH=$PATH:$KDUMP_SCRIPT_DIR
-
get_kdump_confs()
{
local config_opt config_val
@@ -378,7 +375,7 @@ dump_raw()
if ! $(echo -n $CORE_COLLECTOR|grep -q makedumpfile); then
_src_size=`ls -l /proc/vmcore | cut -d' ' -f5`
_src_size_mb=$(($_src_size / 1048576))
- monitor_dd_progress $_src_size_mb &
+ /kdumpscripts/monitor_dd_progress $_src_size_mb &
fi
dinfo "saving vmcore"
commit a1205effaa98c08974c39c3283d191c70337857a
Author: Kairui Song <kasong(a)redhat.com>
Date: Thu Aug 5 00:59:29 2021 +0800
kdump-lib-initramfs.sh: move dump related functions to kdump.sh
These dump related functions are only used by dracut-kdump.sh.
Signed-off-by: Kairui Song <kasong(a)redhat.com>
Acked-by: Philipp Rudo <prudo(a)redhat.com>
diff --git a/dracut-kdump.sh b/dracut-kdump.sh
index 352cad5..a785ab9 100755
--- a/dracut-kdump.sh
+++ b/dracut-kdump.sh
@@ -4,13 +4,301 @@
#
. /lib/dracut-lib.sh
+. /lib/kdump-logger.sh
. /lib/kdump-lib-initramfs.sh
+#initiate the kdump logger
+dlog_init
+if [ $? -ne 0 ]; then
+ echo "failed to initiate the kdump logger."
+ exit 1
+fi
+
+KDUMP_PATH="/var/crash"
+KDUMP_LOG_FILE="/run/initramfs/kexec-dmesg.log"
+CORE_COLLECTOR=""
+DEFAULT_CORE_COLLECTOR="makedumpfile -l --message-level 7 -d 31"
+DMESG_COLLECTOR="/sbin/vmcore-dmesg"
+FAILURE_ACTION="systemctl reboot -f"
+DATEDIR=`date +%Y-%m-%d-%T`
+HOST_IP='127.0.0.1'
+DUMP_INSTRUCTION=""
+SSH_KEY_LOCATION="/root/.ssh/kdump_id_rsa"
+KDUMP_SCRIPT_DIR="/kdumpscripts"
+DD_BLKSIZE=512
+FINAL_ACTION="systemctl reboot -f"
+KDUMP_PRE=""
+KDUMP_POST=""
+NEWROOT="/sysroot"
+OPALCORE="/sys/firmware/opal/mpipl/core"
+
set -o pipefail
DUMP_RETVAL=0
export PATH=$PATH:$KDUMP_SCRIPT_DIR
+get_kdump_confs()
+{
+ local config_opt config_val
+
+ while read config_opt config_val;
+ do
+ # remove inline comments after the end of a directive.
+ case "$config_opt" in
+ path)
+ KDUMP_PATH="$config_val"
+ ;;
+ core_collector)
+ [ -n "$config_val" ] && CORE_COLLECTOR="$config_val"
+ ;;
+ sshkey)
+ if [ -f "$config_val" ]; then
+ SSH_KEY_LOCATION=$config_val
+ fi
+ ;;
+ kdump_pre)
+ KDUMP_PRE="$config_val"
+ ;;
+ kdump_post)
+ KDUMP_POST="$config_val"
+ ;;
+ fence_kdump_args)
+ FENCE_KDUMP_ARGS="$config_val"
+ ;;
+ fence_kdump_nodes)
+ FENCE_KDUMP_NODES="$config_val"
+ ;;
+ failure_action|default)
+ case $config_val in
+ shell)
+ FAILURE_ACTION="kdump_emergency_shell"
+ ;;
+ reboot)
+ FAILURE_ACTION="systemctl reboot -f && exit"
+ ;;
+ halt)
+ FAILURE_ACTION="halt && exit"
+ ;;
+ poweroff)
+ FAILURE_ACTION="systemctl poweroff -f && exit"
+ ;;
+ dump_to_rootfs)
+ FAILURE_ACTION="dump_to_rootfs"
+ ;;
+ esac
+ ;;
+ final_action)
+ case $config_val in
+ reboot)
+ FINAL_ACTION="systemctl reboot -f"
+ ;;
+ halt)
+ FINAL_ACTION="halt"
+ ;;
+ poweroff)
+ FINAL_ACTION="systemctl poweroff -f"
+ ;;
+ esac
+ ;;
+ esac
+ done <<< "$(kdump_read_conf)"
+
+ if [ -z "$CORE_COLLECTOR" ]; then
+ CORE_COLLECTOR="$DEFAULT_CORE_COLLECTOR"
+ if is_ssh_dump_target || is_raw_dump_target; then
+ CORE_COLLECTOR="$CORE_COLLECTOR -F"
+ fi
+ fi
+}
+
+# store the kexec kernel log to a file.
+save_log()
+{
+ dmesg -T > $KDUMP_LOG_FILE
+
+ if command -v journalctl > /dev/null; then
+ journalctl -ab >> $KDUMP_LOG_FILE
+ fi
+ chmod 600 $KDUMP_LOG_FILE
+}
+
+# dump_fs <mount point>
+dump_fs()
+{
+ local _exitcode
+ local _mp=$1
+ local _op=$(get_mount_info OPTIONS target $_mp -f)
+ ddebug "dump_fs _mp=$_mp _opts=$_op"
+
+ if ! is_mounted "$_mp"; then
+ dinfo "dump path \"$_mp\" is not mounted, trying to mount..."
+ mount --target $_mp
+ if [ $? -ne 0 ]; then
+ derror "failed to dump to \"$_mp\", it's not a mount point!"
+ return 1
+ fi
+ fi
+
+ # Remove -F in makedumpfile case. We don't want a flat format dump here.
+ [[ $CORE_COLLECTOR = *makedumpfile* ]] && CORE_COLLECTOR=`echo $CORE_COLLECTOR | sed -e "s/-F//g"`
+
+ local _dump_path=$(echo "$_mp/$KDUMP_PATH/$HOST_IP-$DATEDIR/" | tr -s /)
+
+ dinfo "saving to $_dump_path"
+
+ # Only remount to read-write mode if the dump target is mounted read-only.
+ if [[ "$_op" = "ro"* ]]; then
+ dinfo "Remounting the dump target in rw mode."
+ mount -o remount,rw $_mp || return 1
+ fi
+
+ mkdir -p $_dump_path || return 1
+
+ save_vmcore_dmesg_fs ${DMESG_COLLECTOR} "$_dump_path"
+ save_opalcore_fs "$_dump_path"
+
+ dinfo "saving vmcore"
+ $CORE_COLLECTOR /proc/vmcore $_dump_path/vmcore-incomplete
+ _exitcode=$?
+ if [ $_exitcode -eq 0 ]; then
+ mv $_dump_path/vmcore-incomplete $_dump_path/vmcore
+ sync
+ dinfo "saving vmcore complete"
+ else
+ derror "saving vmcore failed, _exitcode:$_exitcode"
+ fi
+
+ dinfo "saving the $KDUMP_LOG_FILE to $_dump_path/"
+ save_log
+ mv $KDUMP_LOG_FILE $_dump_path/
+ if [ $_exitcode -ne 0 ]; then
+ return 1
+ fi
+
+ # improper kernel cmdline can cause the failure of echo, we can ignore this kind of failure
+ return 0
+}
+
+save_vmcore_dmesg_fs() {
+ local _dmesg_collector=$1
+ local _path=$2
+
+ dinfo "saving vmcore-dmesg.txt to ${_path}"
+ $_dmesg_collector /proc/vmcore > ${_path}/vmcore-dmesg-incomplete.txt
+ _exitcode=$?
+ if [ $_exitcode -eq 0 ]; then
+ mv ${_path}/vmcore-dmesg-incomplete.txt ${_path}/vmcore-dmesg.txt
+ chmod 600 ${_path}/vmcore-dmesg.txt
+
+ # Make sure file is on disk. There have been instances where later
+ # saving vmcore failed and system rebooted without sync and there
+ # was no vmcore-dmesg.txt available.
+ sync
+ dinfo "saving vmcore-dmesg.txt complete"
+ else
+ if [ -f ${_path}/vmcore-dmesg-incomplete.txt ]; then
+ chmod 600 ${_path}/vmcore-dmesg-incomplete.txt
+ fi
+ derror "saving vmcore-dmesg.txt failed"
+ fi
+}
+
+save_opalcore_fs() {
+ local _path=$1
+
+ if [ ! -f $OPALCORE ]; then
+ # Check if we are on an old kernel that uses a different path
+ if [ -f /sys/firmware/opal/core ]; then
+ OPALCORE="/sys/firmware/opal/core"
+ else
+ return 0
+ fi
+ fi
+
+ dinfo "saving opalcore:$OPALCORE to ${_path}/opalcore"
+ cp $OPALCORE ${_path}/opalcore
+ if [ $? -ne 0 ]; then
+ derror "saving opalcore failed"
+ return 1
+ fi
+
+ sync
+ dinfo "saving opalcore complete"
+ return 0
+}
+
+dump_to_rootfs()
+{
+
+ if [[ $(systemctl status dracut-initqueue | sed -n "s/^\s*Active: \(\S*\)\s.*$/\1/p") == "inactive" ]]; then
+ dinfo "Trying to bring up initqueue for rootfs mount"
+ systemctl start dracut-initqueue
+ fi
+
+ dinfo "Clean up dead systemd services"
+ systemctl cancel
+ dinfo "Waiting for rootfs mount, will timeout after 90 seconds"
+ systemctl start --no-block sysroot.mount
+
+ _loop=0
+ while [ $_loop -lt 90 ] && ! is_mounted /sysroot; do
+ sleep 1
+ _loop=$((_loop + 1))
+ done
+
+ if ! is_mounted /sysroot; then
+ derror "Failed to mount rootfs"
+ return
+ fi
+
+ ddebug "NEWROOT=$NEWROOT"
+ dump_fs $NEWROOT
+}
+
+kdump_emergency_shell()
+{
+ ddebug "Switching to kdump emergency shell..."
+
+ [ -f /etc/profile ] && . /etc/profile
+ export PS1='kdump:${PWD}# '
+
+ . /lib/dracut-lib.sh
+ if [ -f /dracut-state.sh ]; then
+ . /dracut-state.sh 2>/dev/null
+ fi
+
+ source_conf /etc/conf.d
+
+ type plymouth >/dev/null 2>&1 && plymouth quit
+
+ source_hook "emergency"
+ while read _tty rest; do
+ (
+ echo
+ echo
+ echo 'Entering kdump emergency mode.'
+ echo 'Type "journalctl" to view system logs.'
+ echo 'Type "rdsosreport" to generate a sosreport, you can then'
+ echo 'save it elsewhere and attach it to a bug report.'
+ echo
+ echo
+ ) > /dev/$_tty
+ done < /proc/consoles
+ sh -i -l
+ /bin/rm -f -- /.console_lock
+}
+
+do_failure_action()
+{
+ dinfo "Executing failure action $FAILURE_ACTION"
+ eval $FAILURE_ACTION
+}
+
+do_final_action()
+{
+ dinfo "Executing final action $FINAL_ACTION"
+ eval $FINAL_ACTION
+}
do_dump()
{
local _ret
diff --git a/kdump-lib-initramfs.sh b/kdump-lib-initramfs.sh
index 73b2699..b30b024 100755
--- a/kdump-lib-initramfs.sh
+++ b/kdump-lib-initramfs.sh
@@ -3,35 +3,9 @@
# Function and variables used in initramfs environment, POSIX compatible
#
-. /lib/kdump-logger.sh
-
DEFAULT_PATH="/var/crash/"
-KDUMP_PATH="/var/crash"
-KDUMP_LOG_FILE="/run/initramfs/kexec-dmesg.log"
-CORE_COLLECTOR=""
-DEFAULT_CORE_COLLECTOR="makedumpfile -l --message-level 7 -d 31"
-DMESG_COLLECTOR="/sbin/vmcore-dmesg"
-FAILURE_ACTION="systemctl reboot -f"
-DATEDIR=`date +%Y-%m-%d-%T`
-HOST_IP='127.0.0.1'
-DUMP_INSTRUCTION=""
-SSH_KEY_LOCATION="/root/.ssh/kdump_id_rsa"
-KDUMP_SCRIPT_DIR="/kdumpscripts"
-DD_BLKSIZE=512
-FINAL_ACTION="systemctl reboot -f"
-KDUMP_PRE=""
-KDUMP_POST=""
-NEWROOT="/sysroot"
-OPALCORE="/sys/firmware/opal/mpipl/core"
KDUMP_CONFIG_FILE="/etc/kdump.conf"
-#initiate the kdump logger
-dlog_init
-if [ $? -ne 0 ]; then
- echo "failed to initiate the kdump logger."
- exit 1
-fi
-
# Read kdump config in well formated style
kdump_read_conf()
{
@@ -156,266 +130,3 @@ is_fs_dump_target()
{
[[ $(kdump_get_conf_val "ext[234]\|xfs\|btrfs\|minix") ]]
}
-
-get_kdump_confs()
-{
- local config_opt config_val
-
- while read config_opt config_val;
- do
- # remove inline comments after the end of a directive.
- case "$config_opt" in
- path)
- KDUMP_PATH="$config_val"
- ;;
- core_collector)
- [ -n "$config_val" ] && CORE_COLLECTOR="$config_val"
- ;;
- sshkey)
- if [ -f "$config_val" ]; then
- SSH_KEY_LOCATION=$config_val
- fi
- ;;
- kdump_pre)
- KDUMP_PRE="$config_val"
- ;;
- kdump_post)
- KDUMP_POST="$config_val"
- ;;
- fence_kdump_args)
- FENCE_KDUMP_ARGS="$config_val"
- ;;
- fence_kdump_nodes)
- FENCE_KDUMP_NODES="$config_val"
- ;;
- failure_action|default)
- case $config_val in
- shell)
- FAILURE_ACTION="kdump_emergency_shell"
- ;;
- reboot)
- FAILURE_ACTION="systemctl reboot -f && exit"
- ;;
- halt)
- FAILURE_ACTION="halt && exit"
- ;;
- poweroff)
- FAILURE_ACTION="systemctl poweroff -f && exit"
- ;;
- dump_to_rootfs)
- FAILURE_ACTION="dump_to_rootfs"
- ;;
- esac
- ;;
- final_action)
- case $config_val in
- reboot)
- FINAL_ACTION="systemctl reboot -f"
- ;;
- halt)
- FINAL_ACTION="halt"
- ;;
- poweroff)
- FINAL_ACTION="systemctl poweroff -f"
- ;;
- esac
- ;;
- esac
- done <<< "$(kdump_read_conf)"
-
- if [ -z "$CORE_COLLECTOR" ]; then
- CORE_COLLECTOR="$DEFAULT_CORE_COLLECTOR"
- if is_ssh_dump_target || is_raw_dump_target; then
- CORE_COLLECTOR="$CORE_COLLECTOR -F"
- fi
- fi
-}
-
-# store the kexec kernel log to a file.
-save_log()
-{
- dmesg -T > $KDUMP_LOG_FILE
-
- if command -v journalctl > /dev/null; then
- journalctl -ab >> $KDUMP_LOG_FILE
- fi
- chmod 600 $KDUMP_LOG_FILE
-}
-
-# dump_fs <mount point>
-dump_fs()
-{
- local _exitcode
- local _mp=$1
- local _op=$(get_mount_info OPTIONS target $_mp -f)
- ddebug "dump_fs _mp=$_mp _opts=$_op"
-
- if ! is_mounted "$_mp"; then
- dinfo "dump path \"$_mp\" is not mounted, trying to mount..."
- mount --target $_mp
- if [ $? -ne 0 ]; then
- derror "failed to dump to \"$_mp\", it's not a mount point!"
- return 1
- fi
- fi
-
- # Remove -F in makedumpfile case. We don't want a flat format dump here.
- [[ $CORE_COLLECTOR = *makedumpfile* ]] && CORE_COLLECTOR=`echo $CORE_COLLECTOR | sed -e "s/-F//g"`
-
- local _dump_path=$(echo "$_mp/$KDUMP_PATH/$HOST_IP-$DATEDIR/" | tr -s /)
-
- dinfo "saving to $_dump_path"
-
- # Only remount to read-write mode if the dump target is mounted read-only.
- if [[ "$_op" = "ro"* ]]; then
- dinfo "Remounting the dump target in rw mode."
- mount -o remount,rw $_mp || return 1
- fi
-
- mkdir -p $_dump_path || return 1
-
- save_vmcore_dmesg_fs ${DMESG_COLLECTOR} "$_dump_path"
- save_opalcore_fs "$_dump_path"
-
- dinfo "saving vmcore"
- $CORE_COLLECTOR /proc/vmcore $_dump_path/vmcore-incomplete
- _exitcode=$?
- if [ $_exitcode -eq 0 ]; then
- mv $_dump_path/vmcore-incomplete $_dump_path/vmcore
- sync
- dinfo "saving vmcore complete"
- else
- derror "saving vmcore failed, _exitcode:$_exitcode"
- fi
-
- dinfo "saving the $KDUMP_LOG_FILE to $_dump_path/"
- save_log
- mv $KDUMP_LOG_FILE $_dump_path/
- if [ $_exitcode -ne 0 ]; then
- return 1
- fi
-
- # improper kernel cmdline can cause the failure of echo, we can ignore this kind of failure
- return 0
-}
-
-save_vmcore_dmesg_fs() {
- local _dmesg_collector=$1
- local _path=$2
-
- dinfo "saving vmcore-dmesg.txt to ${_path}"
- $_dmesg_collector /proc/vmcore > ${_path}/vmcore-dmesg-incomplete.txt
- _exitcode=$?
- if [ $_exitcode -eq 0 ]; then
- mv ${_path}/vmcore-dmesg-incomplete.txt ${_path}/vmcore-dmesg.txt
- chmod 600 ${_path}/vmcore-dmesg.txt
-
- # Make sure file is on disk. There have been instances where later
- # saving vmcore failed and system rebooted without sync and there
- # was no vmcore-dmesg.txt available.
- sync
- dinfo "saving vmcore-dmesg.txt complete"
- else
- if [ -f ${_path}/vmcore-dmesg-incomplete.txt ]; then
- chmod 600 ${_path}/vmcore-dmesg-incomplete.txt
- fi
- derror "saving vmcore-dmesg.txt failed"
- fi
-}
-
-save_opalcore_fs() {
- local _path=$1
-
- if [ ! -f $OPALCORE ]; then
- # Check if we are on an old kernel that uses a different path
- if [ -f /sys/firmware/opal/core ]; then
- OPALCORE="/sys/firmware/opal/core"
- else
- return 0
- fi
- fi
-
- dinfo "saving opalcore:$OPALCORE to ${_path}/opalcore"
- cp $OPALCORE ${_path}/opalcore
- if [ $? -ne 0 ]; then
- derror "saving opalcore failed"
- return 1
- fi
-
- sync
- dinfo "saving opalcore complete"
- return 0
-}
-
-dump_to_rootfs()
-{
-
- if [[ $(systemctl status dracut-initqueue | sed -n "s/^\s*Active: \(\S*\)\s.*$/\1/p") == "inactive" ]]; then
- dinfo "Trying to bring up initqueue for rootfs mount"
- systemctl start dracut-initqueue
- fi
-
- dinfo "Clean up dead systemd services"
- systemctl cancel
- dinfo "Waiting for rootfs mount, will timeout after 90 seconds"
- systemctl start --no-block sysroot.mount
-
- _loop=0
- while [ $_loop -lt 90 ] && ! is_mounted /sysroot; do
- sleep 1
- _loop=$((_loop + 1))
- done
-
- if ! is_mounted /sysroot; then
- derror "Failed to mount rootfs"
- return
- fi
-
- ddebug "NEWROOT=$NEWROOT"
- dump_fs $NEWROOT
-}
-
-kdump_emergency_shell()
-{
- ddebug "Switching to kdump emergency shell..."
-
- [ -f /etc/profile ] && . /etc/profile
- export PS1='kdump:${PWD}# '
-
- . /lib/dracut-lib.sh
- if [ -f /dracut-state.sh ]; then
- . /dracut-state.sh 2>/dev/null
- fi
-
- source_conf /etc/conf.d
-
- type plymouth >/dev/null 2>&1 && plymouth quit
-
- source_hook "emergency"
- while read _tty rest; do
- (
- echo
- echo
- echo 'Entering kdump emergency mode.'
- echo 'Type "journalctl" to view system logs.'
- echo 'Type "rdsosreport" to generate a sosreport, you can then'
- echo 'save it elsewhere and attach it to a bug report.'
- echo
- echo
- ) > /dev/$_tty
- done < /proc/consoles
- sh -i -l
- /bin/rm -f -- /.console_lock
-}
-
-do_failure_action()
-{
- dinfo "Executing failure action $FAILURE_ACTION"
- eval $FAILURE_ACTION
-}
-
-do_final_action()
-{
- dinfo "Executing final action $FINAL_ACTION"
- eval $FINAL_ACTION
-}
commit e7118d1de84b604b25b2f6332f4ae071a9dc08fd
Author: Kairui Song <kasong(a)redhat.com>
Date: Mon Aug 2 00:50:22 2021 +0800
Merge kdump-error-handler.sh into kdump.sh
kdump-error-handler.sh does nothing except calling three functions,
it can be easily merged into kdump.sh by using a parameter to run the
error handling routine.
kdump-lib-initramfs.sh was created to hold the three shared functions
and related code, so by merging these two files, kdump-lib-initramfs.sh
can be simplified by a lot.
Following up commits will clean up kdump-lib-initramfs.sh.
Signed-off-by: Kairui Song <kasong(a)redhat.com>
Acked-by: Philipp Rudo <prudo(a)redhat.com>
diff --git a/dracut-kdump-emergency.service b/dracut-kdump-emergency.service
index f2f6fad..0cf7051 100644
--- a/dracut-kdump-emergency.service
+++ b/dracut-kdump-emergency.service
@@ -12,7 +12,7 @@ Environment=HOME=/
Environment=DRACUT_SYSTEMD=1
Environment=NEWROOT=/sysroot
WorkingDirectory=/
-ExecStart=/bin/kdump-error-handler.sh
+ExecStart=/bin/kdump.sh --error-handler
ExecStopPost=-/bin/rm -f -- /.console_lock
Type=oneshot
StandardInput=tty-force
diff --git a/dracut-kdump-error-handler.sh b/dracut-kdump-error-handler.sh
deleted file mode 100755
index fc2b932..0000000
--- a/dracut-kdump-error-handler.sh
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/bin/sh
-
-. /lib/kdump-lib-initramfs.sh
-
-set -o pipefail
-export PATH=$PATH:$KDUMP_SCRIPT_DIR
-
-get_kdump_confs
-do_failure_action
-do_final_action
diff --git a/dracut-kdump.sh b/dracut-kdump.sh
index 3c165b3..352cad5 100755
--- a/dracut-kdump.sh
+++ b/dracut-kdump.sh
@@ -1,9 +1,7 @@
#!/bin/sh
-
-# continue here only if we have to save dump.
-if [ -f /etc/fadump.initramfs ] && [ ! -f /proc/device-tree/rtas/ibm,kernel-dump ] && [ ! -f /proc/device-tree/ibm,opal/dump/mpipl-boot ]; then
- exit 0
-fi
+#
+# The main kdump routine in capture kernel
+#
. /lib/dracut-lib.sh
. /lib/kdump-lib-initramfs.sh
@@ -288,6 +286,19 @@ fence_kdump_notify()
fi
}
+if [ "$1" = "--error-handler" ]; then
+ get_kdump_confs
+ do_failure_action
+ do_final_action
+
+ exit $?
+fi
+
+# continue here only if we have to save dump.
+if [ -f /etc/fadump.initramfs ] && [ ! -f /proc/device-tree/rtas/ibm,kernel-dump ] && [ ! -f /proc/device-tree/ibm,opal/dump/mpipl-boot ]; then
+ exit 0
+fi
+
read_kdump_confs
fence_kdump_notify
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh
index 4fb013d..d6011ee 100755
--- a/dracut-module-setup.sh
+++ b/dracut-module-setup.sh
@@ -1039,7 +1039,6 @@ install() {
inst "$moddir/kdump.sh" "/usr/bin/kdump.sh"
inst "$moddir/kdump-capture.service" "$systemdsystemunitdir/kdump-capture.service"
systemctl -q --root "$initdir" add-wants initrd.target kdump-capture.service
- inst "$moddir/kdump-error-handler.sh" "/usr/bin/kdump-error-handler.sh"
# Replace existing emergency service and emergency target
cp "$moddir/kdump-emergency.service" "$initdir/$systemdsystemunitdir/emergency.service"
cp "$moddir/kdump-emergency.target" "$initdir/$systemdsystemunitdir/emergency.target"
diff --git a/kexec-tools.spec b/kexec-tools.spec
index 7db9f9c..f71ff81 100644
--- a/kexec-tools.spec
+++ b/kexec-tools.spec
@@ -52,7 +52,6 @@ Source36: kdump-restart.sh
Source100: dracut-kdump.sh
Source101: dracut-module-setup.sh
Source102: dracut-monitor_dd_progress
-Source103: dracut-kdump-error-handler.sh
Source104: dracut-kdump-emergency.service
Source106: dracut-kdump-capture.service
Source107: dracut-kdump-emergency.target
@@ -241,7 +240,6 @@ mkdir -p -m755 $RPM_BUILD_ROOT/etc/kdump-adv-conf/kdump_dracut_modules/99kdumpba
cp %{SOURCE100} $RPM_BUILD_ROOT/etc/kdump-adv-conf/kdump_dracut_modules/99kdumpbase/%{remove_dracut_prefix %{SOURCE100}}
cp %{SOURCE101} $RPM_BUILD_ROOT/etc/kdump-adv-conf/kdump_dracut_modules/99kdumpbase/%{remove_dracut_prefix %{SOURCE101}}
cp %{SOURCE102} $RPM_BUILD_ROOT/etc/kdump-adv-conf/kdump_dracut_modules/99kdumpbase/%{remove_dracut_prefix %{SOURCE102}}
-cp %{SOURCE103} $RPM_BUILD_ROOT/etc/kdump-adv-conf/kdump_dracut_modules/99kdumpbase/%{remove_dracut_prefix %{SOURCE103}}
cp %{SOURCE104} $RPM_BUILD_ROOT/etc/kdump-adv-conf/kdump_dracut_modules/99kdumpbase/%{remove_dracut_prefix %{SOURCE104}}
cp %{SOURCE106} $RPM_BUILD_ROOT/etc/kdump-adv-conf/kdump_dracut_modules/99kdumpbase/%{remove_dracut_prefix %{SOURCE106}}
cp %{SOURCE107} $RPM_BUILD_ROOT/etc/kdump-adv-conf/kdump_dracut_modules/99kdumpbase/%{remove_dracut_prefix %{SOURCE107}}
commit a5faa052d4969cb66719d0b795d746449d3c71b7
Author: Kairui Song <kasong(a)redhat.com>
Date: Tue Sep 14 03:25:46 2021 +0800
kdump-lib-initramfs.sh: prepare to be a POSIX compatible lib
Move all functions needed in the second kernel from kdump-lib.sh
to kdump-lib-initramfs.sh, and update shebang headers.
Now, kdump-lib-initramfs.sh is an independent lib script, no longer
depend on kdump-lib.sh, and kdump-lib.sh is no longer needed for
the second kernel.
In later commits, functions in kdump-lib-initramfs.sh will be reworked
to be POSIX compatible, kdump-lib.sh will contain bash only functions.
POSIX shell have very limited features, eg. `local` keyword doesn't
exist in POSIX but we rely on that heavily. So kdump-lib.sh will
use bash syntax and contain the most complex helper and codes.
kdump-lib-initramfs.sh will contain the minimum set of helpers,
and be shared by both the first and second kernel.
Signed-off-by: Kairui Song <kasong(a)redhat.com>
Acked-by: Philipp Rudo <prudo(a)redhat.com>
diff --git a/.editorconfig b/.editorconfig
index bd8fc8c..87c4f98 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -18,7 +18,7 @@ binary_next_line = false
space_redirects = true
# Some scripts will only run with bash
-[{mkfadumprd,mkdumprd,kdumpctl}]
+[{mkfadumprd,mkdumprd,kdumpctl,kdump-lib.sh}]
shell_variant = bash
# Use dracut code style for *-module-setup.sh
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh
index 8bbf0cf..4fb013d 100755
--- a/dracut-module-setup.sh
+++ b/dracut-module-setup.sh
@@ -1034,7 +1034,6 @@ install() {
inst "/usr/bin/printf" "/sbin/printf"
inst "/usr/bin/logger" "/sbin/logger"
inst "/usr/bin/chmod" "/sbin/chmod"
- inst "/lib/kdump/kdump-lib.sh" "/lib/kdump-lib.sh"
inst "/lib/kdump/kdump-lib-initramfs.sh" "/lib/kdump-lib-initramfs.sh"
inst "/lib/kdump/kdump-logger.sh" "/lib/kdump-logger.sh"
inst "$moddir/kdump.sh" "/usr/bin/kdump.sh"
diff --git a/kdump-lib-initramfs.sh b/kdump-lib-initramfs.sh
index 50443e5..73b2699 100755
--- a/kdump-lib-initramfs.sh
+++ b/kdump-lib-initramfs.sh
@@ -1,8 +1,11 @@
-# These variables and functions are useful in 2nd kernel
+#!/bin/sh
+#
+# Function and variables used in initramfs environment, POSIX compatible
+#
-. /lib/kdump-lib.sh
. /lib/kdump-logger.sh
+DEFAULT_PATH="/var/crash/"
KDUMP_PATH="/var/crash"
KDUMP_LOG_FILE="/run/initramfs/kexec-dmesg.log"
CORE_COLLECTOR=""
@@ -20,6 +23,7 @@ KDUMP_PRE=""
KDUMP_POST=""
NEWROOT="/sysroot"
OPALCORE="/sys/firmware/opal/mpipl/core"
+KDUMP_CONFIG_FILE="/etc/kdump.conf"
#initiate the kdump logger
dlog_init
@@ -28,6 +32,131 @@ if [ $? -ne 0 ]; then
exit 1
fi
+# Read kdump config in well formated style
+kdump_read_conf()
+{
+ # Following steps are applied in order: strip trailing comment, strip trailing space,
+ # strip heading space, match non-empty line, remove duplicated spaces between conf name and value
+ [ -f "$KDUMP_CONFIG_FILE" ] && sed -n -e "s/#.*//;s/\s*$//;s/^\s*//;s/\(\S\+\)\s*\(.*\)/\1 \2/p" $KDUMP_CONFIG_FILE
+}
+
+# Retrieves config value defined in kdump.conf
+# $1: config name, sed regexp compatible
+kdump_get_conf_val() {
+ # For lines matching "^\s*$1\s+", remove matched part (config name including space),
+ # remove tailing comment, space, then store in hold space. Print out the hold buffer on last line.
+ [ -f "$KDUMP_CONFIG_FILE" ] && \
+ sed -n -e "/^\s*\($1\)\s\+/{s/^\s*\($1\)\s\+//;s/#.*//;s/\s*$//;h};\${x;p}" $KDUMP_CONFIG_FILE
+}
+
+is_mounted()
+{
+ findmnt -k -n $1 &>/dev/null
+}
+
+get_mount_info()
+{
+ local _info_type=$1 _src_type=$2 _src=$3; shift 3
+ local _info=$(findmnt -k -n -r -o $_info_type --$_src_type $_src $@)
+
+ [ -z "$_info" ] && [ -e "/etc/fstab" ] && _info=$(findmnt -s -n -r -o $_info_type --$_src_type $_src $@)
+
+ echo $_info
+}
+
+is_ipv6_address()
+{
+ echo $1 | grep -q ":"
+}
+
+is_fs_type_nfs()
+{
+ [ "$1" = "nfs" ] || [ "$1" = "nfs4" ]
+}
+
+# If $1 contains dracut_args "--mount", return <filesystem type>
+get_dracut_args_fstype()
+{
+ echo $1 | grep "\-\-mount" | sed "s/.*--mount .\(.*\)/\1/" | cut -d' ' -f3
+}
+
+# If $1 contains dracut_args "--mount", return <device>
+get_dracut_args_target()
+{
+ echo $1 | grep "\-\-mount" | sed "s/.*--mount .\(.*\)/\1/" | cut -d' ' -f1
+}
+
+get_save_path()
+{
+ local _save_path=$(kdump_get_conf_val path)
+ [ -z "$_save_path" ] && _save_path=$DEFAULT_PATH
+
+ # strip the duplicated "/"
+ echo $_save_path | tr -s /
+}
+
+get_root_fs_device()
+{
+ findmnt -k -f -n -o SOURCE /
+}
+
+# Return the current underlying device of a path, ignore bind mounts
+get_target_from_path()
+{
+ local _target
+
+ _target=$(df $1 2>/dev/null | tail -1 | awk '{print $1}')
+ [[ "$_target" == "/dev/root" ]] && [[ ! -e /dev/root ]] && _target=$(get_root_fs_device)
+ echo $_target
+}
+
+get_fs_type_from_target()
+{
+ get_mount_info FSTYPE source $1 -f
+}
+
+get_mntpoint_from_target()
+{
+ # --source is applied to ensure non-bind mount is returned
+ get_mount_info TARGET source $1 -f
+}
+
+is_ssh_dump_target()
+{
+ [[ $(kdump_get_conf_val ssh) == *@* ]]
+}
+
+is_raw_dump_target()
+{
+ [[ $(kdump_get_conf_val raw) ]]
+}
+
+is_nfs_dump_target()
+{
+ if [[ $(kdump_get_conf_val nfs) ]]; then
+ return 0;
+ fi
+
+ if is_fs_type_nfs $(get_dracut_args_fstype "$(kdump_get_conf_val dracut_args)"); then
+ return 0
+ fi
+
+ local _save_path=$(get_save_path)
+ local _target=$(get_target_from_path $_save_path)
+ local _fstype=$(get_fs_type_from_target $_target)
+
+ if is_fs_type_nfs $_fstype; then
+ return 0
+ fi
+
+ return 1
+}
+
+is_fs_dump_target()
+{
+ [[ $(kdump_get_conf_val "ext[234]\|xfs\|btrfs\|minix") ]]
+}
+
get_kdump_confs()
{
local config_opt config_val
diff --git a/kdump-lib.sh b/kdump-lib.sh
index 7e620c7..d7cb40e 100755
--- a/kdump-lib.sh
+++ b/kdump-lib.sh
@@ -1,13 +1,13 @@
-#!/bin/sh
+#!/bin/bash
#
# Kdump common variables and functions
#
-DEFAULT_PATH="/var/crash/"
+. /usr/lib/kdump/kdump-lib-initramfs.sh
+
FENCE_KDUMP_CONFIG_FILE="/etc/sysconfig/fence_kdump"
FENCE_KDUMP_SEND="/usr/libexec/fence_kdump_send"
FADUMP_ENABLED_SYS_NODE="/sys/kernel/fadump_enabled"
-KDUMP_CONFIG_FILE="/etc/kdump.conf"
is_fadump_capable()
{
@@ -35,64 +35,6 @@ perror_exit() {
exit 1
}
-is_fs_type_nfs()
-{
- [ "$1" = "nfs" ] || [ "$1" = "nfs4" ]
-}
-
-is_ssh_dump_target()
-{
- [[ $(kdump_get_conf_val ssh) == *@* ]]
-}
-
-is_nfs_dump_target()
-{
- if [[ $(kdump_get_conf_val nfs) ]]; then
- return 0;
- fi
-
- if is_fs_type_nfs $(get_dracut_args_fstype "$(kdump_get_conf_val dracut_args)"); then
- return 0
- fi
-
- local _save_path=$(get_save_path)
- local _target=$(get_target_from_path $_save_path)
- local _fstype=$(get_fs_type_from_target $_target)
-
- if is_fs_type_nfs $_fstype; then
- return 0
- fi
-
- return 1
-}
-
-is_raw_dump_target()
-{
- [[ $(kdump_get_conf_val raw) ]]
-}
-
-is_fs_dump_target()
-{
- [[ $(kdump_get_conf_val "ext[234]\|xfs\|btrfs\|minix") ]]
-}
-
-# Read kdump config in well formatted style
-kdump_read_conf()
-{
- # Following steps are applied in order: strip trailing comment, strip trailing space,
- # strip heading space, match non-empty line, remove duplicated spaces between conf name and value
- [ -f "$KDUMP_CONFIG_FILE" ] && sed -n -e "s/#.*//;s/\s*$//;s/^\s*//;s/\(\S\+\)\s*\(.*\)/\1 \2/p" $KDUMP_CONFIG_FILE
-}
-
-# Retrieves config value defined in kdump.conf
-# $1: config name, sed regexp compatible
-kdump_get_conf_val() {
- # For lines matching "^\s*$1\s+", remove matched part (config name including space),
- # remove tailing comment, space, then store in hold space. Print out the hold buffer on last line.
- [ -f "$KDUMP_CONFIG_FILE" ] && \
- sed -n -e "/^\s*\($1\)\s\+/{s/^\s*\($1\)\s\+//;s/#.*//;s/\s*$//;h};\${x;p}" $KDUMP_CONFIG_FILE
-}
-
# Check if fence kdump is configured in Pacemaker cluster
is_pcs_fence_kdump()
{
@@ -142,20 +84,6 @@ get_user_configured_dump_disk()
[ -b "$_target" ] && echo $_target
}
-get_root_fs_device()
-{
- findmnt -k -f -n -o SOURCE /
-}
-
-get_save_path()
-{
- local _save_path=$(kdump_get_conf_val path)
- [ -z "$_save_path" ] && _save_path=$DEFAULT_PATH
-
- # strip the duplicated "/"
- echo $_save_path | tr -s /
-}
-
get_block_dump_target()
{
local _target _path
@@ -261,46 +189,10 @@ get_bind_mount_source()
echo $_mnt$_fsroot$_path
}
-# Return the current underlaying device of a path, ignore bind mounts
-get_target_from_path()
-{
- local _target
-
- _target=$(df $1 2>/dev/null | tail -1 | awk '{print $1}')
- [[ "$_target" == "/dev/root" ]] && [[ ! -e /dev/root ]] && _target=$(get_root_fs_device)
- echo $_target
-}
-
-is_mounted()
-{
- findmnt -k -n $1 &>/dev/null
-}
-
-get_mount_info()
-{
- local _info_type=$1 _src_type=$2 _src=$3; shift 3
- local _info=$(findmnt -k -n -r -o $_info_type --$_src_type $_src $@)
-
- [ -z "$_info" ] && [ -e "/etc/fstab" ] && _info=$(findmnt -s -n -r -o $_info_type --$_src_type $_src $@)
-
- echo $_info
-}
-
-get_fs_type_from_target()
-{
- get_mount_info FSTYPE source $1 -f
-}
-
get_mntopt_from_target()
{
get_mount_info OPTIONS source $1 -f
}
-# Find the general mount point of a dump target, not the bind mount point
-get_mntpoint_from_target()
-{
- # Expcilitly specify --source to findmnt could ensure non-bind mount is returned
- get_mount_info TARGET source $1 -f
-}
# Get the path where the target will be mounted in kdump kernel
# $1: kdump target device
@@ -345,11 +237,6 @@ is_atomic()
grep -q "ostree" /proc/cmdline
}
-is_ipv6_address()
-{
- echo $1 | grep -q ":"
-}
-
# get ip address or hostname from nfs/ssh config value
get_remote_host()
{
@@ -562,18 +449,6 @@ is_mount_in_dracut_args()
[[ " $(kdump_get_conf_val dracut_args)" =~ .*[[:space:]]--mount[=[:space:]].* ]]
}
-# If $1 contains dracut_args "--mount", return <filesystem type>
-get_dracut_args_fstype()
-{
- echo $1 | grep "\-\-mount" | sed "s/.*--mount .\(.*\)/\1/" | cut -d' ' -f3
-}
-
-# If $1 contains dracut_args "--mount", return <device>
-get_dracut_args_target()
-{
- echo $1 | grep "\-\-mount" | sed "s/.*--mount .\(.*\)/\1/" | cut -d' ' -f1
-}
-
check_crash_mem_reserved()
{
local mem_reserved
commit 0e4b66b1ab4d90bea8f3021a46660f5a253eb110
Author: Kairui Song <kasong(a)redhat.com>
Date: Tue Sep 14 02:25:40 2021 +0800
bash scripts: reformat with shfmt
This is a batch update done with:
shfmt -s -w mkfadumprd mkdumprd kdumpctl *-module-setup.sh
Clean up code style and reduce code base size, no behaviour change.
Signed-off-by: Kairui Song <kasong(a)redhat.com>
Acked-by: Philipp Rudo <prudo(a)redhat.com>
diff --git a/dracut-early-kdump-module-setup.sh b/dracut-early-kdump-module-setup.sh
index 83e067c..0e46823 100755
--- a/dracut-early-kdump-module-setup.sh
+++ b/dracut-early-kdump-module-setup.sh
@@ -6,9 +6,8 @@ KDUMP_KERNEL=""
KDUMP_INITRD=""
check() {
- if [[ ! -f /etc/sysconfig/kdump ]] || [[ ! -f /lib/kdump/kdump-lib.sh ]]\
- || [[ -n "${IN_KDUMP}" ]]
- then
+ if [[ ! -f /etc/sysconfig/kdump ]] || [[ ! -f /lib/kdump/kdump-lib.sh ]] \
+ || [[ -n ${IN_KDUMP} ]]; then
return 1
fi
return 255
@@ -25,7 +24,7 @@ prepare_kernel_initrd() {
prepare_kdump_bootinfo
# $kernel is a variable from dracut
- if [[ "$KDUMP_KERNELVER" != "$kernel" ]]; then
+ if [[ $KDUMP_KERNELVER != "$kernel" ]]; then
dwarn "Using kernel version '$KDUMP_KERNELVER' for early kdump," \
"but the initramfs is generated for kernel version '$kernel'"
fi
@@ -33,12 +32,12 @@ prepare_kernel_initrd() {
install() {
prepare_kernel_initrd
- if [[ ! -f "$KDUMP_KERNEL" ]]; then
+ if [[ ! -f $KDUMP_KERNEL ]]; then
derror "Could not find required kernel for earlykdump," \
"earlykdump will not work!"
return 1
fi
- if [[ ! -f "$KDUMP_INITRD" ]]; then
+ if [[ ! -f $KDUMP_INITRD ]]; then
derror "Could not find required kdump initramfs for earlykdump," \
"please ensure kdump initramfs is generated first," \
"earlykdump will not work!"
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh
index e9ec894..8bbf0cf 100755
--- a/dracut-module-setup.sh
+++ b/dracut-module-setup.sh
@@ -11,8 +11,7 @@ kdump_module_init() {
check() {
[[ $debug ]] && set -x
#kdumpctl sets this explicitly
- if [[ -z "$IN_KDUMP" ]] || [[ ! -f /etc/kdump.conf ]]
- then
+ if [[ -z $IN_KDUMP ]] || [[ ! -f /etc/kdump.conf ]]; then
return 1
fi
return 0
@@ -41,11 +40,11 @@ depends() {
_dep="$_dep ssh-client"
fi
- if [[ "$(uname -m)" = "s390x" ]]; then
+ if [[ "$(uname -m)" == "s390x" ]]; then
_dep="$_dep znet"
fi
- if [[ -n "$( ls -A /sys/class/drm 2>/dev/null )" ]] || [[ -d /sys/module/hyperv_fb ]]; then
+ if [[ -n "$(ls -A /sys/class/drm 2> /dev/null)" ]] || [[ -d /sys/module/hyperv_fb ]]; then
add_opt_module drm
fi
@@ -57,19 +56,19 @@ depends() {
}
kdump_is_bridge() {
- [[ -d /sys/class/net/"$1"/bridge ]]
+ [[ -d /sys/class/net/"$1"/bridge ]]
}
kdump_is_bond() {
- [[ -d /sys/class/net/"$1"/bonding ]]
+ [[ -d /sys/class/net/"$1"/bonding ]]
}
kdump_is_team() {
- [[ -f /usr/bin/teamnl ]] && teamnl "$1" ports &> /dev/null
+ [[ -f /usr/bin/teamnl ]] && teamnl "$1" ports &> /dev/null
}
kdump_is_vlan() {
- [[ -f /proc/net/vlan/"$1" ]]
+ [[ -f /proc/net/vlan/"$1" ]]
}
# $1: netdev name
@@ -78,7 +77,7 @@ source_ifcfg_file() {
dwarning "Network Scripts are deprecated. You are encouraged to set up network by NetworkManager."
ifcfg_file=$(get_ifcfg_filename "$1")
- if [[ -f "${ifcfg_file}" ]]; then
+ if [[ -f ${ifcfg_file} ]]; then
. "${ifcfg_file}"
else
dwarning "The ifcfg file of $1 is not found!"
@@ -94,28 +93,26 @@ kdump_setup_dns() {
_tmp=$(get_nmcli_value_by_field "$_nm_show_cmd" "IP4.DNS")
# shellcheck disable=SC2206
- array=( ${_tmp//|/ } )
+ array=(${_tmp//|/ })
if [[ ${array[*]} ]]; then
- for _dns in "${array[@]}"
- do
+ for _dns in "${array[@]}"; do
echo "nameserver=$_dns" >> "$_dnsfile"
done
else
dwarning "Failed to get DNS info via nmcli output. Now try sourcing ifcfg script"
source_ifcfg_file "$_netdev"
- [[ -n "$DNS1" ]] && echo "nameserver=$DNS1" > "$_dnsfile"
- [[ -n "$DNS2" ]] && echo "nameserver=$DNS2" >> "$_dnsfile"
+ [[ -n $DNS1 ]] && echo "nameserver=$DNS1" > "$_dnsfile"
+ [[ -n $DNS2 ]] && echo "nameserver=$DNS2" >> "$_dnsfile"
fi
- while read -r content;
- do
+ while read -r content; do
_nameserver=$(echo "$content" | grep ^nameserver)
- [[ -z "$_nameserver" ]] && continue
+ [[ -z $_nameserver ]] && continue
_dns=$(echo "$_nameserver" | awk '{print $2}')
- [[ -z "$_dns" ]] && continue
+ [[ -z $_dns ]] && continue
- if [[ ! -f $_dnsfile ]] || ! grep -q "$_dns" "$_dnsfile" ; then
+ if [[ ! -f $_dnsfile ]] || ! grep -q "$_dns" "$_dnsfile"; then
echo "nameserver=$_dns" >> "$_dnsfile"
fi
done < "/etc/resolv.conf"
@@ -130,7 +127,7 @@ repeatedly_join_str() {
local _separator="$3"
local i _res
- if [[ "$_count" -le 0 ]]; then
+ if [[ $_count -le 0 ]]; then
echo -n ""
return
fi
@@ -139,7 +136,7 @@ repeatedly_join_str() {
_res="$_str"
((_count--))
- while [[ "$i" -lt "$_count" ]]; do
+ while [[ $i -lt $_count ]]; do
((i++))
_res="${_res}${_separator}${_str}"
done
@@ -160,14 +157,14 @@ cal_netmask_by_prefix() {
local _count _res _octets_per_group _octets_total _seperator _total_groups
local _max_group_value _max_group_value_repr _bits_per_group _tmp _zero_bits
- if [[ "$_ipv6_flag" == "-6" ]]; then
+ if [[ $_ipv6_flag == "-6" ]]; then
_ipv6=1
else
_ipv6=0
fi
- if [[ "$_prefix" -lt 0 || "$_prefix" -gt 128 ]] || \
- ( ((!_ipv6)) && [[ "$_prefix" -gt 32 ]] ); then
+ if [[ $_prefix -lt 0 || $_prefix -gt 128 ]] \
+ || ( ((!_ipv6)) && [[ $_prefix -gt 32 ]]); then
derror "Bad prefix:$_prefix for calculating netmask"
exit 1
fi
@@ -182,7 +179,7 @@ cal_netmask_by_prefix() {
_seperator="."
fi
- _total_groups=$((_octets_total/_octets_per_group))
+ _total_groups=$((_octets_total / _octets_per_group))
_bits_per_group=$((_octets_per_group * _bits_per_octet))
_max_group_value=$(((1 << _bits_per_group) - 1))
@@ -192,39 +189,39 @@ cal_netmask_by_prefix() {
_max_group_value_repr="$_max_group_value"
fi
- _count=$((_prefix/_octets_per_group/_bits_per_octet))
+ _count=$((_prefix / _octets_per_group / _bits_per_octet))
_first_part=$(repeatedly_join_str "$_count" "$_max_group_value_repr" "$_seperator")
_res="$_first_part"
- _tmp=$((_octets_total*_bits_per_octet-_prefix))
+ _tmp=$((_octets_total * _bits_per_octet - _prefix))
_zero_bits=$((_tmp % _bits_per_group))
- if [[ "$_zero_bits" -ne 0 ]]; then
+ if [[ $_zero_bits -ne 0 ]]; then
_second_part=$((_max_group_value >> _zero_bits << _zero_bits))
if ((_ipv6)); then
_second_part=$(printf "%x" $_second_part)
fi
((_count++))
- if [[ -z "$_first_part" ]]; then
+ if [[ -z $_first_part ]]; then
_res="$_second_part"
else
_res="${_first_part}${_seperator}${_second_part}"
fi
fi
- _count=$((_total_groups-_count))
- if [[ "$_count" -eq 0 ]]; then
+ _count=$((_total_groups - _count))
+ if [[ $_count -eq 0 ]]; then
echo -n "$_res"
return
fi
- if ((_ipv6)) && [[ "$_count" -gt 1 ]] ; then
+ if ((_ipv6)) && [[ $_count -gt 1 ]]; then
# use condensed notion for IPv6
_third_part=":"
else
_third_part=$(repeatedly_join_str "$_count" "0" "$_seperator")
fi
- if [[ -z "$_res" ]] && ((!_ipv6)) ; then
+ if [[ -z $_res ]] && ((!_ipv6)); then
echo -n "${_third_part}"
else
echo -n "${_res}${_seperator}${_third_part}"
@@ -244,11 +241,11 @@ kdump_static_ip() {
_ipv6_flag="-6"
fi
- if [[ -n "$_ipaddr" ]]; then
- _gateway=$(ip $_ipv6_flag route list dev "$_netdev" | \
- awk '/^default /{print $3}' | head -n 1)
+ if [[ -n $_ipaddr ]]; then
+ _gateway=$(ip $_ipv6_flag route list dev "$_netdev" \
+ | awk '/^default /{print $3}' | head -n 1)
- if [[ "x" != "x"$_ipv6_flag ]]; then
+ if [[ "x" != "x"$_ipv6_flag ]]; then
# _ipaddr="2002::56ff:feb6:56d5/64", _netmask is the number after "/"
_netmask=${_ipaddr#*\/}
_srcaddr="[$_srcaddr]"
@@ -263,17 +260,17 @@ kdump_static_ip() {
echo -n "${_srcaddr}::${_gateway}:${_netmask}::"
fi
- /sbin/ip $_ipv6_flag route show | grep -v default |\
- grep ".*via.* $_netdev " | grep -v "^[[:space:]]*nexthop" |\
- while read -r _route; do
- _target=$(echo "$_route" | awk '{print $1}')
- _nexthop=$(echo "$_route" | awk '{print $3}')
- if [[ "x" != "x"$_ipv6_flag ]]; then
- _target="[$_target]"
- _nexthop="[$_nexthop]"
- fi
- echo "rd.route=$_target:$_nexthop:$kdumpnic"
- done >> "${initdir}/etc/cmdline.d/45route-static.conf"
+ /sbin/ip $_ipv6_flag route show | grep -v default \
+ | grep ".*via.* $_netdev " | grep -v "^[[:space:]]*nexthop" \
+ | while read -r _route; do
+ _target=$(echo "$_route" | awk '{print $1}')
+ _nexthop=$(echo "$_route" | awk '{print $3}')
+ if [[ "x" != "x"$_ipv6_flag ]]; then
+ _target="[$_target]"
+ _nexthop="[$_nexthop]"
+ fi
+ echo "rd.route=$_target:$_nexthop:$kdumpnic"
+ done >> "${initdir}/etc/cmdline.d/45route-static.conf"
kdump_handle_mulitpath_route "$_netdev" "$_srcaddr" "$kdumpnic"
}
@@ -287,28 +284,28 @@ kdump_handle_mulitpath_route() {
fi
while IFS="" read -r _route; do
- if [[ "$_route" =~ [[:space:]]+nexthop ]]; then
+ if [[ $_route =~ [[:space:]]+nexthop ]]; then
_route=${_route##[[:space:]]}
# Parse multipath route, using previous _target
- [[ "$_target" == 'default' ]] && continue
- [[ "$_route" =~ .*via.*\ $_netdev ]] || continue
+ [[ $_target == 'default' ]] && continue
+ [[ $_route =~ .*via.*\ $_netdev ]] || continue
_weight=$(echo "$_route" | cut -d ' ' -f7)
- if [[ "$_weight" -gt "$_max_weight" ]]; then
+ if [[ $_weight -gt $_max_weight ]]; then
_nexthop=$(echo "$_route" | cut -d ' ' -f3)
_max_weight=$_weight
- if [[ "x" != "x"$_ipv6_flag ]]; then
+ if [[ "x" != "x"$_ipv6_flag ]]; then
_rule="rd.route=[$_target]:[$_nexthop]:$kdumpnic"
else
_rule="rd.route=$_target:$_nexthop:$kdumpnic"
fi
fi
else
- [[ -n "$_rule" ]] && echo "$_rule"
+ [[ -n $_rule ]] && echo "$_rule"
_target=$(echo "$_route" | cut -d ' ' -f1)
_rule="" _max_weight=0 _weight=0
fi
- done >> "${initdir}/etc/cmdline.d/45route-static.conf"\
+ done >> "${initdir}/etc/cmdline.d/45route-static.conf" \
<<< "$(/sbin/ip $_ipv6_flag route show)"
[[ -n $_rule ]] && echo "$_rule" >> "${initdir}/etc/cmdline.d/45route-static.conf"
@@ -323,8 +320,7 @@ kdump_get_mac_addr() {
kdump_get_perm_addr() {
local addr
addr=$(ethtool -P "$1" | sed -e 's/Permanent address: //')
- if [[ -z "$addr" ]] || [[ "$addr" = "00:00:00:00:00:00" ]]
- then
+ if [[ -z $addr ]] || [[ $addr == "00:00:00:00:00:00" ]]; then
derror "Can't get the permanent address of $1"
else
echo "$addr"
@@ -391,13 +387,13 @@ kdump_setup_bond() {
_bondoptions=$(get_nmcli_value_by_field "$_nm_show_cmd" "bond.options")
- if [[ -z "$_bondoptions" ]]; then
+ if [[ -z $_bondoptions ]]; then
dwarning "Failed to get bond configuration via nmlci output. Now try sourcing ifcfg script."
source_ifcfg_file "$_netdev"
_bondoptions="$(echo "$BONDING_OPTS" | xargs echo | tr " " ",")"
fi
- if [[ -z "$_bondoptions" ]]; then
+ if [[ -z $_bondoptions ]]; then
derror "Get empty bond options"
exit 1
fi
@@ -453,30 +449,27 @@ kdump_setup_vlan() {
# code reaped from the list_configured function of
# https://github.com/hreinecke/s390-tools/blob/master/zconf/znetconf
find_online_znet_device() {
- local CCWGROUPBUS_DEVICEDIR="/sys/bus/ccwgroup/devices"
- local NETWORK_DEVICES d ifname ONLINE
-
- [[ ! -d "$CCWGROUPBUS_DEVICEDIR" ]] && return
- NETWORK_DEVICES=$(find $CCWGROUPBUS_DEVICEDIR)
- for d in $NETWORK_DEVICES
- do
- [[ ! -f "$d/online" ]] && continue
- read -r ONLINE < "$d/online"
- if [[ $ONLINE -ne 1 ]]; then
- continue
- fi
- # determine interface name, if there (only for qeth and if
- # device is online)
- if [[ -f $d/if_name ]]
- then
- read -r ifname < "$d/if_name"
- elif [[ -d $d/net ]]
- then
- ifname=$(ls "$d/net/")
- fi
- [[ -n "$ifname" ]] && break
- done
- echo -n "$ifname"
+ local CCWGROUPBUS_DEVICEDIR="/sys/bus/ccwgroup/devices"
+ local NETWORK_DEVICES d ifname ONLINE
+
+ [[ ! -d $CCWGROUPBUS_DEVICEDIR ]] && return
+ NETWORK_DEVICES=$(find $CCWGROUPBUS_DEVICEDIR)
+ for d in $NETWORK_DEVICES; do
+ [[ ! -f "$d/online" ]] && continue
+ read -r ONLINE < "$d/online"
+ if [[ $ONLINE -ne 1 ]]; then
+ continue
+ fi
+ # determine interface name, if there (only for qeth and if
+ # device is online)
+ if [[ -f $d/if_name ]]; then
+ read -r ifname < "$d/if_name"
+ elif [[ -d $d/net ]]; then
+ ifname=$(ls "$d/net/")
+ fi
+ [[ -n $ifname ]] && break
+ done
+ echo -n "$ifname"
}
# setup s390 znet cmdline
@@ -494,7 +487,7 @@ kdump_setup_znet() {
SUBCHANNELS=$(get_nmcli_value_by_field "$_nmcli_cmd" "${s390_prefix}subchannels")
_options=$(get_nmcli_value_by_field "$_nmcli_cmd" "${s390_prefix}options")
- if [[ -z "$NETTYPE" || -z "$SUBCHANNELS" || -z "$_options" ]]; then
+ if [[ -z $NETTYPE || -z $SUBCHANNELS || -z $_options ]]; then
dwarning "Failed to get znet configuration via nmlci output. Now try sourcing ifcfg script."
source_ifcfg_file "$_netdev"
for i in $OPTIONS; do
@@ -502,15 +495,14 @@ kdump_setup_znet() {
done
fi
- if [[ -z "$NETTYPE" || -z "$SUBCHANNELS" || -z "$_options" ]]; then
+ if [[ -z $NETTYPE || -z $SUBCHANNELS || -z $_options ]]; then
exit 1
fi
echo "rd.znet=${NETTYPE},${SUBCHANNELS},${_options} rd.znet_ifname=$_netdev:${SUBCHANNELS}" > "${initdir}/etc/cmdline.d/30znet.conf"
}
-kdump_get_ip_route()
-{
+kdump_get_ip_route() {
local _route
if ! _route=$(/sbin/ip -o route get to "$1" 2>&1); then
derror "Bad kdump network destination: $1"
@@ -519,18 +511,16 @@ kdump_get_ip_route()
echo "$_route"
}
-kdump_get_ip_route_field()
-{
+kdump_get_ip_route_field() {
echo "$1" | sed -n -e "s/^.*\<$2\>\s\+\(\S\+\).*$/\1/p"
}
-kdump_get_remote_ip()
-{
+kdump_get_remote_ip() {
local _remote _remote_temp
_remote=$(get_remote_host "$1")
if is_hostname "$_remote"; then
_remote_temp=$(getent ahosts "$_remote" | grep -v : | head -n 1)
- if [[ -z "$_remote_temp" ]]; then
+ if [[ -z $_remote_temp ]]; then
_remote_temp=$(getent ahosts "$_remote" | head -n 1)
fi
_remote=$(echo "$_remote_temp" | awk '{print $1}')
@@ -555,7 +545,7 @@ kdump_install_net() {
kdumpnic=$(kdump_setup_ifname "$_netdev")
_znet_netdev=$(find_online_znet_device)
- if [[ -n "$_znet_netdev" ]]; then
+ if [[ -n $_znet_netdev ]]; then
_nm_show_cmd_znet=$(get_nmcli_connection_show_cmd_by_ifname "$_znet_netdev")
if ! (kdump_setup_znet "$_znet_netdev" "$_nm_show_cmd_znet"); then
derror "Failed to set up znet"
@@ -564,7 +554,7 @@ kdump_install_net() {
fi
_static=$(kdump_static_ip "$_netdev" "$_srcaddr" "$kdumpnic")
- if [[ -n "$_static" ]]; then
+ if [[ -n $_static ]]; then
_proto=none
elif is_ipv6_address "$_srcaddr"; then
_proto=auto6
@@ -579,8 +569,8 @@ kdump_install_net() {
# so we have to avoid adding duplicates
# We should also check /proc/cmdline for existing ip=xx arg.
# For example, iscsi boot will specify ip=xxx arg in cmdline.
- if [[ ! -f $_ip_conf ]] || ! grep -q "$_ip_opts" "$_ip_conf" &&\
- ! grep -q "ip=[^[:space:]]*$_netdev" /proc/cmdline; then
+ if [[ ! -f $_ip_conf ]] || ! grep -q "$_ip_opts" "$_ip_conf" \
+ && ! grep -q "ip=[^[:space:]]*$_netdev" /proc/cmdline; then
echo "$_ip_opts" >> "$_ip_conf"
fi
@@ -611,8 +601,8 @@ kdump_install_net() {
# the default gate way for network dump, eth1 in the fence kdump path will
# call kdump_install_net again and we don't want eth1 to be the default
# gateway.
- if [[ ! -f ${initdir}/etc/cmdline.d/60kdumpnic.conf ]] &&
- [[ ! -f ${initdir}/etc/cmdline.d/70bootdev.conf ]]; then
+ if [[ ! -f ${initdir}/etc/cmdline.d/60kdumpnic.conf ]] \
+ && [[ ! -f ${initdir}/etc/cmdline.d/70bootdev.conf ]]; then
echo "kdumpnic=$kdumpnic" > "${initdir}/etc/cmdline.d/60kdumpnic.conf"
echo "bootdev=$kdumpnic" > "${initdir}/etc/cmdline.d/70bootdev.conf"
fi
@@ -622,17 +612,17 @@ kdump_install_net() {
kdump_install_pre_post_conf() {
if [[ -d /etc/kdump/pre.d ]]; then
for file in /etc/kdump/pre.d/*; do
- if [[ -x "$file" ]]; then
+ if [[ -x $file ]]; then
dracut_install "$file"
elif [[ $file != "/etc/kdump/pre.d/*" ]]; then
- echo "$file is not executable"
+ echo "$file is not executable"
fi
done
fi
if [[ -d /etc/kdump/post.d ]]; then
for file in /etc/kdump/post.d/*; do
- if [[ -x "$file" ]]; then
+ if [[ -x $file ]]; then
dracut_install "$file"
elif [[ $file != "/etc/kdump/post.d/*" ]]; then
echo "$file is not executable"
@@ -641,8 +631,7 @@ kdump_install_pre_post_conf() {
fi
}
-default_dump_target_install_conf()
-{
+default_dump_target_install_conf() {
local _target _fstype
local _mntpoint _save_path
@@ -663,7 +652,7 @@ default_dump_target_install_conf()
echo "$_fstype $_target" >> "${initdir}/tmp/$$-kdump.conf"
# don't touch the path under root mount
- if [[ "$_mntpoint" != "/" ]]; then
+ if [[ $_mntpoint != "/" ]]; then
_save_path=${_save_path##"$_mntpoint"}
fi
@@ -678,32 +667,31 @@ kdump_install_conf() {
kdump_read_conf > "${initdir}/tmp/$$-kdump.conf"
- while read -r _opt _val;
- do
+ while read -r _opt _val; do
# remove inline comments after the end of a directive.
case "$_opt" in
- raw)
- _pdev=$(persistent_policy="by-id" kdump_get_persistent_dev "$_val")
- sed -i -e "s#^${_opt}[[:space:]]\+$_val#$_opt $_pdev#" "${initdir}/tmp/$$-kdump.conf"
- ;;
- ext[234]|xfs|btrfs|minix)
- _pdev=$(kdump_get_persistent_dev "$_val")
- sed -i -e "s#^${_opt}[[:space:]]\+$_val#$_opt $_pdev#" "${initdir}/tmp/$$-kdump.conf"
- ;;
- ssh|nfs)
- kdump_install_net "$_val"
- ;;
- dracut_args)
- if [[ $(get_dracut_args_fstype "$_val") = nfs* ]] ; then
- kdump_install_net "$(get_dracut_args_target "$_val")"
- fi
- ;;
- kdump_pre|kdump_post|extra_bins)
- dracut_install "$_val"
- ;;
- core_collector)
- dracut_install "${_val%%[[:blank:]]*}"
- ;;
+ raw)
+ _pdev=$(persistent_policy="by-id" kdump_get_persistent_dev "$_val")
+ sed -i -e "s#^${_opt}[[:space:]]\+$_val#$_opt $_pdev#" "${initdir}/tmp/$$-kdump.conf"
+ ;;
+ ext[234] | xfs | btrfs | minix)
+ _pdev=$(kdump_get_persistent_dev "$_val")
+ sed -i -e "s#^${_opt}[[:space:]]\+$_val#$_opt $_pdev#" "${initdir}/tmp/$$-kdump.conf"
+ ;;
+ ssh | nfs)
+ kdump_install_net "$_val"
+ ;;
+ dracut_args)
+ if [[ $(get_dracut_args_fstype "$_val") == nfs* ]]; then
+ kdump_install_net "$(get_dracut_args_target "$_val")"
+ fi
+ ;;
+ kdump_pre | kdump_post | extra_bins)
+ dracut_install "$_val"
+ ;;
+ core_collector)
+ dracut_install "${_val%%[[:blank:]]*}"
+ ;;
esac
done <<< "$(kdump_read_conf)"
@@ -711,7 +699,7 @@ kdump_install_conf() {
default_dump_target_install_conf
- kdump_configure_fence_kdump "${initdir}/tmp/$$-kdump.conf"
+ kdump_configure_fence_kdump "${initdir}/tmp/$$-kdump.conf"
inst "${initdir}/tmp/$$-kdump.conf" "/etc/kdump.conf"
rm -f "${initdir}/tmp/$$-kdump.conf"
}
@@ -744,16 +732,17 @@ kdump_get_iscsi_initiator() {
local _initiator
local initiator_conf="/etc/iscsi/initiatorname.iscsi"
- [[ -f "$initiator_conf" ]] || return 1
+ [[ -f $initiator_conf ]] || return 1
while read -r _initiator; do
- [[ -z "${_initiator%%#*}" ]] && continue # Skip comment lines
+ [[ -z ${_initiator%%#*} ]] && continue # Skip comment lines
case $_initiator in
InitiatorName=*)
initiator=${_initiator#InitiatorName=}
echo "rd.iscsi.initiator=${initiator}"
- return 0;;
+ return 0
+ ;;
*) ;;
esac
done < ${initiator_conf}
@@ -763,15 +752,21 @@ kdump_get_iscsi_initiator() {
# Figure out iBFT session according to session type
is_ibft() {
- [[ "$(kdump_iscsi_get_rec_val "$1" "node.discovery_type")" = fw ]]
+ [[ "$(kdump_iscsi_get_rec_val "$1" "node.discovery_type")" == fw ]]
}
kdump_setup_iscsi_device() {
local path=$1
- local tgt_name; local tgt_ipaddr;
- local username; local password; local userpwd_str;
- local username_in; local password_in; local userpwd_in_str;
- local netroot_str ; local initiator_str;
+ local tgt_name
+ local tgt_ipaddr
+ local username
+ local password
+ local userpwd_str
+ local username_in
+ local password_in
+ local userpwd_in_str
+ local netroot_str
+ local initiator_str
local netroot_conf="${initdir}/etc/cmdline.d/50iscsi.conf"
local initiator_conf="/etc/iscsi/initiatorname.iscsi"
@@ -779,7 +774,7 @@ kdump_setup_iscsi_device() {
# Check once before getting explicit values, so we can bail out early,
# e.g. in case of pure-hardware(all-offload) iscsi.
- if ! /sbin/iscsiadm -m session -r "$path" &>/dev/null ; then
+ if ! /sbin/iscsiadm -m session -r "$path" &> /dev/null; then
return 1
fi
@@ -796,18 +791,18 @@ kdump_setup_iscsi_device() {
# get and set username and password details
username=$(kdump_iscsi_get_rec_val "$path" "node.session.auth.username")
- [[ "$username" == "<empty>" ]] && username=""
+ [[ $username == "<empty>" ]] && username=""
password=$(kdump_iscsi_get_rec_val "$path" "node.session.auth.password")
- [[ "$password" == "<empty>" ]] && password=""
+ [[ $password == "<empty>" ]] && password=""
username_in=$(kdump_iscsi_get_rec_val "$path" "node.session.auth.username_in")
- [[ -n "$username" ]] && userpwd_str="$username:$password"
+ [[ -n $username ]] && userpwd_str="$username:$password"
# get and set incoming username and password details
- [[ "$username_in" == "<empty>" ]] && username_in=""
+ [[ $username_in == "<empty>" ]] && username_in=""
password_in=$(kdump_iscsi_get_rec_val "$path" "node.session.auth.password_in")
- [[ "$password_in" == "<empty>" ]] && password_in=""
+ [[ $password_in == "<empty>" ]] && password_in=""
- [[ -n "$username_in" ]] && userpwd_in_str=":$username_in:$password_in"
+ [[ -n $username_in ]] && userpwd_in_str=":$username_in:$password_in"
kdump_install_net "$tgt_ipaddr"
@@ -824,8 +819,8 @@ kdump_setup_iscsi_device() {
# If netroot target does not exist already, append.
if ! grep -q "$netroot_str" "$netroot_conf"; then
- echo "$netroot_str" >> "$netroot_conf"
- dinfo "Appended $netroot_str to $netroot_conf"
+ echo "$netroot_str" >> "$netroot_conf"
+ dinfo "Appended $netroot_str to $netroot_conf"
fi
# Setup initator
@@ -836,14 +831,14 @@ kdump_setup_iscsi_device() {
# If initiator details do not exist already, append.
if ! grep -q "$initiator_str" "$netroot_conf"; then
- echo "$initiator_str" >> "$netroot_conf"
- dinfo "Appended $initiator_str to $netroot_conf"
+ echo "$initiator_str" >> "$netroot_conf"
+ dinfo "Appended $initiator_str to $netroot_conf"
fi
}
-kdump_check_iscsi_targets () {
+kdump_check_iscsi_targets() {
# If our prerequisites are not met, fail anyways.
- type -P iscsistart >/dev/null || return 1
+ type -P iscsistart > /dev/null || return 1
kdump_check_setup_iscsi() (
local _dev
@@ -869,12 +864,11 @@ get_alias() {
local alias_set
ips=$(hostname -I)
- for ip in $ips
- do
- # in /etc/hosts, alias can come at the 2nd column
- if entries=$(grep "$ip" /etc/hosts | awk '{ $1=""; print $0 }'); then
- alias_set="$alias_set $entries"
- fi
+ for ip in $ips; do
+ # in /etc/hosts, alias can come at the 2nd column
+ if entries=$(grep "$ip" /etc/hosts | awk '{ $1=""; print $0 }'); then
+ alias_set="$alias_set $entries"
+ fi
done
echo "$alias_set"
@@ -892,7 +886,7 @@ is_localhost() {
hostnames="$hostnames $shortnames $aliasname"
for name in ${hostnames}; do
- if [[ "$name" == "$nodename" ]]; then
+ if [[ $name == "$nodename" ]]; then
return 0
fi
done
@@ -948,7 +942,7 @@ get_generic_fence_kdump_nodes() {
# setup fence_kdump in cluster
# setup proper network and install needed files
-kdump_configure_fence_kdump () {
+kdump_configure_fence_kdump() {
local kdump_cfg_file=$1
local nodes
local args
@@ -963,7 +957,7 @@ kdump_configure_fence_kdump () {
echo "fence_kdump_nodes $nodes" >> "${kdump_cfg_file}"
args=$(get_pcs_fence_kdump_args)
- if [[ -n "$args" ]]; then
+ if [[ -n $args ]]; then
echo "fence_kdump_args $args" >> "${kdump_cfg_file}"
fi
@@ -987,14 +981,14 @@ kdump_configure_fence_kdump () {
kdump_install_random_seed() {
local poolsize
- poolsize=$(</proc/sys/kernel/random/poolsize)
+ poolsize=$(< /proc/sys/kernel/random/poolsize)
if [[ ! -d "${initdir}/var/lib/" ]]; then
mkdir -p "${initdir}/var/lib/"
fi
dd if=/dev/urandom of="${initdir}/var/lib/random-seed" \
- bs="$poolsize" count=1 2> /dev/null
+ bs="$poolsize" count=1 2> /dev/null
}
kdump_install_systemd_conf() {
@@ -1071,8 +1065,8 @@ install() {
# it unconditionally here, if "/etc/lvm/lvm.conf" doesn't exist, it
# actually does nothing.
sed -i -e \
- 's/\(^[[:space:]]*reserved_memory[[:space:]]*=\)[[:space:]]*[[:digit:]]*/\1 1024/' \
- "${initdir}/etc/lvm/lvm.conf" &>/dev/null
+ 's/\(^[[:space:]]*reserved_memory[[:space:]]*=\)[[:space:]]*[[:digit:]]*/\1 1024/' \
+ "${initdir}/etc/lvm/lvm.conf" &> /dev/null
# Save more memory by dropping switch root capability
dracut_no_switch_root
diff --git a/kdumpctl b/kdumpctl
index d11c3c1..59ec068 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -46,7 +46,7 @@ single_instance_lock()
{
local rc timeout=5
- if ! exec 9>/var/lock/kdump; then
+ if ! exec 9> /var/lock/kdump; then
derror "Create file lock failed"
exit 1
fi
@@ -90,9 +90,9 @@ save_core()
# https://fedorahosted.org/abrt/
if [[ -x /usr/bin/dumpoops ]]; then
ddebug "makedumpfile --dump-dmesg $coredir/vmcore $coredir/dmesg"
- makedumpfile --dump-dmesg "$coredir/vmcore" "$coredir/dmesg" >/dev/null 2>&1
+ makedumpfile --dump-dmesg "$coredir/vmcore" "$coredir/dmesg" > /dev/null 2>&1
ddebug "dumpoops -d $coredir/dmesg"
- if dumpoops -d "$coredir/dmesg" >/dev/null 2>&1; then
+ if dumpoops -d "$coredir/dmesg" > /dev/null 2>&1; then
dinfo "kernel oops has been collected by abrt tool"
fi
fi
@@ -131,7 +131,7 @@ rebuild_kdump_initrd()
rebuild_initrd()
{
- if [[ ! -w $(dirname "$TARGET_INITRD") ]];then
+ if [[ ! -w $(dirname "$TARGET_INITRD") ]]; then
derror "$(dirname "$TARGET_INITRD") does not have write permission. Cannot rebuild $TARGET_INITRD"
return 1
fi
@@ -149,7 +149,7 @@ rebuild_initrd()
check_exist()
{
for file in $1; do
- if [[ ! -e "$file" ]]; then
+ if [[ ! -e $file ]]; then
derror "Error: $file not found."
return 1
fi
@@ -160,7 +160,7 @@ check_exist()
check_executable()
{
for file in $1; do
- if [[ ! -x "$file" ]]; then
+ if [[ ! -x $file ]]; then
derror "Error: $file is not executable."
return 1
fi
@@ -171,7 +171,7 @@ backup_default_initrd()
{
ddebug "backup default initrd: $DEFAULT_INITRD"
- if [[ ! -f "$DEFAULT_INITRD" ]]; then
+ if [[ ! -f $DEFAULT_INITRD ]]; then
return
fi
@@ -190,7 +190,7 @@ restore_default_initrd()
{
ddebug "restore default initrd: $DEFAULT_INITRD"
- if [[ ! -f "$DEFAULT_INITRD" ]]; then
+ if [[ ! -f $DEFAULT_INITRD ]]; then
return
fi
@@ -200,7 +200,7 @@ restore_default_initrd()
# verify checksum before restoring
backup_checksum=$(sha1sum "$DEFAULT_INITRD_BAK" | awk '{ print $1 }')
default_checksum=$(awk '{ print $1 }' "$INITRD_CHECKSUM_LOCATION")
- if [[ "$default_checksum" != "$backup_checksum" ]]; then
+ if [[ $default_checksum != "$backup_checksum" ]]; then
dwarn "WARNING: checksum mismatch! Can't restore original initrd.."
else
rm -f $INITRD_CHECKSUM_LOCATION
@@ -220,7 +220,7 @@ check_config()
dracut_args)
if [[ $config_val == *--mount* ]]; then
if [[ $(echo "$config_val" | grep -o "\-\-mount" | wc -l) -ne 1 ]]; then
- derror "Multiple mount targets specified in one \"dracut_args\"."
+ derror 'Multiple mount targets specified in one "dracut_args".'
return 1
fi
config_opt=_target
@@ -232,12 +232,12 @@ check_config()
fi
config_opt=_target
;;
- ext[234]|minix|btrfs|xfs|nfs|ssh)
+ ext[234] | minix | btrfs | xfs | nfs | ssh)
config_opt=_target
;;
- sshkey|path|core_collector|kdump_post|kdump_pre|extra_bins|extra_modules|failure_action|default|final_action|force_rebuild|force_no_rebuild|fence_kdump_args|fence_kdump_nodes)
- ;;
- net|options|link_delay|disk_timeout|debug_mem_level|blacklist)
+ sshkey | path | core_collector | kdump_post | kdump_pre | extra_bins | extra_modules | failure_action | default | final_action | force_rebuild | force_no_rebuild | fence_kdump_args | fence_kdump_nodes) ;;
+
+ net | options | link_delay | disk_timeout | debug_mem_level | blacklist)
derror "Deprecated kdump config option: $config_opt. Refer to kdump.conf manpage for alternatives."
return 1
;;
@@ -250,12 +250,12 @@ check_config()
;;
esac
- if [[ -z "$config_val" ]]; then
+ if [[ -z $config_val ]]; then
derror "Invalid kdump config value for option '$config_opt'"
return 1
fi
- if [[ -n "${_opt_rec[$config_opt]}" ]]; then
+ if [[ -n ${_opt_rec[$config_opt]} ]]; then
if [[ $config_opt == _target ]]; then
derror "More than one dump targets specified"
else
@@ -291,7 +291,7 @@ get_pcs_cluster_modified_files()
if [[ -f $FENCE_KDUMP_CONFIG_FILE ]]; then
time_stamp=$(stat -c "%Y" "$FENCE_KDUMP_CONFIG_FILE")
- if [[ "$time_stamp" -gt "$image_time" ]]; then
+ if [[ $time_stamp -gt $image_time ]]; then
modified_files="$modified_files $FENCE_KDUMP_CONFIG_FILE"
fi
fi
@@ -335,14 +335,14 @@ check_files_modified()
HOOKS="/etc/kdump/post.d/ /etc/kdump/pre.d/"
if [[ -d /etc/kdump/post.d ]]; then
for file in /etc/kdump/post.d/*; do
- if [[ -x "$file" ]]; then
+ if [[ -x $file ]]; then
POST_FILES="$POST_FILES $file"
fi
done
fi
if [[ -d /etc/kdump/pre.d ]]; then
for file in /etc/kdump/pre.d/*; do
- if [[ -x "$file" ]]; then
+ if [[ -x $file ]]; then
PRE_FILES="$PRE_FILES $file"
fi
done
@@ -359,19 +359,19 @@ check_files_modified()
# Check for any updated extra module
EXTRA_MODULES="$(kdump_get_conf_val extra_modules)"
- if [[ -n "$EXTRA_MODULES" ]]; then
+ if [[ -n $EXTRA_MODULES ]]; then
if [[ -e /lib/modules/$KDUMP_KERNELVER/modules.dep ]]; then
files="$files /lib/modules/$KDUMP_KERNELVER/modules.dep"
fi
for _module in $EXTRA_MODULES; do
- if _module_file="$(modinfo --set-version "$KDUMP_KERNELVER" --filename "$_module" 2>/dev/null)"; then
+ if _module_file="$(modinfo --set-version "$KDUMP_KERNELVER" --filename "$_module" 2> /dev/null)"; then
files="$files $_module_file"
for _dep_modules in $(modinfo -F depends "$_module" | tr ',' ' '); do
- files="$files $(modinfo --set-version "$KDUMP_KERNELVER" --filename "$_dep_modules" 2>/dev/null)"
+ files="$files $(modinfo --set-version "$KDUMP_KERNELVER" --filename "$_dep_modules" 2> /dev/null)"
done
else
# If it's not a module nor builtin, give an error
- if ! ( modprobe --set-version "$KDUMP_KERNELVER" --dry-run "$_module" &>/dev/null ); then
+ if ! (modprobe --set-version "$KDUMP_KERNELVER" --dry-run "$_module" &> /dev/null); then
dwarn "Module $_module not found"
fi
fi
@@ -383,15 +383,15 @@ check_files_modified()
check_exist "$files" && check_executable "$EXTRA_BINS" || return 2
for file in $files; do
- if [[ -e "$file" ]]; then
+ if [[ -e $file ]]; then
time_stamp=$(stat -c "%Y" "$file")
- if [[ "$time_stamp" -gt "$image_time" ]]; then
+ if [[ $time_stamp -gt $image_time ]]; then
modified_files="$modified_files $file"
fi
- if [[ -L "$file" ]]; then
+ if [[ -L $file ]]; then
file=$(readlink -m "$file")
time_stamp=$(stat -c "%Y" "$file")
- if [[ "$time_stamp" -gt "$image_time" ]]; then
+ if [[ $time_stamp -gt $image_time ]]; then
modified_files="$modified_files $file"
fi
fi
@@ -400,7 +400,7 @@ check_files_modified()
fi
done
- if [[ -n "$modified_files" ]]; then
+ if [[ -n $modified_files ]]; then
dinfo "Detected change(s) in the following file(s): $modified_files"
return 1
fi
@@ -414,8 +414,9 @@ check_drivers_modified()
# If it's dump target is on block device, detect the block driver
_target=$(get_block_dump_target)
- if [[ -n "$_target" ]]; then
- _record_block_drivers() {
+ if [[ -n $_target ]]; then
+ _record_block_drivers()
+ {
local _drivers
_drivers=$(udevadm info -a "/dev/block/$1" | sed -n 's/\s*DRIVERS=="\(\S\+\)"/\1/p')
for _driver in $_drivers; do
@@ -431,7 +432,7 @@ check_drivers_modified()
# Include watchdog drivers if watchdog module is not omitted
is_dracut_mod_omitted watchdog || _new_drivers+=" $(get_watchdog_drvs)"
- [[ -z "$_new_drivers" ]] && return 0
+ [[ -z $_new_drivers ]] && return 0
if is_fadump_capable; then
_old_drivers="$(lsinitrd "$TARGET_INITRD" -f /usr/lib/dracut/fadump-kernel-modules.txt | tr '\n' ' ')"
@@ -443,9 +444,9 @@ check_drivers_modified()
ddebug "Modules included in old initramfs: '$_old_drivers'"
for _driver in $_new_drivers; do
# Skip deprecated/invalid driver name or built-in module
- _module_name=$(modinfo --set-version "$KDUMP_KERNELVER" -F name "$_driver" 2>/dev/null)
- _module_filename=$(modinfo --set-version "$KDUMP_KERNELVER" -n "$_driver" 2>/dev/null)
- if [[ -z "$_module_name" ]] || [[ -z "$_module_filename" ]] || [[ "$_module_filename" = *"(builtin)"* ]]; then
+ _module_name=$(modinfo --set-version "$KDUMP_KERNELVER" -F name "$_driver" 2> /dev/null)
+ _module_filename=$(modinfo --set-version "$KDUMP_KERNELVER" -n "$_driver" 2> /dev/null)
+ if [[ -z $_module_name ]] || [[ -z $_module_filename ]] || [[ $_module_filename == *"(builtin)"* ]]; then
continue
fi
if ! [[ " $_old_drivers " == *" $_module_name "* ]]; then
@@ -474,21 +475,21 @@ check_fs_modified()
_target=$(get_block_dump_target)
_new_fstype=$(get_fs_type_from_target "$_target")
- if [[ -z "$_target" ]] || [[ -z "$_new_fstype" ]];then
+ if [[ -z $_target ]] || [[ -z $_new_fstype ]]; then
derror "Dump target is invalid"
return 2
fi
ddebug "_target=$_target _new_fstype=$_new_fstype"
_new_dev=$(kdump_get_persistent_dev "$_target")
- if [[ -z "$_new_dev" ]]; then
+ if [[ -z $_new_dev ]]; then
perror "Get persistent device name failed"
return 2
fi
_new_mntpoint="$(get_kdump_mntpoint_from_target "$_target")"
_dracut_args=$(lsinitrd "$TARGET_INITRD" -f usr/lib/dracut/build-parameter.txt)
- if [[ -z "$_dracut_args" ]];then
+ if [[ -z $_dracut_args ]]; then
dwarn "Warning: No dracut arguments found in initrd"
return 0
fi
@@ -501,10 +502,10 @@ check_fs_modified()
_old_dev=$1
_old_mntpoint=$2
_old_fstype=$3
- [[ $_new_dev = "$_old_dev" && $_new_mntpoint = "$_old_mntpoint" && $_new_fstype = "$_old_fstype" ]] && return 0
+ [[ $_new_dev == "$_old_dev" && $_new_mntpoint == "$_old_mntpoint" && $_new_fstype == "$_old_fstype" ]] && return 0
# otherwise rebuild if target device is not a root device
else
- [[ "$_target" = "$(get_root_fs_device)" ]] && return 0
+ [[ $_target == "$(get_root_fs_device)" ]] && return 0
fi
dinfo "Detected change in File System"
@@ -551,36 +552,36 @@ check_rebuild()
force_no_rebuild=$(kdump_get_conf_val force_no_rebuild)
force_no_rebuild=${force_no_rebuild:-0}
- if [[ "$force_no_rebuild" != "0" ]] && [[ "$force_no_rebuild" != "1" ]];then
+ if [[ $force_no_rebuild != "0" ]] && [[ $force_no_rebuild != "1" ]]; then
derror "Error: force_no_rebuild value is invalid"
return 1
fi
force_rebuild=$(kdump_get_conf_val force_rebuild)
force_rebuild=${force_rebuild:-0}
- if [[ "$force_rebuild" != "0" ]] && [[ "$force_rebuild" != "1" ]];then
+ if [[ $force_rebuild != "0" ]] && [[ $force_rebuild != "1" ]]; then
derror "Error: force_rebuild value is invalid"
return 1
fi
- if [[ "$force_no_rebuild" == "1" && "$force_rebuild" == "1" ]]; then
+ if [[ $force_no_rebuild == "1" && $force_rebuild == "1" ]]; then
derror "Error: force_rebuild and force_no_rebuild are enabled simultaneously in kdump.conf"
return 1
fi
# Will not rebuild kdump initrd
- if [[ "$force_no_rebuild" == "1" ]]; then
+ if [[ $force_no_rebuild == "1" ]]; then
return 0
fi
#check to see if dependent files has been modified
#since last build of the image file
if [[ -f $TARGET_INITRD ]]; then
- image_time=$(stat -c "%Y" "$TARGET_INITRD" 2>/dev/null)
+ image_time=$(stat -c "%Y" "$TARGET_INITRD" 2> /dev/null)
#in case of fadump mode, check whether the default/target
#initrd is already built with dump capture capability
- if [[ "$DEFAULT_DUMP_MODE" == "fadump" ]]; then
+ if [[ $DEFAULT_DUMP_MODE == "fadump" ]]; then
capture_capable_initrd=$(lsinitrd -f $DRACUT_MODULES_FILE "$TARGET_INITRD" | grep -c -e ^kdumpbase$ -e ^zz-fadumpinit$)
fi
fi
@@ -589,17 +590,17 @@ check_rebuild()
ret=$?
if [[ $ret -eq 2 ]]; then
return 1
- elif [[ $ret -eq 1 ]];then
+ elif [[ $ret -eq 1 ]]; then
system_modified="1"
fi
if [[ $image_time -eq 0 ]]; then
dinfo "No kdump initial ramdisk found."
- elif [[ "$capture_capable_initrd" == "0" ]]; then
+ elif [[ $capture_capable_initrd == "0" ]]; then
dinfo "Rebuild $TARGET_INITRD with dump capture support"
- elif [[ "$force_rebuild" != "0" ]]; then
+ elif [[ $force_rebuild != "0" ]]; then
dinfo "Force rebuild $TARGET_INITRD"
- elif [[ "$system_modified" != "0" ]]; then
+ elif [[ $system_modified != "0" ]]; then
:
else
return 0
@@ -617,13 +618,13 @@ function load_kdump_kernel_key()
# this is only called inside is_secure_boot_enforced,
# no need to retest
- # this is only required if DT /ibm,secure-boot is a file.
- # if it is a dir, we are on OpenPower and don't need this.
- if ! [[ -f /proc/device-tree/ibm,secure-boot ]]; then
- return
- fi
+ # this is only required if DT /ibm,secure-boot is a file.
+ # if it is a dir, we are on OpenPower and don't need this.
+ if ! [[ -f /proc/device-tree/ibm,secure-boot ]]; then
+ return
+ fi
- KDUMP_KEY_ID=$(keyctl padd asymmetric kernelkey-$RANDOM %:.ima < "/usr/share/doc/kernel-keys/$KDUMP_KERNELVER/kernel-signing-ppc.cer")
+ KDUMP_KEY_ID=$(keyctl padd asymmetric kernelkey-$RANDOM %:.ima < "/usr/share/doc/kernel-keys/$KDUMP_KERNELVER/kernel-signing-ppc.cer")
}
# remove a previously loaded key. There's no real security implication
@@ -631,7 +632,7 @@ function load_kdump_kernel_key()
# to be idempotent and so as to reduce the potential for confusion.
function remove_kdump_kernel_key()
{
- if [[ -z "$KDUMP_KEY_ID" ]]; then
+ if [[ -z $KDUMP_KEY_ID ]]; then
return
fi
@@ -696,7 +697,7 @@ check_ssh_config()
case "$config_opt" in
sshkey)
# remove inline comments after the end of a directive.
- if [[ -f "$config_val" ]]; then
+ if [[ -f $config_val ]]; then
# canonicalize the path
SSH_KEY_LOCATION=$(/usr/bin/readlink -m "$config_val")
else
@@ -709,14 +710,14 @@ check_ssh_config()
ssh)
DUMP_TARGET=$config_val
;;
- *)
- ;;
+ *) ;;
+
esac
done <<< "$(kdump_read_conf)"
#make sure they've configured kdump.conf for ssh dumps
SSH_TARGET=$(echo -n "$DUMP_TARGET" | sed -n '/.*@/p')
- if [[ -z "$SSH_TARGET" ]]; then
+ if [[ -z $SSH_TARGET ]]; then
return 1
fi
return 0
@@ -763,7 +764,7 @@ check_and_wait_network_ready()
diff=$((cur - start_time))
# 60s time out
if [[ $diff -gt 180 ]]; then
- break;
+ break
fi
sleep 1
done
@@ -814,19 +815,19 @@ propagate_ssh_key()
show_reserved_mem()
{
- local mem
- local mem_mb
+ local mem
+ local mem_mb
- mem=$(</sys/kernel/kexec_crash_size)
- mem_mb=$((mem / 1024 / 1024))
+ mem=$(< /sys/kernel/kexec_crash_size)
+ mem_mb=$((mem / 1024 / 1024))
- dinfo "Reserved ${mem_mb}MB memory for crash kernel"
+ dinfo "Reserved ${mem_mb}MB memory for crash kernel"
}
check_current_fadump_status()
{
# Check if firmware-assisted dump has been registered.
- rc=$(<$FADUMP_REGISTER_SYS_NODE)
+ rc=$(< $FADUMP_REGISTER_SYS_NODE)
[[ $rc -eq 1 ]] && return 0
return 1
}
@@ -848,8 +849,8 @@ save_raw()
local raw_target
raw_target=$(kdump_get_conf_val raw)
- [[ -z "$raw_target" ]] && return 0
- [[ -b "$raw_target" ]] || {
+ [[ -z $raw_target ]] && return 0
+ [[ -b $raw_target ]] || {
derror "raw partition $raw_target not found"
return 1
}
@@ -859,22 +860,22 @@ save_raw()
return 0
fi
kdump_dir=$(kdump_get_conf_val path)
- if [[ -z "${kdump_dir}" ]]; then
+ if [[ -z ${kdump_dir} ]]; then
coredir="/var/crash/$(date +"%Y-%m-%d-%H:%M")"
else
coredir="${kdump_dir}/$(date +"%Y-%m-%d-%H:%M")"
fi
mkdir -p "$coredir"
- [[ -d "$coredir" ]] || {
+ [[ -d $coredir ]] || {
derror "failed to create $coredir"
return 1
}
- if makedumpfile -R "$coredir/vmcore" < "$raw_target" >/dev/null 2>&1; then
+ if makedumpfile -R "$coredir/vmcore" < "$raw_target" > /dev/null 2>&1; then
# dump found
dinfo "Dump saved to $coredir/vmcore"
# wipe makedumpfile header
- dd if=/dev/zero of="$raw_target" bs=1b count=1 2>/dev/null
+ dd if=/dev/zero of="$raw_target" bs=1b count=1 2> /dev/null
else
rm -rf "$coredir"
fi
@@ -897,11 +898,11 @@ path_to_be_relabeled()
if is_user_configured_dump_target; then
if is_mount_in_dracut_args; then
- return;
+ return
fi
_target=$(local_fs_dump_target)
- if [[ -n "$_target" ]]; then
+ if [[ -n $_target ]]; then
_mnt=$(get_mntpoint_from_target "$_target")
if ! is_mounted "$_mnt"; then
return
@@ -913,8 +914,8 @@ path_to_be_relabeled()
_path=$(get_save_path)
# if $_path is masked by other mount, we will not relabel it.
- _rmnt=$(df "$_mnt/$_path" 2>/dev/null | tail -1 | awk '{ print $NF }')
- if [[ "$_rmnt" == "$_mnt" ]]; then
+ _rmnt=$(df "$_mnt/$_path" 2> /dev/null | tail -1 | awk '{ print $NF }')
+ if [[ $_rmnt == "$_mnt" ]]; then
echo "$_mnt/$_path"
fi
}
@@ -924,14 +925,14 @@ selinux_relabel()
local _path _i _attr
_path=$(path_to_be_relabeled)
- if [[ -z "$_path" ]] || ! [[ -d "$_path" ]] ; then
+ if [[ -z $_path ]] || ! [[ -d $_path ]]; then
return
fi
while IFS= read -r -d '' _i; do
- _attr=$(getfattr -m "security.selinux" "$_i" 2>/dev/null)
- if [[ -z "$_attr" ]]; then
- restorecon "$_i";
+ _attr=$(getfattr -m "security.selinux" "$_i" 2> /dev/null)
+ if [[ -z $_attr ]]; then
+ restorecon "$_i"
fi
done < <(find "$_path" -print0)
}
@@ -947,7 +948,7 @@ check_fence_kdump_config()
nodes=$(kdump_get_conf_val "fence_kdump_nodes")
for node in $nodes; do
- if [[ "$node" = "$hostname" ]]; then
+ if [[ $node == "$hostname" ]]; then
derror "Option fence_kdump_nodes cannot contain $hostname"
return 1
fi
@@ -1003,25 +1004,26 @@ check_failure_action_config()
default_option=$(kdump_get_conf_val default)
failure_action=$(kdump_get_conf_val failure_action)
- if [[ -z "$failure_action" ]] && [[ -z "$default_option" ]]; then
+ if [[ -z $failure_action ]] && [[ -z $default_option ]]; then
return 0
- elif [[ -n "$failure_action" ]] && [[ -n "$default_option" ]]; then
+ elif [[ -n $failure_action ]] && [[ -n $default_option ]]; then
derror "Cannot specify 'failure_action' and 'default' option together"
return 1
fi
- if [[ -n "$default_option" ]]; then
+ if [[ -n $default_option ]]; then
option="default"
failure_action="$default_option"
fi
case "$failure_action" in
- reboot|halt|poweroff|shell|dump_to_rootfs)
+ reboot | halt | poweroff | shell | dump_to_rootfs)
return 0
- ;;
- *)
+ ;;
+ *)
dinfo $"Usage kdump.conf: $option {reboot|halt|poweroff|shell|dump_to_rootfs}"
return 1
+ ;;
esac
}
@@ -1030,16 +1032,17 @@ check_final_action_config()
local final_action
final_action=$(kdump_get_conf_val final_action)
- if [[ -z "$final_action" ]]; then
+ if [[ -z $final_action ]]; then
return 0
else
case "$final_action" in
- reboot|halt|poweroff)
+ reboot | halt | poweroff)
return 0
- ;;
- *)
+ ;;
+ *)
dinfo $"Usage kdump.conf: final_action {reboot|halt|poweroff}"
return 1
+ ;;
esac
fi
}
@@ -1056,7 +1059,7 @@ start()
return 1
fi
- if sestatus 2>/dev/null | grep -q "SELinux status.*enabled"; then
+ if sestatus 2> /dev/null | grep -q "SELinux status.*enabled"; then
selinux_relabel
fi
@@ -1187,7 +1190,8 @@ stop()
return 0
}
-rebuild() {
+rebuild()
+{
check_config || return 1
if check_ssh_config; then
@@ -1203,33 +1207,34 @@ rebuild() {
return $?
}
-do_estimate() {
+do_estimate()
+{
local kdump_mods
local -A large_mods
local baseline
local kernel_size mod_size initrd_size baseline_size runtime_size reserved_size estimated_size recommended_size
- local size_mb=$(( 1024 * 1024 ))
+ local size_mb=$((1024 * 1024))
setup_initrd
- if [[ ! -f "$TARGET_INITRD" ]]; then
+ if [[ ! -f $TARGET_INITRD ]]; then
derror "kdumpctl estimate: kdump initramfs is not built yet."
exit 1
fi
kdump_mods="$(lsinitrd "$TARGET_INITRD" -f /usr/lib/dracut/hostonly-kernel-modules.txt | tr '\n' ' ')"
baseline=$(kdump_get_arch_recommend_size)
- if [[ "${baseline: -1}" == "M" ]]; then
+ if [[ ${baseline: -1} == "M" ]]; then
baseline=${baseline%M}
- elif [[ "${baseline: -1}" == "G" ]]; then
- baseline=$(( ${baseline%G} * 1024 ))
- elif [[ "${baseline: -1}" == "T" ]]; then
- baseline=$(( ${baseline%Y} * 1048576 ))
+ elif [[ ${baseline: -1} == "G" ]]; then
+ baseline=$((${baseline%G} * 1024))
+ elif [[ ${baseline: -1} == "T" ]]; then
+ baseline=$((${baseline%Y} * 1048576))
fi
# The default pre-reserved crashkernel value
baseline_size=$((baseline * size_mb))
# Current reserved crashkernel size
- reserved_size=$(</sys/kernel/kexec_crash_size)
+ reserved_size=$(< /sys/kernel/kexec_crash_size)
# A pre-estimated value for userspace usage and kernel
# runtime allocation, 64M should good for most cases
runtime_size=$((64 * size_mb))
@@ -1240,7 +1245,7 @@ do_estimate() {
# Kernel modules static size after loaded
mod_size=0
while read -r _name _size _; do
- if [[ ! " $kdump_mods " == *" $_name "* ]]; then
+ if [[ " $kdump_mods " != *" $_name "* ]]; then
continue
fi
mod_size=$((mod_size + _size))
@@ -1255,8 +1260,8 @@ do_estimate() {
crypt_size=0
for _dev in $(get_all_kdump_crypt_dev); do
_crypt_info=$(cryptsetup luksDump "/dev/block/$_dev")
- [[ $(echo "$_crypt_info" | sed -n "s/^Version:\s*\(.*\)/\1/p" ) == "2" ]] || continue
- for _mem in $(echo "$_crypt_info" | sed -n "s/\sMemory:\s*\(.*\)/\1/p" | sort -n ); do
+ [[ $(echo "$_crypt_info" | sed -n "s/^Version:\s*\(.*\)/\1/p") == "2" ]] || continue
+ for _mem in $(echo "$_crypt_info" | sed -n "s/\sMemory:\s*\(.*\)/\1/p" | sort -n); do
crypt_size=$((crypt_size + _mem * 1024))
break
done
@@ -1277,10 +1282,10 @@ do_estimate() {
echo "Kernel modules size: $((mod_size / size_mb))M"
echo "Initramfs size: $((initrd_size / size_mb))M"
echo "Runtime reservation: $((runtime_size / size_mb))M"
- [[ $crypt_size -ne 0 ]] && \
- echo "LUKS required size: $((crypt_size / size_mb))M"
+ [[ $crypt_size -ne 0 ]] &&
+ echo "LUKS required size: $((crypt_size / size_mb))M"
echo -n "Large modules:"
- if [[ "${#large_mods[@]}" -eq 0 ]]; then
+ if [[ ${#large_mods[@]} -eq 0 ]]; then
echo " <none>"
else
echo ""
@@ -1294,14 +1299,15 @@ do_estimate() {
fi
}
-reset_crashkernel() {
+reset_crashkernel()
+{
local kernel=$1 entry crashkernel_default
local grub_etc_default="/etc/default/grub"
- [[ -z "$kernel" ]] && kernel=$(uname -r)
- crashkernel_default=$(cat "/usr/lib/modules/$kernel/crashkernel.default" 2>/dev/null)
+ [[ -z $kernel ]] && kernel=$(uname -r)
+ crashkernel_default=$(cat "/usr/lib/modules/$kernel/crashkernel.default" 2> /dev/null)
- if [[ -z "$crashkernel_default" ]]; then
+ if [[ -z $crashkernel_default ]]; then
derror "$kernel doesn't have a crashkernel.default"
exit 1
fi
@@ -1318,7 +1324,7 @@ reset_crashkernel() {
entry=${entry#\"}
entry=${entry%\"}
- if [[ -f "$grub_etc_default" ]]; then
+ if [[ -f $grub_etc_default ]]; then
sed -i -e "s/^\(GRUB_CMDLINE_LINUX=.*\)crashkernel=[^\ \"]*\([\ \"].*\)$/\1$crashkernel_default\2/" "$grub_etc_default"
fi
@@ -1328,18 +1334,18 @@ reset_crashkernel() {
fi
}
-if [[ ! -f "$KDUMP_CONFIG_FILE" ]]; then
+if [[ ! -f $KDUMP_CONFIG_FILE ]]; then
derror "Error: No kdump config file found!"
exit 1
fi
-main ()
+main()
{
# Determine if the dump mode is kdump or fadump
determine_dump_mode
case "$1" in
- start)
+ start)
if [[ -s /proc/vmcore ]]; then
save_core
reboot
@@ -1347,51 +1353,52 @@ main ()
start
fi
;;
- stop)
+ stop)
stop
;;
- status)
+ status)
EXIT_CODE=0
check_current_status
case "$?" in
- 0)
+ 0)
dinfo "Kdump is operational"
EXIT_CODE=0
;;
- 1)
+ 1)
dinfo "Kdump is not operational"
EXIT_CODE=3
;;
esac
exit $EXIT_CODE
;;
- reload)
+ reload)
reload
;;
- restart)
+ restart)
stop
start
;;
- rebuild)
+ rebuild)
rebuild
;;
- condrestart)
- ;;
- propagate)
+ condrestart) ;;
+
+ propagate)
propagate_ssh_key
;;
- showmem)
+ showmem)
show_reserved_mem
;;
- estimate)
+ estimate)
do_estimate
;;
- reset-crashkernel)
+ reset-crashkernel)
reset_crashkernel "$2"
;;
- *)
+ *)
dinfo $"Usage: $0 {estimate|start|stop|status|restart|reload|rebuild|reset-crashkernel|propagate|showmem}"
exit 1
+ ;;
esac
}
@@ -1400,6 +1407,9 @@ single_instance_lock
# To avoid fd 9 leaking, we invoke a subshell, close fd 9 and call main.
# So that fd isn't leaking when main is invoking a subshell.
-(exec 9<&-; main "$@")
+(
+ exec 9<&-
+ main "$@"
+)
exit $?
diff --git a/mkdumprd b/mkdumprd
index a027e6a..eebbbe1 100644
--- a/mkdumprd
+++ b/mkdumprd
@@ -27,7 +27,7 @@ SAVE_PATH=$(get_save_path)
OVERRIDE_RESETTABLE=0
extra_modules=""
-dracut_args=( --add kdumpbase --quiet --hostonly --hostonly-cmdline --hostonly-i18n --hostonly-mode strict -o "plymouth dash resume ifcfg earlykdump" )
+dracut_args=(--add kdumpbase --quiet --hostonly --hostonly-cmdline --hostonly-i18n --hostonly-mode strict -o "plymouth dash resume ifcfg earlykdump")
MKDUMPRD_TMPDIR="$(mktemp -d -t mkdumprd.XXXXXX)"
[ -d "$MKDUMPRD_TMPDIR" ] || perror_exit "dracut: mktemp -p -d -t dracut.XXXXXX failed."
@@ -43,66 +43,71 @@ trap '
# clean up after ourselves no matter how we die.
trap 'exit 1;' SIGINT
-add_dracut_arg() {
- dracut_args+=( "$@" )
+add_dracut_arg()
+{
+ dracut_args+=("$@")
}
-add_dracut_mount() {
- add_dracut_arg "--mount" "$1"
+add_dracut_mount()
+{
+ add_dracut_arg "--mount" "$1"
}
-add_dracut_sshkey() {
- add_dracut_arg "--sshkey" "$1"
+add_dracut_sshkey()
+{
+ add_dracut_arg "--sshkey" "$1"
}
# caller should ensure $1 is valid and mounted in 1st kernel
-to_mount() {
- local _target=$1 _fstype=$2 _options=$3 _sed_cmd _new_mntpoint _pdev
-
- _new_mntpoint=$(get_kdump_mntpoint_from_target "$_target")
- _fstype="${_fstype:-$(get_fs_type_from_target "$_target")}"
- _options="${_options:-$(get_mntopt_from_target "$_target")}"
- _options="${_options:-defaults}"
-
- if [[ "$_fstype" == "nfs"* ]]; then
- _pdev=$_target
- _sed_cmd+='s/,addr=[^,]*//;'
- _sed_cmd+='s/,proto=[^,]*//;'
- _sed_cmd+='s/,clientaddr=[^,]*//;'
- else
- # for non-nfs _target converting to use udev persistent name
- _pdev="$(kdump_get_persistent_dev "$_target")"
- if [[ -z $_pdev ]]; then
- return 1
- fi
- fi
-
- # mount fs target as rw in 2nd kernel
- _sed_cmd+='s/\(^\|,\)ro\($\|,\)/\1rw\2/g;'
- # with 'noauto' in fstab nfs and non-root disk mount will fail in 2nd
- # kernel, filter it out here.
- _sed_cmd+='s/\(^\|,\)noauto\($\|,\)/\1/g;'
- # drop nofail or nobootwait
- _sed_cmd+='s/\(^\|,\)nofail\($\|,\)/\1/g;'
- _sed_cmd+='s/\(^\|,\)nobootwait\($\|,\)/\1/g;'
-
- _options=$(echo "$_options" | sed "$_sed_cmd")
-
- echo "$_pdev $_new_mntpoint $_fstype $_options"
+to_mount()
+{
+ local _target=$1 _fstype=$2 _options=$3 _sed_cmd _new_mntpoint _pdev
+
+ _new_mntpoint=$(get_kdump_mntpoint_from_target "$_target")
+ _fstype="${_fstype:-$(get_fs_type_from_target "$_target")}"
+ _options="${_options:-$(get_mntopt_from_target "$_target")}"
+ _options="${_options:-defaults}"
+
+ if [[ $_fstype == "nfs"* ]]; then
+ _pdev=$_target
+ _sed_cmd+='s/,addr=[^,]*//;'
+ _sed_cmd+='s/,proto=[^,]*//;'
+ _sed_cmd+='s/,clientaddr=[^,]*//;'
+ else
+ # for non-nfs _target converting to use udev persistent name
+ _pdev="$(kdump_get_persistent_dev "$_target")"
+ if [[ -z $_pdev ]]; then
+ return 1
+ fi
+ fi
+
+ # mount fs target as rw in 2nd kernel
+ _sed_cmd+='s/\(^\|,\)ro\($\|,\)/\1rw\2/g;'
+ # with 'noauto' in fstab nfs and non-root disk mount will fail in 2nd
+ # kernel, filter it out here.
+ _sed_cmd+='s/\(^\|,\)noauto\($\|,\)/\1/g;'
+ # drop nofail or nobootwait
+ _sed_cmd+='s/\(^\|,\)nofail\($\|,\)/\1/g;'
+ _sed_cmd+='s/\(^\|,\)nobootwait\($\|,\)/\1/g;'
+
+ _options=$(echo "$_options" | sed "$_sed_cmd")
+
+ echo "$_pdev $_new_mntpoint $_fstype $_options"
}
#Function: get_ssh_size
#$1=dump target
#called from while loop and shouldn't read from stdin, so we're using "ssh -n"
-get_ssh_size() {
- local _out
- local _opt=("-i" "$SSH_KEY_LOCATION" "-o" "BatchMode=yes" "-o" "StrictHostKeyChecking=yes")
+get_ssh_size()
+{
+ local _out
+ local _opt=("-i" "$SSH_KEY_LOCATION" "-o" "BatchMode=yes" "-o" "StrictHostKeyChecking=yes")
- if ! _out=$(ssh -q -n "${_opt[@]}" "$1" "df" "--output=avail" "$SAVE_PATH"); then
- perror_exit "checking remote ssh server available size failed."
- fi
+ if ! _out=$(ssh -q -n "${_opt[@]}" "$1" "df" "--output=avail" "$SAVE_PATH"); then
+ perror_exit "checking remote ssh server available size failed."
+ fi
- echo -n "$_out" | tail -1
+ echo -n "$_out" | tail -1
}
#mkdir if save path does not exist on ssh dump target
@@ -111,320 +116,323 @@ get_ssh_size() {
#called from while loop and shouldn't read from stdin, so we're using "ssh -n"
mkdir_save_path_ssh()
{
- local _opt _dir
- _opt=(-i "$SSH_KEY_LOCATION" -o BatchMode=yes -o StrictHostKeyChecking=yes)
- ssh -qn "${_opt[@]}" "$1" mkdir -p "$SAVE_PATH" &>/dev/null || \
- perror_exit "mkdir failed on $1:$SAVE_PATH"
+ local _opt _dir
+ _opt=(-i "$SSH_KEY_LOCATION" -o BatchMode=yes -o StrictHostKeyChecking=yes)
+ ssh -qn "${_opt[@]}" "$1" mkdir -p "$SAVE_PATH" &> /dev/null ||
+ perror_exit "mkdir failed on $1:$SAVE_PATH"
- # check whether user has write permission on $1:$SAVE_PATH
- _dir=$(ssh -qn "${_opt[@]}" "$1" mktemp -dqp "$SAVE_PATH" 2>/dev/null) || \
- perror_exit "Could not create temporary directory on $1:$SAVE_PATH. Make sure user has write permission on destination"
- ssh -qn "${_opt[@]}" "$1" rmdir "$_dir"
+ # check whether user has write permission on $1:$SAVE_PATH
+ _dir=$(ssh -qn "${_opt[@]}" "$1" mktemp -dqp "$SAVE_PATH" 2> /dev/null) ||
+ perror_exit "Could not create temporary directory on $1:$SAVE_PATH. Make sure user has write permission on destination"
+ ssh -qn "${_opt[@]}" "$1" rmdir "$_dir"
- return 0
+ return 0
}
#Function: get_fs_size
#$1=dump target
-get_fs_size() {
- df --output=avail "$(get_mntpoint_from_target "$1")/$SAVE_PATH" | tail -1
+get_fs_size()
+{
+ df --output=avail "$(get_mntpoint_from_target "$1")/$SAVE_PATH" | tail -1
}
#Function: get_raw_size
#$1=dump target
-get_raw_size() {
- fdisk -s "$1"
+get_raw_size()
+{
+ fdisk -s "$1"
}
#Function: check_size
#$1: dump type string ('raw', 'fs', 'ssh')
#$2: dump target
-check_size() {
- local avail memtotal
-
- memtotal=$(awk '/MemTotal/{print $2}' /proc/meminfo)
- case "$1" in
- raw)
- avail=$(get_raw_size "$2")
- ;;
- ssh)
- avail=$(get_ssh_size "$2")
- ;;
- fs)
- avail=$(get_fs_size "$2")
- ;;
- *)
- return
- esac || perror_exit "Check dump target size failed"
-
- if [[ "$avail" -lt "$memtotal" ]]; then
- dwarn "Warning: There might not be enough space to save a vmcore."
- dwarn " The size of $2 should be greater than $memtotal kilo bytes."
- fi
+check_size()
+{
+ local avail memtotal
+
+ memtotal=$(awk '/MemTotal/{print $2}' /proc/meminfo)
+ case "$1" in
+ raw)
+ avail=$(get_raw_size "$2")
+ ;;
+ ssh)
+ avail=$(get_ssh_size "$2")
+ ;;
+ fs)
+ avail=$(get_fs_size "$2")
+ ;;
+ *)
+ return
+ ;;
+ esac || perror_exit "Check dump target size failed"
+
+ if [[ $avail -lt $memtotal ]]; then
+ dwarn "Warning: There might not be enough space to save a vmcore."
+ dwarn " The size of $2 should be greater than $memtotal kilo bytes."
+ fi
}
check_save_path_fs()
{
- local _path=$1
+ local _path=$1
- if [[ ! -d $_path ]]; then
- perror_exit "Dump path $_path does not exist."
- fi
+ if [[ ! -d $_path ]]; then
+ perror_exit "Dump path $_path does not exist."
+ fi
}
mount_failure()
{
- local _target=$1
- local _mnt=$2
- local _fstype=$3
- local msg="Failed to mount $_target"
+ local _target=$1
+ local _mnt=$2
+ local _fstype=$3
+ local msg="Failed to mount $_target"
- if [[ -n "$_mnt" ]]; then
- msg="$msg on $_mnt"
- fi
+ if [[ -n $_mnt ]]; then
+ msg="$msg on $_mnt"
+ fi
- msg="$msg for kdump preflight check."
+ msg="$msg for kdump preflight check."
- if [[ $_fstype = "nfs" ]]; then
- msg="$msg Please make sure nfs-utils has been installed."
- fi
+ if [[ $_fstype == "nfs" ]]; then
+ msg="$msg Please make sure nfs-utils has been installed."
+ fi
- perror_exit "$msg"
+ perror_exit "$msg"
}
check_user_configured_target()
{
- local _target=$1 _cfg_fs_type=$2 _mounted
- local _mnt _opt _fstype
-
- _mnt=$(get_mntpoint_from_target "$_target")
- _opt=$(get_mntopt_from_target "$_target")
- _fstype=$(get_fs_type_from_target "$_target")
-
- if [[ -n "$_fstype" ]]; then
- # In case of nfs4, nfs should be used instead, nfs* options is deprecated in kdump.conf
- [[ $_fstype = "nfs"* ]] && _fstype=nfs
-
- if [[ -n "$_cfg_fs_type" ]] && [[ "$_fstype" != "$_cfg_fs_type" ]]; then
- perror_exit "\"$_target\" have a wrong type config \"$_cfg_fs_type\", expected \"$_fstype\""
- fi
- else
- _fstype="$_cfg_fs_type"
- _fstype="$_cfg_fs_type"
- fi
-
- # For noauto mount, mount it inplace with default value.
- # Else use the temporary target directory
- if [[ -n "$_mnt" ]]; then
- if ! is_mounted "$_mnt"; then
- if [[ $_opt = *",noauto"* ]]; then
- mount "$_mnt" || mount_failure "$_target" "$_mnt" "$_fstype"
- _mounted=$_mnt
- else
- perror_exit "Dump target \"$_target\" is neither mounted nor configured as \"noauto\""
- fi
- fi
- else
- _mnt=$MKDUMPRD_TMPMNT
- mkdir -p "$_mnt"
- mount "$_target" "$_mnt" -t "$_fstype" -o defaults || mount_failure "$_target" "" "$_fstype"
- _mounted=$_mnt
- fi
-
- # For user configured target, use $SAVE_PATH as the dump path within the target
- if [[ ! -d "$_mnt/$SAVE_PATH" ]]; then
- perror_exit "Dump path \"$_mnt/$SAVE_PATH\" does not exist in dump target \"$_target\""
- fi
-
- check_size fs "$_target"
-
- # Unmount it early, if function is interrupted and didn't reach here, the shell trap will clear it up anyway
- if [[ -n "$_mounted" ]]; then
- umount -f -- "$_mounted"
- fi
+ local _target=$1 _cfg_fs_type=$2 _mounted
+ local _mnt _opt _fstype
+
+ _mnt=$(get_mntpoint_from_target "$_target")
+ _opt=$(get_mntopt_from_target "$_target")
+ _fstype=$(get_fs_type_from_target "$_target")
+
+ if [[ -n $_fstype ]]; then
+ # In case of nfs4, nfs should be used instead, nfs* options is deprecated in kdump.conf
+ [[ $_fstype == "nfs"* ]] && _fstype=nfs
+
+ if [[ -n $_cfg_fs_type ]] && [[ $_fstype != "$_cfg_fs_type" ]]; then
+ perror_exit "\"$_target\" have a wrong type config \"$_cfg_fs_type\", expected \"$_fstype\""
+ fi
+ else
+ _fstype="$_cfg_fs_type"
+ _fstype="$_cfg_fs_type"
+ fi
+
+ # For noauto mount, mount it inplace with default value.
+ # Else use the temporary target directory
+ if [[ -n $_mnt ]]; then
+ if ! is_mounted "$_mnt"; then
+ if [[ $_opt == *",noauto"* ]]; then
+ mount "$_mnt" || mount_failure "$_target" "$_mnt" "$_fstype"
+ _mounted=$_mnt
+ else
+ perror_exit "Dump target \"$_target\" is neither mounted nor configured as \"noauto\""
+ fi
+ fi
+ else
+ _mnt=$MKDUMPRD_TMPMNT
+ mkdir -p "$_mnt"
+ mount "$_target" "$_mnt" -t "$_fstype" -o defaults || mount_failure "$_target" "" "$_fstype"
+ _mounted=$_mnt
+ fi
+
+ # For user configured target, use $SAVE_PATH as the dump path within the target
+ if [[ ! -d "$_mnt/$SAVE_PATH" ]]; then
+ perror_exit "Dump path \"$_mnt/$SAVE_PATH\" does not exist in dump target \"$_target\""
+ fi
+
+ check_size fs "$_target"
+
+ # Unmount it early, if function is interrupted and didn't reach here, the shell trap will clear it up anyway
+ if [[ -n $_mounted ]]; then
+ umount -f -- "$_mounted"
+ fi
}
# $1: core_collector config value
-verify_core_collector() {
- local _cmd="${1%% *}"
- local _params="${1#* }"
-
- if [[ "$_cmd" != "makedumpfile" ]]; then
- if is_raw_dump_target; then
- dwarn "Warning: specifying a non-makedumpfile core collector, you will have to recover the vmcore manually."
- fi
- return
- fi
-
- if is_ssh_dump_target || is_raw_dump_target; then
- if ! strstr "$_params" "-F"; then
- perror_exit "The specified dump target needs makedumpfile \"-F\" option."
- fi
- _params="$_params vmcore"
- else
- _params="$_params vmcore dumpfile"
- fi
-
- # shellcheck disable=SC2086
- if ! $_cmd --check-params $_params; then
- perror_exit "makedumpfile parameter check failed."
- fi
+verify_core_collector()
+{
+ local _cmd="${1%% *}"
+ local _params="${1#* }"
+
+ if [[ $_cmd != "makedumpfile" ]]; then
+ if is_raw_dump_target; then
+ dwarn "Warning: specifying a non-makedumpfile core collector, you will have to recover the vmcore manually."
+ fi
+ return
+ fi
+
+ if is_ssh_dump_target || is_raw_dump_target; then
+ if ! strstr "$_params" "-F"; then
+ perror_exit 'The specified dump target needs makedumpfile "-F" option.'
+ fi
+ _params="$_params vmcore"
+ else
+ _params="$_params vmcore dumpfile"
+ fi
+
+ # shellcheck disable=SC2086
+ if ! $_cmd --check-params $_params; then
+ perror_exit "makedumpfile parameter check failed."
+ fi
}
-add_mount() {
- local _mnt
+add_mount()
+{
+ local _mnt
- _mnt=$(to_mount "$@") || exit 1
+ _mnt=$(to_mount "$@") || exit 1
- add_dracut_mount "$_mnt"
+ add_dracut_mount "$_mnt"
}
#handle the case user does not specify the dump target explicitly
handle_default_dump_target()
{
- local _target
- local _mntpoint
+ local _target
+ local _mntpoint
- is_user_configured_dump_target && return
+ is_user_configured_dump_target && return
- check_save_path_fs "$SAVE_PATH"
+ check_save_path_fs "$SAVE_PATH"
- _save_path=$(get_bind_mount_source "$SAVE_PATH")
- _target=$(get_target_from_path "$_save_path")
- _mntpoint=$(get_mntpoint_from_target "$_target")
+ _save_path=$(get_bind_mount_source "$SAVE_PATH")
+ _target=$(get_target_from_path "$_save_path")
+ _mntpoint=$(get_mntpoint_from_target "$_target")
- SAVE_PATH=${_save_path##"$_mntpoint"}
- add_mount "$_target"
- check_size fs "$_target"
+ SAVE_PATH=${_save_path##"$_mntpoint"}
+ add_mount "$_target"
+ check_size fs "$_target"
}
# $1: function name
for_each_block_target()
{
- local dev majmin
+ local dev majmin
- for dev in $(get_kdump_targets); do
- [[ -b "$dev" ]] || continue
- majmin=$(get_maj_min "$dev")
- check_block_and_slaves "$1" "$majmin" && return 1
- done
+ for dev in $(get_kdump_targets); do
+ [[ -b $dev ]] || continue
+ majmin=$(get_maj_min "$dev")
+ check_block_and_slaves "$1" "$majmin" && return 1
+ done
- return 0
+ return 0
}
#judge if a specific device with $1 is unresettable
#return false if unresettable.
is_unresettable()
{
- local path device resettable=1
-
- path="/sys/$(udevadm info --query=all --path="/sys/dev/block/$1" | awk '/^P:/ {print $2}' | sed -e 's/\(cciss[0-9]\+\/\).*/\1/g' -e 's/\/block\/.*$//')/resettable"
- if [[ -f "$path" ]]; then
- resettable="$(<"$path")"
- [[ $resettable -eq 0 ]] && [[ "$OVERRIDE_RESETTABLE" -eq 0 ]] && {
- device=$(udevadm info --query=all --path="/sys/dev/block/$1" | awk -F= '/DEVNAME/{print $2}')
- derror "Error: Can not save vmcore because device $device is unresettable"
- return 0
- }
- fi
-
- return 1
+ local path device resettable=1
+
+ path="/sys/$(udevadm info --query=all --path="/sys/dev/block/$1" | awk '/^P:/ {print $2}' | sed -e 's/\(cciss[0-9]\+\/\).*/\1/g' -e 's/\/block\/.*$//')/resettable"
+ if [[ -f $path ]]; then
+ resettable="$(< "$path")"
+ [[ $resettable -eq 0 ]] && [[ $OVERRIDE_RESETTABLE -eq 0 ]] && {
+ device=$(udevadm info --query=all --path="/sys/dev/block/$1" | awk -F= '/DEVNAME/{print $2}')
+ derror "Error: Can not save vmcore because device $device is unresettable"
+ return 0
+ }
+ fi
+
+ return 1
}
#check if machine is resettable.
#return true if resettable
check_resettable()
{
- local _target _override_resettable
+ local _target _override_resettable
- _override_resettable=$(kdump_get_conf_val override_resettable)
- OVERRIDE_RESETTABLE=${_override_resettable:-$OVERRIDE_RESETTABLE}
- if [ "$OVERRIDE_RESETTABLE" != "0" ] && [ "$OVERRIDE_RESETTABLE" != "1" ];then
- perror_exit "override_resettable value '$OVERRIDE_RESETTABLE' is invalid"
- fi
+ _override_resettable=$(kdump_get_conf_val override_resettable)
+ OVERRIDE_RESETTABLE=${_override_resettable:-$OVERRIDE_RESETTABLE}
+ if [ "$OVERRIDE_RESETTABLE" != "0" ] && [ "$OVERRIDE_RESETTABLE" != "1" ]; then
+ perror_exit "override_resettable value '$OVERRIDE_RESETTABLE' is invalid"
+ fi
- for_each_block_target is_unresettable && return
+ for_each_block_target is_unresettable && return
- return 1
+ return 1
}
check_crypt()
{
- local _dev
+ local _dev
- for _dev in $(get_kdump_targets); do
- if [[ -n $(get_luks_crypt_dev "$(get_maj_min "$_dev")") ]]; then
- derror "Device $_dev is encrypted." && return 1
- fi
- done
+ for _dev in $(get_kdump_targets); do
+ if [[ -n $(get_luks_crypt_dev "$(get_maj_min "$_dev")") ]]; then
+ derror "Device $_dev is encrypted." && return 1
+ fi
+ done
}
if ! check_resettable; then
- exit 1
+ exit 1
fi
if ! check_crypt; then
- dwarn "Warning: Encrypted device is in dump path, which is not recommended, see kexec-kdump-howto.txt for more details."
+ dwarn "Warning: Encrypted device is in dump path, which is not recommended, see kexec-kdump-howto.txt for more details."
fi
# firstly get right SSH_KEY_LOCATION
keyfile=$(kdump_get_conf_val sshkey)
-if [[ -f "$keyfile" ]]; then
- # canonicalize the path
- SSH_KEY_LOCATION=$(/usr/bin/readlink -m "$keyfile")
+if [[ -f $keyfile ]]; then
+ # canonicalize the path
+ SSH_KEY_LOCATION=$(/usr/bin/readlink -m "$keyfile")
fi
-while read -r config_opt config_val;
-do
- # remove inline comments after the end of a directive.
- case "$config_opt" in
- extra_modules)
- extra_modules="$extra_modules $config_val"
- ;;
- ext[234]|xfs|btrfs|minix|nfs)
- check_user_configured_target "$config_val" "$config_opt"
- add_mount "$config_val" "$config_opt"
- ;;
- raw)
- # checking raw disk writable
- dd if="$config_val" count=1 of=/dev/null > /dev/null 2>&1 || {
- perror_exit "Bad raw disk $config_val"
- }
- _praw=$(persistent_policy="by-id" kdump_get_persistent_dev "$config_val")
- if [[ -z $_praw ]]; then
- exit 1
- fi
- add_dracut_arg "--device" "$_praw"
- check_size raw "$config_val"
- ;;
- ssh)
- if strstr "$config_val" "@";
- then
- mkdir_save_path_ssh "$config_val"
- check_size ssh "$config_val"
- add_dracut_sshkey "$SSH_KEY_LOCATION"
- else
- perror_exit "Bad ssh dump target $config_val"
- fi
- ;;
- core_collector)
- verify_core_collector "$config_val"
- ;;
- dracut_args)
- while read -r dracut_arg; do
- add_dracut_arg "$dracut_arg"
- done <<< "$(echo "$config_val" | xargs -n 1 echo)"
- ;;
- *)
- ;;
- esac
+while read -r config_opt config_val; do
+ # remove inline comments after the end of a directive.
+ case "$config_opt" in
+ extra_modules)
+ extra_modules="$extra_modules $config_val"
+ ;;
+ ext[234] | xfs | btrfs | minix | nfs)
+ check_user_configured_target "$config_val" "$config_opt"
+ add_mount "$config_val" "$config_opt"
+ ;;
+ raw)
+ # checking raw disk writable
+ dd if="$config_val" count=1 of=/dev/null > /dev/null 2>&1 || {
+ perror_exit "Bad raw disk $config_val"
+ }
+ _praw=$(persistent_policy="by-id" kdump_get_persistent_dev "$config_val")
+ if [[ -z $_praw ]]; then
+ exit 1
+ fi
+ add_dracut_arg "--device" "$_praw"
+ check_size raw "$config_val"
+ ;;
+ ssh)
+ if strstr "$config_val" "@"; then
+ mkdir_save_path_ssh "$config_val"
+ check_size ssh "$config_val"
+ add_dracut_sshkey "$SSH_KEY_LOCATION"
+ else
+ perror_exit "Bad ssh dump target $config_val"
+ fi
+ ;;
+ core_collector)
+ verify_core_collector "$config_val"
+ ;;
+ dracut_args)
+ while read -r dracut_arg; do
+ add_dracut_arg "$dracut_arg"
+ done <<< "$(echo "$config_val" | xargs -n 1 echo)"
+ ;;
+ *) ;;
+
+ esac
done <<< "$(kdump_read_conf)"
handle_default_dump_target
-if [[ -n "$extra_modules" ]]
-then
- add_dracut_arg "--add-drivers" "$extra_modules"
+if [[ -n $extra_modules ]]; then
+ add_dracut_arg "--add-drivers" "$extra_modules"
fi
# TODO: The below check is not needed anymore with the introduction of
@@ -433,11 +441,11 @@ fi
# parameter available in fadump case. So, find a way to fix that first
# before removing this check.
if ! is_fadump_capable; then
- # The 2nd rootfs mount stays behind the normal dump target mount,
- # so it doesn't affect the logic of check_dump_fs_modified().
- is_dump_to_rootfs && add_mount "$(to_dev_name "$(get_root_fs_device)")"
+ # The 2nd rootfs mount stays behind the normal dump target mount,
+ # so it doesn't affect the logic of check_dump_fs_modified().
+ is_dump_to_rootfs && add_mount "$(to_dev_name "$(get_root_fs_device)")"
- add_dracut_arg "--no-hostonly-default-device"
+ add_dracut_arg "--no-hostonly-default-device"
fi
dracut "${dracut_args[@]}" "$@"
diff --git a/mkfadumprd b/mkfadumprd
index 5c96ee7..b890f83 100644
--- a/mkfadumprd
+++ b/mkfadumprd
@@ -44,22 +44,22 @@ fi
### Unpack the initramfs having dump capture capability
mkdir -p "$MKFADUMPRD_TMPDIR/fadumproot"
-if ! (pushd "$MKFADUMPRD_TMPDIR/fadumproot" > /dev/null && lsinitrd --unpack "$FADUMP_INITRD" && \
+if ! (pushd "$MKFADUMPRD_TMPDIR/fadumproot" > /dev/null && lsinitrd --unpack "$FADUMP_INITRD" &&
popd > /dev/null); then
derror "mkfadumprd: failed to unpack '$MKFADUMPRD_TMPDIR'"
exit 1
fi
### Pack it into the normal boot initramfs with zz-fadumpinit module
-_dracut_isolate_args=(\
- --rebuild "$REBUILD_INITRD" --add zz-fadumpinit \
+_dracut_isolate_args=(
+ --rebuild "$REBUILD_INITRD" --add zz-fadumpinit
-i "$MKFADUMPRD_TMPDIR/fadumproot" /fadumproot
-i "$MKFADUMPRD_TMPDIR/fadumproot/usr/lib/dracut/hostonly-kernel-modules.txt"
/usr/lib/dracut/fadump-kernel-modules.txt
)
if is_squash_available; then
- _dracut_isolate_args+=( --add squash )
+ _dracut_isolate_args+=(--add squash)
fi
if ! dracut --force --quiet "${_dracut_isolate_args[@]}" "$@" "$TARGET_INITRD"; then
commit 4f75e16700874b2e934fb3b9b85522cf7f36bd04
Author: Kairui Song <kasong(a)redhat.com>
Date: Wed Aug 18 02:04:45 2021 +0800
bash scripts: declare and assign separately
Declare and assign separately to avoid masking return values:
https://github.com/koalaman/shellcheck/wiki/SC2155
Signed-off-by: Kairui Song <kasong(a)redhat.com>
Acked-by: Philipp Rudo <prudo(a)redhat.com>
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh
index 7c51e01..e9ec894 100755
--- a/dracut-module-setup.sh
+++ b/dracut-module-setup.sh
@@ -321,7 +321,8 @@ kdump_get_mac_addr() {
#Bonding or team master modifies the mac address
#of its slaves, we should use perm address
kdump_get_perm_addr() {
- local addr=$(ethtool -P "$1" | sed -e 's/Permanent address: //')
+ local addr
+ addr=$(ethtool -P "$1" | sed -e 's/Permanent address: //')
if [[ -z "$addr" ]] || [[ "$addr" = "00:00:00:00:00:00" ]]
then
derror "Can't get the permanent address of $1"
@@ -427,10 +428,13 @@ kdump_setup_team() {
kdump_setup_vlan() {
local _netdev=$1
- local _phydev="$(awk '/^Device:/{print $2}' /proc/net/vlan/"$_netdev")"
- local _netmac="$(kdump_get_mac_addr "$_phydev")"
+ local _phydev
+ local _netmac
local _kdumpdev
+ _phydev="$(awk '/^Device:/{print $2}' /proc/net/vlan/"$_netdev")"
+ _netmac="$(kdump_get_mac_addr "$_phydev")"
+
#Just support vlan over bond and team
if kdump_is_bridge "$_phydev"; then
derror "Vlan over bridge is not supported!"
@@ -522,7 +526,8 @@ kdump_get_ip_route_field()
kdump_get_remote_ip()
{
- local _remote=$(get_remote_host "$1") _remote_temp
+ local _remote _remote_temp
+ _remote=$(get_remote_host "$1")
if is_hostname "$_remote"; then
_remote_temp=$(getent ahosts "$_remote" | grep -v : | head -n 1)
if [[ -z "$_remote_temp" ]]; then
@@ -876,11 +881,14 @@ get_alias() {
}
is_localhost() {
- local hostnames=$(hostname -A)
- local shortnames=$(hostname -A -s)
- local aliasname=$(get_alias)
+ local hostnames
+ local shortnames
+ local aliasname
local nodename=$1
+ hostnames=$(hostname -A)
+ shortnames=$(hostname -A -s)
+ aliasname=$(get_alias)
hostnames="$hostnames $shortnames $aliasname"
for name in ${hostnames}; do
diff --git a/kdumpctl b/kdumpctl
index 208818c..d11c3c1 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -690,6 +690,8 @@ load_kdump()
check_ssh_config()
{
+ local SSH_TARGET
+
while read -r config_opt config_val; do
case "$config_opt" in
sshkey)
@@ -713,7 +715,7 @@ check_ssh_config()
done <<< "$(kdump_read_conf)"
#make sure they've configured kdump.conf for ssh dumps
- local SSH_TARGET=$(echo -n "$DUMP_TARGET" | sed -n '/.*@/p')
+ SSH_TARGET=$(echo -n "$DUMP_TARGET" | sed -n '/.*@/p')
if [[ -z "$SSH_TARGET" ]]; then
return 1
fi
@@ -725,13 +727,14 @@ check_ssh_config()
# by the return val of 'ssh'
check_and_wait_network_ready()
{
- local start_time=$(date +%s)
+ local start_time
local warn_once=1
local cur
local diff
local retval
local errmsg
+ start_time=$(date +%s)
while true; do
errmsg=$(ssh -i "$SSH_KEY_LOCATION" -o BatchMode=yes "$DUMP_TARGET" mkdir -p "$SAVE_PATH" 2>&1)
retval=$?
@@ -935,9 +938,13 @@ selinux_relabel()
check_fence_kdump_config()
{
- local hostname=$(hostname)
- local ipaddrs=$(hostname -I)
- local nodes=$(kdump_get_conf_val "fence_kdump_nodes")
+ local hostname
+ local ipaddrs
+ local nodes
+
+ hostname=$(hostname)
+ ipaddrs=$(hostname -I)
+ nodes=$(kdump_get_conf_val "fence_kdump_nodes")
for node in $nodes; do
if [[ "$node" = "$hostname" ]]; then
diff --git a/mkdumprd b/mkdumprd
index b75bbdd..a027e6a 100644
--- a/mkdumprd
+++ b/mkdumprd
@@ -29,9 +29,9 @@ OVERRIDE_RESETTABLE=0
extra_modules=""
dracut_args=( --add kdumpbase --quiet --hostonly --hostonly-cmdline --hostonly-i18n --hostonly-mode strict -o "plymouth dash resume ifcfg earlykdump" )
-readonly MKDUMPRD_TMPDIR="$(mktemp -d -t mkdumprd.XXXXXX)"
+MKDUMPRD_TMPDIR="$(mktemp -d -t mkdumprd.XXXXXX)"
[ -d "$MKDUMPRD_TMPDIR" ] || perror_exit "dracut: mktemp -p -d -t dracut.XXXXXX failed."
-readonly MKDUMPRD_TMPMNT="$MKDUMPRD_TMPDIR/target"
+MKDUMPRD_TMPMNT="$MKDUMPRD_TMPDIR/target"
trap '
ret=$?;
@@ -195,9 +195,11 @@ mount_failure()
check_user_configured_target()
{
local _target=$1 _cfg_fs_type=$2 _mounted
- local _mnt=$(get_mntpoint_from_target "$_target")
- local _opt=$(get_mntopt_from_target "$_target")
- local _fstype=$(get_fs_type_from_target "$_target")
+ local _mnt _opt _fstype
+
+ _mnt=$(get_mntpoint_from_target "$_target")
+ _opt=$(get_mntopt_from_target "$_target")
+ _fstype=$(get_fs_type_from_target "$_target")
if [[ -n "$_fstype" ]]; then
# In case of nfs4, nfs should be used instead, nfs* options is deprecated in kdump.conf
@@ -314,14 +316,13 @@ for_each_block_target()
#return false if unresettable.
is_unresettable()
{
- local path="/sys/$(udevadm info --query=all --path="/sys/dev/block/$1" | awk '/^P:/ {print $2}' | sed -e 's/\(cciss[0-9]\+\/\).*/\1/g' -e 's/\/block\/.*$//')/resettable"
- local resettable=1
+ local path device resettable=1
- if [[ -f "$path" ]]
- then
+ path="/sys/$(udevadm info --query=all --path="/sys/dev/block/$1" | awk '/^P:/ {print $2}' | sed -e 's/\(cciss[0-9]\+\/\).*/\1/g' -e 's/\/block\/.*$//')/resettable"
+ if [[ -f "$path" ]]; then
resettable="$(<"$path")"
[[ $resettable -eq 0 ]] && [[ "$OVERRIDE_RESETTABLE" -eq 0 ]] && {
- local device=$(udevadm info --query=all --path="/sys/dev/block/$1" | awk -F= '/DEVNAME/{print $2}')
+ device=$(udevadm info --query=all --path="/sys/dev/block/$1" | awk -F= '/DEVNAME/{print $2}')
derror "Error: Can not save vmcore because device $device is unresettable"
return 0
}
diff --git a/mkfadumprd b/mkfadumprd
index ca9f362..5c96ee7 100644
--- a/mkfadumprd
+++ b/mkfadumprd
@@ -17,7 +17,7 @@ if ! dlog_init; then
exit 1
fi
-readonly MKFADUMPRD_TMPDIR="$(mktemp -d -t mkfadumprd.XXXXXX)"
+MKFADUMPRD_TMPDIR="$(mktemp -d -t mkfadumprd.XXXXXX)"
[ -d "$MKFADUMPRD_TMPDIR" ] || perror_exit "mkfadumprd: mktemp -d -t mkfadumprd.XXXXXX failed."
trap '
ret=$?;
commit a4648fc851be56d141fd43c8ade1a61c4069f47e
Author: Kairui Song <kasong(a)redhat.com>
Date: Wed Sep 8 17:23:16 2021 +0800
bash scripts: fix redundant exit code check
As suggested by:
https://github.com/koalaman/shellcheck/wiki/SC2181
Signed-off-by: Kairui Song <kasong(a)redhat.com>
Acked-by: Philipp Rudo <prudo(a)redhat.com>
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh
index 07a96e5..7c51e01 100755
--- a/dracut-module-setup.sh
+++ b/dracut-module-setup.sh
@@ -255,8 +255,7 @@ kdump_static_ip() {
_gateway="[$_gateway]"
else
_prefix=$(cut -d'/' -f2 <<< "$_ipaddr")
- _netmask=$(cal_netmask_by_prefix "$_prefix" "$_ipv6_flag")
- if [[ "$?" -ne 0 ]]; then
+ if ! _netmask=$(cal_netmask_by_prefix "$_prefix" "$_ipv6_flag"); then
derror "Failed to calculate netmask for $_ipaddr"
exit 1
fi
@@ -359,10 +358,7 @@ kdump_setup_bridge() {
_dev=${_dev##*/}
_kdumpdev=$_dev
if kdump_is_bond "$_dev"; then
- (kdump_setup_bond "$_dev" "$(get_nmcli_connection_show_cmd_by_ifname "$_dev")")
- if [[ $? != 0 ]]; then
- exit 1
- fi
+ (kdump_setup_bond "$_dev" "$(get_nmcli_connection_show_cmd_by_ifname "$_dev")") || exit 1
elif kdump_is_team "$_dev"; then
kdump_setup_team "$_dev"
elif kdump_is_vlan "$_dev"; then
@@ -420,9 +416,7 @@ kdump_setup_team() {
echo " team=$_netdev:${_slaves%,}" >> "${initdir}/etc/cmdline.d/44team.conf"
#Buggy version teamdctl outputs to stderr!
#Try to use the latest version of teamd.
- teamdctl "$_netdev" config dump > "${initdir}/tmp/$$-$_netdev.conf"
- if [[ $? -ne 0 ]]
- then
+ if ! teamdctl "$_netdev" config dump > "${initdir}/tmp/$$-$_netdev.conf"; then
derror "teamdctl failed."
exit 1
fi
@@ -442,10 +436,7 @@ kdump_setup_vlan() {
derror "Vlan over bridge is not supported!"
exit 1
elif kdump_is_bond "$_phydev"; then
- (kdump_setup_bond "$_phydev" "$(get_nmcli_connection_show_cmd_by_ifname "$_phydev")")
- if [[ $? != 0 ]]; then
- exit 1
- fi
+ (kdump_setup_bond "$_phydev" "$(get_nmcli_connection_show_cmd_by_ifname "$_phydev")") || exit 1
echo " vlan=$(kdump_setup_ifname "$_netdev"):$_phydev" > "${initdir}/etc/cmdline.d/43vlan.conf"
else
_kdumpdev="$(kdump_setup_ifname "$_phydev")"
@@ -516,8 +507,8 @@ kdump_setup_znet() {
kdump_get_ip_route()
{
- local _route=$(/sbin/ip -o route get to "$1" 2>&1)
- if [[ $? != 0 ]]; then
+ local _route
+ if ! _route=$(/sbin/ip -o route get to "$1" 2>&1); then
derror "Bad kdump network destination: $1"
exit 1
fi
@@ -561,8 +552,7 @@ kdump_install_net() {
_znet_netdev=$(find_online_znet_device)
if [[ -n "$_znet_netdev" ]]; then
_nm_show_cmd_znet=$(get_nmcli_connection_show_cmd_by_ifname "$_znet_netdev")
- (kdump_setup_znet "$_znet_netdev" "$_nm_show_cmd_znet")
- if [[ $? != 0 ]]; then
+ if ! (kdump_setup_znet "$_znet_netdev" "$_nm_show_cmd_znet"); then
derror "Failed to set up znet"
exit 1
fi
@@ -592,10 +582,7 @@ kdump_install_net() {
if kdump_is_bridge "$_netdev"; then
kdump_setup_bridge "$_netdev"
elif kdump_is_bond "$_netdev"; then
- (kdump_setup_bond "$_netdev" "$_nm_show_cmd")
- if [[ $? != 0 ]]; then
- exit 1
- fi
+ (kdump_setup_bond "$_netdev" "$_nm_show_cmd") || exit 1
elif kdump_is_team "$_netdev"; then
kdump_setup_team "$_netdev"
elif kdump_is_vlan "$_netdev"; then
@@ -837,8 +824,10 @@ kdump_setup_iscsi_device() {
fi
# Setup initator
- initiator_str=$(kdump_get_iscsi_initiator)
- [[ $? -ne "0" ]] && derror "Failed to get initiator name" && return 1
+ if ! initiator_str=$(kdump_get_iscsi_initiator); then
+ derror "Failed to get initiator name"
+ return 1
+ fi
# If initiator details do not exist already, append.
if ! grep -q "$initiator_str" "$netroot_conf"; then
@@ -878,8 +867,7 @@ get_alias() {
for ip in $ips
do
# in /etc/hosts, alias can come at the 2nd column
- entries=$(grep "$ip" /etc/hosts | awk '{ $1=""; print $0 }')
- if [[ $? -eq 0 ]]; then
+ if entries=$(grep "$ip" /etc/hosts | awk '{ $1=""; print $0 }'); then
alias_set="$alias_set $entries"
fi
done
@@ -1004,8 +992,7 @@ kdump_install_random_seed() {
kdump_install_systemd_conf() {
# Kdump turns out to require longer default systemd mount timeout
# than 1st kernel(90s by default), we use default 300s for kdump.
- grep -r "^[[:space:]]*DefaultTimeoutStartSec=" "${initdir}/etc/systemd/system.conf"* &>/dev/null
- if [[ $? -ne 0 ]]; then
+ if ! grep -q -r "^[[:space:]]*DefaultTimeoutStartSec=" "${initdir}/etc/systemd/system.conf"*; then
mkdir -p "${initdir}/etc/systemd/system.conf.d"
echo "[Manager]" > "${initdir}/etc/systemd/system.conf.d/kdump.conf"
echo "DefaultTimeoutStartSec=300s" >> "${initdir}/etc/systemd/system.conf.d/kdump.conf"
diff --git a/kdumpctl b/kdumpctl
index ed6dc3a..208818c 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -37,8 +37,7 @@ fi
. /lib/kdump/kdump-logger.sh
#initiate the kdump logger
-dlog_init
-if [[ $? -ne 0 ]]; then
+if ! dlog_init; then
echo "failed to initiate the kdump logger."
exit 1
fi
@@ -47,8 +46,7 @@ single_instance_lock()
{
local rc timeout=5
- exec 9>/var/lock/kdump
- if [[ $? -ne 0 ]]; then
+ if ! exec 9>/var/lock/kdump; then
derror "Create file lock failed"
exit 1
fi
@@ -80,8 +78,7 @@ save_core()
mkdir -p "$coredir"
ddebug "cp --sparse=always /proc/vmcore $coredir/vmcore-incomplete"
- cp --sparse=always /proc/vmcore "$coredir/vmcore-incomplete"
- if [[ $? == 0 ]]; then
+ if cp --sparse=always /proc/vmcore "$coredir/vmcore-incomplete"; then
mv "$coredir/vmcore-incomplete" "$coredir/vmcore"
dinfo "saved a vmcore to $coredir"
else
@@ -95,8 +92,7 @@ save_core()
ddebug "makedumpfile --dump-dmesg $coredir/vmcore $coredir/dmesg"
makedumpfile --dump-dmesg "$coredir/vmcore" "$coredir/dmesg" >/dev/null 2>&1
ddebug "dumpoops -d $coredir/dmesg"
- dumpoops -d "$coredir/dmesg" >/dev/null 2>&1
- if [[ $? == 0 ]]; then
+ if dumpoops -d "$coredir/dmesg" >/dev/null 2>&1; then
dinfo "kernel oops has been collected by abrt tool"
fi
fi
@@ -121,8 +117,7 @@ check_earlykdump_is_enabled()
rebuild_kdump_initrd()
{
ddebug "rebuild kdump initrd: $MKDUMPRD $TARGET_INITRD $KDUMP_KERNELVER"
- $MKDUMPRD "$TARGET_INITRD" "$KDUMP_KERNELVER"
- if [[ $? != 0 ]]; then
+ if ! $MKDUMPRD "$TARGET_INITRD" "$KDUMP_KERNELVER"; then
derror "mkdumprd: failed to make kdump initrd"
return 1
fi
@@ -184,8 +179,7 @@ backup_default_initrd()
dinfo "Backing up $DEFAULT_INITRD before rebuild."
# save checksum to verify before restoring
sha1sum "$DEFAULT_INITRD" > "$INITRD_CHECKSUM_LOCATION"
- cp "$DEFAULT_INITRD" "$DEFAULT_INITRD_BAK"
- if [[ $? -ne 0 ]]; then
+ if ! cp "$DEFAULT_INITRD" "$DEFAULT_INITRD_BAK"; then
dwarn "WARNING: failed to backup $DEFAULT_INITRD."
rm -f "$DEFAULT_INITRD_BAK"
fi
@@ -210,8 +204,7 @@ restore_default_initrd()
dwarn "WARNING: checksum mismatch! Can't restore original initrd.."
else
rm -f $INITRD_CHECKSUM_LOCATION
- mv "$DEFAULT_INITRD_BAK" "$DEFAULT_INITRD"
- if [[ $? -eq 0 ]]; then
+ if mv "$DEFAULT_INITRD_BAK" "$DEFAULT_INITRD"; then
derror "Restoring original initrd as fadump mode is disabled."
sync
fi
@@ -308,8 +301,7 @@ get_pcs_cluster_modified_files()
setup_initrd()
{
- prepare_kdump_bootinfo
- if [[ $? -ne 0 ]]; then
+ if ! prepare_kdump_bootinfo; then
derror "failed to prepare for kdump bootinfo."
return 1
fi
@@ -372,8 +364,7 @@ check_files_modified()
files="$files /lib/modules/$KDUMP_KERNELVER/modules.dep"
fi
for _module in $EXTRA_MODULES; do
- _module_file="$(modinfo --set-version "$KDUMP_KERNELVER" --filename "$_module" 2>/dev/null)"
- if [[ $? -eq 0 ]]; then
+ if _module_file="$(modinfo --set-version "$KDUMP_KERNELVER" --filename "$_module" 2>/dev/null)"; then
files="$files $_module_file"
for _dep_modules in $(modinfo -F depends "$_module" | tr ',' ' '); do
files="$files $(modinfo --set-version "$KDUMP_KERNELVER" --filename "$_dep_modules" 2>/dev/null)"
@@ -389,8 +380,7 @@ check_files_modified()
# HOOKS is mandatory and need to check the modification time
files="$files $HOOKS"
- check_exist "$files" && check_executable "$EXTRA_BINS"
- [[ $? -ne 0 ]] && return 2
+ check_exist "$files" && check_executable "$EXTRA_BINS" || return 2
for file in $files; do
if [[ -e "$file" ]]; then
@@ -455,7 +445,7 @@ check_drivers_modified()
# Skip deprecated/invalid driver name or built-in module
_module_name=$(modinfo --set-version "$KDUMP_KERNELVER" -F name "$_driver" 2>/dev/null)
_module_filename=$(modinfo --set-version "$KDUMP_KERNELVER" -n "$_driver" 2>/dev/null)
- if [[ $? -ne 0 ]] || [[ -z "$_module_name" ]] || [[ "$_module_filename" = *"(builtin)"* ]]; then
+ if [[ -z "$_module_name" ]] || [[ -z "$_module_filename" ]] || [[ "$_module_filename" = *"(builtin)"* ]]; then
continue
fi
if ! [[ " $_old_drivers " == *" $_module_name "* ]]; then
@@ -505,8 +495,7 @@ check_fs_modified()
# if --mount argument present then match old and new target, mount
# point and file system. If any of them mismatches then rebuild
- echo "$_dracut_args" | grep -q "\-\-mount"
- if [[ $? -eq 0 ]];then
+ if echo "$_dracut_args" | grep -q "\-\-mount"; then
# shellcheck disable=SC2046
set -- $(echo "$_dracut_args" | awk -F "--mount '" '{print $2}' | cut -d' ' -f1,2,3)
_old_dev=$1
@@ -558,11 +547,7 @@ check_rebuild()
local force_rebuild force_no_rebuild
local ret system_modified="0"
- setup_initrd
-
- if [[ $? -ne 0 ]]; then
- return 1
- fi
+ setup_initrd || return 1
force_no_rebuild=$(kdump_get_conf_val force_no_rebuild)
force_no_rebuild=${force_no_rebuild:-0}
@@ -761,8 +746,7 @@ check_and_wait_network_ready()
# if server removes the authorized_keys or, no /root/.ssh/kdump_id_rsa
ddebug "$errmsg"
- echo "$errmsg" | grep -q "Permission denied\|No such file or directory\|Host key verification failed"
- if [[ $? -eq 0 ]]; then
+ if echo "$errmsg" | grep -q "Permission denied\|No such file or directory\|Host key verification failed"; then
derror "Could not create $DUMP_TARGET:$SAVE_PATH, you probably need to run \"kdumpctl propagate\""
return 1
fi
@@ -788,16 +772,11 @@ check_and_wait_network_ready()
check_ssh_target()
{
check_and_wait_network_ready
- if [[ $? -ne 0 ]]; then
- return 1
- fi
- return 0
}
propagate_ssh_key()
{
- check_ssh_config
- if [[ $? -ne 0 ]]; then
+ if ! check_ssh_config; then
derror "No ssh config specified in $KDUMP_CONFIG_FILE. Can't propagate"
exit 1
fi
@@ -904,8 +883,7 @@ local_fs_dump_target()
{
local _target
- _target=$(grep -E "^ext[234]|^xfs|^btrfs|^minix" /etc/kdump.conf)
- if [[ $? -eq 0 ]]; then
+ if _target=$(grep -E "^ext[234]|^xfs|^btrfs|^minix" /etc/kdump.conf); then
echo "$_target" | awk '{print $2}'
fi
}
@@ -967,8 +945,7 @@ check_fence_kdump_config()
return 1
fi
# node can be ipaddr
- echo "$ipaddrs " | grep -q "$node "
- if [[ $? -eq 0 ]]; then
+ if echo "$ipaddrs " | grep -q "$node "; then
derror "Option fence_kdump_nodes cannot contain $node"
return 1
fi
@@ -1062,14 +1039,12 @@ check_final_action_config()
start()
{
- check_dump_feasibility
- if [[ $? -ne 0 ]]; then
+ if ! check_dump_feasibility; then
derror "Starting kdump: [FAILED]"
return 1
fi
- check_config
- if [[ $? -ne 0 ]]; then
+ if ! check_config; then
derror "Starting kdump: [FAILED]"
return 1
fi
@@ -1078,14 +1053,12 @@ start()
selinux_relabel
fi
- save_raw
- if [[ $? -ne 0 ]]; then
+ if ! save_raw; then
derror "Starting kdump: [FAILED]"
return 1
fi
- check_current_status
- if [[ $? == 0 ]]; then
+ if check_current_status; then
dwarn "Kdump already running: [WARNING]"
return 0
fi
@@ -1097,14 +1070,12 @@ start()
fi
fi
- check_rebuild
- if [[ $? != 0 ]]; then
+ if ! check_rebuild; then
derror "Starting kdump: [FAILED]"
return 1
fi
- start_dump
- if [[ $? != 0 ]]; then
+ if ! start_dump; then
derror "Starting kdump: [FAILED]"
return 1
fi
@@ -1114,8 +1085,7 @@ start()
reload()
{
- check_current_status
- if [[ $? -ne 0 ]]; then
+ if ! check_current_status; then
dwarn "Kdump was not running: [WARNING]"
fi
@@ -1123,24 +1093,20 @@ reload()
reload_fadump
return $?
else
- stop_kdump
- fi
-
- if [[ $? -ne 0 ]]; then
- derror "Stopping kdump: [FAILED]"
- return 1
+ if ! stop_kdump; then
+ derror "Stopping kdump: [FAILED]"
+ return 1
+ fi
fi
dinfo "Stopping kdump: [OK]"
- setup_initrd
- if [[ $? -ne 0 ]]; then
+ if ! setup_initrd; then
derror "Starting kdump: [FAILED]"
return 1
fi
- start_dump
- if [[ $? -ne 0 ]]; then
+ if ! start_dump; then
derror "Starting kdump: [FAILED]"
return 1
fi
@@ -1168,6 +1134,7 @@ stop_kdump()
$KEXEC -p -u
fi
+ # shellcheck disable=SC2181
if [[ $? != 0 ]]; then
derror "kexec: failed to unload kdump kernel"
return 1
@@ -1179,16 +1146,14 @@ stop_kdump()
reload_fadump()
{
- echo 1 > $FADUMP_REGISTER_SYS_NODE
- if [[ $? == 0 ]]; then
+ if echo 1 > $FADUMP_REGISTER_SYS_NODE; then
dinfo "fadump: re-registered successfully"
return 0
else
# FADump could fail on older kernel where re-register
# support is not enabled. Try stop/start from userspace
# to handle such scenario.
- stop_fadump
- if [[ $? == 0 ]]; then
+ if stop_fadump; then
start_fadump
return $?
fi
@@ -1205,6 +1170,7 @@ stop()
stop_kdump
fi
+ # shellcheck disable=SC2181
if [[ $? != 0 ]]; then
derror "Stopping kdump: [FAILED]"
return 1
@@ -1215,10 +1181,7 @@ stop()
}
rebuild() {
- check_config
- if [[ $? -ne 0 ]]; then
- return 1
- fi
+ check_config || return 1
if check_ssh_config; then
if ! check_ssh_target; then
@@ -1226,10 +1189,7 @@ rebuild() {
fi
fi
- setup_initrd
- if [[ $? -ne 0 ]]; then
- return 1
- fi
+ setup_initrd || return 1
dinfo "Rebuilding $TARGET_INITRD"
rebuild_initrd
diff --git a/mkdumprd b/mkdumprd
index b5cc39e..b75bbdd 100644
--- a/mkdumprd
+++ b/mkdumprd
@@ -17,8 +17,7 @@ fi
export IN_KDUMP=1
#initiate the kdump logger
-dlog_init
-if [[ $? -ne 0 ]]; then
+if ! dlog_init; then
echo "failed to initiate the kdump logger."
exit 1
fi
@@ -114,18 +113,12 @@ mkdir_save_path_ssh()
{
local _opt _dir
_opt=(-i "$SSH_KEY_LOCATION" -o BatchMode=yes -o StrictHostKeyChecking=yes)
- ssh -qn "${_opt[@]}" "$1" mkdir -p "$SAVE_PATH" 2>&1 > /dev/null
- _ret=$?
- if [[ $_ret -ne 0 ]]; then
+ ssh -qn "${_opt[@]}" "$1" mkdir -p "$SAVE_PATH" &>/dev/null || \
perror_exit "mkdir failed on $1:$SAVE_PATH"
- fi
- #check whether user has write permission on $1:$SAVE_PATH
- _dir=$(ssh -qn "${_opt[@]}" "$1" mktemp -dqp "$SAVE_PATH" 2>/dev/null)
- _ret=$?
- if [[ $_ret -ne 0 ]]; then
+ # check whether user has write permission on $1:$SAVE_PATH
+ _dir=$(ssh -qn "${_opt[@]}" "$1" mktemp -dqp "$SAVE_PATH" 2>/dev/null) || \
perror_exit "Could not create temporary directory on $1:$SAVE_PATH. Make sure user has write permission on destination"
- fi
ssh -qn "${_opt[@]}" "$1" rmdir "$_dir"
return 0
@@ -162,11 +155,7 @@ check_size() {
;;
*)
return
- esac
-
- if [[ $? -ne 0 ]]; then
- perror_exit "Check dump target size failed"
- fi
+ esac || perror_exit "Check dump target size failed"
if [[ "$avail" -lt "$memtotal" ]]; then
dwarn "Warning: There might not be enough space to save a vmcore."
@@ -227,8 +216,7 @@ check_user_configured_target()
if [[ -n "$_mnt" ]]; then
if ! is_mounted "$_mnt"; then
if [[ $_opt = *",noauto"* ]]; then
- mount "$_mnt"
- [[ $? -ne 0 ]] && mount_failure "$_target" "$_mnt" "$_fstype"
+ mount "$_mnt" || mount_failure "$_target" "$_mnt" "$_fstype"
_mounted=$_mnt
else
perror_exit "Dump target \"$_target\" is neither mounted nor configured as \"noauto\""
@@ -237,8 +225,7 @@ check_user_configured_target()
else
_mnt=$MKDUMPRD_TMPMNT
mkdir -p "$_mnt"
- mount "$_target" "$_mnt" -t "$_fstype" -o defaults
- [[ $? -ne 0 ]] && mount_failure "$_target" "" "$_fstype"
+ mount "$_target" "$_mnt" -t "$_fstype" -o defaults || mount_failure "$_target" "" "$_fstype"
_mounted=$_mnt
fi
@@ -283,11 +270,9 @@ verify_core_collector() {
}
add_mount() {
- local _mnt=$(to_mount "$@")
+ local _mnt
- if [[ $? -ne 0 ]]; then
- exit 1
- fi
+ _mnt=$(to_mount "$@") || exit 1
add_dracut_mount "$_mnt"
}
@@ -349,7 +334,7 @@ is_unresettable()
#return true if resettable
check_resettable()
{
- local _ret _target _override_resettable
+ local _target _override_resettable
_override_resettable=$(kdump_get_conf_val override_resettable)
OVERRIDE_RESETTABLE=${_override_resettable:-$OVERRIDE_RESETTABLE}
@@ -357,10 +342,7 @@ check_resettable()
perror_exit "override_resettable value '$OVERRIDE_RESETTABLE' is invalid"
fi
- for_each_block_target is_unresettable
- _ret=$?
-
- [[ $_ret -eq 0 ]] && return
+ for_each_block_target is_unresettable && return
return 1
}
commit 86538ca6e2e555caa8cdd2bcfcc3c5e94ac6bf58
Author: Kairui Song <kasong(a)redhat.com>
Date: Wed Sep 8 17:21:41 2021 +0800
bash scripts: fix variable quoting issue
Fixed quoting issues found by shellcheck, no feature
change. This should fix many errors when there is space
in any shell variables, eg. dump target's name/path/id.
False positives are marked with "# shellcheck disable=SCXXXX", for
example, args are expected to split so it should not be quoted.
And replaced some `cut -d ' ' -fX` with `awk '{print $X}'` since cut
is fragile, and doesn't work well with any quoted strings that have
redundant space.
Following quoting related issues are fixed (check the link
for example code and what could go wrong):
https://github.com/koalaman/shellcheck/wiki/SC2046
https://github.com/koalaman/shellcheck/wiki/SC2053
https://github.com/koalaman/shellcheck/wiki/SC2068
https://github.com/koalaman/shellcheck/wiki/SC2086
https://github.com/koalaman/shellcheck/wiki/SC2206
Signed-off-by: Kairui Song <kasong(a)redhat.com>
Acked-by: Philipp Rudo <prudo(a)redhat.com>
diff --git a/dracut-early-kdump-module-setup.sh b/dracut-early-kdump-module-setup.sh
index 00546e0..83e067c 100755
--- a/dracut-early-kdump-module-setup.sh
+++ b/dracut-early-kdump-module-setup.sh
@@ -25,7 +25,7 @@ prepare_kernel_initrd() {
prepare_kdump_bootinfo
# $kernel is a variable from dracut
- if [[ "$KDUMP_KERNELVER" != $kernel ]]; then
+ if [[ "$KDUMP_KERNELVER" != "$kernel" ]]; then
dwarn "Using kernel version '$KDUMP_KERNELVER' for early kdump," \
"but the initramfs is generated for kernel version '$kernel'"
fi
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh
index 515cff0..07a96e5 100755
--- a/dracut-module-setup.sh
+++ b/dracut-module-setup.sh
@@ -53,7 +53,7 @@ depends() {
_dep="$_dep network"
fi
- echo $_dep
+ echo "$_dep"
}
kdump_is_bridge() {
@@ -65,7 +65,7 @@ kdump_is_bond() {
}
kdump_is_team() {
- [[ -f /usr/bin/teamnl ]] && teamnl $1 ports &> /dev/null
+ [[ -f /usr/bin/teamnl ]] && teamnl "$1" ports &> /dev/null
}
kdump_is_vlan() {
@@ -77,9 +77,9 @@ source_ifcfg_file() {
local ifcfg_file
dwarning "Network Scripts are deprecated. You are encouraged to set up network by NetworkManager."
- ifcfg_file=$(get_ifcfg_filename $1)
+ ifcfg_file=$(get_ifcfg_filename "$1")
if [[ -f "${ifcfg_file}" ]]; then
- . ${ifcfg_file}
+ . "${ifcfg_file}"
else
dwarning "The ifcfg file of $1 is not found!"
fi
@@ -93,7 +93,8 @@ kdump_setup_dns() {
local _dnsfile=${initdir}/etc/cmdline.d/42dns.conf
_tmp=$(get_nmcli_value_by_field "$_nm_show_cmd" "IP4.DNS")
- array=(${_tmp//|/ })
+ # shellcheck disable=SC2206
+ array=( ${_tmp//|/ } )
if [[ ${array[*]} ]]; then
for _dns in "${array[@]}"
do
@@ -108,10 +109,10 @@ kdump_setup_dns() {
while read -r content;
do
- _nameserver=$(echo $content | grep ^nameserver)
+ _nameserver=$(echo "$content" | grep ^nameserver)
[[ -z "$_nameserver" ]] && continue
- _dns=$(echo $_nameserver | cut -d' ' -f2)
+ _dns=$(echo "$_nameserver" | awk '{print $2}')
[[ -z "$_dns" ]] && continue
if [[ ! -f $_dnsfile ]] || ! grep -q "$_dns" "$_dnsfile" ; then
@@ -237,14 +238,14 @@ kdump_static_ip() {
local _netdev="$1" _srcaddr="$2" kdumpnic="$3" _ipv6_flag
local _netmask _gateway _ipaddr _target _nexthop _prefix
- _ipaddr=$(ip addr show dev $_netdev permanent | awk "/ $_srcaddr\/.* /{print \$2}")
+ _ipaddr=$(ip addr show dev "$_netdev" permanent | awk "/ $_srcaddr\/.* /{print \$2}")
- if is_ipv6_address $_srcaddr; then
+ if is_ipv6_address "$_srcaddr"; then
_ipv6_flag="-6"
fi
if [[ -n "$_ipaddr" ]]; then
- _gateway=$(ip $_ipv6_flag route list dev $_netdev | \
+ _gateway=$(ip $_ipv6_flag route list dev "$_netdev" | \
awk '/^default /{print $3}' | head -n 1)
if [[ "x" != "x"$_ipv6_flag ]]; then
@@ -266,23 +267,23 @@ kdump_static_ip() {
/sbin/ip $_ipv6_flag route show | grep -v default |\
grep ".*via.* $_netdev " | grep -v "^[[:space:]]*nexthop" |\
while read -r _route; do
- _target=$(echo $_route | cut -d ' ' -f1)
- _nexthop=$(echo $_route | cut -d ' ' -f3)
+ _target=$(echo "$_route" | awk '{print $1}')
+ _nexthop=$(echo "$_route" | awk '{print $3}')
if [[ "x" != "x"$_ipv6_flag ]]; then
_target="[$_target]"
_nexthop="[$_nexthop]"
fi
echo "rd.route=$_target:$_nexthop:$kdumpnic"
- done >> ${initdir}/etc/cmdline.d/45route-static.conf
+ done >> "${initdir}/etc/cmdline.d/45route-static.conf"
- kdump_handle_mulitpath_route $_netdev $_srcaddr $kdumpnic
+ kdump_handle_mulitpath_route "$_netdev" "$_srcaddr" "$kdumpnic"
}
kdump_handle_mulitpath_route() {
local _netdev="$1" _srcaddr="$2" kdumpnic="$3" _ipv6_flag
local _target _nexthop _route _weight _max_weight _rule
- if is_ipv6_address $_srcaddr; then
+ if is_ipv6_address "$_srcaddr"; then
_ipv6_flag="-6"
fi
@@ -308,20 +309,20 @@ kdump_handle_mulitpath_route() {
_target=$(echo "$_route" | cut -d ' ' -f1)
_rule="" _max_weight=0 _weight=0
fi
- done >> ${initdir}/etc/cmdline.d/45route-static.conf\
+ done >> "${initdir}/etc/cmdline.d/45route-static.conf"\
<<< "$(/sbin/ip $_ipv6_flag route show)"
- [[ -n $_rule ]] && echo $_rule >> ${initdir}/etc/cmdline.d/45route-static.conf
+ [[ -n $_rule ]] && echo "$_rule" >> "${initdir}/etc/cmdline.d/45route-static.conf"
}
kdump_get_mac_addr() {
- cat /sys/class/net/$1/address
+ cat "/sys/class/net/$1/address"
}
#Bonding or team master modifies the mac address
#of its slaves, we should use perm address
kdump_get_perm_addr() {
- local addr=$(ethtool -P $1 | sed -e 's/Permanent address: //')
+ local addr=$(ethtool -P "$1" | sed -e 's/Permanent address: //')
if [[ -z "$addr" ]] || [[ "$addr" = "00:00:00:00:00:00" ]]
then
derror "Can't get the permanent address of $1"
@@ -367,9 +368,9 @@ kdump_setup_bridge() {
elif kdump_is_vlan "$_dev"; then
kdump_setup_vlan "$_dev"
else
- _mac=$(kdump_get_mac_addr $_dev)
- _kdumpdev=$(kdump_setup_ifname $_dev)
- echo -n " ifname=$_kdumpdev:$_mac" >> ${initdir}/etc/cmdline.d/41bridge.conf
+ _mac=$(kdump_get_mac_addr "$_dev")
+ _kdumpdev=$(kdump_setup_ifname "$_dev")
+ echo -n " ifname=$_kdumpdev:$_mac" >> "${initdir}/etc/cmdline.d/41bridge.conf"
fi
_brif+="$_kdumpdev,"
done
@@ -383,10 +384,10 @@ kdump_setup_bond() {
local _netdev="$1"
local _nm_show_cmd="$2"
local _dev _mac _slaves _kdumpdev _bondoptions
- for _dev in $(cat /sys/class/net/$_netdev/bonding/slaves); do
- _mac=$(kdump_get_perm_addr $_dev)
- _kdumpdev=$(kdump_setup_ifname $_dev)
- echo -n " ifname=$_kdumpdev:$_mac" >> ${initdir}/etc/cmdline.d/42bond.conf
+ for _dev in $(cat "/sys/class/net/$_netdev/bonding/slaves"); do
+ _mac=$(kdump_get_perm_addr "$_dev")
+ _kdumpdev=$(kdump_setup_ifname "$_dev")
+ echo -n " ifname=$_kdumpdev:$_mac" >> "${initdir}/etc/cmdline.d/42bond.conf"
_slaves+="$_kdumpdev,"
done
echo -n " bond=$_netdev:${_slaves%,}" >> "${initdir}/etc/cmdline.d/42bond.conf"
@@ -395,8 +396,8 @@ kdump_setup_bond() {
if [[ -z "$_bondoptions" ]]; then
dwarning "Failed to get bond configuration via nmlci output. Now try sourcing ifcfg script."
- source_ifcfg_file $_netdev
- _bondoptions="$(echo $BONDING_OPTS | xargs echo | tr " " ",")"
+ source_ifcfg_file "$_netdev"
+ _bondoptions="$(echo "$BONDING_OPTS" | xargs echo | tr " " ",")"
fi
if [[ -z "$_bondoptions" ]]; then
@@ -404,36 +405,36 @@ kdump_setup_bond() {
exit 1
fi
- echo ":$_bondoptions" >> ${initdir}/etc/cmdline.d/42bond.conf
+ echo ":$_bondoptions" >> "${initdir}/etc/cmdline.d/42bond.conf"
}
kdump_setup_team() {
local _netdev=$1
local _dev _mac _slaves _kdumpdev
- for _dev in $(teamnl $_netdev ports | awk -F':' '{print $2}'); do
- _mac=$(kdump_get_perm_addr $_dev)
- _kdumpdev=$(kdump_setup_ifname $_dev)
- echo -n " ifname=$_kdumpdev:$_mac" >> ${initdir}/etc/cmdline.d/44team.conf
+ for _dev in $(teamnl "$_netdev" ports | awk -F':' '{print $2}'); do
+ _mac=$(kdump_get_perm_addr "$_dev")
+ _kdumpdev=$(kdump_setup_ifname "$_dev")
+ echo -n " ifname=$_kdumpdev:$_mac" >> "${initdir}/etc/cmdline.d/44team.conf"
_slaves+="$_kdumpdev,"
done
echo " team=$_netdev:${_slaves%,}" >> "${initdir}/etc/cmdline.d/44team.conf"
#Buggy version teamdctl outputs to stderr!
#Try to use the latest version of teamd.
- teamdctl "$_netdev" config dump > ${initdir}/tmp/$$-$_netdev.conf
+ teamdctl "$_netdev" config dump > "${initdir}/tmp/$$-$_netdev.conf"
if [[ $? -ne 0 ]]
then
derror "teamdctl failed."
exit 1
fi
inst_dir /etc/teamd
- inst_simple ${initdir}/tmp/$$-$_netdev.conf "/etc/teamd/$_netdev.conf"
- rm -f ${initdir}/tmp/$$-$_netdev.conf
+ inst_simple "${initdir}/tmp/$$-$_netdev.conf" "/etc/teamd/$_netdev.conf"
+ rm -f "${initdir}/tmp/$$-$_netdev.conf"
}
kdump_setup_vlan() {
local _netdev=$1
local _phydev="$(awk '/^Device:/{print $2}' /proc/net/vlan/"$_netdev")"
- local _netmac="$(kdump_get_mac_addr $_phydev)"
+ local _netmac="$(kdump_get_mac_addr "$_phydev")"
local _kdumpdev
#Just support vlan over bond and team
@@ -445,10 +446,10 @@ kdump_setup_vlan() {
if [[ $? != 0 ]]; then
exit 1
fi
- echo " vlan=$(kdump_setup_ifname $_netdev):$_phydev" > ${initdir}/etc/cmdline.d/43vlan.conf
+ echo " vlan=$(kdump_setup_ifname "$_netdev"):$_phydev" > "${initdir}/etc/cmdline.d/43vlan.conf"
else
- _kdumpdev="$(kdump_setup_ifname $_phydev)"
- echo " vlan=$(kdump_setup_ifname $_netdev):$_kdumpdev ifname=$_kdumpdev:$_netmac" > ${initdir}/etc/cmdline.d/43vlan.conf
+ _kdumpdev="$(kdump_setup_ifname "$_phydev")"
+ echo " vlan=$(kdump_setup_ifname "$_netdev"):$_kdumpdev ifname=$_kdumpdev:$_netmac" > "${initdir}/etc/cmdline.d/43vlan.conf"
fi
}
@@ -465,7 +466,7 @@ find_online_znet_device() {
for d in $NETWORK_DEVICES
do
[[ ! -f "$d/online" ]] && continue
- read -r ONLINE < $d/online
+ read -r ONLINE < "$d/online"
if [[ $ONLINE -ne 1 ]]; then
continue
fi
@@ -473,10 +474,10 @@ find_online_znet_device() {
# device is online)
if [[ -f $d/if_name ]]
then
- read -r ifname < $d/if_name
+ read -r ifname < "$d/if_name"
elif [[ -d $d/net ]]
then
- ifname=$(ls $d/net/)
+ ifname=$(ls "$d/net/")
fi
[[ -n "$ifname" ]] && break
done
@@ -500,7 +501,7 @@ kdump_setup_znet() {
if [[ -z "$NETTYPE" || -z "$SUBCHANNELS" || -z "$_options" ]]; then
dwarning "Failed to get znet configuration via nmlci output. Now try sourcing ifcfg script."
- source_ifcfg_file $_netdev
+ source_ifcfg_file "$_netdev"
for i in $OPTIONS; do
_options=${_options},$i
done
@@ -510,17 +511,17 @@ kdump_setup_znet() {
exit 1
fi
- echo rd.znet=${NETTYPE},${SUBCHANNELS},${_options} rd.znet_ifname=$_netdev:${SUBCHANNELS} > ${initdir}/etc/cmdline.d/30znet.conf
+ echo "rd.znet=${NETTYPE},${SUBCHANNELS},${_options} rd.znet_ifname=$_netdev:${SUBCHANNELS}" > "${initdir}/etc/cmdline.d/30znet.conf"
}
kdump_get_ip_route()
{
- local _route=$(/sbin/ip -o route get to $1 2>&1)
+ local _route=$(/sbin/ip -o route get to "$1" 2>&1)
if [[ $? != 0 ]]; then
derror "Bad kdump network destination: $1"
exit 1
fi
- echo $_route
+ echo "$_route"
}
kdump_get_ip_route_field()
@@ -530,15 +531,15 @@ kdump_get_ip_route_field()
kdump_get_remote_ip()
{
- local _remote=$(get_remote_host $1) _remote_temp
- if is_hostname $_remote; then
- _remote_temp=$(getent ahosts $_remote | grep -v : | head -n 1)
+ local _remote=$(get_remote_host "$1") _remote_temp
+ if is_hostname "$_remote"; then
+ _remote_temp=$(getent ahosts "$_remote" | grep -v : | head -n 1)
if [[ -z "$_remote_temp" ]]; then
- _remote_temp=$(getent ahosts $_remote | head -n 1)
+ _remote_temp=$(getent ahosts "$_remote" | head -n 1)
fi
- _remote=$(echo $_remote_temp | cut -d' ' -f1)
+ _remote=$(echo "$_remote_temp" | awk '{print $1}')
fi
- echo $_remote
+ echo "$_remote"
}
# Setup dracut to bring up network interface that enable
@@ -549,13 +550,13 @@ kdump_install_net() {
local _static _proto _ip_conf _ip_opts _ifname_opts
local _znet_netdev _nm_show_cmd_znet
- _destaddr=$(kdump_get_remote_ip $1)
- _route=$(kdump_get_ip_route $_destaddr)
+ _destaddr=$(kdump_get_remote_ip "$1")
+ _route=$(kdump_get_ip_route "$_destaddr")
_srcaddr=$(kdump_get_ip_route_field "$_route" "src")
_netdev=$(kdump_get_ip_route_field "$_route" "dev")
_nm_show_cmd=$(get_nmcli_connection_show_cmd_by_ifname "$_netdev")
- _netmac=$(kdump_get_mac_addr $_netdev)
- kdumpnic=$(kdump_setup_ifname $_netdev)
+ _netmac=$(kdump_get_mac_addr "$_netdev")
+ kdumpnic=$(kdump_setup_ifname "$_netdev")
_znet_netdev=$(find_online_znet_device)
if [[ -n "$_znet_netdev" ]]; then
@@ -567,10 +568,10 @@ kdump_install_net() {
fi
fi
- _static=$(kdump_static_ip $_netdev $_srcaddr $kdumpnic)
+ _static=$(kdump_static_ip "$_netdev" "$_srcaddr" "$kdumpnic")
if [[ -n "$_static" ]]; then
_proto=none
- elif is_ipv6_address $_srcaddr; then
+ elif is_ipv6_address "$_srcaddr"; then
_proto=auto6
else
_proto=dhcp
@@ -583,9 +584,9 @@ kdump_install_net() {
# so we have to avoid adding duplicates
# We should also check /proc/cmdline for existing ip=xx arg.
# For example, iscsi boot will specify ip=xxx arg in cmdline.
- if [[ ! -f $_ip_conf ]] || ! grep -q $_ip_opts $_ip_conf &&\
+ if [[ ! -f $_ip_conf ]] || ! grep -q "$_ip_opts" "$_ip_conf" &&\
! grep -q "ip=[^[:space:]]*$_netdev" /proc/cmdline; then
- echo "$_ip_opts" >> $_ip_conf
+ echo "$_ip_opts" >> "$_ip_conf"
fi
if kdump_is_bridge "$_netdev"; then
@@ -601,14 +602,14 @@ kdump_install_net() {
kdump_setup_vlan "$_netdev"
else
_ifname_opts=" ifname=$kdumpnic:$_netmac"
- echo "$_ifname_opts" >> $_ip_conf
+ echo "$_ifname_opts" >> "$_ip_conf"
fi
kdump_setup_dns "$_netdev" "$_nm_show_cmd"
if [[ ! -f ${initdir}/etc/cmdline.d/50neednet.conf ]]; then
# network-manager module needs this parameter
- echo "rd.neednet" >> ${initdir}/etc/cmdline.d/50neednet.conf
+ echo "rd.neednet" >> "${initdir}/etc/cmdline.d/50neednet.conf"
fi
# Save netdev used for kdump as cmdline
@@ -620,8 +621,8 @@ kdump_install_net() {
# gateway.
if [[ ! -f ${initdir}/etc/cmdline.d/60kdumpnic.conf ]] &&
[[ ! -f ${initdir}/etc/cmdline.d/70bootdev.conf ]]; then
- echo "kdumpnic=$kdumpnic" > ${initdir}/etc/cmdline.d/60kdumpnic.conf
- echo "bootdev=$kdumpnic" > ${initdir}/etc/cmdline.d/70bootdev.conf
+ echo "kdumpnic=$kdumpnic" > "${initdir}/etc/cmdline.d/60kdumpnic.conf"
+ echo "bootdev=$kdumpnic" > "${initdir}/etc/cmdline.d/70bootdev.conf"
fi
}
@@ -630,7 +631,7 @@ kdump_install_pre_post_conf() {
if [[ -d /etc/kdump/pre.d ]]; then
for file in /etc/kdump/pre.d/*; do
if [[ -x "$file" ]]; then
- dracut_install $file
+ dracut_install "$file"
elif [[ $file != "/etc/kdump/pre.d/*" ]]; then
echo "$file is not executable"
fi
@@ -640,7 +641,7 @@ kdump_install_pre_post_conf() {
if [[ -d /etc/kdump/post.d ]]; then
for file in /etc/kdump/post.d/*; do
if [[ -x "$file" ]]; then
- dracut_install $file
+ dracut_install "$file"
elif [[ $file != "/etc/kdump/post.d/*" ]]; then
echo "$file is not executable"
fi
@@ -655,19 +656,19 @@ default_dump_target_install_conf()
is_user_configured_dump_target && return
- _save_path=$(get_bind_mount_source $(get_save_path))
- _target=$(get_target_from_path $_save_path)
- _mntpoint=$(get_mntpoint_from_target $_target)
+ _save_path=$(get_bind_mount_source "$(get_save_path)")
+ _target=$(get_target_from_path "$_save_path")
+ _mntpoint=$(get_mntpoint_from_target "$_target")
- _fstype=$(get_fs_type_from_target $_target)
- if is_fs_type_nfs $_fstype; then
+ _fstype=$(get_fs_type_from_target "$_target")
+ if is_fs_type_nfs "$_fstype"; then
kdump_install_net "$_target"
_fstype="nfs"
else
- _target=$(kdump_get_persistent_dev $_target)
+ _target=$(kdump_get_persistent_dev "$_target")
fi
- echo "$_fstype $_target" >> ${initdir}/tmp/$$-kdump.conf
+ echo "$_fstype $_target" >> "${initdir}/tmp/$$-kdump.conf"
# don't touch the path under root mount
if [[ "$_mntpoint" != "/" ]]; then
@@ -675,8 +676,8 @@ default_dump_target_install_conf()
fi
#erase the old path line, then insert the parsed path
- sed -i "/^path/d" ${initdir}/tmp/$$-kdump.conf
- echo "path $_save_path" >> ${initdir}/tmp/$$-kdump.conf
+ sed -i "/^path/d" "${initdir}/tmp/$$-kdump.conf"
+ echo "path $_save_path" >> "${initdir}/tmp/$$-kdump.conf"
}
#install kdump.conf and what user specifies in kdump.conf
@@ -690,12 +691,12 @@ kdump_install_conf() {
# remove inline comments after the end of a directive.
case "$_opt" in
raw)
- _pdev=$(persistent_policy="by-id" kdump_get_persistent_dev $_val)
- sed -i -e "s#^${_opt}[[:space:]]\+$_val#$_opt $_pdev#" ${initdir}/tmp/$$-kdump.conf
+ _pdev=$(persistent_policy="by-id" kdump_get_persistent_dev "$_val")
+ sed -i -e "s#^${_opt}[[:space:]]\+$_val#$_opt $_pdev#" "${initdir}/tmp/$$-kdump.conf"
;;
ext[234]|xfs|btrfs|minix)
- _pdev=$(kdump_get_persistent_dev $_val)
- sed -i -e "s#^${_opt}[[:space:]]\+$_val#$_opt $_pdev#" ${initdir}/tmp/$$-kdump.conf
+ _pdev=$(kdump_get_persistent_dev "$_val")
+ sed -i -e "s#^${_opt}[[:space:]]\+$_val#$_opt $_pdev#" "${initdir}/tmp/$$-kdump.conf"
;;
ssh|nfs)
kdump_install_net "$_val"
@@ -706,7 +707,7 @@ kdump_install_conf() {
fi
;;
kdump_pre|kdump_post|extra_bins)
- dracut_install $_val
+ dracut_install "$_val"
;;
core_collector)
dracut_install "${_val%%[[:blank:]]*}"
@@ -720,7 +721,7 @@ kdump_install_conf() {
kdump_configure_fence_kdump "${initdir}/tmp/$$-kdump.conf"
inst "${initdir}/tmp/$$-kdump.conf" "/etc/kdump.conf"
- rm -f ${initdir}/tmp/$$-kdump.conf
+ rm -f "${initdir}/tmp/$$-kdump.conf"
}
# Default sysctl parameters should suffice for kdump kernel.
@@ -742,9 +743,9 @@ kdump_iscsi_get_rec_val() {
# The open-iscsi 742 release changed to using flat files in
# /var/lib/iscsi.
- result=$(/sbin/iscsiadm --show -m session -r ${1} | grep "^${2} = ")
+ result=$(/sbin/iscsiadm --show -m session -r "$1" | grep "^${2} = ")
result=${result##* = }
- echo $result
+ echo "$result"
}
kdump_get_iscsi_initiator() {
@@ -770,7 +771,7 @@ kdump_get_iscsi_initiator() {
# Figure out iBFT session according to session type
is_ibft() {
- [[ "$(kdump_iscsi_get_rec_val $1 "node.discovery_type")" = fw ]]
+ [[ "$(kdump_iscsi_get_rec_val "$1" "node.discovery_type")" = fw ]]
}
kdump_setup_iscsi_device() {
@@ -786,32 +787,32 @@ kdump_setup_iscsi_device() {
# Check once before getting explicit values, so we can bail out early,
# e.g. in case of pure-hardware(all-offload) iscsi.
- if ! /sbin/iscsiadm -m session -r ${path} &>/dev/null ; then
+ if ! /sbin/iscsiadm -m session -r "$path" &>/dev/null ; then
return 1
fi
- if is_ibft ${path}; then
+ if is_ibft "$path"; then
return
fi
# Remove software iscsi cmdline generated by 95iscsi,
# and let kdump regenerate here.
- rm -f ${initdir}/etc/cmdline.d/95iscsi.conf
+ rm -f "${initdir}/etc/cmdline.d/95iscsi.conf"
- tgt_name=$(kdump_iscsi_get_rec_val ${path} "node.name")
- tgt_ipaddr=$(kdump_iscsi_get_rec_val ${path} "node.conn\[0\].address")
+ tgt_name=$(kdump_iscsi_get_rec_val "$path" "node.name")
+ tgt_ipaddr=$(kdump_iscsi_get_rec_val "$path" "node.conn\[0\].address")
# get and set username and password details
- username=$(kdump_iscsi_get_rec_val ${path} "node.session.auth.username")
+ username=$(kdump_iscsi_get_rec_val "$path" "node.session.auth.username")
[[ "$username" == "<empty>" ]] && username=""
- password=$(kdump_iscsi_get_rec_val ${path} "node.session.auth.password")
+ password=$(kdump_iscsi_get_rec_val "$path" "node.session.auth.password")
[[ "$password" == "<empty>" ]] && password=""
- username_in=$(kdump_iscsi_get_rec_val ${path} "node.session.auth.username_in")
+ username_in=$(kdump_iscsi_get_rec_val "$path" "node.session.auth.username_in")
[[ -n "$username" ]] && userpwd_str="$username:$password"
# get and set incoming username and password details
[[ "$username_in" == "<empty>" ]] && username_in=""
- password_in=$(kdump_iscsi_get_rec_val ${path} "node.session.auth.password_in")
+ password_in=$(kdump_iscsi_get_rec_val "$path" "node.session.auth.password_in")
[[ "$password_in" == "<empty>" ]] && password_in=""
[[ -n "$username_in" ]] && userpwd_in_str=":$username_in:$password_in"
@@ -822,16 +823,16 @@ kdump_setup_iscsi_device() {
# FIXME: Do we need to parse and set other parameters like protocol, port
# iscsi_iface_name, netdev_name, LUN etc.
- if is_ipv6_address $tgt_ipaddr; then
+ if is_ipv6_address "$tgt_ipaddr"; then
tgt_ipaddr="[$tgt_ipaddr]"
fi
netroot_str="netroot=iscsi:${userpwd_str}${userpwd_in_str}@$tgt_ipaddr::::$tgt_name"
- [[ -f $netroot_conf ]] || touch $netroot_conf
+ [[ -f $netroot_conf ]] || touch "$netroot_conf"
# If netroot target does not exist already, append.
- if ! grep -q $netroot_str $netroot_conf; then
- echo $netroot_str >> $netroot_conf
+ if ! grep -q "$netroot_str" "$netroot_conf"; then
+ echo "$netroot_str" >> "$netroot_conf"
dinfo "Appended $netroot_str to $netroot_conf"
fi
@@ -840,9 +841,9 @@ kdump_setup_iscsi_device() {
[[ $? -ne "0" ]] && derror "Failed to get initiator name" && return 1
# If initiator details do not exist already, append.
- if ! grep -q "$initiator_str" $netroot_conf; then
- echo "$initiator_str" >> $netroot_conf
- dinfo "Appended "$initiator_str" to $netroot_conf"
+ if ! grep -q "$initiator_str" "$netroot_conf"; then
+ echo "$initiator_str" >> "$netroot_conf"
+ dinfo "Appended $initiator_str to $netroot_conf"
fi
}
@@ -877,13 +878,13 @@ get_alias() {
for ip in $ips
do
# in /etc/hosts, alias can come at the 2nd column
- entries=$(grep $ip /etc/hosts | awk '{ $1=""; print $0 }')
+ entries=$(grep "$ip" /etc/hosts | awk '{ $1=""; print $0 }')
if [[ $? -eq 0 ]]; then
alias_set="$alias_set $entries"
fi
done
- echo $alias_set
+ echo "$alias_set"
}
is_localhost() {
@@ -914,23 +915,23 @@ get_pcs_fence_kdump_nodes() {
# we need to convert each to node1, node2 ... nodeX in each iteration
for node in ${nodelist}; do
# convert $node from 'uname="nodeX"' to 'nodeX'
- eval $node
- nodename=$uname
+ eval "$node"
+ nodename="$uname"
# Skip its own node name
- if is_localhost $nodename; then
+ if is_localhost "$nodename"; then
continue
fi
nodes="$nodes $nodename"
done
- echo $nodes
+ echo "$nodes"
}
# retrieves fence_kdump args from config file
get_pcs_fence_kdump_args() {
if [[ -f $FENCE_KDUMP_CONFIG_FILE ]]; then
- . $FENCE_KDUMP_CONFIG_FILE
- echo $FENCE_KDUMP_OPTS
+ . "$FENCE_KDUMP_CONFIG_FILE"
+ echo "$FENCE_KDUMP_OPTS"
fi
}
@@ -941,12 +942,12 @@ get_generic_fence_kdump_nodes() {
nodes=$(kdump_get_conf_val "fence_kdump_nodes")
for node in ${nodes}; do
# Skip its own node name
- if is_localhost $node; then
+ if is_localhost "$node"; then
continue
fi
filtered="$filtered $node"
done
- echo $filtered
+ echo "$filtered"
}
# setup fence_kdump in cluster
@@ -963,11 +964,11 @@ kdump_configure_fence_kdump () {
nodes=$(get_pcs_fence_kdump_nodes)
# set appropriate options in kdump.conf
- echo "fence_kdump_nodes $nodes" >> ${kdump_cfg_file}
+ echo "fence_kdump_nodes $nodes" >> "${kdump_cfg_file}"
args=$(get_pcs_fence_kdump_args)
if [[ -n "$args" ]]; then
- echo "fence_kdump_args $args" >> ${kdump_cfg_file}
+ echo "fence_kdump_args $args" >> "${kdump_cfg_file}"
fi
else
@@ -977,12 +978,12 @@ kdump_configure_fence_kdump () {
# setup network for each node
for node in ${nodes}; do
- kdump_install_net $node
+ kdump_install_net "$node"
done
dracut_install /etc/hosts
dracut_install /etc/nsswitch.conf
- dracut_install $FENCE_KDUMP_SEND
+ dracut_install "$FENCE_KDUMP_SEND"
}
# Install a random seed used to feed /dev/urandom
@@ -992,32 +993,32 @@ kdump_install_random_seed() {
poolsize=$(</proc/sys/kernel/random/poolsize)
- if [[ ! -d ${initdir}/var/lib/ ]]; then
- mkdir -p ${initdir}/var/lib/
+ if [[ ! -d "${initdir}/var/lib/" ]]; then
+ mkdir -p "${initdir}/var/lib/"
fi
- dd if=/dev/urandom of=${initdir}/var/lib/random-seed \
- bs=$poolsize count=1 2> /dev/null
+ dd if=/dev/urandom of="${initdir}/var/lib/random-seed" \
+ bs="$poolsize" count=1 2> /dev/null
}
kdump_install_systemd_conf() {
# Kdump turns out to require longer default systemd mount timeout
# than 1st kernel(90s by default), we use default 300s for kdump.
- grep -r "^[[:space:]]*DefaultTimeoutStartSec=" ${initdir}/etc/systemd/system.conf* &>/dev/null
+ grep -r "^[[:space:]]*DefaultTimeoutStartSec=" "${initdir}/etc/systemd/system.conf"* &>/dev/null
if [[ $? -ne 0 ]]; then
- mkdir -p ${initdir}/etc/systemd/system.conf.d
- echo "[Manager]" > ${initdir}/etc/systemd/system.conf.d/kdump.conf
- echo "DefaultTimeoutStartSec=300s" >> ${initdir}/etc/systemd/system.conf.d/kdump.conf
+ mkdir -p "${initdir}/etc/systemd/system.conf.d"
+ echo "[Manager]" > "${initdir}/etc/systemd/system.conf.d/kdump.conf"
+ echo "DefaultTimeoutStartSec=300s" >> "${initdir}/etc/systemd/system.conf.d/kdump.conf"
fi
# Forward logs to console directly, and don't read Kmsg, this avoids
# unneccessary memory consumption and make console output more useful.
# Only do so for non fadump image.
- mkdir -p ${initdir}/etc/systemd/journald.conf.d
- echo "[Journal]" > ${initdir}/etc/systemd/journald.conf.d/kdump.conf
- echo "Storage=volatile" >> ${initdir}/etc/systemd/journald.conf.d/kdump.conf
- echo "ReadKMsg=no" >> ${initdir}/etc/systemd/journald.conf.d/kdump.conf
- echo "ForwardToConsole=yes" >> ${initdir}/etc/systemd/journald.conf.d/kdump.conf
+ mkdir -p "${initdir}/etc/systemd/journald.conf.d"
+ echo "[Journal]" > "${initdir}/etc/systemd/journald.conf.d/kdump.conf"
+ echo "Storage=volatile" >> "${initdir}/etc/systemd/journald.conf.d/kdump.conf"
+ echo "ReadKMsg=no" >> "${initdir}/etc/systemd/journald.conf.d/kdump.conf"
+ echo "ForwardToConsole=yes" >> "${initdir}/etc/systemd/journald.conf.d/kdump.conf"
}
install() {
@@ -1030,7 +1031,7 @@ install() {
fi
dracut_install -o /etc/adjtime /etc/localtime
inst "$moddir/monitor_dd_progress" "/kdumpscripts/monitor_dd_progress"
- chmod +x ${initdir}/kdumpscripts/monitor_dd_progress
+ chmod +x "${initdir}/kdumpscripts/monitor_dd_progress"
inst "/bin/dd" "/bin/dd"
inst "/bin/tail" "/bin/tail"
inst "/bin/date" "/bin/date"
@@ -1076,7 +1077,7 @@ install() {
# actually does nothing.
sed -i -e \
's/\(^[[:space:]]*reserved_memory[[:space:]]*=\)[[:space:]]*[[:digit:]]*/\1 1024/' \
- ${initdir}/etc/lvm/lvm.conf &>/dev/null
+ "${initdir}/etc/lvm/lvm.conf" &>/dev/null
# Save more memory by dropping switch root capability
dracut_no_switch_root
diff --git a/kdumpctl b/kdumpctl
index 11782df..ed6dc3a 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -78,11 +78,11 @@ save_core()
{
coredir="/var/crash/$(date +"%Y-%m-%d-%H:%M")"
- mkdir -p $coredir
+ mkdir -p "$coredir"
ddebug "cp --sparse=always /proc/vmcore $coredir/vmcore-incomplete"
- cp --sparse=always /proc/vmcore $coredir/vmcore-incomplete
+ cp --sparse=always /proc/vmcore "$coredir/vmcore-incomplete"
if [[ $? == 0 ]]; then
- mv $coredir/vmcore-incomplete $coredir/vmcore
+ mv "$coredir/vmcore-incomplete" "$coredir/vmcore"
dinfo "saved a vmcore to $coredir"
else
derror "failed to save a vmcore to $coredir"
@@ -93,9 +93,9 @@ save_core()
# https://fedorahosted.org/abrt/
if [[ -x /usr/bin/dumpoops ]]; then
ddebug "makedumpfile --dump-dmesg $coredir/vmcore $coredir/dmesg"
- makedumpfile --dump-dmesg $coredir/vmcore $coredir/dmesg >/dev/null 2>&1
+ makedumpfile --dump-dmesg "$coredir/vmcore" "$coredir/dmesg" >/dev/null 2>&1
ddebug "dumpoops -d $coredir/dmesg"
- dumpoops -d $coredir/dmesg >/dev/null 2>&1
+ dumpoops -d "$coredir/dmesg" >/dev/null 2>&1
if [[ $? == 0 ]]; then
dinfo "kernel oops has been collected by abrt tool"
fi
@@ -121,7 +121,7 @@ check_earlykdump_is_enabled()
rebuild_kdump_initrd()
{
ddebug "rebuild kdump initrd: $MKDUMPRD $TARGET_INITRD $KDUMP_KERNELVER"
- $MKDUMPRD $TARGET_INITRD $KDUMP_KERNELVER
+ $MKDUMPRD "$TARGET_INITRD" "$KDUMP_KERNELVER"
if [[ $? != 0 ]]; then
derror "mkdumprd: failed to make kdump initrd"
return 1
@@ -136,8 +136,8 @@ rebuild_kdump_initrd()
rebuild_initrd()
{
- if [[ ! -w $(dirname $TARGET_INITRD) ]];then
- derror "$(dirname $TARGET_INITRD) does not have write permission. Cannot rebuild $TARGET_INITRD"
+ if [[ ! -w $(dirname "$TARGET_INITRD") ]];then
+ derror "$(dirname "$TARGET_INITRD") does not have write permission. Cannot rebuild $TARGET_INITRD"
return 1
fi
@@ -183,11 +183,11 @@ backup_default_initrd()
if [[ ! -e $DEFAULT_INITRD_BAK ]]; then
dinfo "Backing up $DEFAULT_INITRD before rebuild."
# save checksum to verify before restoring
- sha1sum $DEFAULT_INITRD > $INITRD_CHECKSUM_LOCATION
- cp $DEFAULT_INITRD $DEFAULT_INITRD_BAK
+ sha1sum "$DEFAULT_INITRD" > "$INITRD_CHECKSUM_LOCATION"
+ cp "$DEFAULT_INITRD" "$DEFAULT_INITRD_BAK"
if [[ $? -ne 0 ]]; then
dwarn "WARNING: failed to backup $DEFAULT_INITRD."
- rm -f $DEFAULT_INITRD_BAK
+ rm -f "$DEFAULT_INITRD_BAK"
fi
fi
}
@@ -210,7 +210,7 @@ restore_default_initrd()
dwarn "WARNING: checksum mismatch! Can't restore original initrd.."
else
rm -f $INITRD_CHECKSUM_LOCATION
- mv $DEFAULT_INITRD_BAK $DEFAULT_INITRD
+ mv "$DEFAULT_INITRD_BAK" "$DEFAULT_INITRD"
if [[ $? -eq 0 ]]; then
derror "Restoring original initrd as fadump mode is disabled."
sync
@@ -226,7 +226,7 @@ check_config()
case "$config_opt" in
dracut_args)
if [[ $config_val == *--mount* ]]; then
- if [[ $(echo $config_val | grep -o "\-\-mount" | wc -l) -ne 1 ]]; then
+ if [[ $(echo "$config_val" | grep -o "\-\-mount" | wc -l) -ne 1 ]]; then
derror "Multiple mount targets specified in one \"dracut_args\"."
return 1
fi
@@ -297,13 +297,13 @@ get_pcs_cluster_modified_files()
fi
if [[ -f $FENCE_KDUMP_CONFIG_FILE ]]; then
- time_stamp=$(stat -c "%Y" $FENCE_KDUMP_CONFIG_FILE)
+ time_stamp=$(stat -c "%Y" "$FENCE_KDUMP_CONFIG_FILE")
if [[ "$time_stamp" -gt "$image_time" ]]; then
modified_files="$modified_files $FENCE_KDUMP_CONFIG_FILE"
fi
fi
- echo $modified_files
+ echo "$modified_files"
}
setup_initrd()
@@ -314,7 +314,7 @@ setup_initrd()
return 1
fi
- DEFAULT_INITRD_BAK="$KDUMP_BOOTDIR/.$(basename $DEFAULT_INITRD).default"
+ DEFAULT_INITRD_BAK="$KDUMP_BOOTDIR/.$(basename "$DEFAULT_INITRD").default"
if [[ $DEFAULT_DUMP_MODE == "fadump" ]]; then
TARGET_INITRD="$DEFAULT_INITRD"
@@ -357,7 +357,7 @@ check_files_modified()
fi
HOOKS="$HOOKS $POST_FILES $PRE_FILES"
CORE_COLLECTOR=$(kdump_get_conf_val core_collector | awk '{print $1}')
- CORE_COLLECTOR=$(type -P $CORE_COLLECTOR)
+ CORE_COLLECTOR=$(type -P "$CORE_COLLECTOR")
# POST_FILES and PRE_FILES are already checked against executable, need not to check again.
EXTRA_BINS="$EXTRA_BINS $CHECK_FILES"
CHECK_FILES=$(kdump_get_conf_val extra_bins)
@@ -375,8 +375,8 @@ check_files_modified()
_module_file="$(modinfo --set-version "$KDUMP_KERNELVER" --filename "$_module" 2>/dev/null)"
if [[ $? -eq 0 ]]; then
files="$files $_module_file"
- for _dep_modules in $(modinfo -F depends $_module | tr ',' ' '); do
- files="$files $(modinfo --set-version "$KDUMP_KERNELVER" --filename $_dep_modules 2>/dev/null)"
+ for _dep_modules in $(modinfo -F depends "$_module" | tr ',' ' '); do
+ files="$files $(modinfo --set-version "$KDUMP_KERNELVER" --filename "$_dep_modules" 2>/dev/null)"
done
else
# If it's not a module nor builtin, give an error
@@ -394,13 +394,13 @@ check_files_modified()
for file in $files; do
if [[ -e "$file" ]]; then
- time_stamp=$(stat -c "%Y" $file)
+ time_stamp=$(stat -c "%Y" "$file")
if [[ "$time_stamp" -gt "$image_time" ]]; then
modified_files="$modified_files $file"
fi
if [[ -L "$file" ]]; then
- file=$(readlink -m $file)
- time_stamp=$(stat -c "%Y" $file)
+ file=$(readlink -m "$file")
+ time_stamp=$(stat -c "%Y" "$file")
if [[ "$time_stamp" -gt "$image_time" ]]; then
modified_files="$modified_files $file"
fi
@@ -453,8 +453,8 @@ check_drivers_modified()
ddebug "Modules included in old initramfs: '$_old_drivers'"
for _driver in $_new_drivers; do
# Skip deprecated/invalid driver name or built-in module
- _module_name=$(modinfo --set-version "$KDUMP_KERNELVER" -F name $_driver 2>/dev/null)
- _module_filename=$(modinfo --set-version "$KDUMP_KERNELVER" -n $_driver 2>/dev/null)
+ _module_name=$(modinfo --set-version "$KDUMP_KERNELVER" -F name "$_driver" 2>/dev/null)
+ _module_filename=$(modinfo --set-version "$KDUMP_KERNELVER" -n "$_driver" 2>/dev/null)
if [[ $? -ne 0 ]] || [[ -z "$_module_name" ]] || [[ "$_module_filename" = *"(builtin)"* ]]; then
continue
fi
@@ -483,21 +483,21 @@ check_fs_modified()
fi
_target=$(get_block_dump_target)
- _new_fstype=$(get_fs_type_from_target $_target)
+ _new_fstype=$(get_fs_type_from_target "$_target")
if [[ -z "$_target" ]] || [[ -z "$_new_fstype" ]];then
derror "Dump target is invalid"
return 2
fi
ddebug "_target=$_target _new_fstype=$_new_fstype"
- _new_dev=$(kdump_get_persistent_dev $_target)
+ _new_dev=$(kdump_get_persistent_dev "$_target")
if [[ -z "$_new_dev" ]]; then
perror "Get persistent device name failed"
return 2
fi
- _new_mntpoint="$(get_kdump_mntpoint_from_target $_target)"
- _dracut_args=$(lsinitrd $TARGET_INITRD -f usr/lib/dracut/build-parameter.txt)
+ _new_mntpoint="$(get_kdump_mntpoint_from_target "$_target")"
+ _dracut_args=$(lsinitrd "$TARGET_INITRD" -f usr/lib/dracut/build-parameter.txt)
if [[ -z "$_dracut_args" ]];then
dwarn "Warning: No dracut arguments found in initrd"
return 0
@@ -505,13 +505,14 @@ check_fs_modified()
# if --mount argument present then match old and new target, mount
# point and file system. If any of them mismatches then rebuild
- echo $_dracut_args | grep -q "\-\-mount"
+ echo "$_dracut_args" | grep -q "\-\-mount"
if [[ $? -eq 0 ]];then
- set -- $(echo $_dracut_args | awk -F "--mount '" '{print $2}' | cut -d' ' -f1,2,3)
+ # shellcheck disable=SC2046
+ set -- $(echo "$_dracut_args" | awk -F "--mount '" '{print $2}' | cut -d' ' -f1,2,3)
_old_dev=$1
_old_mntpoint=$2
_old_fstype=$3
- [[ $_new_dev = $_old_dev && $_new_mntpoint = $_old_mntpoint && $_new_fstype = $_old_fstype ]] && return 0
+ [[ $_new_dev = "$_old_dev" && $_new_mntpoint = "$_old_mntpoint" && $_new_fstype = "$_old_fstype" ]] && return 0
# otherwise rebuild if target device is not a root device
else
[[ "$_target" = "$(get_root_fs_device)" ]] && return 0
@@ -590,7 +591,7 @@ check_rebuild()
#check to see if dependent files has been modified
#since last build of the image file
if [[ -f $TARGET_INITRD ]]; then
- image_time=$(stat -c "%Y" $TARGET_INITRD 2>/dev/null)
+ image_time=$(stat -c "%Y" "$TARGET_INITRD" 2>/dev/null)
#in case of fadump mode, check whether the default/target
#initrd is already built with dump capture capability
@@ -649,7 +650,7 @@ function remove_kdump_kernel_key()
return
fi
- keyctl unlink $KDUMP_KEY_ID %:.ima
+ keyctl unlink "$KDUMP_KEY_ID" %:.ima
}
# Load the kdump kernel specified in /etc/sysconfig/kdump
@@ -682,9 +683,10 @@ load_kdump()
PS4='+ $(date "+%Y-%m-%d %H:%M:%S") ${BASH_SOURCE}@${LINENO}: '
set -x
+ # shellcheck disable=SC2086
$KEXEC $KEXEC_ARGS $standard_kexec_args \
--command-line="$KDUMP_COMMANDLINE" \
- --initrd=$TARGET_INITRD $KDUMP_KERNEL
+ --initrd="$TARGET_INITRD" "$KDUMP_KERNEL"
ret=$?
set +x
@@ -709,7 +711,7 @@ check_ssh_config()
# remove inline comments after the end of a directive.
if [[ -f "$config_val" ]]; then
# canonicalize the path
- SSH_KEY_LOCATION=$(/usr/bin/readlink -m $config_val)
+ SSH_KEY_LOCATION=$(/usr/bin/readlink -m "$config_val")
else
dwarn "WARNING: '$config_val' doesn't exist, using default value '$SSH_KEY_LOCATION'"
fi
@@ -726,7 +728,7 @@ check_ssh_config()
done <<< "$(kdump_read_conf)"
#make sure they've configured kdump.conf for ssh dumps
- local SSH_TARGET=$(echo -n $DUMP_TARGET | sed -n '/.*@/p')
+ local SSH_TARGET=$(echo -n "$DUMP_TARGET" | sed -n '/.*@/p')
if [[ -z "$SSH_TARGET" ]]; then
return 1
fi
@@ -746,7 +748,7 @@ check_and_wait_network_ready()
local errmsg
while true; do
- errmsg=$(ssh -i $SSH_KEY_LOCATION -o BatchMode=yes $DUMP_TARGET mkdir -p $SAVE_PATH 2>&1)
+ errmsg=$(ssh -i "$SSH_KEY_LOCATION" -o BatchMode=yes "$DUMP_TARGET" mkdir -p "$SAVE_PATH" 2>&1)
retval=$?
# ssh exits with the exit status of the remote command or with 255 if an error occurred
@@ -759,7 +761,7 @@ check_and_wait_network_ready()
# if server removes the authorized_keys or, no /root/.ssh/kdump_id_rsa
ddebug "$errmsg"
- echo $errmsg | grep -q "Permission denied\|No such file or directory\|Host key verification failed"
+ echo "$errmsg" | grep -q "Permission denied\|No such file or directory\|Host key verification failed"
if [[ $? -eq 0 ]]; then
derror "Could not create $DUMP_TARGET:$SAVE_PATH, you probably need to run \"kdumpctl propagate\""
return 1
@@ -808,16 +810,16 @@ propagate_ssh_key()
dinfo "Using existing keys..."
else
dinfo "Generating new ssh keys... "
- /usr/bin/ssh-keygen -t rsa -f $KEYFILE -N "" 2>&1 > /dev/null
+ /usr/bin/ssh-keygen -t rsa -f "$KEYFILE" -N "" 2>&1 > /dev/null
dinfo "done."
fi
#now find the target ssh user and server to contact.
- SSH_USER=$(echo $DUMP_TARGET | cut -d\ -f2 | cut -d@ -f1)
- SSH_SERVER=$(echo $DUMP_TARGET | sed -e's/\(.*(a)\)\(.*$\)/\2/')
+ SSH_USER=$(echo "$DUMP_TARGET" | cut -d@ -f1)
+ SSH_SERVER=$(echo "$DUMP_TARGET" | sed -e's/\(.*(a)\)\(.*$\)/\2/')
#now send the found key to the found server
- ssh-copy-id -i $KEYFILE $SSH_USER@$SSH_SERVER
+ ssh-copy-id -i "$KEYFILE" "$SSH_USER@$SSH_SERVER"
RET=$?
if [[ $RET == 0 ]]; then
dinfo "$KEYFILE has been added to ~$SSH_USER/.ssh/authorized_keys on $SSH_SERVER"
@@ -836,7 +838,7 @@ show_reserved_mem()
mem=$(</sys/kernel/kexec_crash_size)
mem_mb=$((mem / 1024 / 1024))
- dinfo "Reserved "$mem_mb"MB memory for crash kernel"
+ dinfo "Reserved ${mem_mb}MB memory for crash kernel"
}
check_current_fadump_status()
@@ -869,8 +871,8 @@ save_raw()
derror "raw partition $raw_target not found"
return 1
}
- check_fs=$(lsblk --nodeps -npo FSTYPE $raw_target)
- if [[ $(echo $check_fs | wc -w) -ne 0 ]]; then
+ check_fs=$(lsblk --nodeps -npo FSTYPE "$raw_target")
+ if [[ $(echo "$check_fs" | wc -w) -ne 0 ]]; then
dwarn "Warning: Detected '$check_fs' signature on $raw_target, data loss is expected."
return 0
fi
@@ -886,11 +888,11 @@ save_raw()
derror "failed to create $coredir"
return 1
}
- if makedumpfile -R $coredir/vmcore <$raw_target >/dev/null 2>&1; then
+ if makedumpfile -R "$coredir/vmcore" < "$raw_target" >/dev/null 2>&1; then
# dump found
dinfo "Dump saved to $coredir/vmcore"
# wipe makedumpfile header
- dd if=/dev/zero of=$raw_target bs=1b count=1 2>/dev/null
+ dd if=/dev/zero of="$raw_target" bs=1b count=1 2>/dev/null
else
rm -rf "$coredir"
fi
@@ -904,7 +906,7 @@ local_fs_dump_target()
_target=$(grep -E "^ext[234]|^xfs|^btrfs|^minix" /etc/kdump.conf)
if [[ $? -eq 0 ]]; then
- echo $_target|awk '{print $2}'
+ echo "$_target" | awk '{print $2}'
fi
}
@@ -919,7 +921,7 @@ path_to_be_relabeled()
_target=$(local_fs_dump_target)
if [[ -n "$_target" ]]; then
- _mnt=$(get_mntpoint_from_target $_target)
+ _mnt=$(get_mntpoint_from_target "$_target")
if ! is_mounted "$_mnt"; then
return
fi
@@ -930,9 +932,9 @@ path_to_be_relabeled()
_path=$(get_save_path)
# if $_path is masked by other mount, we will not relabel it.
- _rmnt=$(df $_mnt/$_path 2>/dev/null | tail -1 | awk '{ print $NF }')
+ _rmnt=$(df "$_mnt/$_path" 2>/dev/null | tail -1 | awk '{ print $NF }')
if [[ "$_rmnt" == "$_mnt" ]]; then
- echo $_mnt/$_path
+ echo "$_mnt/$_path"
fi
}
diff --git a/mkdumprd b/mkdumprd
index 3101d3f..b5cc39e 100644
--- a/mkdumprd
+++ b/mkdumprd
@@ -60,9 +60,9 @@ add_dracut_sshkey() {
to_mount() {
local _target=$1 _fstype=$2 _options=$3 _sed_cmd _new_mntpoint _pdev
- _new_mntpoint=$(get_kdump_mntpoint_from_target $_target)
- _fstype="${_fstype:-$(get_fs_type_from_target $_target)}"
- _options="${_options:-$(get_mntopt_from_target $_target)}"
+ _new_mntpoint=$(get_kdump_mntpoint_from_target "$_target")
+ _fstype="${_fstype:-$(get_fs_type_from_target "$_target")}"
+ _options="${_options:-$(get_mntopt_from_target "$_target")}"
_options="${_options:-defaults}"
if [[ "$_fstype" == "nfs"* ]]; then
@@ -72,8 +72,8 @@ to_mount() {
_sed_cmd+='s/,clientaddr=[^,]*//;'
else
# for non-nfs _target converting to use udev persistent name
- _pdev="$(kdump_get_persistent_dev $_target)"
- if [[ -z "$_pdev" ]]; then
+ _pdev="$(kdump_get_persistent_dev "$_target")"
+ if [[ -z $_pdev ]]; then
return 1
fi
fi
@@ -114,19 +114,19 @@ mkdir_save_path_ssh()
{
local _opt _dir
_opt=(-i "$SSH_KEY_LOCATION" -o BatchMode=yes -o StrictHostKeyChecking=yes)
- ssh -qn "${_opt[@]}" $1 mkdir -p $SAVE_PATH 2>&1 > /dev/null
+ ssh -qn "${_opt[@]}" "$1" mkdir -p "$SAVE_PATH" 2>&1 > /dev/null
_ret=$?
if [[ $_ret -ne 0 ]]; then
perror_exit "mkdir failed on $1:$SAVE_PATH"
fi
#check whether user has write permission on $1:$SAVE_PATH
- _dir=$(ssh -qn "${_opt[@]}" $1 mktemp -dqp $SAVE_PATH 2>/dev/null)
+ _dir=$(ssh -qn "${_opt[@]}" "$1" mktemp -dqp "$SAVE_PATH" 2>/dev/null)
_ret=$?
if [[ $_ret -ne 0 ]]; then
perror_exit "Could not create temporary directory on $1:$SAVE_PATH. Make sure user has write permission on destination"
fi
- ssh -qn "${_opt[@]}" $1 rmdir $_dir
+ ssh -qn "${_opt[@]}" "$1" rmdir "$_dir"
return 0
}
@@ -168,7 +168,7 @@ check_size() {
perror_exit "Check dump target size failed"
fi
- if [[ $avail -lt $memtotal ]]; then
+ if [[ "$avail" -lt "$memtotal" ]]; then
dwarn "Warning: There might not be enough space to save a vmcore."
dwarn " The size of $2 should be greater than $memtotal kilo bytes."
fi
@@ -206,9 +206,9 @@ mount_failure()
check_user_configured_target()
{
local _target=$1 _cfg_fs_type=$2 _mounted
- local _mnt=$(get_mntpoint_from_target $_target)
- local _opt=$(get_mntopt_from_target $_target)
- local _fstype=$(get_fs_type_from_target $_target)
+ local _mnt=$(get_mntpoint_from_target "$_target")
+ local _opt=$(get_mntopt_from_target "$_target")
+ local _fstype=$(get_fs_type_from_target "$_target")
if [[ -n "$_fstype" ]]; then
# In case of nfs4, nfs should be used instead, nfs* options is deprecated in kdump.conf
@@ -227,7 +227,7 @@ check_user_configured_target()
if [[ -n "$_mnt" ]]; then
if ! is_mounted "$_mnt"; then
if [[ $_opt = *",noauto"* ]]; then
- mount $_mnt
+ mount "$_mnt"
[[ $? -ne 0 ]] && mount_failure "$_target" "$_mnt" "$_fstype"
_mounted=$_mnt
else
@@ -236,8 +236,8 @@ check_user_configured_target()
fi
else
_mnt=$MKDUMPRD_TMPMNT
- mkdir -p $_mnt
- mount $_target $_mnt -t $_fstype -o defaults
+ mkdir -p "$_mnt"
+ mount "$_target" "$_mnt" -t "$_fstype" -o defaults
[[ $? -ne 0 ]] && mount_failure "$_target" "" "$_fstype"
_mounted=$_mnt
fi
@@ -251,7 +251,7 @@ check_user_configured_target()
# Unmount it early, if function is interrupted and didn't reach here, the shell trap will clear it up anyway
if [[ -n "$_mounted" ]]; then
- umount -f -- $_mounted
+ umount -f -- "$_mounted"
fi
}
@@ -276,13 +276,14 @@ verify_core_collector() {
_params="$_params vmcore dumpfile"
fi
+ # shellcheck disable=SC2086
if ! $_cmd --check-params $_params; then
perror_exit "makedumpfile parameter check failed."
fi
}
add_mount() {
- local _mnt=$(to_mount $@)
+ local _mnt=$(to_mount "$@")
if [[ $? -ne 0 ]]; then
exit 1
@@ -299,15 +300,15 @@ handle_default_dump_target()
is_user_configured_dump_target && return
- check_save_path_fs $SAVE_PATH
+ check_save_path_fs "$SAVE_PATH"
- _save_path=$(get_bind_mount_source $SAVE_PATH)
- _target=$(get_target_from_path $_save_path)
- _mntpoint=$(get_mntpoint_from_target $_target)
+ _save_path=$(get_bind_mount_source "$SAVE_PATH")
+ _target=$(get_target_from_path "$_save_path")
+ _mntpoint=$(get_mntpoint_from_target "$_target")
SAVE_PATH=${_save_path##"$_mntpoint"}
add_mount "$_target"
- check_size fs $_target
+ check_size fs "$_target"
}
# $1: function name
@@ -317,8 +318,8 @@ for_each_block_target()
for dev in $(get_kdump_targets); do
[[ -b "$dev" ]] || continue
- majmin=$(get_maj_min $dev)
- check_block_and_slaves $1 $majmin && return 1
+ majmin=$(get_maj_min "$dev")
+ check_block_and_slaves "$1" "$majmin" && return 1
done
return 0
@@ -328,14 +329,14 @@ for_each_block_target()
#return false if unresettable.
is_unresettable()
{
- local path="/sys/$(udevadm info --query=all --path=/sys/dev/block/$1 | awk '/^P:/ {print $2}' | sed -e 's/\(cciss[0-9]\+\/\).*/\1/g' -e 's/\/block\/.*$//')/resettable"
+ local path="/sys/$(udevadm info --query=all --path="/sys/dev/block/$1" | awk '/^P:/ {print $2}' | sed -e 's/\(cciss[0-9]\+\/\).*/\1/g' -e 's/\/block\/.*$//')/resettable"
local resettable=1
if [[ -f "$path" ]]
then
resettable="$(<"$path")"
[[ $resettable -eq 0 ]] && [[ "$OVERRIDE_RESETTABLE" -eq 0 ]] && {
- local device=$(udevadm info --query=all --path=/sys/dev/block/$1 | awk -F= '/DEVNAME/{print $2}')
+ local device=$(udevadm info --query=all --path="/sys/dev/block/$1" | awk -F= '/DEVNAME/{print $2}')
derror "Error: Can not save vmcore because device $device is unresettable"
return 0
}
@@ -387,7 +388,7 @@ fi
keyfile=$(kdump_get_conf_val sshkey)
if [[ -f "$keyfile" ]]; then
# canonicalize the path
- SSH_KEY_LOCATION=$(/usr/bin/readlink -m $keyfile)
+ SSH_KEY_LOCATION=$(/usr/bin/readlink -m "$keyfile")
fi
while read -r config_opt config_val;
@@ -403,21 +404,21 @@ do
;;
raw)
# checking raw disk writable
- dd if=$config_val count=1 of=/dev/null > /dev/null 2>&1 || {
+ dd if="$config_val" count=1 of=/dev/null > /dev/null 2>&1 || {
perror_exit "Bad raw disk $config_val"
}
- _praw=$(persistent_policy="by-id" kdump_get_persistent_dev $config_val)
- if [[ -z "$_praw" ]]; then
+ _praw=$(persistent_policy="by-id" kdump_get_persistent_dev "$config_val")
+ if [[ -z $_praw ]]; then
exit 1
fi
add_dracut_arg "--device" "$_praw"
- check_size raw $config_val
+ check_size raw "$config_val"
;;
ssh)
if strstr "$config_val" "@";
then
- mkdir_save_path_ssh $config_val
- check_size ssh $config_val
+ mkdir_save_path_ssh "$config_val"
+ check_size ssh "$config_val"
add_dracut_sshkey "$SSH_KEY_LOCATION"
else
perror_exit "Bad ssh dump target $config_val"
@@ -451,7 +452,7 @@ fi
if ! is_fadump_capable; then
# The 2nd rootfs mount stays behind the normal dump target mount,
# so it doesn't affect the logic of check_dump_fs_modified().
- is_dump_to_rootfs && add_mount "$(to_dev_name $(get_root_fs_device))"
+ is_dump_to_rootfs && add_mount "$(to_dev_name "$(get_root_fs_device)")"
add_dracut_arg "--no-hostonly-default-device"
fi
commit 70978c00e5a573f0901ac404067eaea2c6536370
Author: Kairui Song <kasong(a)redhat.com>
Date: Wed Sep 8 17:20:51 2021 +0800
bash scripts: replace '[ ]' with '[[ ]]' for bash scripts
kdumpctl, mkdumprd, *-module-setup.sh only target bash, since they
only run in first kernel and depend on dracut, and dracut depends
on bash. So use '[[ ]]' to replace '[ ]'.
This is a batch update done with following command:
`sed -i -e 's/\(\s\)\[\s\([^]]*\)\s\]/\1\[\[\ \2 \]\]/g' kdumpctl, mkdumprd, *-module-setup.sh`
and replaced [ ... -a ... ] with [[ ... ]] && [[ ... ]] manually.
See https://tldp.org/LDP/abs/html/testconstructs.html for more details
on '[[ ]]', it's more versatile, safer, and slightly faster than '[ ]'.
This will also help shfmt to clean up the code in later commits.
Signed-off-by: Kairui Song <kasong(a)redhat.com>
Acked-by: Philipp Rudo <prudo(a)redhat.com>
diff --git a/dracut-early-kdump-module-setup.sh b/dracut-early-kdump-module-setup.sh
index b25d6b5..00546e0 100755
--- a/dracut-early-kdump-module-setup.sh
+++ b/dracut-early-kdump-module-setup.sh
@@ -6,8 +6,8 @@ KDUMP_KERNEL=""
KDUMP_INITRD=""
check() {
- if [ ! -f /etc/sysconfig/kdump ] || [ ! -f /lib/kdump/kdump-lib.sh ]\
- || [ -n "${IN_KDUMP}" ]
+ if [[ ! -f /etc/sysconfig/kdump ]] || [[ ! -f /lib/kdump/kdump-lib.sh ]]\
+ || [[ -n "${IN_KDUMP}" ]]
then
return 1
fi
@@ -25,7 +25,7 @@ prepare_kernel_initrd() {
prepare_kdump_bootinfo
# $kernel is a variable from dracut
- if [ "$KDUMP_KERNELVER" != $kernel ]; then
+ if [[ "$KDUMP_KERNELVER" != $kernel ]]; then
dwarn "Using kernel version '$KDUMP_KERNELVER' for early kdump," \
"but the initramfs is generated for kernel version '$kernel'"
fi
@@ -33,12 +33,12 @@ prepare_kernel_initrd() {
install() {
prepare_kernel_initrd
- if [ ! -f "$KDUMP_KERNEL" ]; then
+ if [[ ! -f "$KDUMP_KERNEL" ]]; then
derror "Could not find required kernel for earlykdump," \
"earlykdump will not work!"
return 1
fi
- if [ ! -f "$KDUMP_INITRD" ]; then
+ if [[ ! -f "$KDUMP_INITRD" ]]; then
derror "Could not find required kdump initramfs for earlykdump," \
"please ensure kdump initramfs is generated first," \
"earlykdump will not work!"
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh
index 29a2f27..515cff0 100755
--- a/dracut-module-setup.sh
+++ b/dracut-module-setup.sh
@@ -11,7 +11,7 @@ kdump_module_init() {
check() {
[[ $debug ]] && set -x
#kdumpctl sets this explicitly
- if [ -z "$IN_KDUMP" ] || [ ! -f /etc/kdump.conf ]
+ if [[ -z "$IN_KDUMP" ]] || [[ ! -f /etc/kdump.conf ]]
then
return 1
fi
@@ -41,11 +41,11 @@ depends() {
_dep="$_dep ssh-client"
fi
- if [ "$(uname -m)" = "s390x" ]; then
+ if [[ "$(uname -m)" = "s390x" ]]; then
_dep="$_dep znet"
fi
- if [ -n "$( ls -A /sys/class/drm 2>/dev/null )" ] || [ -d /sys/module/hyperv_fb ]; then
+ if [[ -n "$( ls -A /sys/class/drm 2>/dev/null )" ]] || [[ -d /sys/module/hyperv_fb ]]; then
add_opt_module drm
fi
@@ -57,19 +57,19 @@ depends() {
}
kdump_is_bridge() {
- [ -d /sys/class/net/"$1"/bridge ]
+ [[ -d /sys/class/net/"$1"/bridge ]]
}
kdump_is_bond() {
- [ -d /sys/class/net/"$1"/bonding ]
+ [[ -d /sys/class/net/"$1"/bonding ]]
}
kdump_is_team() {
- [ -f /usr/bin/teamnl ] && teamnl $1 ports &> /dev/null
+ [[ -f /usr/bin/teamnl ]] && teamnl $1 ports &> /dev/null
}
kdump_is_vlan() {
- [ -f /proc/net/vlan/"$1" ]
+ [[ -f /proc/net/vlan/"$1" ]]
}
# $1: netdev name
@@ -78,7 +78,7 @@ source_ifcfg_file() {
dwarning "Network Scripts are deprecated. You are encouraged to set up network by NetworkManager."
ifcfg_file=$(get_ifcfg_filename $1)
- if [ -f "${ifcfg_file}" ]; then
+ if [[ -f "${ifcfg_file}" ]]; then
. ${ifcfg_file}
else
dwarning "The ifcfg file of $1 is not found!"
@@ -102,19 +102,19 @@ kdump_setup_dns() {
else
dwarning "Failed to get DNS info via nmcli output. Now try sourcing ifcfg script"
source_ifcfg_file "$_netdev"
- [ -n "$DNS1" ] && echo "nameserver=$DNS1" > "$_dnsfile"
- [ -n "$DNS2" ] && echo "nameserver=$DNS2" >> "$_dnsfile"
+ [[ -n "$DNS1" ]] && echo "nameserver=$DNS1" > "$_dnsfile"
+ [[ -n "$DNS2" ]] && echo "nameserver=$DNS2" >> "$_dnsfile"
fi
while read -r content;
do
_nameserver=$(echo $content | grep ^nameserver)
- [ -z "$_nameserver" ] && continue
+ [[ -z "$_nameserver" ]] && continue
_dns=$(echo $_nameserver | cut -d' ' -f2)
- [ -z "$_dns" ] && continue
+ [[ -z "$_dns" ]] && continue
- if [ ! -f $_dnsfile ] || ! grep -q "$_dns" "$_dnsfile" ; then
+ if [[ ! -f $_dnsfile ]] || ! grep -q "$_dns" "$_dnsfile" ; then
echo "nameserver=$_dns" >> "$_dnsfile"
fi
done < "/etc/resolv.conf"
@@ -243,11 +243,11 @@ kdump_static_ip() {
_ipv6_flag="-6"
fi
- if [ -n "$_ipaddr" ]; then
+ if [[ -n "$_ipaddr" ]]; then
_gateway=$(ip $_ipv6_flag route list dev $_netdev | \
awk '/^default /{print $3}' | head -n 1)
- if [ "x" != "x"$_ipv6_flag ]; then
+ if [[ "x" != "x"$_ipv6_flag ]]; then
# _ipaddr="2002::56ff:feb6:56d5/64", _netmask is the number after "/"
_netmask=${_ipaddr#*\/}
_srcaddr="[$_srcaddr]"
@@ -268,7 +268,7 @@ kdump_static_ip() {
while read -r _route; do
_target=$(echo $_route | cut -d ' ' -f1)
_nexthop=$(echo $_route | cut -d ' ' -f3)
- if [ "x" != "x"$_ipv6_flag ]; then
+ if [[ "x" != "x"$_ipv6_flag ]]; then
_target="[$_target]"
_nexthop="[$_nexthop]"
fi
@@ -297,7 +297,7 @@ kdump_handle_mulitpath_route() {
if [[ "$_weight" -gt "$_max_weight" ]]; then
_nexthop=$(echo "$_route" | cut -d ' ' -f3)
_max_weight=$_weight
- if [ "x" != "x"$_ipv6_flag ]; then
+ if [[ "x" != "x"$_ipv6_flag ]]; then
_rule="rd.route=[$_target]:[$_nexthop]:$kdumpnic"
else
_rule="rd.route=$_target:$_nexthop:$kdumpnic"
@@ -322,7 +322,7 @@ kdump_get_mac_addr() {
#of its slaves, we should use perm address
kdump_get_perm_addr() {
local addr=$(ethtool -P $1 | sed -e 's/Permanent address: //')
- if [ -z "$addr" ] || [ "$addr" = "00:00:00:00:00:00" ]
+ if [[ -z "$addr" ]] || [[ "$addr" = "00:00:00:00:00:00" ]]
then
derror "Can't get the permanent address of $1"
else
@@ -420,7 +420,7 @@ kdump_setup_team() {
#Buggy version teamdctl outputs to stderr!
#Try to use the latest version of teamd.
teamdctl "$_netdev" config dump > ${initdir}/tmp/$$-$_netdev.conf
- if [ $? -ne 0 ]
+ if [[ $? -ne 0 ]]
then
derror "teamdctl failed."
exit 1
@@ -460,25 +460,25 @@ find_online_znet_device() {
local CCWGROUPBUS_DEVICEDIR="/sys/bus/ccwgroup/devices"
local NETWORK_DEVICES d ifname ONLINE
- [ ! -d "$CCWGROUPBUS_DEVICEDIR" ] && return
+ [[ ! -d "$CCWGROUPBUS_DEVICEDIR" ]] && return
NETWORK_DEVICES=$(find $CCWGROUPBUS_DEVICEDIR)
for d in $NETWORK_DEVICES
do
- [ ! -f "$d/online" ] && continue
+ [[ ! -f "$d/online" ]] && continue
read -r ONLINE < $d/online
- if [ $ONLINE -ne 1 ]; then
+ if [[ $ONLINE -ne 1 ]]; then
continue
fi
# determine interface name, if there (only for qeth and if
# device is online)
- if [ -f $d/if_name ]
+ if [[ -f $d/if_name ]]
then
read -r ifname < $d/if_name
- elif [ -d $d/net ]
+ elif [[ -d $d/net ]]
then
ifname=$(ls $d/net/)
fi
- [ -n "$ifname" ] && break
+ [[ -n "$ifname" ]] && break
done
echo -n "$ifname"
}
@@ -533,7 +533,7 @@ kdump_get_remote_ip()
local _remote=$(get_remote_host $1) _remote_temp
if is_hostname $_remote; then
_remote_temp=$(getent ahosts $_remote | grep -v : | head -n 1)
- if [ -z "$_remote_temp" ]; then
+ if [[ -z "$_remote_temp" ]]; then
_remote_temp=$(getent ahosts $_remote | head -n 1)
fi
_remote=$(echo $_remote_temp | cut -d' ' -f1)
@@ -568,7 +568,7 @@ kdump_install_net() {
fi
_static=$(kdump_static_ip $_netdev $_srcaddr $kdumpnic)
- if [ -n "$_static" ]; then
+ if [[ -n "$_static" ]]; then
_proto=none
elif is_ipv6_address $_srcaddr; then
_proto=auto6
@@ -583,7 +583,7 @@ kdump_install_net() {
# so we have to avoid adding duplicates
# We should also check /proc/cmdline for existing ip=xx arg.
# For example, iscsi boot will specify ip=xxx arg in cmdline.
- if [ ! -f $_ip_conf ] || ! grep -q $_ip_opts $_ip_conf &&\
+ if [[ ! -f $_ip_conf ]] || ! grep -q $_ip_opts $_ip_conf &&\
! grep -q "ip=[^[:space:]]*$_netdev" /proc/cmdline; then
echo "$_ip_opts" >> $_ip_conf
fi
@@ -606,7 +606,7 @@ kdump_install_net() {
kdump_setup_dns "$_netdev" "$_nm_show_cmd"
- if [ ! -f ${initdir}/etc/cmdline.d/50neednet.conf ]; then
+ if [[ ! -f ${initdir}/etc/cmdline.d/50neednet.conf ]]; then
# network-manager module needs this parameter
echo "rd.neednet" >> ${initdir}/etc/cmdline.d/50neednet.conf
fi
@@ -618,8 +618,8 @@ kdump_install_net() {
# the default gate way for network dump, eth1 in the fence kdump path will
# call kdump_install_net again and we don't want eth1 to be the default
# gateway.
- if [ ! -f ${initdir}/etc/cmdline.d/60kdumpnic.conf ] &&
- [ ! -f ${initdir}/etc/cmdline.d/70bootdev.conf ]; then
+ if [[ ! -f ${initdir}/etc/cmdline.d/60kdumpnic.conf ]] &&
+ [[ ! -f ${initdir}/etc/cmdline.d/70bootdev.conf ]]; then
echo "kdumpnic=$kdumpnic" > ${initdir}/etc/cmdline.d/60kdumpnic.conf
echo "bootdev=$kdumpnic" > ${initdir}/etc/cmdline.d/70bootdev.conf
fi
@@ -627,21 +627,21 @@ kdump_install_net() {
# install etc/kdump/pre.d and /etc/kdump/post.d
kdump_install_pre_post_conf() {
- if [ -d /etc/kdump/pre.d ]; then
+ if [[ -d /etc/kdump/pre.d ]]; then
for file in /etc/kdump/pre.d/*; do
- if [ -x "$file" ]; then
+ if [[ -x "$file" ]]; then
dracut_install $file
- elif [ $file != "/etc/kdump/pre.d/*" ]; then
+ elif [[ $file != "/etc/kdump/pre.d/*" ]]; then
echo "$file is not executable"
fi
done
fi
- if [ -d /etc/kdump/post.d ]; then
+ if [[ -d /etc/kdump/post.d ]]; then
for file in /etc/kdump/post.d/*; do
- if [ -x "$file" ]; then
+ if [[ -x "$file" ]]; then
dracut_install $file
- elif [ $file != "/etc/kdump/post.d/*" ]; then
+ elif [[ $file != "/etc/kdump/post.d/*" ]]; then
echo "$file is not executable"
fi
done
@@ -670,7 +670,7 @@ default_dump_target_install_conf()
echo "$_fstype $_target" >> ${initdir}/tmp/$$-kdump.conf
# don't touch the path under root mount
- if [ "$_mntpoint" != "/" ]; then
+ if [[ "$_mntpoint" != "/" ]]; then
_save_path=${_save_path##"$_mntpoint"}
fi
@@ -751,10 +751,10 @@ kdump_get_iscsi_initiator() {
local _initiator
local initiator_conf="/etc/iscsi/initiatorname.iscsi"
- [ -f "$initiator_conf" ] || return 1
+ [[ -f "$initiator_conf" ]] || return 1
while read -r _initiator; do
- [ -z "${_initiator%%#*}" ] && continue # Skip comment lines
+ [[ -z "${_initiator%%#*}" ]] && continue # Skip comment lines
case $_initiator in
InitiatorName=*)
@@ -770,7 +770,7 @@ kdump_get_iscsi_initiator() {
# Figure out iBFT session according to session type
is_ibft() {
- [ "$(kdump_iscsi_get_rec_val $1 "node.discovery_type")" = fw ]
+ [[ "$(kdump_iscsi_get_rec_val $1 "node.discovery_type")" = fw ]]
}
kdump_setup_iscsi_device() {
@@ -803,18 +803,18 @@ kdump_setup_iscsi_device() {
# get and set username and password details
username=$(kdump_iscsi_get_rec_val ${path} "node.session.auth.username")
- [ "$username" == "<empty>" ] && username=""
+ [[ "$username" == "<empty>" ]] && username=""
password=$(kdump_iscsi_get_rec_val ${path} "node.session.auth.password")
- [ "$password" == "<empty>" ] && password=""
+ [[ "$password" == "<empty>" ]] && password=""
username_in=$(kdump_iscsi_get_rec_val ${path} "node.session.auth.username_in")
- [ -n "$username" ] && userpwd_str="$username:$password"
+ [[ -n "$username" ]] && userpwd_str="$username:$password"
# get and set incoming username and password details
- [ "$username_in" == "<empty>" ] && username_in=""
+ [[ "$username_in" == "<empty>" ]] && username_in=""
password_in=$(kdump_iscsi_get_rec_val ${path} "node.session.auth.password_in")
- [ "$password_in" == "<empty>" ] && password_in=""
+ [[ "$password_in" == "<empty>" ]] && password_in=""
- [ -n "$username_in" ] && userpwd_in_str=":$username_in:$password_in"
+ [[ -n "$username_in" ]] && userpwd_in_str=":$username_in:$password_in"
kdump_install_net "$tgt_ipaddr"
@@ -837,7 +837,7 @@ kdump_setup_iscsi_device() {
# Setup initator
initiator_str=$(kdump_get_iscsi_initiator)
- [ $? -ne "0" ] && derror "Failed to get initiator name" && return 1
+ [[ $? -ne "0" ]] && derror "Failed to get initiator name" && return 1
# If initiator details do not exist already, append.
if ! grep -q "$initiator_str" $netroot_conf; then
@@ -878,7 +878,7 @@ get_alias() {
do
# in /etc/hosts, alias can come at the 2nd column
entries=$(grep $ip /etc/hosts | awk '{ $1=""; print $0 }')
- if [ $? -eq 0 ]; then
+ if [[ $? -eq 0 ]]; then
alias_set="$alias_set $entries"
fi
done
@@ -895,7 +895,7 @@ is_localhost() {
hostnames="$hostnames $shortnames $aliasname"
for name in ${hostnames}; do
- if [ "$name" == "$nodename" ]; then
+ if [[ "$name" == "$nodename" ]]; then
return 0
fi
done
@@ -928,7 +928,7 @@ get_pcs_fence_kdump_nodes() {
# retrieves fence_kdump args from config file
get_pcs_fence_kdump_args() {
- if [ -f $FENCE_KDUMP_CONFIG_FILE ]; then
+ if [[ -f $FENCE_KDUMP_CONFIG_FILE ]]; then
. $FENCE_KDUMP_CONFIG_FILE
echo $FENCE_KDUMP_OPTS
fi
@@ -966,7 +966,7 @@ kdump_configure_fence_kdump () {
echo "fence_kdump_nodes $nodes" >> ${kdump_cfg_file}
args=$(get_pcs_fence_kdump_args)
- if [ -n "$args" ]; then
+ if [[ -n "$args" ]]; then
echo "fence_kdump_args $args" >> ${kdump_cfg_file}
fi
@@ -992,7 +992,7 @@ kdump_install_random_seed() {
poolsize=$(</proc/sys/kernel/random/poolsize)
- if [ ! -d ${initdir}/var/lib/ ]; then
+ if [[ ! -d ${initdir}/var/lib/ ]]; then
mkdir -p ${initdir}/var/lib/
fi
@@ -1004,7 +1004,7 @@ kdump_install_systemd_conf() {
# Kdump turns out to require longer default systemd mount timeout
# than 1st kernel(90s by default), we use default 300s for kdump.
grep -r "^[[:space:]]*DefaultTimeoutStartSec=" ${initdir}/etc/systemd/system.conf* &>/dev/null
- if [ $? -ne 0 ]; then
+ if [[ $? -ne 0 ]]; then
mkdir -p ${initdir}/etc/systemd/system.conf.d
echo "[Manager]" > ${initdir}/etc/systemd/system.conf.d/kdump.conf
echo "DefaultTimeoutStartSec=300s" >> ${initdir}/etc/systemd/system.conf.d/kdump.conf
diff --git a/kdumpctl b/kdumpctl
index 1f76bf2..11782df 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -27,7 +27,7 @@ standard_kexec_args="-d -p"
# Some default values in case /etc/sysconfig/kdump doesn't include
KDUMP_COMMANDLINE_REMOVE="hugepages hugepagesz slub_debug"
-if [ -f /etc/sysconfig/kdump ]; then
+if [[ -f /etc/sysconfig/kdump ]]; then
. /etc/sysconfig/kdump
fi
@@ -38,7 +38,7 @@ fi
#initiate the kdump logger
dlog_init
-if [ $? -ne 0 ]; then
+if [[ $? -ne 0 ]]; then
echo "failed to initiate the kdump logger."
exit 1
fi
@@ -48,7 +48,7 @@ single_instance_lock()
local rc timeout=5
exec 9>/var/lock/kdump
- if [ $? -ne 0 ]; then
+ if [[ $? -ne 0 ]]; then
derror "Create file lock failed"
exit 1
fi
@@ -56,7 +56,7 @@ single_instance_lock()
flock -n 9
rc=$?
- while [ $rc -ne 0 ]; do
+ while [[ $rc -ne 0 ]]; do
dinfo "Another app is currently holding the kdump lock; waiting for it to exit..."
flock -w $timeout 9
rc=$?
@@ -81,7 +81,7 @@ save_core()
mkdir -p $coredir
ddebug "cp --sparse=always /proc/vmcore $coredir/vmcore-incomplete"
cp --sparse=always /proc/vmcore $coredir/vmcore-incomplete
- if [ $? == 0 ]; then
+ if [[ $? == 0 ]]; then
mv $coredir/vmcore-incomplete $coredir/vmcore
dinfo "saved a vmcore to $coredir"
else
@@ -91,12 +91,12 @@ save_core()
# pass the dmesg to Abrt tool if exists, in order
# to collect the kernel oops message.
# https://fedorahosted.org/abrt/
- if [ -x /usr/bin/dumpoops ]; then
+ if [[ -x /usr/bin/dumpoops ]]; then
ddebug "makedumpfile --dump-dmesg $coredir/vmcore $coredir/dmesg"
makedumpfile --dump-dmesg $coredir/vmcore $coredir/dmesg >/dev/null 2>&1
ddebug "dumpoops -d $coredir/dmesg"
dumpoops -d $coredir/dmesg >/dev/null 2>&1
- if [ $? == 0 ]; then
+ if [[ $? == 0 ]]; then
dinfo "kernel oops has been collected by abrt tool"
fi
fi
@@ -122,7 +122,7 @@ rebuild_kdump_initrd()
{
ddebug "rebuild kdump initrd: $MKDUMPRD $TARGET_INITRD $KDUMP_KERNELVER"
$MKDUMPRD $TARGET_INITRD $KDUMP_KERNELVER
- if [ $? != 0 ]; then
+ if [[ $? != 0 ]]; then
derror "mkdumprd: failed to make kdump initrd"
return 1
fi
@@ -141,7 +141,7 @@ rebuild_initrd()
return 1
fi
- if [ $DEFAULT_DUMP_MODE == "fadump" ]; then
+ if [[ $DEFAULT_DUMP_MODE == "fadump" ]]; then
rebuild_fadump_initrd
else
rebuild_kdump_initrd
@@ -154,7 +154,7 @@ rebuild_initrd()
check_exist()
{
for file in $1; do
- if [ ! -e "$file" ]; then
+ if [[ ! -e "$file" ]]; then
derror "Error: $file not found."
return 1
fi
@@ -165,7 +165,7 @@ check_exist()
check_executable()
{
for file in $1; do
- if [ ! -x "$file" ]; then
+ if [[ ! -x "$file" ]]; then
derror "Error: $file is not executable."
return 1
fi
@@ -176,16 +176,16 @@ backup_default_initrd()
{
ddebug "backup default initrd: $DEFAULT_INITRD"
- if [ ! -f "$DEFAULT_INITRD" ]; then
+ if [[ ! -f "$DEFAULT_INITRD" ]]; then
return
fi
- if [ ! -e $DEFAULT_INITRD_BAK ]; then
+ if [[ ! -e $DEFAULT_INITRD_BAK ]]; then
dinfo "Backing up $DEFAULT_INITRD before rebuild."
# save checksum to verify before restoring
sha1sum $DEFAULT_INITRD > $INITRD_CHECKSUM_LOCATION
cp $DEFAULT_INITRD $DEFAULT_INITRD_BAK
- if [ $? -ne 0 ]; then
+ if [[ $? -ne 0 ]]; then
dwarn "WARNING: failed to backup $DEFAULT_INITRD."
rm -f $DEFAULT_INITRD_BAK
fi
@@ -196,17 +196,17 @@ restore_default_initrd()
{
ddebug "restore default initrd: $DEFAULT_INITRD"
- if [ ! -f "$DEFAULT_INITRD" ]; then
+ if [[ ! -f "$DEFAULT_INITRD" ]]; then
return
fi
# If a backup initrd exists, we must be switching back from
# fadump to kdump. Restore the original default initrd.
- if [ -f $DEFAULT_INITRD_BAK ] && [ -f $INITRD_CHECKSUM_LOCATION ]; then
+ if [[ -f $DEFAULT_INITRD_BAK ]] && [[ -f $INITRD_CHECKSUM_LOCATION ]]; then
# verify checksum before restoring
backup_checksum=$(sha1sum "$DEFAULT_INITRD_BAK" | awk '{ print $1 }')
default_checksum=$(awk '{ print $1 }' "$INITRD_CHECKSUM_LOCATION")
- if [ "$default_checksum" != "$backup_checksum" ]; then
+ if [[ "$default_checksum" != "$backup_checksum" ]]; then
dwarn "WARNING: checksum mismatch! Can't restore original initrd.."
else
rm -f $INITRD_CHECKSUM_LOCATION
@@ -226,7 +226,7 @@ check_config()
case "$config_opt" in
dracut_args)
if [[ $config_val == *--mount* ]]; then
- if [ $(echo $config_val | grep -o "\-\-mount" | wc -l) -ne 1 ]; then
+ if [[ $(echo $config_val | grep -o "\-\-mount" | wc -l) -ne 1 ]]; then
derror "Multiple mount targets specified in one \"dracut_args\"."
return 1
fi
@@ -234,7 +234,7 @@ check_config()
fi
;;
raw)
- if [ -d "/proc/device-tree/ibm,opal/dump" ]; then
+ if [[ -d "/proc/device-tree/ibm,opal/dump" ]]; then
dwarn "WARNING: Won't capture opalcore when 'raw' dump target is used."
fi
config_opt=_target
@@ -262,8 +262,8 @@ check_config()
return 1
fi
- if [ -n "${_opt_rec[$config_opt]}" ]; then
- if [ $config_opt == _target ]; then
+ if [[ -n "${_opt_rec[$config_opt]}" ]]; then
+ if [[ $config_opt == _target ]]; then
derror "More than one dump targets specified"
else
derror "Duplicated kdump config value of option $config_opt"
@@ -292,13 +292,13 @@ get_pcs_cluster_modified_files()
time_stamp=$(pcs cluster cib | xmllint --xpath 'string(/cib/@cib-last-written)' - | xargs -0 date +%s --date)
- if [ -n $time_stamp -a $time_stamp -gt $image_time ]; then
+ if [[ -n $time_stamp ]] && [[ $time_stamp -gt $image_time ]]; then
modified_files="cluster-cib"
fi
- if [ -f $FENCE_KDUMP_CONFIG_FILE ]; then
+ if [[ -f $FENCE_KDUMP_CONFIG_FILE ]]; then
time_stamp=$(stat -c "%Y" $FENCE_KDUMP_CONFIG_FILE)
- if [ "$time_stamp" -gt "$image_time" ]; then
+ if [[ "$time_stamp" -gt "$image_time" ]]; then
modified_files="$modified_files $FENCE_KDUMP_CONFIG_FILE"
fi
fi
@@ -309,13 +309,13 @@ get_pcs_cluster_modified_files()
setup_initrd()
{
prepare_kdump_bootinfo
- if [ $? -ne 0 ]; then
+ if [[ $? -ne 0 ]]; then
derror "failed to prepare for kdump bootinfo."
return 1
fi
DEFAULT_INITRD_BAK="$KDUMP_BOOTDIR/.$(basename $DEFAULT_INITRD).default"
- if [ $DEFAULT_DUMP_MODE == "fadump" ]; then
+ if [[ $DEFAULT_DUMP_MODE == "fadump" ]]; then
TARGET_INITRD="$DEFAULT_INITRD"
# backup initrd for reference before replacing it
@@ -341,16 +341,16 @@ check_files_modified()
EXTRA_BINS=$(kdump_get_conf_val kdump_post)
CHECK_FILES=$(kdump_get_conf_val kdump_pre)
HOOKS="/etc/kdump/post.d/ /etc/kdump/pre.d/"
- if [ -d /etc/kdump/post.d ]; then
+ if [[ -d /etc/kdump/post.d ]]; then
for file in /etc/kdump/post.d/*; do
- if [ -x "$file" ]; then
+ if [[ -x "$file" ]]; then
POST_FILES="$POST_FILES $file"
fi
done
fi
- if [ -d /etc/kdump/pre.d ]; then
+ if [[ -d /etc/kdump/pre.d ]]; then
for file in /etc/kdump/pre.d/*; do
- if [ -x "$file" ]; then
+ if [[ -x "$file" ]]; then
PRE_FILES="$PRE_FILES $file"
fi
done
@@ -367,8 +367,8 @@ check_files_modified()
# Check for any updated extra module
EXTRA_MODULES="$(kdump_get_conf_val extra_modules)"
- if [ -n "$EXTRA_MODULES" ]; then
- if [ -e /lib/modules/$KDUMP_KERNELVER/modules.dep ]; then
+ if [[ -n "$EXTRA_MODULES" ]]; then
+ if [[ -e /lib/modules/$KDUMP_KERNELVER/modules.dep ]]; then
files="$files /lib/modules/$KDUMP_KERNELVER/modules.dep"
fi
for _module in $EXTRA_MODULES; do
@@ -390,18 +390,18 @@ check_files_modified()
# HOOKS is mandatory and need to check the modification time
files="$files $HOOKS"
check_exist "$files" && check_executable "$EXTRA_BINS"
- [ $? -ne 0 ] && return 2
+ [[ $? -ne 0 ]] && return 2
for file in $files; do
- if [ -e "$file" ]; then
+ if [[ -e "$file" ]]; then
time_stamp=$(stat -c "%Y" $file)
- if [ "$time_stamp" -gt "$image_time" ]; then
+ if [[ "$time_stamp" -gt "$image_time" ]]; then
modified_files="$modified_files $file"
fi
- if [ -L "$file" ]; then
+ if [[ -L "$file" ]]; then
file=$(readlink -m $file)
time_stamp=$(stat -c "%Y" $file)
- if [ "$time_stamp" -gt "$image_time" ]; then
+ if [[ "$time_stamp" -gt "$image_time" ]]; then
modified_files="$modified_files $file"
fi
fi
@@ -410,7 +410,7 @@ check_files_modified()
fi
done
- if [ -n "$modified_files" ]; then
+ if [[ -n "$modified_files" ]]; then
dinfo "Detected change(s) in the following file(s): $modified_files"
return 1
fi
@@ -441,7 +441,7 @@ check_drivers_modified()
# Include watchdog drivers if watchdog module is not omitted
is_dracut_mod_omitted watchdog || _new_drivers+=" $(get_watchdog_drvs)"
- [ -z "$_new_drivers" ] && return 0
+ [[ -z "$_new_drivers" ]] && return 0
if is_fadump_capable; then
_old_drivers="$(lsinitrd "$TARGET_INITRD" -f /usr/lib/dracut/fadump-kernel-modules.txt | tr '\n' ' ')"
@@ -455,7 +455,7 @@ check_drivers_modified()
# Skip deprecated/invalid driver name or built-in module
_module_name=$(modinfo --set-version "$KDUMP_KERNELVER" -F name $_driver 2>/dev/null)
_module_filename=$(modinfo --set-version "$KDUMP_KERNELVER" -n $_driver 2>/dev/null)
- if [ $? -ne 0 ] || [ -z "$_module_name" ] || [[ "$_module_filename" = *"(builtin)"* ]]; then
+ if [[ $? -ne 0 ]] || [[ -z "$_module_name" ]] || [[ "$_module_filename" = *"(builtin)"* ]]; then
continue
fi
if ! [[ " $_old_drivers " == *" $_module_name "* ]]; then
@@ -491,7 +491,7 @@ check_fs_modified()
ddebug "_target=$_target _new_fstype=$_new_fstype"
_new_dev=$(kdump_get_persistent_dev $_target)
- if [ -z "$_new_dev" ]; then
+ if [[ -z "$_new_dev" ]]; then
perror "Get persistent device name failed"
return 2
fi
@@ -532,19 +532,19 @@ check_system_modified()
check_files_modified
ret=$?
- if [ $ret -ne 0 ]; then
+ if [[ $ret -ne 0 ]]; then
return $ret
fi
check_fs_modified
ret=$?
- if [ $ret -ne 0 ]; then
+ if [[ $ret -ne 0 ]]; then
return $ret
fi
check_drivers_modified
ret=$?
- if [ $ret -ne 0 ]; then
+ if [[ $ret -ne 0 ]]; then
return $ret
fi
@@ -559,20 +559,20 @@ check_rebuild()
setup_initrd
- if [ $? -ne 0 ]; then
+ if [[ $? -ne 0 ]]; then
return 1
fi
force_no_rebuild=$(kdump_get_conf_val force_no_rebuild)
force_no_rebuild=${force_no_rebuild:-0}
- if [ "$force_no_rebuild" != "0" ] && [ "$force_no_rebuild" != "1" ];then
+ if [[ "$force_no_rebuild" != "0" ]] && [[ "$force_no_rebuild" != "1" ]];then
derror "Error: force_no_rebuild value is invalid"
return 1
fi
force_rebuild=$(kdump_get_conf_val force_rebuild)
force_rebuild=${force_rebuild:-0}
- if [ "$force_rebuild" != "0" ] && [ "$force_rebuild" != "1" ];then
+ if [[ "$force_rebuild" != "0" ]] && [[ "$force_rebuild" != "1" ]];then
derror "Error: force_rebuild value is invalid"
return 1
fi
@@ -583,37 +583,37 @@ check_rebuild()
fi
# Will not rebuild kdump initrd
- if [ "$force_no_rebuild" == "1" ]; then
+ if [[ "$force_no_rebuild" == "1" ]]; then
return 0
fi
#check to see if dependent files has been modified
#since last build of the image file
- if [ -f $TARGET_INITRD ]; then
+ if [[ -f $TARGET_INITRD ]]; then
image_time=$(stat -c "%Y" $TARGET_INITRD 2>/dev/null)
#in case of fadump mode, check whether the default/target
#initrd is already built with dump capture capability
- if [ "$DEFAULT_DUMP_MODE" == "fadump" ]; then
+ if [[ "$DEFAULT_DUMP_MODE" == "fadump" ]]; then
capture_capable_initrd=$(lsinitrd -f $DRACUT_MODULES_FILE "$TARGET_INITRD" | grep -c -e ^kdumpbase$ -e ^zz-fadumpinit$)
fi
fi
check_system_modified
ret=$?
- if [ $ret -eq 2 ]; then
+ if [[ $ret -eq 2 ]]; then
return 1
- elif [ $ret -eq 1 ];then
+ elif [[ $ret -eq 1 ]];then
system_modified="1"
fi
- if [ $image_time -eq 0 ]; then
+ if [[ $image_time -eq 0 ]]; then
dinfo "No kdump initial ramdisk found."
- elif [ "$capture_capable_initrd" == "0" ]; then
+ elif [[ "$capture_capable_initrd" == "0" ]]; then
dinfo "Rebuild $TARGET_INITRD with dump capture support"
- elif [ "$force_rebuild" != "0" ]; then
+ elif [[ "$force_rebuild" != "0" ]]; then
dinfo "Force rebuild $TARGET_INITRD"
- elif [ "$system_modified" != "0" ]; then
+ elif [[ "$system_modified" != "0" ]]; then
:
else
return 0
@@ -633,7 +633,7 @@ function load_kdump_kernel_key()
# this is only required if DT /ibm,secure-boot is a file.
# if it is a dir, we are on OpenPower and don't need this.
- if ! [ -f /proc/device-tree/ibm,secure-boot ]; then
+ if ! [[ -f /proc/device-tree/ibm,secure-boot ]]; then
return
fi
@@ -645,7 +645,7 @@ function load_kdump_kernel_key()
# to be idempotent and so as to reduce the potential for confusion.
function remove_kdump_kernel_key()
{
- if [ -z "$KDUMP_KEY_ID" ]; then
+ if [[ -z "$KDUMP_KEY_ID" ]]; then
return
fi
@@ -692,7 +692,7 @@ load_kdump()
remove_kdump_kernel_key
- if [ $ret == 0 ]; then
+ if [[ $ret == 0 ]]; then
dinfo "kexec: loaded kdump kernel"
return 0
else
@@ -707,7 +707,7 @@ check_ssh_config()
case "$config_opt" in
sshkey)
# remove inline comments after the end of a directive.
- if [ -f "$config_val" ]; then
+ if [[ -f "$config_val" ]]; then
# canonicalize the path
SSH_KEY_LOCATION=$(/usr/bin/readlink -m $config_val)
else
@@ -727,7 +727,7 @@ check_ssh_config()
#make sure they've configured kdump.conf for ssh dumps
local SSH_TARGET=$(echo -n $DUMP_TARGET | sed -n '/.*@/p')
- if [ -z "$SSH_TARGET" ]; then
+ if [[ -z "$SSH_TARGET" ]]; then
return 1
fi
return 0
@@ -750,9 +750,9 @@ check_and_wait_network_ready()
retval=$?
# ssh exits with the exit status of the remote command or with 255 if an error occurred
- if [ $retval -eq 0 ]; then
+ if [[ $retval -eq 0 ]]; then
return 0
- elif [ $retval -ne 255 ]; then
+ elif [[ $retval -ne 255 ]]; then
derror "Could not create $DUMP_TARGET:$SAVE_PATH, you should check the privilege on server side"
return 1
fi
@@ -760,12 +760,12 @@ check_and_wait_network_ready()
# if server removes the authorized_keys or, no /root/.ssh/kdump_id_rsa
ddebug "$errmsg"
echo $errmsg | grep -q "Permission denied\|No such file or directory\|Host key verification failed"
- if [ $? -eq 0 ]; then
+ if [[ $? -eq 0 ]]; then
derror "Could not create $DUMP_TARGET:$SAVE_PATH, you probably need to run \"kdumpctl propagate\""
return 1
fi
- if [ $warn_once -eq 1 ]; then
+ if [[ $warn_once -eq 1 ]]; then
dwarn "Network dump target is not usable, waiting for it to be ready..."
warn_once=0
fi
@@ -773,7 +773,7 @@ check_and_wait_network_ready()
cur=$(date +%s)
diff=$((cur - start_time))
# 60s time out
- if [ $diff -gt 180 ]; then
+ if [[ $diff -gt 180 ]]; then
break;
fi
sleep 1
@@ -786,7 +786,7 @@ check_and_wait_network_ready()
check_ssh_target()
{
check_and_wait_network_ready
- if [ $? -ne 0 ]; then
+ if [[ $? -ne 0 ]]; then
return 1
fi
return 0
@@ -795,7 +795,7 @@ check_ssh_target()
propagate_ssh_key()
{
check_ssh_config
- if [ $? -ne 0 ]; then
+ if [[ $? -ne 0 ]]; then
derror "No ssh config specified in $KDUMP_CONFIG_FILE. Can't propagate"
exit 1
fi
@@ -804,7 +804,7 @@ propagate_ssh_key()
local errmsg="Failed to propagate ssh key"
#Check to see if we already created key, if not, create it.
- if [ -f $KEYFILE ]; then
+ if [[ -f $KEYFILE ]]; then
dinfo "Using existing keys..."
else
dinfo "Generating new ssh keys... "
@@ -819,7 +819,7 @@ propagate_ssh_key()
#now send the found key to the found server
ssh-copy-id -i $KEYFILE $SSH_USER@$SSH_SERVER
RET=$?
- if [ $RET == 0 ]; then
+ if [[ $RET == 0 ]]; then
dinfo "$KEYFILE has been added to ~$SSH_USER/.ssh/authorized_keys on $SSH_SERVER"
return 0
else
@@ -843,13 +843,13 @@ check_current_fadump_status()
{
# Check if firmware-assisted dump has been registered.
rc=$(<$FADUMP_REGISTER_SYS_NODE)
- [ $rc -eq 1 ] && return 0
+ [[ $rc -eq 1 ]] && return 0
return 1
}
check_current_status()
{
- if [ $DEFAULT_DUMP_MODE == "fadump" ]; then
+ if [[ $DEFAULT_DUMP_MODE == "fadump" ]]; then
check_current_fadump_status
else
check_current_kdump_status
@@ -864,8 +864,8 @@ save_raw()
local raw_target
raw_target=$(kdump_get_conf_val raw)
- [ -z "$raw_target" ] && return 0
- [ -b "$raw_target" ] || {
+ [[ -z "$raw_target" ]] && return 0
+ [[ -b "$raw_target" ]] || {
derror "raw partition $raw_target not found"
return 1
}
@@ -875,14 +875,14 @@ save_raw()
return 0
fi
kdump_dir=$(kdump_get_conf_val path)
- if [ -z "${kdump_dir}" ]; then
+ if [[ -z "${kdump_dir}" ]]; then
coredir="/var/crash/$(date +"%Y-%m-%d-%H:%M")"
else
coredir="${kdump_dir}/$(date +"%Y-%m-%d-%H:%M")"
fi
mkdir -p "$coredir"
- [ -d "$coredir" ] || {
+ [[ -d "$coredir" ]] || {
derror "failed to create $coredir"
return 1
}
@@ -903,7 +903,7 @@ local_fs_dump_target()
local _target
_target=$(grep -E "^ext[234]|^xfs|^btrfs|^minix" /etc/kdump.conf)
- if [ $? -eq 0 ]; then
+ if [[ $? -eq 0 ]]; then
echo $_target|awk '{print $2}'
fi
}
@@ -931,7 +931,7 @@ path_to_be_relabeled()
_path=$(get_save_path)
# if $_path is masked by other mount, we will not relabel it.
_rmnt=$(df $_mnt/$_path 2>/dev/null | tail -1 | awk '{ print $NF }')
- if [ "$_rmnt" == "$_mnt" ]; then
+ if [[ "$_rmnt" == "$_mnt" ]]; then
echo $_mnt/$_path
fi
}
@@ -941,13 +941,13 @@ selinux_relabel()
local _path _i _attr
_path=$(path_to_be_relabeled)
- if [ -z "$_path" ] || ! [ -d "$_path" ] ; then
+ if [[ -z "$_path" ]] || ! [[ -d "$_path" ]] ; then
return
fi
while IFS= read -r -d '' _i; do
_attr=$(getfattr -m "security.selinux" "$_i" 2>/dev/null)
- if [ -z "$_attr" ]; then
+ if [[ -z "$_attr" ]]; then
restorecon "$_i";
fi
done < <(find "$_path" -print0)
@@ -960,13 +960,13 @@ check_fence_kdump_config()
local nodes=$(kdump_get_conf_val "fence_kdump_nodes")
for node in $nodes; do
- if [ "$node" = "$hostname" ]; then
+ if [[ "$node" = "$hostname" ]]; then
derror "Option fence_kdump_nodes cannot contain $hostname"
return 1
fi
# node can be ipaddr
echo "$ipaddrs " | grep -q "$node "
- if [ $? -eq 0 ]; then
+ if [[ $? -eq 0 ]]; then
derror "Option fence_kdump_nodes cannot contain $node"
return 1
fi
@@ -977,7 +977,7 @@ check_fence_kdump_config()
check_dump_feasibility()
{
- if [ $DEFAULT_DUMP_MODE == "fadump" ]; then
+ if [[ $DEFAULT_DUMP_MODE == "fadump" ]]; then
return 0
fi
@@ -999,7 +999,7 @@ start_fadump()
start_dump()
{
- if [ $DEFAULT_DUMP_MODE == "fadump" ]; then
+ if [[ $DEFAULT_DUMP_MODE == "fadump" ]]; then
start_fadump
else
load_kdump
@@ -1017,14 +1017,14 @@ check_failure_action_config()
default_option=$(kdump_get_conf_val default)
failure_action=$(kdump_get_conf_val failure_action)
- if [ -z "$failure_action" -a -z "$default_option" ]; then
+ if [[ -z "$failure_action" ]] && [[ -z "$default_option" ]]; then
return 0
- elif [ -n "$failure_action" -a -n "$default_option" ]; then
+ elif [[ -n "$failure_action" ]] && [[ -n "$default_option" ]]; then
derror "Cannot specify 'failure_action' and 'default' option together"
return 1
fi
- if [ -n "$default_option" ]; then
+ if [[ -n "$default_option" ]]; then
option="default"
failure_action="$default_option"
fi
@@ -1044,7 +1044,7 @@ check_final_action_config()
local final_action
final_action=$(kdump_get_conf_val final_action)
- if [ -z "$final_action" ]; then
+ if [[ -z "$final_action" ]]; then
return 0
else
case "$final_action" in
@@ -1061,13 +1061,13 @@ check_final_action_config()
start()
{
check_dump_feasibility
- if [ $? -ne 0 ]; then
+ if [[ $? -ne 0 ]]; then
derror "Starting kdump: [FAILED]"
return 1
fi
check_config
- if [ $? -ne 0 ]; then
+ if [[ $? -ne 0 ]]; then
derror "Starting kdump: [FAILED]"
return 1
fi
@@ -1077,13 +1077,13 @@ start()
fi
save_raw
- if [ $? -ne 0 ]; then
+ if [[ $? -ne 0 ]]; then
derror "Starting kdump: [FAILED]"
return 1
fi
check_current_status
- if [ $? == 0 ]; then
+ if [[ $? == 0 ]]; then
dwarn "Kdump already running: [WARNING]"
return 0
fi
@@ -1096,13 +1096,13 @@ start()
fi
check_rebuild
- if [ $? != 0 ]; then
+ if [[ $? != 0 ]]; then
derror "Starting kdump: [FAILED]"
return 1
fi
start_dump
- if [ $? != 0 ]; then
+ if [[ $? != 0 ]]; then
derror "Starting kdump: [FAILED]"
return 1
fi
@@ -1113,18 +1113,18 @@ start()
reload()
{
check_current_status
- if [ $? -ne 0 ]; then
+ if [[ $? -ne 0 ]]; then
dwarn "Kdump was not running: [WARNING]"
fi
- if [ $DEFAULT_DUMP_MODE == "fadump" ]; then
+ if [[ $DEFAULT_DUMP_MODE == "fadump" ]]; then
reload_fadump
return $?
else
stop_kdump
fi
- if [ $? -ne 0 ]; then
+ if [[ $? -ne 0 ]]; then
derror "Stopping kdump: [FAILED]"
return 1
fi
@@ -1132,13 +1132,13 @@ reload()
dinfo "Stopping kdump: [OK]"
setup_initrd
- if [ $? -ne 0 ]; then
+ if [[ $? -ne 0 ]]; then
derror "Starting kdump: [FAILED]"
return 1
fi
start_dump
- if [ $? -ne 0 ]; then
+ if [[ $? -ne 0 ]]; then
derror "Starting kdump: [FAILED]"
return 1
fi
@@ -1166,7 +1166,7 @@ stop_kdump()
$KEXEC -p -u
fi
- if [ $? != 0 ]; then
+ if [[ $? != 0 ]]; then
derror "kexec: failed to unload kdump kernel"
return 1
fi
@@ -1178,7 +1178,7 @@ stop_kdump()
reload_fadump()
{
echo 1 > $FADUMP_REGISTER_SYS_NODE
- if [ $? == 0 ]; then
+ if [[ $? == 0 ]]; then
dinfo "fadump: re-registered successfully"
return 0
else
@@ -1186,7 +1186,7 @@ reload_fadump()
# support is not enabled. Try stop/start from userspace
# to handle such scenario.
stop_fadump
- if [ $? == 0 ]; then
+ if [[ $? == 0 ]]; then
start_fadump
return $?
fi
@@ -1197,13 +1197,13 @@ reload_fadump()
stop()
{
- if [ $DEFAULT_DUMP_MODE == "fadump" ]; then
+ if [[ $DEFAULT_DUMP_MODE == "fadump" ]]; then
stop_fadump
else
stop_kdump
fi
- if [ $? != 0 ]; then
+ if [[ $? != 0 ]]; then
derror "Stopping kdump: [FAILED]"
return 1
fi
@@ -1214,7 +1214,7 @@ stop()
rebuild() {
check_config
- if [ $? -ne 0 ]; then
+ if [[ $? -ne 0 ]]; then
return 1
fi
@@ -1225,7 +1225,7 @@ rebuild() {
fi
setup_initrd
- if [ $? -ne 0 ]; then
+ if [[ $? -ne 0 ]]; then
return 1
fi
@@ -1242,7 +1242,7 @@ do_estimate() {
local size_mb=$(( 1024 * 1024 ))
setup_initrd
- if [ ! -f "$TARGET_INITRD" ]; then
+ if [[ ! -f "$TARGET_INITRD" ]]; then
derror "kdumpctl estimate: kdump initramfs is not built yet."
exit 1
fi
@@ -1359,7 +1359,7 @@ reset_crashkernel() {
fi
}
-if [ ! -f "$KDUMP_CONFIG_FILE" ]; then
+if [[ ! -f "$KDUMP_CONFIG_FILE" ]]; then
derror "Error: No kdump config file found!"
exit 1
fi
@@ -1371,7 +1371,7 @@ main ()
case "$1" in
start)
- if [ -s /proc/vmcore ]; then
+ if [[ -s /proc/vmcore ]]; then
save_core
reboot
else
diff --git a/mkdumprd b/mkdumprd
index 6621e30..3101d3f 100644
--- a/mkdumprd
+++ b/mkdumprd
@@ -6,7 +6,7 @@
# Written by Cong Wang <amwang(a)redhat.com>
#
-if [ -f /etc/sysconfig/kdump ]; then
+if [[ -f /etc/sysconfig/kdump ]]; then
. /etc/sysconfig/kdump
fi
@@ -18,7 +18,7 @@ export IN_KDUMP=1
#initiate the kdump logger
dlog_init
-if [ $? -ne 0 ]; then
+if [[ $? -ne 0 ]]; then
echo "failed to initiate the kdump logger."
exit 1
fi
@@ -73,7 +73,7 @@ to_mount() {
else
# for non-nfs _target converting to use udev persistent name
_pdev="$(kdump_get_persistent_dev $_target)"
- if [ -z "$_pdev" ]; then
+ if [[ -z "$_pdev" ]]; then
return 1
fi
fi
@@ -116,14 +116,14 @@ mkdir_save_path_ssh()
_opt=(-i "$SSH_KEY_LOCATION" -o BatchMode=yes -o StrictHostKeyChecking=yes)
ssh -qn "${_opt[@]}" $1 mkdir -p $SAVE_PATH 2>&1 > /dev/null
_ret=$?
- if [ $_ret -ne 0 ]; then
+ if [[ $_ret -ne 0 ]]; then
perror_exit "mkdir failed on $1:$SAVE_PATH"
fi
#check whether user has write permission on $1:$SAVE_PATH
_dir=$(ssh -qn "${_opt[@]}" $1 mktemp -dqp $SAVE_PATH 2>/dev/null)
_ret=$?
- if [ $_ret -ne 0 ]; then
+ if [[ $_ret -ne 0 ]]; then
perror_exit "Could not create temporary directory on $1:$SAVE_PATH. Make sure user has write permission on destination"
fi
ssh -qn "${_opt[@]}" $1 rmdir $_dir
@@ -164,11 +164,11 @@ check_size() {
return
esac
- if [ $? -ne 0 ]; then
+ if [[ $? -ne 0 ]]; then
perror_exit "Check dump target size failed"
fi
- if [ $avail -lt $memtotal ]; then
+ if [[ $avail -lt $memtotal ]]; then
dwarn "Warning: There might not be enough space to save a vmcore."
dwarn " The size of $2 should be greater than $memtotal kilo bytes."
fi
@@ -178,7 +178,7 @@ check_save_path_fs()
{
local _path=$1
- if [ ! -d $_path ]; then
+ if [[ ! -d $_path ]]; then
perror_exit "Dump path $_path does not exist."
fi
}
@@ -190,7 +190,7 @@ mount_failure()
local _fstype=$3
local msg="Failed to mount $_target"
- if [ -n "$_mnt" ]; then
+ if [[ -n "$_mnt" ]]; then
msg="$msg on $_mnt"
fi
@@ -210,11 +210,11 @@ check_user_configured_target()
local _opt=$(get_mntopt_from_target $_target)
local _fstype=$(get_fs_type_from_target $_target)
- if [ -n "$_fstype" ]; then
+ if [[ -n "$_fstype" ]]; then
# In case of nfs4, nfs should be used instead, nfs* options is deprecated in kdump.conf
[[ $_fstype = "nfs"* ]] && _fstype=nfs
- if [ -n "$_cfg_fs_type" ] && [ "$_fstype" != "$_cfg_fs_type" ]; then
+ if [[ -n "$_cfg_fs_type" ]] && [[ "$_fstype" != "$_cfg_fs_type" ]]; then
perror_exit "\"$_target\" have a wrong type config \"$_cfg_fs_type\", expected \"$_fstype\""
fi
else
@@ -224,11 +224,11 @@ check_user_configured_target()
# For noauto mount, mount it inplace with default value.
# Else use the temporary target directory
- if [ -n "$_mnt" ]; then
+ if [[ -n "$_mnt" ]]; then
if ! is_mounted "$_mnt"; then
if [[ $_opt = *",noauto"* ]]; then
mount $_mnt
- [ $? -ne 0 ] && mount_failure "$_target" "$_mnt" "$_fstype"
+ [[ $? -ne 0 ]] && mount_failure "$_target" "$_mnt" "$_fstype"
_mounted=$_mnt
else
perror_exit "Dump target \"$_target\" is neither mounted nor configured as \"noauto\""
@@ -238,19 +238,19 @@ check_user_configured_target()
_mnt=$MKDUMPRD_TMPMNT
mkdir -p $_mnt
mount $_target $_mnt -t $_fstype -o defaults
- [ $? -ne 0 ] && mount_failure "$_target" "" "$_fstype"
+ [[ $? -ne 0 ]] && mount_failure "$_target" "" "$_fstype"
_mounted=$_mnt
fi
# For user configured target, use $SAVE_PATH as the dump path within the target
- if [ ! -d "$_mnt/$SAVE_PATH" ]; then
+ if [[ ! -d "$_mnt/$SAVE_PATH" ]]; then
perror_exit "Dump path \"$_mnt/$SAVE_PATH\" does not exist in dump target \"$_target\""
fi
check_size fs "$_target"
# Unmount it early, if function is interrupted and didn't reach here, the shell trap will clear it up anyway
- if [ -n "$_mounted" ]; then
+ if [[ -n "$_mounted" ]]; then
umount -f -- $_mounted
fi
}
@@ -260,7 +260,7 @@ verify_core_collector() {
local _cmd="${1%% *}"
local _params="${1#* }"
- if [ "$_cmd" != "makedumpfile" ]; then
+ if [[ "$_cmd" != "makedumpfile" ]]; then
if is_raw_dump_target; then
dwarn "Warning: specifying a non-makedumpfile core collector, you will have to recover the vmcore manually."
fi
@@ -284,7 +284,7 @@ verify_core_collector() {
add_mount() {
local _mnt=$(to_mount $@)
- if [ $? -ne 0 ]; then
+ if [[ $? -ne 0 ]]; then
exit 1
fi
@@ -316,7 +316,7 @@ for_each_block_target()
local dev majmin
for dev in $(get_kdump_targets); do
- [ -b "$dev" ] || continue
+ [[ -b "$dev" ]] || continue
majmin=$(get_maj_min $dev)
check_block_and_slaves $1 $majmin && return 1
done
@@ -331,10 +331,10 @@ is_unresettable()
local path="/sys/$(udevadm info --query=all --path=/sys/dev/block/$1 | awk '/^P:/ {print $2}' | sed -e 's/\(cciss[0-9]\+\/\).*/\1/g' -e 's/\/block\/.*$//')/resettable"
local resettable=1
- if [ -f "$path" ]
+ if [[ -f "$path" ]]
then
resettable="$(<"$path")"
- [ $resettable -eq 0 -a "$OVERRIDE_RESETTABLE" -eq 0 ] && {
+ [[ $resettable -eq 0 ]] && [[ "$OVERRIDE_RESETTABLE" -eq 0 ]] && {
local device=$(udevadm info --query=all --path=/sys/dev/block/$1 | awk -F= '/DEVNAME/{print $2}')
derror "Error: Can not save vmcore because device $device is unresettable"
return 0
@@ -359,7 +359,7 @@ check_resettable()
for_each_block_target is_unresettable
_ret=$?
- [ $_ret -eq 0 ] && return
+ [[ $_ret -eq 0 ]] && return
return 1
}
@@ -385,7 +385,7 @@ fi
# firstly get right SSH_KEY_LOCATION
keyfile=$(kdump_get_conf_val sshkey)
-if [ -f "$keyfile" ]; then
+if [[ -f "$keyfile" ]]; then
# canonicalize the path
SSH_KEY_LOCATION=$(/usr/bin/readlink -m $keyfile)
fi
@@ -407,7 +407,7 @@ do
perror_exit "Bad raw disk $config_val"
}
_praw=$(persistent_policy="by-id" kdump_get_persistent_dev $config_val)
- if [ -z "$_praw" ]; then
+ if [[ -z "$_praw" ]]; then
exit 1
fi
add_dracut_arg "--device" "$_praw"
@@ -438,7 +438,7 @@ done <<< "$(kdump_read_conf)"
handle_default_dump_target
-if [ -n "$extra_modules" ]
+if [[ -n "$extra_modules" ]]
then
add_dracut_arg "--add-drivers" "$extra_modules"
fi
diff --git a/mkfadumprd b/mkfadumprd
index 5c87933..ca9f362 100644
--- a/mkfadumprd
+++ b/mkfadumprd
@@ -2,7 +2,7 @@
# Generate an initramfs image that isolates dump capture capability within
# the default initramfs using zz-fadumpinit dracut module.
-if [ -f /etc/sysconfig/kdump ]; then
+if [[ -f /etc/sysconfig/kdump ]]; then
. /etc/sysconfig/kdump
fi
commit 54cc5c44befa308e122d93221c65486164ffb3e5
Author: Kairui Song <kasong(a)redhat.com>
Date: Wed Sep 8 01:48:52 2021 +0800
bash scripts: use $(...) notation instead of legacy `...`
This is a batch update done with following command:
`sed -i -e 's/`\([^`]*\)`/\$(\1)/g' mkfadumprd mkdumprd \
kdumpctl dracut-module-setup.sh dracut-fadump-module-setup.sh \
dracut-early-kdump-module-setup.sh`
And manually converted some corner cases. This fixes
all related issues detected by shellcheck.
Make it easier to do clean up in later commits.
Check following link for reasons to switch to the new syntax:
https://github.com/koalaman/shellcheck/wiki/SC2006
Signed-off-by: Kairui Song <kasong(a)redhat.com>
Acked-by: Philipp Rudo <prudo(a)redhat.com>
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh
index 202fce5..29a2f27 100755
--- a/dracut-module-setup.sh
+++ b/dracut-module-setup.sh
@@ -266,8 +266,8 @@ kdump_static_ip() {
/sbin/ip $_ipv6_flag route show | grep -v default |\
grep ".*via.* $_netdev " | grep -v "^[[:space:]]*nexthop" |\
while read -r _route; do
- _target=`echo $_route | cut -d ' ' -f1`
- _nexthop=`echo $_route | cut -d ' ' -f3`
+ _target=$(echo $_route | cut -d ' ' -f1)
+ _nexthop=$(echo $_route | cut -d ' ' -f3)
if [ "x" != "x"$_ipv6_flag ]; then
_target="[$_target]"
_nexthop="[$_nexthop]"
@@ -293,9 +293,9 @@ kdump_handle_mulitpath_route() {
[[ "$_target" == 'default' ]] && continue
[[ "$_route" =~ .*via.*\ $_netdev ]] || continue
- _weight=`echo "$_route" | cut -d ' ' -f7`
+ _weight=$(echo "$_route" | cut -d ' ' -f7)
if [[ "$_weight" -gt "$_max_weight" ]]; then
- _nexthop=`echo "$_route" | cut -d ' ' -f3`
+ _nexthop=$(echo "$_route" | cut -d ' ' -f3)
_max_weight=$_weight
if [ "x" != "x"$_ipv6_flag ]; then
_rule="rd.route=[$_target]:[$_nexthop]:$kdumpnic"
@@ -305,7 +305,7 @@ kdump_handle_mulitpath_route() {
fi
else
[[ -n "$_rule" ]] && echo "$_rule"
- _target=`echo "$_route" | cut -d ' ' -f1`
+ _target=$(echo "$_route" | cut -d ' ' -f1)
_rule="" _max_weight=0 _weight=0
fi
done >> ${initdir}/etc/cmdline.d/45route-static.conf\
@@ -383,7 +383,7 @@ kdump_setup_bond() {
local _netdev="$1"
local _nm_show_cmd="$2"
local _dev _mac _slaves _kdumpdev _bondoptions
- for _dev in `cat /sys/class/net/$_netdev/bonding/slaves`; do
+ for _dev in $(cat /sys/class/net/$_netdev/bonding/slaves); do
_mac=$(kdump_get_perm_addr $_dev)
_kdumpdev=$(kdump_setup_ifname $_dev)
echo -n " ifname=$_kdumpdev:$_mac" >> ${initdir}/etc/cmdline.d/42bond.conf
@@ -410,7 +410,7 @@ kdump_setup_bond() {
kdump_setup_team() {
local _netdev=$1
local _dev _mac _slaves _kdumpdev
- for _dev in `teamnl $_netdev ports | awk -F':' '{print $2}'`; do
+ for _dev in $(teamnl $_netdev ports | awk -F':' '{print $2}'); do
_mac=$(kdump_get_perm_addr $_dev)
_kdumpdev=$(kdump_setup_ifname $_dev)
echo -n " ifname=$_kdumpdev:$_mac" >> ${initdir}/etc/cmdline.d/44team.conf
@@ -532,11 +532,11 @@ kdump_get_remote_ip()
{
local _remote=$(get_remote_host $1) _remote_temp
if is_hostname $_remote; then
- _remote_temp=`getent ahosts $_remote | grep -v : | head -n 1`
+ _remote_temp=$(getent ahosts $_remote | grep -v : | head -n 1)
if [ -z "$_remote_temp" ]; then
- _remote_temp=`getent ahosts $_remote | head -n 1`
+ _remote_temp=$(getent ahosts $_remote | head -n 1)
fi
- _remote=`echo $_remote_temp | cut -d' ' -f1`
+ _remote=$(echo $_remote_temp | cut -d' ' -f1)
fi
echo $_remote
}
@@ -908,7 +908,7 @@ get_pcs_fence_kdump_nodes() {
pcs cluster sync > /dev/null 2>&1 && pcs cluster cib-upgrade > /dev/null 2>&1
# get cluster nodes from cluster cib, get interface and ip address
- nodelist=`pcs cluster cib | xmllint --xpath "/cib/status/node_state/@uname" -`
+ nodelist=$(pcs cluster cib | xmllint --xpath "/cib/status/node_state/@uname" -)
# nodelist is formed as 'uname="node1" uname="node2" ... uname="nodeX"'
# we need to convert each to node1, node2 ... nodeX in each iteration
diff --git a/kdumpctl b/kdumpctl
index 72c4966..1f76bf2 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -76,7 +76,7 @@ determine_dump_mode()
save_core()
{
- coredir="/var/crash/`date +"%Y-%m-%d-%H:%M"`"
+ coredir="/var/crash/$(date +"%Y-%m-%d-%H:%M")"
mkdir -p $coredir
ddebug "cp --sparse=always /proc/vmcore $coredir/vmcore-incomplete"
@@ -290,15 +290,14 @@ get_pcs_cluster_modified_files()
is_generic_fence_kdump && return 1
is_pcs_fence_kdump || return 1
- time_stamp=`pcs cluster cib | xmllint --xpath 'string(/cib/@cib-last-written)' - | \
- xargs -0 date +%s --date`
+ time_stamp=$(pcs cluster cib | xmllint --xpath 'string(/cib/@cib-last-written)' - | xargs -0 date +%s --date)
if [ -n $time_stamp -a $time_stamp -gt $image_time ]; then
modified_files="cluster-cib"
fi
if [ -f $FENCE_KDUMP_CONFIG_FILE ]; then
- time_stamp=`stat -c "%Y" $FENCE_KDUMP_CONFIG_FILE`
+ time_stamp=$(stat -c "%Y" $FENCE_KDUMP_CONFIG_FILE)
if [ "$time_stamp" -gt "$image_time" ]; then
modified_files="$modified_files $FENCE_KDUMP_CONFIG_FILE"
fi
@@ -358,7 +357,7 @@ check_files_modified()
fi
HOOKS="$HOOKS $POST_FILES $PRE_FILES"
CORE_COLLECTOR=$(kdump_get_conf_val core_collector | awk '{print $1}')
- CORE_COLLECTOR=`type -P $CORE_COLLECTOR`
+ CORE_COLLECTOR=$(type -P $CORE_COLLECTOR)
# POST_FILES and PRE_FILES are already checked against executable, need not to check again.
EXTRA_BINS="$EXTRA_BINS $CHECK_FILES"
CHECK_FILES=$(kdump_get_conf_val extra_bins)
@@ -395,13 +394,13 @@ check_files_modified()
for file in $files; do
if [ -e "$file" ]; then
- time_stamp=`stat -c "%Y" $file`
+ time_stamp=$(stat -c "%Y" $file)
if [ "$time_stamp" -gt "$image_time" ]; then
modified_files="$modified_files $file"
fi
if [ -L "$file" ]; then
file=$(readlink -m $file)
- time_stamp=`stat -c "%Y" $file`
+ time_stamp=$(stat -c "%Y" $file)
if [ "$time_stamp" -gt "$image_time" ]; then
modified_files="$modified_files $file"
fi
@@ -591,7 +590,7 @@ check_rebuild()
#check to see if dependent files has been modified
#since last build of the image file
if [ -f $TARGET_INITRD ]; then
- image_time=`stat -c "%Y" $TARGET_INITRD 2>/dev/null`
+ image_time=$(stat -c "%Y" $TARGET_INITRD 2>/dev/null)
#in case of fadump mode, check whether the default/target
#initrd is already built with dump capture capability
@@ -727,7 +726,7 @@ check_ssh_config()
done <<< "$(kdump_read_conf)"
#make sure they've configured kdump.conf for ssh dumps
- local SSH_TARGET=`echo -n $DUMP_TARGET | sed -n '/.*@/p'`
+ local SSH_TARGET=$(echo -n $DUMP_TARGET | sed -n '/.*@/p')
if [ -z "$SSH_TARGET" ]; then
return 1
fi
@@ -814,8 +813,8 @@ propagate_ssh_key()
fi
#now find the target ssh user and server to contact.
- SSH_USER=`echo $DUMP_TARGET | cut -d\ -f2 | cut -d@ -f1`
- SSH_SERVER=`echo $DUMP_TARGET | sed -e's/\(.*(a)\)\(.*$\)/\2/'`
+ SSH_USER=$(echo $DUMP_TARGET | cut -d\ -f2 | cut -d@ -f1)
+ SSH_SERVER=$(echo $DUMP_TARGET | sed -e's/\(.*(a)\)\(.*$\)/\2/')
#now send the found key to the found server
ssh-copy-id -i $KEYFILE $SSH_USER@$SSH_SERVER
@@ -844,7 +843,7 @@ check_current_fadump_status()
{
# Check if firmware-assisted dump has been registered.
rc=$(<$FADUMP_REGISTER_SYS_NODE)
- [[ $rc -eq 1 ]] && return 0
+ [ $rc -eq 1 ] && return 0
return 1
}
@@ -877,9 +876,9 @@ save_raw()
fi
kdump_dir=$(kdump_get_conf_val path)
if [ -z "${kdump_dir}" ]; then
- coredir="/var/crash/`date +"%Y-%m-%d-%H:%M"`"
+ coredir="/var/crash/$(date +"%Y-%m-%d-%H:%M")"
else
- coredir="${kdump_dir}/`date +"%Y-%m-%d-%H:%M"`"
+ coredir="${kdump_dir}/$(date +"%Y-%m-%d-%H:%M")"
fi
mkdir -p "$coredir"
@@ -956,8 +955,8 @@ selinux_relabel()
check_fence_kdump_config()
{
- local hostname=`hostname`
- local ipaddrs=`hostname -I`
+ local hostname=$(hostname)
+ local ipaddrs=$(hostname -I)
local nodes=$(kdump_get_conf_val "fence_kdump_nodes")
for node in $nodes; do
commit a416930706944828ae9bd8daf49be8ca998d3fcc
Author: Kairui Song <kasong(a)redhat.com>
Date: Wed Aug 4 15:50:30 2021 +0800
bash scripts: always use "read -r"
This helps to strip spaces and avoid mangling backslashes:
https://github.com/koalaman/shellcheck/wiki/SC2162
Signed-off-by: Kairui Song <kasong(a)redhat.com>
Acked-by: Philipp Rudo <prudo(a)redhat.com>
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh
index f37d2d2..202fce5 100755
--- a/dracut-module-setup.sh
+++ b/dracut-module-setup.sh
@@ -106,7 +106,7 @@ kdump_setup_dns() {
[ -n "$DNS2" ] && echo "nameserver=$DNS2" >> "$_dnsfile"
fi
- while read content;
+ while read -r content;
do
_nameserver=$(echo $content | grep ^nameserver)
[ -z "$_nameserver" ] && continue
@@ -265,7 +265,7 @@ kdump_static_ip() {
/sbin/ip $_ipv6_flag route show | grep -v default |\
grep ".*via.* $_netdev " | grep -v "^[[:space:]]*nexthop" |\
- while read _route; do
+ while read -r _route; do
_target=`echo $_route | cut -d ' ' -f1`
_nexthop=`echo $_route | cut -d ' ' -f3`
if [ "x" != "x"$_ipv6_flag ]; then
@@ -286,7 +286,7 @@ kdump_handle_mulitpath_route() {
_ipv6_flag="-6"
fi
- while IFS="" read _route; do
+ while IFS="" read -r _route; do
if [[ "$_route" =~ [[:space:]]+nexthop ]]; then
_route=${_route##[[:space:]]}
# Parse multipath route, using previous _target
@@ -465,7 +465,7 @@ find_online_znet_device() {
for d in $NETWORK_DEVICES
do
[ ! -f "$d/online" ] && continue
- read ONLINE < $d/online
+ read -r ONLINE < $d/online
if [ $ONLINE -ne 1 ]; then
continue
fi
@@ -473,7 +473,7 @@ find_online_znet_device() {
# device is online)
if [ -f $d/if_name ]
then
- read ifname < $d/if_name
+ read -r ifname < $d/if_name
elif [ -d $d/net ]
then
ifname=$(ls $d/net/)
@@ -685,7 +685,7 @@ kdump_install_conf() {
kdump_read_conf > "${initdir}/tmp/$$-kdump.conf"
- while read _opt _val;
+ while read -r _opt _val;
do
# remove inline comments after the end of a directive.
case "$_opt" in
@@ -753,7 +753,7 @@ kdump_get_iscsi_initiator() {
[ -f "$initiator_conf" ] || return 1
- while read _initiator; do
+ while read -r _initiator; do
[ -z "${_initiator%%#*}" ] && continue # Skip comment lines
case $_initiator in
diff --git a/kdumpctl b/kdumpctl
index 3e92804..72c4966 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -704,7 +704,7 @@ load_kdump()
check_ssh_config()
{
- while read config_opt config_val; do
+ while read -r config_opt config_val; do
case "$config_opt" in
sshkey)
# remove inline comments after the end of a directive.
diff --git a/mkdumprd b/mkdumprd
index 5341245..6621e30 100644
--- a/mkdumprd
+++ b/mkdumprd
@@ -390,7 +390,7 @@ if [ -f "$keyfile" ]; then
SSH_KEY_LOCATION=$(/usr/bin/readlink -m $keyfile)
fi
-while read config_opt config_val;
+while read -r config_opt config_val;
do
# remove inline comments after the end of a directive.
case "$config_opt" in
commit fdfad3102e0d0564a7f26f7a3f25596d12502481
Author: Kairui Song <kasong(a)redhat.com>
Date: Wed Aug 4 15:46:27 2021 +0800
bash scripts: get rid of unnecessary sed calls
Use bash builtin string substitution instead, as suggested by:
https://github.com/koalaman/shellcheck/wiki/SC2001
Signed-off-by: Kairui Song <kasong(a)redhat.com>
Acked-by: Philipp Rudo <prudo(a)redhat.com>
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh
index fc90912..f37d2d2 100755
--- a/dracut-module-setup.sh
+++ b/dracut-module-setup.sh
@@ -288,7 +288,7 @@ kdump_handle_mulitpath_route() {
while IFS="" read _route; do
if [[ "$_route" =~ [[:space:]]+nexthop ]]; then
- _route=$(echo "$_route" | sed -e 's/^[[:space:]]*//')
+ _route=${_route##[[:space:]]}
# Parse multipath route, using previous _target
[[ "$_target" == 'default' ]] && continue
[[ "$_route" =~ .*via.*\ $_netdev ]] || continue
@@ -373,7 +373,7 @@ kdump_setup_bridge() {
fi
_brif+="$_kdumpdev,"
done
- echo " bridge=$_netdev:$(echo $_brif | sed -e 's/,$//')" >> ${initdir}/etc/cmdline.d/41bridge.conf
+ echo " bridge=$_netdev:${_brif%,}" >> "${initdir}/etc/cmdline.d/41bridge.conf"
}
# drauct takes bond=<bondname>[:<bondslaves>:[:<options>]] syntax to parse
@@ -389,7 +389,7 @@ kdump_setup_bond() {
echo -n " ifname=$_kdumpdev:$_mac" >> ${initdir}/etc/cmdline.d/42bond.conf
_slaves+="$_kdumpdev,"
done
- echo -n " bond=$_netdev:$(echo $_slaves | sed 's/,$//')" >> ${initdir}/etc/cmdline.d/42bond.conf
+ echo -n " bond=$_netdev:${_slaves%,}" >> "${initdir}/etc/cmdline.d/42bond.conf"
_bondoptions=$(get_nmcli_value_by_field "$_nm_show_cmd" "bond.options")
@@ -416,7 +416,7 @@ kdump_setup_team() {
echo -n " ifname=$_kdumpdev:$_mac" >> ${initdir}/etc/cmdline.d/44team.conf
_slaves+="$_kdumpdev,"
done
- echo " team=$_netdev:$(echo $_slaves | sed -e 's/,$//')" >> ${initdir}/etc/cmdline.d/44team.conf
+ echo " team=$_netdev:${_slaves%,}" >> "${initdir}/etc/cmdline.d/44team.conf"
#Buggy version teamdctl outputs to stderr!
#Try to use the latest version of teamd.
teamdctl "$_netdev" config dump > ${initdir}/tmp/$$-$_netdev.conf
diff --git a/mkdumprd b/mkdumprd
index 36e2b90..5341245 100644
--- a/mkdumprd
+++ b/mkdumprd
@@ -58,7 +58,7 @@ add_dracut_sshkey() {
# caller should ensure $1 is valid and mounted in 1st kernel
to_mount() {
- local _target=$1 _fstype=$2 _options=$3 _new_mntpoint _pdev
+ local _target=$1 _fstype=$2 _options=$3 _sed_cmd _new_mntpoint _pdev
_new_mntpoint=$(get_kdump_mntpoint_from_target $_target)
_fstype="${_fstype:-$(get_fs_type_from_target $_target)}"
@@ -67,9 +67,9 @@ to_mount() {
if [[ "$_fstype" == "nfs"* ]]; then
_pdev=$_target
- _options=$(echo $_options | sed 's/,addr=[^,]*//')
- _options=$(echo $_options | sed 's/,proto=[^,]*//')
- _options=$(echo $_options | sed 's/,clientaddr=[^,]*//')
+ _sed_cmd+='s/,addr=[^,]*//;'
+ _sed_cmd+='s/,proto=[^,]*//;'
+ _sed_cmd+='s/,clientaddr=[^,]*//;'
else
# for non-nfs _target converting to use udev persistent name
_pdev="$(kdump_get_persistent_dev $_target)"
@@ -79,13 +79,15 @@ to_mount() {
fi
# mount fs target as rw in 2nd kernel
- _options=$(echo $_options | sed 's/\(^\|,\)ro\($\|,\)/\1rw\2/g')
+ _sed_cmd+='s/\(^\|,\)ro\($\|,\)/\1rw\2/g;'
# with 'noauto' in fstab nfs and non-root disk mount will fail in 2nd
# kernel, filter it out here.
- _options=$(echo $_options | sed 's/\(^\|,\)noauto\($\|,\)/\1/g')
+ _sed_cmd+='s/\(^\|,\)noauto\($\|,\)/\1/g;'
# drop nofail or nobootwait
- _options=$(echo $_options | sed 's/\(^\|,\)nofail\($\|,\)/\1/g')
- _options=$(echo $_options | sed 's/\(^\|,\)nobootwait\($\|,\)/\1/g')
+ _sed_cmd+='s/\(^\|,\)nofail\($\|,\)/\1/g;'
+ _sed_cmd+='s/\(^\|,\)nobootwait\($\|,\)/\1/g;'
+
+ _options=$(echo "$_options" | sed "$_sed_cmd")
echo "$_pdev $_new_mntpoint $_fstype $_options"
}
commit c4d85142be300814b8818fe8aad65eaa042e01c8
Author: Kairui Song <kasong(a)redhat.com>
Date: Wed Aug 4 15:18:59 2021 +0800
bash scripts: get rid of expr and let
As suggested by:
https://github.com/koalaman/shellcheck/wiki/SC2219
Signed-off-by: Kairui Song <kasong(a)redhat.com>
Acked-by: Philipp Rudo <prudo(a)redhat.com>
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh
index ef731fc..fc90912 100755
--- a/dracut-module-setup.sh
+++ b/dracut-module-setup.sh
@@ -196,7 +196,7 @@ cal_netmask_by_prefix() {
_res="$_first_part"
_tmp=$((_octets_total*_bits_per_octet-_prefix))
- _zero_bits=$(expr $_tmp % $_bits_per_group)
+ _zero_bits=$((_tmp % _bits_per_group))
if [[ "$_zero_bits" -ne 0 ]]; then
_second_part=$((_max_group_value >> _zero_bits << _zero_bits))
if ((_ipv6)); then
diff --git a/kdumpctl b/kdumpctl
index 2226417..3e92804 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -772,7 +772,7 @@ check_and_wait_network_ready()
fi
cur=$(date +%s)
- let "diff = $cur - $start_time"
+ diff=$((cur - start_time))
# 60s time out
if [ $diff -gt 180 ]; then
break;
@@ -835,7 +835,7 @@ show_reserved_mem()
local mem_mb
mem=$(</sys/kernel/kexec_crash_size)
- mem_mb=$(expr "$mem" / 1024 / 1024)
+ mem_mb=$((mem / 1024 / 1024))
dinfo "Reserved "$mem_mb"MB memory for crash kernel"
}
commit 6d45257cc15b3a5b28ed3bfdacb06af065aaecb7
Author: Kairui Song <kasong(a)redhat.com>
Date: Wed Aug 4 15:14:00 2021 +0800
bash scripts: remove useless cat
Some `cat` calls are useless, remove them to make it cleaner.
See: https://github.com/koalaman/shellcheck/wiki/SC2002
Signed-off-by: Kairui Song <kasong(a)redhat.com>
Acked-by: Philipp Rudo <prudo(a)redhat.com>
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh
index af17736..ef731fc 100755
--- a/dracut-module-setup.sh
+++ b/dracut-module-setup.sh
@@ -114,7 +114,7 @@ kdump_setup_dns() {
_dns=$(echo $_nameserver | cut -d' ' -f2)
[ -z "$_dns" ] && continue
- if [ ! -f $_dnsfile ] || [ ! $(cat $_dnsfile | grep -q $_dns) ]; then
+ if [ ! -f $_dnsfile ] || ! grep -q "$_dns" "$_dnsfile" ; then
echo "nameserver=$_dns" >> "$_dnsfile"
fi
done < "/etc/resolv.conf"
@@ -988,7 +988,9 @@ kdump_configure_fence_kdump () {
# Install a random seed used to feed /dev/urandom
# By the time kdump service starts, /dev/uramdom is already fed by systemd
kdump_install_random_seed() {
- local poolsize=`cat /proc/sys/kernel/random/poolsize`
+ local poolsize
+
+ poolsize=$(</proc/sys/kernel/random/poolsize)
if [ ! -d ${initdir}/var/lib/ ]; then
mkdir -p ${initdir}/var/lib/
diff --git a/kdumpctl b/kdumpctl
index bb3d42a..2226417 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -204,8 +204,8 @@ restore_default_initrd()
# fadump to kdump. Restore the original default initrd.
if [ -f $DEFAULT_INITRD_BAK ] && [ -f $INITRD_CHECKSUM_LOCATION ]; then
# verify checksum before restoring
- backup_checksum=`sha1sum $DEFAULT_INITRD_BAK | awk '{ print $1 }'`
- default_checksum=`cat $INITRD_CHECKSUM_LOCATION | awk '{ print $1 }'`
+ backup_checksum=$(sha1sum "$DEFAULT_INITRD_BAK" | awk '{ print $1 }')
+ default_checksum=$(awk '{ print $1 }' "$INITRD_CHECKSUM_LOCATION")
if [ "$default_checksum" != "$backup_checksum" ]; then
dwarn "WARNING: checksum mismatch! Can't restore original initrd.."
else
@@ -638,8 +638,7 @@ function load_kdump_kernel_key()
return
fi
- KDUMP_KEY_ID=$(cat /usr/share/doc/kernel-keys/$KDUMP_KERNELVER/kernel-signing-ppc.cer |
- keyctl padd asymmetric kernelkey-$RANDOM %:.ima)
+ KDUMP_KEY_ID=$(keyctl padd asymmetric kernelkey-$RANDOM %:.ima < "/usr/share/doc/kernel-keys/$KDUMP_KERNELVER/kernel-signing-ppc.cer")
}
# remove a previously loaded key. There's no real security implication
@@ -832,8 +831,11 @@ propagate_ssh_key()
show_reserved_mem()
{
- local mem=$(cat /sys/kernel/kexec_crash_size)
- local mem_mb=$(expr $mem / 1024 / 1024)
+ local mem
+ local mem_mb
+
+ mem=$(</sys/kernel/kexec_crash_size)
+ mem_mb=$(expr "$mem" / 1024 / 1024)
dinfo "Reserved "$mem_mb"MB memory for crash kernel"
}
@@ -841,8 +843,8 @@ show_reserved_mem()
check_current_fadump_status()
{
# Check if firmware-assisted dump has been registered.
- rc=`cat $FADUMP_REGISTER_SYS_NODE`
- [ $rc -eq 1 ] && return 0
+ rc=$(<$FADUMP_REGISTER_SYS_NODE)
+ [[ $rc -eq 1 ]] && return 0
return 1
}
@@ -1259,7 +1261,7 @@ do_estimate() {
# The default pre-reserved crashkernel value
baseline_size=$((baseline * size_mb))
# Current reserved crashkernel size
- reserved_size=$(cat /sys/kernel/kexec_crash_size)
+ reserved_size=$(</sys/kernel/kexec_crash_size)
# A pre-estimated value for userspace usage and kernel
# runtime allocation, 64M should good for most cases
runtime_size=$((64 * size_mb))
diff --git a/mkdumprd b/mkdumprd
index aa0f785..36e2b90 100644
--- a/mkdumprd
+++ b/mkdumprd
@@ -331,7 +331,7 @@ is_unresettable()
if [ -f "$path" ]
then
- resettable="$(cat $path)"
+ resettable="$(<"$path")"
[ $resettable -eq 0 -a "$OVERRIDE_RESETTABLE" -eq 0 ] && {
local device=$(udevadm info --query=all --path=/sys/dev/block/$1 | awk -F= '/DEVNAME/{print $2}')
derror "Error: Can not save vmcore because device $device is unresettable"
commit 3b0157197b4dcc7c06487d5f44395317c5f4670f
Author: Kairui Song <kasong(a)redhat.com>
Date: Wed Sep 8 15:15:44 2021 +0800
dracut-module-setup.sh: remove surrounding $() for subshell
Some functions are executed in subshell to avoid variable environment
pollution. But the surrounding $() is not needed, and it may lead to
executing output which is unexpected here.
See: https://github.com/koalaman/shellcheck/wiki/SC2091
Signed-off-by: Kairui Song <kasong(a)redhat.com>
Suggested-by: Coiby Xu <coxu(a)redhat.com>
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh
index 267c98e..af17736 100755
--- a/dracut-module-setup.sh
+++ b/dracut-module-setup.sh
@@ -358,7 +358,7 @@ kdump_setup_bridge() {
_dev=${_dev##*/}
_kdumpdev=$_dev
if kdump_is_bond "$_dev"; then
- $(kdump_setup_bond "$_dev" "$(get_nmcli_connection_show_cmd_by_ifname "$_dev")")
+ (kdump_setup_bond "$_dev" "$(get_nmcli_connection_show_cmd_by_ifname "$_dev")")
if [[ $? != 0 ]]; then
exit 1
fi
@@ -441,7 +441,7 @@ kdump_setup_vlan() {
derror "Vlan over bridge is not supported!"
exit 1
elif kdump_is_bond "$_phydev"; then
- $(kdump_setup_bond "$_phydev" "$(get_nmcli_connection_show_cmd_by_ifname "$_phydev")")
+ (kdump_setup_bond "$_phydev" "$(get_nmcli_connection_show_cmd_by_ifname "$_phydev")")
if [[ $? != 0 ]]; then
exit 1
fi
@@ -560,7 +560,7 @@ kdump_install_net() {
_znet_netdev=$(find_online_znet_device)
if [[ -n "$_znet_netdev" ]]; then
_nm_show_cmd_znet=$(get_nmcli_connection_show_cmd_by_ifname "$_znet_netdev")
- $(kdump_setup_znet "$_znet_netdev" "$_nm_show_cmd_znet")
+ (kdump_setup_znet "$_znet_netdev" "$_nm_show_cmd_znet")
if [[ $? != 0 ]]; then
derror "Failed to set up znet"
exit 1
@@ -591,7 +591,7 @@ kdump_install_net() {
if kdump_is_bridge "$_netdev"; then
kdump_setup_bridge "$_netdev"
elif kdump_is_bond "$_netdev"; then
- $(kdump_setup_bond "$_netdev" "$_nm_show_cmd")
+ (kdump_setup_bond "$_netdev" "$_nm_show_cmd")
if [[ $? != 0 ]]; then
exit 1
fi
commit 67e559a6b905b8f06a0929b7d7c86130fbe30638
Author: Kairui Song <kasong(a)redhat.com>
Date: Wed Aug 4 16:29:55 2021 +0800
dracut-module-setup.sh: make iscsi check fail early if cd failed
As suggested by:
https://github.com/koalaman/shellcheck/wiki/SC2164
Signed-off-by: Kairui Song <kasong(a)redhat.com>
Acked-by: Philipp Rudo <prudo(a)redhat.com>
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh
index f13b1a7..267c98e 100755
--- a/dracut-module-setup.sh
+++ b/dracut-module-setup.sh
@@ -855,7 +855,7 @@ kdump_check_iscsi_targets () {
_dev=$1
[[ -L /sys/dev/block/$_dev ]] || return
- cd "$(readlink -f /sys/dev/block/$_dev)"
+ cd "$(readlink -f "/sys/dev/block/$_dev")" || return 1
until [[ -d sys || -d iscsi_session ]]; do
cd ..
done
commit 3b2fa982bbe413e61ac53fa114782e1f08f8a939
Author: Kairui Song <kasong(a)redhat.com>
Date: Wed Aug 4 16:16:44 2021 +0800
dracut-module-setup.sh: fix a loop over ls issue
Iterating over ls output is fragile:
https://github.com/koalaman/shellcheck/wiki/SC2045
Signed-off-by: Kairui Song <kasong(a)redhat.com>
Acked-by: Philipp Rudo <prudo(a)redhat.com>
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh
index 8b0398a..f13b1a7 100755
--- a/dracut-module-setup.sh
+++ b/dracut-module-setup.sh
@@ -353,7 +353,9 @@ kdump_setup_ifname() {
kdump_setup_bridge() {
local _netdev=$1
local _brif _dev _mac _kdumpdev
- for _dev in `ls /sys/class/net/$_netdev/brif/`; do
+ for _dev in "/sys/class/net/$_netdev/brif/"*; do
+ [[ -e $_dev ]] || continue
+ _dev=${_dev##*/}
_kdumpdev=$_dev
if kdump_is_bond "$_dev"; then
$(kdump_setup_bond "$_dev" "$(get_nmcli_connection_show_cmd_by_ifname "$_dev")")
commit dfe7555323e22d3f23621fcdae11b2c467754175
Author: Kairui Song <kasong(a)redhat.com>
Date: Wed Aug 4 15:51:34 2021 +0800
dracut-module-setup.sh: fix a ambiguous variable reference
Wrap the variable with {...}, else it may get interpreted as array due
to the '[' char next to it.
Signed-off-by: Kairui Song <kasong(a)redhat.com>
Acked-by: Philipp Rudo <prudo(a)redhat.com>
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh
index 3d465c4..8b0398a 100755
--- a/dracut-module-setup.sh
+++ b/dracut-module-setup.sh
@@ -689,11 +689,11 @@ kdump_install_conf() {
case "$_opt" in
raw)
_pdev=$(persistent_policy="by-id" kdump_get_persistent_dev $_val)
- sed -i -e "s#^$_opt[[:space:]]\+$_val#$_opt $_pdev#" ${initdir}/tmp/$$-kdump.conf
+ sed -i -e "s#^${_opt}[[:space:]]\+$_val#$_opt $_pdev#" ${initdir}/tmp/$$-kdump.conf
;;
ext[234]|xfs|btrfs|minix)
_pdev=$(kdump_get_persistent_dev $_val)
- sed -i -e "s#^$_opt[[:space:]]\+$_val#$_opt $_pdev#" ${initdir}/tmp/$$-kdump.conf
+ sed -i -e "s#^${_opt}[[:space:]]\+$_val#$_opt $_pdev#" ${initdir}/tmp/$$-kdump.conf
;;
ssh|nfs)
kdump_install_net "$_val"
commit da3ad9cbdaa332ed9384799e4b3198b9e55c5cd3
Author: Kairui Song <kasong(a)redhat.com>
Date: Wed Aug 4 15:47:43 2021 +0800
dracut-module-setup.sh: use "*" to expend array as string
As suggested by:
https://github.com/koalaman/shellcheck/wiki/SC2199
The array is not quoted here but implicitly concatenate still happens,
could be harmless but shellcheck complains about it so fix it.
Signed-off-by: Kairui Song <kasong(a)redhat.com>
Acked-by: Philipp Rudo <prudo(a)redhat.com>
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh
index 815abeb..3d465c4 100755
--- a/dracut-module-setup.sh
+++ b/dracut-module-setup.sh
@@ -94,7 +94,7 @@ kdump_setup_dns() {
_tmp=$(get_nmcli_value_by_field "$_nm_show_cmd" "IP4.DNS")
array=(${_tmp//|/ })
- if [[ ${array[@]} ]]; then
+ if [[ ${array[*]} ]]; then
for _dns in "${array[@]}"
do
echo "nameserver=$_dns" >> "$_dnsfile"
commit 49dd4fcdbb9a21e938829e014d2db7ec3e5d2fea
Author: Kairui Song <kasong(a)redhat.com>
Date: Wed Aug 4 15:41:10 2021 +0800
dracut-module-setup.sh: fix _bondoptions wrong references
Signed-off-by: Kairui Song <kasong(a)redhat.com>
Acked-by: Philipp Rudo <prudo(a)redhat.com>
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh
index 7396403..815abeb 100755
--- a/dracut-module-setup.sh
+++ b/dracut-module-setup.sh
@@ -391,13 +391,13 @@ kdump_setup_bond() {
_bondoptions=$(get_nmcli_value_by_field "$_nm_show_cmd" "bond.options")
- if [[ -z "_bondoptions" ]]; then
+ if [[ -z "$_bondoptions" ]]; then
dwarning "Failed to get bond configuration via nmlci output. Now try sourcing ifcfg script."
source_ifcfg_file $_netdev
_bondoptions="$(echo $BONDING_OPTS | xargs echo | tr " " ",")"
fi
- if [[ -z "_bondoptions" ]]; then
+ if [[ -z "$_bondoptions" ]]; then
derror "Get empty bond options"
exit 1
fi
commit ba7aa447b25f2c66f48ff7ca4a139eb39e4f2340
Author: Kairui Song <kasong(a)redhat.com>
Date: Wed Aug 4 14:29:10 2021 +0800
dracut-module-setup.sh: remove an unused variable
Signed-off-by: Kairui Song <kasong(a)redhat.com>
Acked-by: Philipp Rudo <prudo(a)redhat.com>
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh
index d7f8cb5..7396403 100755
--- a/dracut-module-setup.sh
+++ b/dracut-module-setup.sh
@@ -997,8 +997,6 @@ kdump_install_random_seed() {
}
kdump_install_systemd_conf() {
- local failure_action=$(kdump_get_conf_val "failure_action")
-
# Kdump turns out to require longer default systemd mount timeout
# than 1st kernel(90s by default), we use default 300s for kdump.
grep -r "^[[:space:]]*DefaultTimeoutStartSec=" ${initdir}/etc/systemd/system.conf* &>/dev/null
commit 46542ccda5df42a8b07e1d7fee629374e51e732a
Author: Kairui Song <kasong(a)redhat.com>
Date: Wed Aug 4 02:59:43 2021 +0800
dracut-module-setup.sh: rework kdump_get_ip_route_field
Avoid duplicated echo / cut / grep call, just use sed.
Signed-off-by: Kairui Song <kasong(a)redhat.com>
Acked-by: Philipp Rudo <prudo(a)redhat.com>
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh
index 53abdc7..d7f8cb5 100755
--- a/dracut-module-setup.sh
+++ b/dracut-module-setup.sh
@@ -523,9 +523,7 @@ kdump_get_ip_route()
kdump_get_ip_route_field()
{
- if `echo $1 | grep -q $2`; then
- echo ${1##*$2} | cut -d ' ' -f1
- fi
+ echo "$1" | sed -n -e "s/^.*\<$2\>\s\+\(\S\+\).*$/\1/p"
}
kdump_get_remote_ip()
commit 982205d6072b1c10b2f0eff44c3ccbfa92dd3198
Author: Kairui Song <kasong(a)redhat.com>
Date: Wed Aug 4 03:06:57 2021 +0800
mkfadumprd: make _dracut_isolate_args an array
To make arguments list work as expected, array is preferred.
Check following link for details:
https://github.com/koalaman/shellcheck/wiki/SC2089
Signed-off-by: Kairui Song <kasong(a)redhat.com>
Acked-by: Philipp Rudo <prudo(a)redhat.com>
diff --git a/mkfadumprd b/mkfadumprd
index aecf2a8..5c87933 100644
--- a/mkfadumprd
+++ b/mkfadumprd
@@ -51,14 +51,17 @@ if ! (pushd "$MKFADUMPRD_TMPDIR/fadumproot" > /dev/null && lsinitrd --unpack "$F
fi
### Pack it into the normal boot initramfs with zz-fadumpinit module
-_dracut_isolate_args="--rebuild $REBUILD_INITRD --add zz-fadumpinit \
- -i $MKFADUMPRD_TMPDIR/fadumproot /fadumproot \
- -i $MKFADUMPRD_TMPDIR/fadumproot/usr/lib/dracut/hostonly-kernel-modules.txt
- /usr/lib/dracut/fadump-kernel-modules.txt"
+_dracut_isolate_args=(\
+ --rebuild "$REBUILD_INITRD" --add zz-fadumpinit \
+ -i "$MKFADUMPRD_TMPDIR/fadumproot" /fadumproot
+ -i "$MKFADUMPRD_TMPDIR/fadumproot/usr/lib/dracut/hostonly-kernel-modules.txt"
+ /usr/lib/dracut/fadump-kernel-modules.txt
+)
if is_squash_available; then
- _dracut_isolate_args="$_dracut_isolate_args --add squash"
+ _dracut_isolate_args+=( --add squash )
fi
-if ! dracut --force --quiet $_dracut_isolate_args $@ "$TARGET_INITRD"; then
+
+if ! dracut --force --quiet "${_dracut_isolate_args[@]}" "$@" "$TARGET_INITRD"; then
perror_exit "mkfadumprd: failed to setup '$TARGET_INITRD' with dump capture capability"
fi
commit 3a4b0351d0f31de739a2aae794e0e2af7fcc4942
Author: Kairui Song <kasong(a)redhat.com>
Date: Wed Aug 18 15:45:20 2021 +0800
mkdumprd: use array to store ssh arguments in mkdir_save_path_ssh
For storing arguments, plain string is not a good choice. Array is
preferred:
See: https://github.com/koalaman/shellcheck/wiki/SC2089
Signed-off-by: Kairui Song <kasong(a)redhat.com>
Acked-by: Philipp Rudo <prudo(a)redhat.com>
diff --git a/mkdumprd b/mkdumprd
index 79cc6b5..aa0f785 100644
--- a/mkdumprd
+++ b/mkdumprd
@@ -111,20 +111,20 @@ get_ssh_size() {
mkdir_save_path_ssh()
{
local _opt _dir
- _opt="-i $SSH_KEY_LOCATION -o BatchMode=yes -o StrictHostKeyChecking=yes"
- ssh -qn $_opt $1 mkdir -p $SAVE_PATH 2>&1 > /dev/null
+ _opt=(-i "$SSH_KEY_LOCATION" -o BatchMode=yes -o StrictHostKeyChecking=yes)
+ ssh -qn "${_opt[@]}" $1 mkdir -p $SAVE_PATH 2>&1 > /dev/null
_ret=$?
if [ $_ret -ne 0 ]; then
perror_exit "mkdir failed on $1:$SAVE_PATH"
fi
#check whether user has write permission on $1:$SAVE_PATH
- _dir=$(ssh -qn $_opt $1 mktemp -dqp $SAVE_PATH 2>/dev/null)
+ _dir=$(ssh -qn "${_opt[@]}" $1 mktemp -dqp $SAVE_PATH 2>/dev/null)
_ret=$?
if [ $_ret -ne 0 ]; then
perror_exit "Could not create temporary directory on $1:$SAVE_PATH. Make sure user has write permission on destination"
fi
- ssh -qn $_opt $1 rmdir $_dir
+ ssh -qn "${_opt[@]}" $1 rmdir $_dir
return 0
}
commit c486b1fa3010c4c5f190ece9a2ed0a1430dfe7b5
Author: Kairui Song <kasong(a)redhat.com>
Date: Tue Sep 7 14:42:30 2021 +0800
mkdumprd: remove an awk call in get_fs_size
By using `df --output=avail`, the awk call can be dropped.
Signed-off-by: Kairui Song <kasong(a)redhat.com>
Acked-by: Philipp Rudo <prudo(a)redhat.com>
diff --git a/mkdumprd b/mkdumprd
index bc50208..79cc6b5 100644
--- a/mkdumprd
+++ b/mkdumprd
@@ -132,7 +132,7 @@ mkdir_save_path_ssh()
#Function: get_fs_size
#$1=dump target
get_fs_size() {
- df -P "$(get_mntpoint_from_target "$1")/$SAVE_PATH"|tail -1|awk '{print $4}'
+ df --output=avail "$(get_mntpoint_from_target "$1")/$SAVE_PATH" | tail -1
}
#Function: get_raw_size
commit d6449e7293fb426ebb9f0bffee57d675573a64d6
Author: Kairui Song <kasong(a)redhat.com>
Date: Wed Aug 4 17:15:42 2021 +0800
mkdumprd: fix multiple issues with get_ssh_size
Currently get_ssh_size is not working as expected, it should return the
target's available space, but it will include df's header row string as
the result. Fix this issue by only use the last output line.
And the _opt variable will be used as args so it should be an array.
Also remove the awk call, just use `df --output=avail` instead.
Signed-off-by: Kairui Song <kasong(a)redhat.com>
Acked-by: Philipp Rudo <prudo(a)redhat.com>
diff --git a/mkdumprd b/mkdumprd
index de0e22d..bc50208 100644
--- a/mkdumprd
+++ b/mkdumprd
@@ -94,15 +94,14 @@ to_mount() {
#$1=dump target
#called from while loop and shouldn't read from stdin, so we're using "ssh -n"
get_ssh_size() {
- local _opt _out
- _opt="-i $SSH_KEY_LOCATION -o BatchMode=yes -o StrictHostKeyChecking=yes"
- _out=$(ssh -q -n $_opt $1 "df -P $SAVE_PATH")
- [ $? -ne 0 ] && {
+ local _out
+ local _opt=("-i" "$SSH_KEY_LOCATION" "-o" "BatchMode=yes" "-o" "StrictHostKeyChecking=yes")
+
+ if ! _out=$(ssh -q -n "${_opt[@]}" "$1" "df" "--output=avail" "$SAVE_PATH"); then
perror_exit "checking remote ssh server available size failed."
- }
+ fi
- #ssh output removed the line break, so print field NF-2
- echo -n "$_out" | awk '{avail=NF-2; print $avail}'
+ echo -n "$_out" | tail -1
}
#mkdir if save path does not exist on ssh dump target
commit e4c7b5bbf598be896ae6aeb7b842a15b4be63d38
Author: Kairui Song <kasong(a)redhat.com>
Date: Wed Aug 4 03:53:35 2021 +0800
mkdumprd: remove some redundant echo
Signed-off-by: Kairui Song <kasong(a)redhat.com>
Acked-by: Philipp Rudo <prudo(a)redhat.com>
diff --git a/mkdumprd b/mkdumprd
index c7538a9..de0e22d 100644
--- a/mkdumprd
+++ b/mkdumprd
@@ -94,7 +94,7 @@ to_mount() {
#$1=dump target
#called from while loop and shouldn't read from stdin, so we're using "ssh -n"
get_ssh_size() {
- local _opt _out _size
+ local _opt _out
_opt="-i $SSH_KEY_LOCATION -o BatchMode=yes -o StrictHostKeyChecking=yes"
_out=$(ssh -q -n $_opt $1 "df -P $SAVE_PATH")
[ $? -ne 0 ] && {
@@ -102,8 +102,7 @@ get_ssh_size() {
}
#ssh output removed the line break, so print field NF-2
- _size=$(echo -n $_out| awk '{avail=NF-2; print $avail}')
- echo -n $_size
+ echo -n "$_out" | awk '{avail=NF-2; print $avail}'
}
#mkdir if save path does not exist on ssh dump target
@@ -134,14 +133,13 @@ mkdir_save_path_ssh()
#Function: get_fs_size
#$1=dump target
get_fs_size() {
- local _mnt=$(get_mntpoint_from_target $1)
- echo -n $(df -P "${_mnt}/$SAVE_PATH"|tail -1|awk '{print $4}')
+ df -P "$(get_mntpoint_from_target "$1")/$SAVE_PATH"|tail -1|awk '{print $4}'
}
#Function: get_raw_size
#$1=dump target
get_raw_size() {
- echo -n $(fdisk -s "$1")
+ fdisk -s "$1"
}
#Function: check_size
commit 227fc2bc7dcd9ebc328634dc421373624ba22cc2
Author: Kairui Song <kasong(a)redhat.com>
Date: Wed Aug 4 03:50:04 2021 +0800
mkdumprd: make dracut_args an array again
To make arguments list work as expected, array is preferred.
Use xargs only to parse the "dracut_args" config value, and pass the
array directly to dracut.
Check following link for details:
https://github.com/koalaman/shellcheck/wiki/SC2089
Signed-off-by: Kairui Song <kasong(a)redhat.com>
Acked-by: Philipp Rudo <prudo(a)redhat.com>
diff --git a/mkdumprd b/mkdumprd
index 8687b30..c7538a9 100644
--- a/mkdumprd
+++ b/mkdumprd
@@ -28,7 +28,7 @@ SAVE_PATH=$(get_save_path)
OVERRIDE_RESETTABLE=0
extra_modules=""
-dracut_args="--add kdumpbase --quiet --hostonly --hostonly-cmdline --hostonly-i18n --hostonly-mode strict -o \"plymouth dash resume ifcfg earlykdump\""
+dracut_args=( --add kdumpbase --quiet --hostonly --hostonly-cmdline --hostonly-i18n --hostonly-mode strict -o "plymouth dash resume ifcfg earlykdump" )
readonly MKDUMPRD_TMPDIR="$(mktemp -d -t mkdumprd.XXXXXX)"
[ -d "$MKDUMPRD_TMPDIR" ] || perror_exit "dracut: mktemp -p -d -t dracut.XXXXXX failed."
@@ -45,15 +45,15 @@ trap '
trap 'exit 1;' SIGINT
add_dracut_arg() {
- dracut_args="$dracut_args $@"
+ dracut_args+=( "$@" )
}
add_dracut_mount() {
- add_dracut_arg "--mount" "\"$1\""
+ add_dracut_arg "--mount" "$1"
}
add_dracut_sshkey() {
- add_dracut_arg "--sshkey" "\"$1\""
+ add_dracut_arg "--sshkey" "$1"
}
# caller should ensure $1 is valid and mounted in 1st kernel
@@ -428,7 +428,9 @@ do
verify_core_collector "$config_val"
;;
dracut_args)
- add_dracut_arg $config_val
+ while read -r dracut_arg; do
+ add_dracut_arg "$dracut_arg"
+ done <<< "$(echo "$config_val" | xargs -n 1 echo)"
;;
*)
;;
@@ -439,7 +441,7 @@ handle_default_dump_target
if [ -n "$extra_modules" ]
then
- add_dracut_arg "--add-drivers" \"$extra_modules\"
+ add_dracut_arg "--add-drivers" "$extra_modules"
fi
# TODO: The below check is not needed anymore with the introduction of
@@ -455,7 +457,7 @@ if ! is_fadump_capable; then
add_dracut_arg "--no-hostonly-default-device"
fi
-echo "$dracut_args $@" | xargs dracut
+dracut "${dracut_args[@]}" "$@"
_rc=$?
sync
commit 075e62252ec13e582e8aaa43a0fefee1ad5d8a58
Author: Kairui Song <kasong(a)redhat.com>
Date: Wed Aug 4 01:58:04 2021 +0800
mkdumprd: use kdump_get_conf_val to read config values
Simplify the code and cover more corner cases.
Signed-off-by: Kairui Song <kasong(a)redhat.com>
Acked-by: Philipp Rudo <prudo(a)redhat.com>
diff --git a/mkdumprd b/mkdumprd
index d554511..8687b30 100644
--- a/mkdumprd
+++ b/mkdumprd
@@ -23,7 +23,6 @@ if [ $? -ne 0 ]; then
exit 1
fi
-conf_file="/etc/kdump.conf"
SSH_KEY_LOCATION="/root/.ssh/kdump_id_rsa"
SAVE_PATH=$(get_save_path)
OVERRIDE_RESETTABLE=0
@@ -312,19 +311,6 @@ handle_default_dump_target()
check_size fs $_target
}
-get_override_resettable()
-{
- local override_resettable
-
- override_resettable=$(grep "^override_resettable" $conf_file)
- if [ -n "$override_resettable" ]; then
- OVERRIDE_RESETTABLE=$(echo $override_resettable | cut -d' ' -f2)
- if [ "$OVERRIDE_RESETTABLE" != "0" ] && [ "$OVERRIDE_RESETTABLE" != "1" ];then
- perror_exit "override_resettable value $OVERRIDE_RESETTABLE is invalid"
- fi
- fi
-}
-
# $1: function name
for_each_block_target()
{
@@ -363,9 +349,13 @@ is_unresettable()
#return true if resettable
check_resettable()
{
- local _ret _target
+ local _ret _target _override_resettable
- get_override_resettable
+ _override_resettable=$(kdump_get_conf_val override_resettable)
+ OVERRIDE_RESETTABLE=${_override_resettable:-$OVERRIDE_RESETTABLE}
+ if [ "$OVERRIDE_RESETTABLE" != "0" ] && [ "$OVERRIDE_RESETTABLE" != "1" ];then
+ perror_exit "override_resettable value '$OVERRIDE_RESETTABLE' is invalid"
+ fi
for_each_block_target is_unresettable
_ret=$?
@@ -395,7 +385,7 @@ if ! check_crypt; then
fi
# firstly get right SSH_KEY_LOCATION
-keyfile=$(awk '/^sshkey/ {print $2}' $conf_file)
+keyfile=$(kdump_get_conf_val sshkey)
if [ -f "$keyfile" ]; then
# canonicalize the path
SSH_KEY_LOCATION=$(/usr/bin/readlink -m $keyfile)
commit 80525afaceac3fa6bdf6e57686f66ab497d2f153
Author: Kairui Song <kasong(a)redhat.com>
Date: Wed Aug 4 15:44:02 2021 +0800
kdumpctl: refine grep usage
Use `grep -q` instead of redirect to /dev/null.
Use `grep -c` instead, as suggested in:
https://github.com/koalaman/shellcheck/wiki/SC2126
Use `grep -E` instead of `egrep`.
https://github.com/koalaman/shellcheck/wiki/SC2196
Signed-off-by: Kairui Song <kasong(a)redhat.com>
diff --git a/kdumpctl b/kdumpctl
index 01858a3..bb3d42a 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -506,7 +506,7 @@ check_fs_modified()
# if --mount argument present then match old and new target, mount
# point and file system. If any of them mismatches then rebuild
- echo $_dracut_args | grep "\-\-mount" &> /dev/null
+ echo $_dracut_args | grep -q "\-\-mount"
if [[ $? -eq 0 ]];then
set -- $(echo $_dracut_args | awk -F "--mount '" '{print $2}' | cut -d' ' -f1,2,3)
_old_dev=$1
@@ -596,7 +596,7 @@ check_rebuild()
#in case of fadump mode, check whether the default/target
#initrd is already built with dump capture capability
if [ "$DEFAULT_DUMP_MODE" == "fadump" ]; then
- capture_capable_initrd=$(lsinitrd -f $DRACUT_MODULES_FILE $TARGET_INITRD | grep -e ^kdumpbase$ -e ^zz-fadumpinit$ | wc -l)
+ capture_capable_initrd=$(lsinitrd -f $DRACUT_MODULES_FILE "$TARGET_INITRD" | grep -c -e ^kdumpbase$ -e ^zz-fadumpinit$)
fi
fi
@@ -761,7 +761,7 @@ check_and_wait_network_ready()
# if server removes the authorized_keys or, no /root/.ssh/kdump_id_rsa
ddebug "$errmsg"
- echo $errmsg | grep -q "Permission denied\|No such file or directory\|Host key verification failed" &> /dev/null
+ echo $errmsg | grep -q "Permission denied\|No such file or directory\|Host key verification failed"
if [ $? -eq 0 ]; then
derror "Could not create $DUMP_TARGET:$SAVE_PATH, you probably need to run \"kdumpctl propagate\""
return 1
@@ -901,7 +901,7 @@ local_fs_dump_target()
{
local _target
- _target=$(egrep "^ext[234]|^xfs|^btrfs|^minix" /etc/kdump.conf)
+ _target=$(grep -E "^ext[234]|^xfs|^btrfs|^minix" /etc/kdump.conf)
if [ $? -eq 0 ]; then
echo $_target|awk '{print $2}'
fi
@@ -964,7 +964,7 @@ check_fence_kdump_config()
return 1
fi
# node can be ipaddr
- echo "$ipaddrs " | grep "$node " > /dev/null
+ echo "$ipaddrs " | grep -q "$node "
if [ $? -eq 0 ]; then
derror "Option fence_kdump_nodes cannot contain $node"
return 1
commit dfb76467c9d9462e91e4dd8838f461fb7ab2538f
Author: Kairui Song <kasong(a)redhat.com>
Date: Wed Aug 4 16:22:17 2021 +0800
kdumpctl: fix fragile loops over find output
For loops over find output are fragile, use a while read loop:
https://github.com/koalaman/shellcheck/wiki/SC2044
Signed-off-by: Kairui Song <kasong(a)redhat.com>
Acked-by: Philipp Rudo <prudo(a)redhat.com
diff --git a/kdumpctl b/kdumpctl
index 3f92dac..01858a3 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -944,12 +944,12 @@ selinux_relabel()
return
fi
- for _i in $(find $_path); do
- _attr=$(getfattr -m "security.selinux" $_i 2>/dev/null)
+ while IFS= read -r -d '' _i; do
+ _attr=$(getfattr -m "security.selinux" "$_i" 2>/dev/null)
if [ -z "$_attr" ]; then
- restorecon $_i;
+ restorecon "$_i";
fi
- done
+ done < <(find "$_path" -print0)
}
check_fence_kdump_config()
commit 01613b7211a3de096a889000817ebb9da513f4af
Author: Kairui Song <kasong(a)redhat.com>
Date: Tue Aug 3 22:50:02 2021 +0800
kdumpctl: use kdump_get_conf_val to read config values
Also fixed kdumpctl, use `awk` instead of `cut` to read
core_collector's executable name correctly when its arguments
are not seperated by space.
Signed-off-by: Kairui Song <kasong(a)redhat.com>
Acked-by: Philipp Rudo <prudo(a)redhat.com>
diff --git a/kdumpctl b/kdumpctl
index db3a301..3f92dac 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -339,8 +339,8 @@ check_files_modified()
#also rebuild when Pacemaker cluster conf is changed and fence kdump is enabled.
modified_files=$(get_pcs_cluster_modified_files)
- EXTRA_BINS=`grep ^kdump_post $KDUMP_CONFIG_FILE | cut -d\ -f2`
- CHECK_FILES=`grep ^kdump_pre $KDUMP_CONFIG_FILE | cut -d\ -f2`
+ EXTRA_BINS=$(kdump_get_conf_val kdump_post)
+ CHECK_FILES=$(kdump_get_conf_val kdump_pre)
HOOKS="/etc/kdump/post.d/ /etc/kdump/pre.d/"
if [ -d /etc/kdump/post.d ]; then
for file in /etc/kdump/post.d/*; do
@@ -357,17 +357,17 @@ check_files_modified()
done
fi
HOOKS="$HOOKS $POST_FILES $PRE_FILES"
- CORE_COLLECTOR=`grep ^core_collector $KDUMP_CONFIG_FILE | cut -d\ -f2`
+ CORE_COLLECTOR=$(kdump_get_conf_val core_collector | awk '{print $1}')
CORE_COLLECTOR=`type -P $CORE_COLLECTOR`
# POST_FILES and PRE_FILES are already checked against executable, need not to check again.
EXTRA_BINS="$EXTRA_BINS $CHECK_FILES"
- CHECK_FILES=`grep ^extra_bins $KDUMP_CONFIG_FILE | cut -d\ -f2-`
+ CHECK_FILES=$(kdump_get_conf_val extra_bins)
EXTRA_BINS="$EXTRA_BINS $CHECK_FILES"
files="$KDUMP_CONFIG_FILE $KDUMP_KERNEL $EXTRA_BINS $CORE_COLLECTOR"
[[ -e /etc/fstab ]] && files="$files /etc/fstab"
# Check for any updated extra module
- EXTRA_MODULES="$(grep ^extra_modules $KDUMP_CONFIG_FILE | sed 's/^extra_modules\s*//')"
+ EXTRA_MODULES="$(kdump_get_conf_val extra_modules)"
if [ -n "$EXTRA_MODULES" ]; then
if [ -e /lib/modules/$KDUMP_KERNELVER/modules.dep ]; then
files="$files /lib/modules/$KDUMP_KERNELVER/modules.dep"
@@ -555,8 +555,7 @@ check_system_modified()
check_rebuild()
{
local capture_capable_initrd="1"
- local _force_rebuild force_rebuild="0"
- local _force_no_rebuild force_no_rebuild="0"
+ local force_rebuild force_no_rebuild
local ret system_modified="0"
setup_initrd
@@ -565,22 +564,18 @@ check_rebuild()
return 1
fi
- _force_no_rebuild=`grep ^force_no_rebuild $KDUMP_CONFIG_FILE 2>/dev/null`
- if [ $? -eq 0 ]; then
- force_no_rebuild=`echo $_force_no_rebuild | cut -d' ' -f2`
- if [ "$force_no_rebuild" != "0" ] && [ "$force_no_rebuild" != "1" ];then
- derror "Error: force_no_rebuild value is invalid"
- return 1
- fi
+ force_no_rebuild=$(kdump_get_conf_val force_no_rebuild)
+ force_no_rebuild=${force_no_rebuild:-0}
+ if [ "$force_no_rebuild" != "0" ] && [ "$force_no_rebuild" != "1" ];then
+ derror "Error: force_no_rebuild value is invalid"
+ return 1
fi
- _force_rebuild=`grep ^force_rebuild $KDUMP_CONFIG_FILE 2>/dev/null`
- if [ $? -eq 0 ]; then
- force_rebuild=`echo $_force_rebuild | cut -d' ' -f2`
- if [ "$force_rebuild" != "0" ] && [ "$force_rebuild" != "1" ];then
- derror "Error: force_rebuild value is invalid"
- return 1
- fi
+ force_rebuild=$(kdump_get_conf_val force_rebuild)
+ force_rebuild=${force_rebuild:-0}
+ if [ "$force_rebuild" != "0" ] && [ "$force_rebuild" != "1" ];then
+ derror "Error: force_rebuild value is invalid"
+ return 1
fi
if [[ "$force_no_rebuild" == "1" && "$force_rebuild" == "1" ]]; then
@@ -867,7 +862,7 @@ save_raw()
local kdump_dir
local raw_target
- raw_target=$(awk '$1 ~ /^raw$/ { print $2; }' $KDUMP_CONFIG_FILE)
+ raw_target=$(kdump_get_conf_val raw)
[ -z "$raw_target" ] && return 0
[ -b "$raw_target" ] || {
derror "raw partition $raw_target not found"
@@ -878,7 +873,7 @@ save_raw()
dwarn "Warning: Detected '$check_fs' signature on $raw_target, data loss is expected."
return 0
fi
- kdump_dir=`grep ^path $KDUMP_CONFIG_FILE | cut -d' ' -f2-`
+ kdump_dir=$(kdump_get_conf_val path)
if [ -z "${kdump_dir}" ]; then
coredir="/var/crash/`date +"%Y-%m-%d-%H:%M"`"
else
@@ -1018,8 +1013,8 @@ check_failure_action_config()
local failure_action
local option="failure_action"
- default_option=$(awk '$1 ~ /^default$/ {print $2;}' $KDUMP_CONFIG_FILE)
- failure_action=$(awk '$1 ~ /^failure_action$/ {print $2;}' $KDUMP_CONFIG_FILE)
+ default_option=$(kdump_get_conf_val default)
+ failure_action=$(kdump_get_conf_val failure_action)
if [ -z "$failure_action" -a -z "$default_option" ]; then
return 0
@@ -1047,7 +1042,7 @@ check_final_action_config()
{
local final_action
- final_action=$(awk '$1 ~ /^final_action$/ {print $2;}' $KDUMP_CONFIG_FILE)
+ final_action=$(kdump_get_conf_val final_action)
if [ -z "$final_action" ]; then
return 0
else
commit ab1ef78aa25b7ae2e34e16a74712079653981e6b
Author: Kairui Song <kasong(a)redhat.com>
Date: Wed Aug 4 01:18:48 2021 +0800
kdump-lib.sh: use kdump_get_conf_val to read config values
Signed-off-by: Kairui Song <kasong(a)redhat.com>
Acked-by: Philipp Rudo <prudo(a)redhat.com>
diff --git a/kdump-lib.sh b/kdump-lib.sh
index b57457c..7e620c7 100755
--- a/kdump-lib.sh
+++ b/kdump-lib.sh
@@ -42,16 +42,16 @@ is_fs_type_nfs()
is_ssh_dump_target()
{
- grep -q "^ssh[[:blank:]].*@" /etc/kdump.conf
+ [[ $(kdump_get_conf_val ssh) == *@* ]]
}
is_nfs_dump_target()
{
- if grep -q "^nfs" /etc/kdump.conf; then
+ if [[ $(kdump_get_conf_val nfs) ]]; then
return 0;
fi
- if is_fs_type_nfs $(get_dracut_args_fstype "$(grep "^dracut_args .*\-\-mount" /etc/kdump.conf)"); then
+ if is_fs_type_nfs $(get_dracut_args_fstype "$(kdump_get_conf_val dracut_args)"); then
return 0
fi
@@ -68,12 +68,12 @@ is_nfs_dump_target()
is_raw_dump_target()
{
- grep -q "^raw" /etc/kdump.conf
+ [[ $(kdump_get_conf_val raw) ]]
}
is_fs_dump_target()
{
- egrep -q "^ext[234]|^xfs|^btrfs|^minix" /etc/kdump.conf
+ [[ $(kdump_get_conf_val "ext[234]\|xfs\|btrfs\|minix") ]]
}
# Read kdump config in well formatted style
@@ -109,7 +109,7 @@ is_generic_fence_kdump()
{
[ -x $FENCE_KDUMP_SEND ] || return 1
- grep -q "^fence_kdump_nodes" /etc/kdump.conf
+ [[ $(kdump_get_conf_val fence_kdump_nodes) ]]
}
to_dev_name() {
@@ -128,17 +128,17 @@ to_dev_name() {
is_user_configured_dump_target()
{
- grep -E -q "^ext[234]|^xfs|^btrfs|^minix|^raw|^nfs|^ssh" /etc/kdump.conf || is_mount_in_dracut_args;
+ [[ $(kdump_get_conf_val "ext[234]\|xfs\|btrfs\|minix\|raw\|nfs\|ssh") ]] || is_mount_in_dracut_args
}
get_user_configured_dump_disk()
{
local _target
- _target=$(egrep "^ext[234]|^xfs|^btrfs|^minix|^raw" /etc/kdump.conf 2>/dev/null |awk '{print $2}')
+ _target=$(kdump_get_conf_val "ext[234]\|xfs\|btrfs\|minix\|raw")
[ -n "$_target" ] && echo $_target && return
- _target=$(get_dracut_args_target "$(grep "^dracut_args .*\-\-mount" /etc/kdump.conf)")
+ _target=$(get_dracut_args_target "$(kdump_get_conf_val "dracut_args")")
[ -b "$_target" ] && echo $_target
}
@@ -149,7 +149,7 @@ get_root_fs_device()
get_save_path()
{
- local _save_path=$(awk '$1 == "path" {print $2}' /etc/kdump.conf)
+ local _save_path=$(kdump_get_conf_val path)
[ -z "$_save_path" ] && _save_path=$DEFAULT_PATH
# strip the duplicated "/"
@@ -175,7 +175,7 @@ get_block_dump_target()
is_dump_to_rootfs()
{
- grep -E "^(failure_action|default)[[:space:]]dump_to_rootfs" /etc/kdump.conf >/dev/null
+ [[ $(kdump_get_conf_val "failure_action|default") == dump_to_rootfs ]]
}
get_failure_action_target()
@@ -530,7 +530,7 @@ get_ifcfg_filename() {
is_dracut_mod_omitted() {
local dracut_args dracut_mod=$1
- set -- $(grep "^dracut_args" /etc/kdump.conf)
+ set -- $(kdump_get_conf_val dracut_args)
while [ $# -gt 0 ]; do
case $1 in
-o|--omit)
@@ -559,7 +559,7 @@ is_wdt_active() {
# its correctness).
is_mount_in_dracut_args()
{
- grep -q "^dracut_args .*\-\-mount" /etc/kdump.conf
+ [[ " $(kdump_get_conf_val dracut_args)" =~ .*[[:space:]]--mount[=[:space:]].* ]]
}
# If $1 contains dracut_args "--mount", return <filesystem type>
commit 09ccf88405793220af640c5317cbadb71cf03d36
Author: Kairui Song <kasong(a)redhat.com>
Date: Mon Aug 16 23:25:14 2021 +0800
kdump-lib.sh: add a config value retrive helper
Add a helper kdump_get_conf_val to replace get_option_value.
It can help cover more corner cases in the code, like when there are
multiple spaces in config file, config value separated by a tab,
heading spaces, or trailing comments.
And this uses "sed group command" and "sed hold buffer", make it much
faster than previous `grep <config> | tail -1`.
This helper is supposed to provide a universal way for kexec-tools
scripts to read in config value. Currently, different scripts are
reading the config in many different fragile ways.
For example, following codes are found in kexec-tools script code base:
1. grep ^force_rebuild $KDUMP_CONFIG_FILE
echo $_force_rebuild | cut -d' ' -f2
2. grep ^kdump_post $KDUMP_CONFIG_FILE | cut -d\ -f2
3. awk '/^sshkey/ {print $2}' $conf_file
4. grep ^path $KDUMP_CONFIG_FILE | cut -d' ' -f2-
1, 2, and 4 will fail if the space is replaced by, e.g. a tab
1 and 2 might fail if there are multiple spaces between config name
and config value:
"kdump_post /var/crash/scripts/kdump-post.sh"
A space will be read instead of config value.
1, 2, 3 will fail if there are space in file path, like:
"kdump_post /var/crash/scripts dir/kdump-post.sh"
4 will fail if there are trailing comments:
"path /var/crash # some comment here"
And all will fail if there are heading space,
" path /var/crash"
And all will most likely cause problems if the config file contains
the same option more than once.
And all of them are slower than the new sed call. Old get_option_value
is also very slow and doesn't handle heading space.
Although we never claim to support heading space or tailing comments
before, it's harmless to be more robust on config reading, and many
conf files in /etc support heading spaces. And have a faster and
safer config reading helper makes it easier to clean up the code.
Signed-off-by: Kairui Song <kasong(a)redhat.com>
Acked-by: Philipp Rudo <prudo(a)redhat.com>
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh
index ff9f7fe..53abdc7 100755
--- a/dracut-module-setup.sh
+++ b/dracut-module-setup.sh
@@ -938,7 +938,7 @@ get_generic_fence_kdump_nodes() {
local filtered
local nodes
- nodes=$(get_option_value "fence_kdump_nodes")
+ nodes=$(kdump_get_conf_val "fence_kdump_nodes")
for node in ${nodes}; do
# Skip its own node name
if is_localhost $node; then
@@ -999,7 +999,7 @@ kdump_install_random_seed() {
}
kdump_install_systemd_conf() {
- local failure_action=$(get_option_value "failure_action")
+ local failure_action=$(kdump_get_conf_val "failure_action")
# Kdump turns out to require longer default systemd mount timeout
# than 1st kernel(90s by default), we use default 300s for kdump.
diff --git a/kdump-lib.sh b/kdump-lib.sh
index 841740b..b57457c 100755
--- a/kdump-lib.sh
+++ b/kdump-lib.sh
@@ -76,11 +76,6 @@ is_fs_dump_target()
egrep -q "^ext[234]|^xfs|^btrfs|^minix" /etc/kdump.conf
}
-strip_comments()
-{
- echo $@ | sed -e 's/\(.*\)#.*/\1/'
-}
-
# Read kdump config in well formatted style
kdump_read_conf()
{
@@ -89,6 +84,15 @@ kdump_read_conf()
[ -f "$KDUMP_CONFIG_FILE" ] && sed -n -e "s/#.*//;s/\s*$//;s/^\s*//;s/\(\S\+\)\s*\(.*\)/\1 \2/p" $KDUMP_CONFIG_FILE
}
+# Retrieves config value defined in kdump.conf
+# $1: config name, sed regexp compatible
+kdump_get_conf_val() {
+ # For lines matching "^\s*$1\s+", remove matched part (config name including space),
+ # remove tailing comment, space, then store in hold space. Print out the hold buffer on last line.
+ [ -f "$KDUMP_CONFIG_FILE" ] && \
+ sed -n -e "/^\s*\($1\)\s\+/{s/^\s*\($1\)\s\+//;s/#.*//;s/\s*$//;h};\${x;p}" $KDUMP_CONFIG_FILE
+}
+
# Check if fence kdump is configured in Pacemaker cluster
is_pcs_fence_kdump()
{
@@ -322,12 +326,6 @@ get_kdump_mntpoint_from_target()
echo $_mntpoint | tr -s "/"
}
-# get_option_value <option_name>
-# retrieves value of option defined in kdump.conf
-get_option_value() {
- strip_comments `grep "^$1[[:space:]]\+" /etc/kdump.conf | tail -1 | cut -d\ -f2-`
-}
-
kdump_get_persistent_dev() {
local dev="${1//\"/}"
diff --git a/kdumpctl b/kdumpctl
index 5d9420d..db3a301 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -961,7 +961,7 @@ check_fence_kdump_config()
{
local hostname=`hostname`
local ipaddrs=`hostname -I`
- local nodes=$(get_option_value "fence_kdump_nodes")
+ local nodes=$(kdump_get_conf_val "fence_kdump_nodes")
for node in $nodes; do
if [ "$node" = "$hostname" ]; then
commit a0282ab22c4e61294346c8ab9c42ab87b8bdfbb0
Author: Kairui Song <kasong(a)redhat.com>
Date: Tue Aug 3 19:49:51 2021 +0800
kdump-lib.sh: add a config format and read helper
Add a helper `kdump_read_conf` to replace read_strip_comments.
`kdump_read_conf` does a few more things:
- remove trailing spaces.
- format the content, remove duplicated spaces between name and value.
- read from KDUMP_CONFIG_FILE (/etc/kdump.conf) directly, avoid pasting
"/etc/kdump.conf" path everywhere in the code.
- check if config file exists, just in case.
Also unify the environmental variable, now KDUMP_CONFIG_FILE stands for
the default config location.
This helps avoid some shell pitfalls about spaces when reading config.
Signed-off-by: Kairui Song <kasong(a)redhat.com>
Acked-by: Philipp Rudo <prudo(a)redhat.com>
diff --git a/dracut-kdump.sh b/dracut-kdump.sh
index 3e65c44..3c165b3 100755
--- a/dracut-kdump.sh
+++ b/dracut-kdump.sh
@@ -246,10 +246,10 @@ get_host_ip()
return 0
}
-read_kdump_conf()
+read_kdump_confs()
{
- if [ ! -f "$KDUMP_CONF" ]; then
- derror "$KDUMP_CONF not found"
+ if [ ! -f "$KDUMP_CONFIG_FILE" ]; then
+ derror "$KDUMP_CONFIG_FILE not found"
return
fi
@@ -278,7 +278,7 @@ read_kdump_conf()
add_dump_code "dump_ssh $SSH_KEY_LOCATION $config_val"
;;
esac
- done <<< "$(read_strip_comments $KDUMP_CONF)"
+ done <<< "$(kdump_read_conf)"
}
fence_kdump_notify()
@@ -288,7 +288,7 @@ fence_kdump_notify()
fi
}
-read_kdump_conf
+read_kdump_confs
fence_kdump_notify
get_host_ip
diff --git a/dracut-module-setup.sh b/dracut-module-setup.sh
index a1f33e8..ff9f7fe 100755
--- a/dracut-module-setup.sh
+++ b/dracut-module-setup.sh
@@ -682,7 +682,8 @@ default_dump_target_install_conf()
#install kdump.conf and what user specifies in kdump.conf
kdump_install_conf() {
local _opt _val _pdev
- (read_strip_comments /etc/kdump.conf) > ${initdir}/tmp/$$-kdump.conf
+
+ kdump_read_conf > "${initdir}/tmp/$$-kdump.conf"
while read _opt _val;
do
@@ -711,7 +712,7 @@ kdump_install_conf() {
dracut_install "${_val%%[[:blank:]]*}"
;;
esac
- done <<< "$(read_strip_comments /etc/kdump.conf)"
+ done <<< "$(kdump_read_conf)"
kdump_install_pre_post_conf
diff --git a/kdump-lib-initramfs.sh b/kdump-lib-initramfs.sh
index 319f9a0..50443e5 100755
--- a/kdump-lib-initramfs.sh
+++ b/kdump-lib-initramfs.sh
@@ -16,7 +16,6 @@ SSH_KEY_LOCATION="/root/.ssh/kdump_id_rsa"
KDUMP_SCRIPT_DIR="/kdumpscripts"
DD_BLKSIZE=512
FINAL_ACTION="systemctl reboot -f"
-KDUMP_CONF="/etc/kdump.conf"
KDUMP_PRE=""
KDUMP_POST=""
NEWROOT="/sysroot"
@@ -93,7 +92,7 @@ get_kdump_confs()
esac
;;
esac
- done <<< "$(read_strip_comments $KDUMP_CONF)"
+ done <<< "$(kdump_read_conf)"
if [ -z "$CORE_COLLECTOR" ]; then
CORE_COLLECTOR="$DEFAULT_CORE_COLLECTOR"
diff --git a/kdump-lib.sh b/kdump-lib.sh
index 4bd9751..841740b 100755
--- a/kdump-lib.sh
+++ b/kdump-lib.sh
@@ -7,6 +7,7 @@ DEFAULT_PATH="/var/crash/"
FENCE_KDUMP_CONFIG_FILE="/etc/sysconfig/fence_kdump"
FENCE_KDUMP_SEND="/usr/libexec/fence_kdump_send"
FADUMP_ENABLED_SYS_NODE="/sys/kernel/fadump_enabled"
+KDUMP_CONFIG_FILE="/etc/kdump.conf"
is_fadump_capable()
{
@@ -80,12 +81,12 @@ strip_comments()
echo $@ | sed -e 's/\(.*\)#.*/\1/'
}
-# Read from kdump config file stripping all comments
-read_strip_comments()
+# Read kdump config in well formatted style
+kdump_read_conf()
{
- # strip heading spaces, and print any content starting with
- # neither space or #, and strip everything after #
- sed -n -e "s/^\s*\([^# \t][^#]\+\).*/\1/gp" $1
+ # Following steps are applied in order: strip trailing comment, strip trailing space,
+ # strip heading space, match non-empty line, remove duplicated spaces between conf name and value
+ [ -f "$KDUMP_CONFIG_FILE" ] && sed -n -e "s/#.*//;s/\s*$//;s/^\s*//;s/\(\S\+\)\s*\(.*\)/\1 \2/p" $KDUMP_CONFIG_FILE
}
# Check if fence kdump is configured in Pacemaker cluster
diff --git a/kdumpctl b/kdumpctl
index c2f0b3f..5d9420d 100755
--- a/kdumpctl
+++ b/kdumpctl
@@ -5,7 +5,6 @@ KDUMP_KERNELVER=""
KDUMP_KERNEL=""
KDUMP_COMMANDLINE=""
KEXEC_ARGS=""
-KDUMP_CONFIG_FILE="/etc/kdump.conf"
KDUMP_LOG_PATH="/var/log"
MKDUMPRD="/sbin/mkdumprd -f"
MKFADUMPRD="/sbin/mkfadumprd"
@@ -272,7 +271,7 @@ check_config()
return 1
fi
_opt_rec[$config_opt]="$config_val"
- done <<< "$(read_strip_comments $KDUMP_CONFIG_FILE)"
+ done <<< "$(kdump_read_conf)"
check_failure_action_config || return 1
check_final_action_config || return 1
@@ -731,7 +730,7 @@ check_ssh_config()
*)
;;
esac
- done <<< "$(read_strip_comments $KDUMP_CONFIG_FILE)"
+ done <<< "$(kdump_read_conf)"
#make sure they've configured kdump.conf for ssh dumps
local SSH_TARGET=`echo -n $DUMP_TARGET | sed -n '/.*@/p'`
@@ -1362,7 +1361,7 @@ reset_crashkernel() {
grubby --args "$crashkernel_default" --update-kernel "$entry" $zipl_arg
[[ $zipl_arg ]] && zipl > /dev/null
fi
- }
+}
if [ ! -f "$KDUMP_CONFIG_FILE" ]; then
derror "Error: No kdump config file found!"
diff --git a/mkdumprd b/mkdumprd
index 89a160d..d554511 100644
--- a/mkdumprd
+++ b/mkdumprd
@@ -443,7 +443,7 @@ do
*)
;;
esac
-done <<< "$(read_strip_comments $conf_file)"
+done <<< "$(kdump_read_conf)"
handle_default_dump_target
commit bcb1176ec6f17538ffff94d2fbd21579938c3c05
Author: Kairui Song <kasong(a)redhat.com>
Date: Fri Jul 30 01:08:30 2021 +0800
Add a .editorconfig file
EditorConfig file is helpful for tools like `shfmt`, also could be a
hint for code styling.
The code style spec used in this new added .editorconfig file is
generated based on existing code style.
Following commits will make mkfadumprd, mkdumprd, kdumpctl, kdump-lib.sh,
and *-module-setup.sh only be used in first kernel, so use bash syntax
for these scripts. Other scripts will use sh syntax for better POSIX
compatibility.
Signed-off-by: Kairui Song <kasong(a)redhat.com>
Acked-by: Pingfan Liu <piliu(a)redhat.com>
Acked-by: Philipp Rudo <prudo(a)redhat.com>
Signed-off-by: Kairui Song <kasong(a)redhat.com>
diff --git a/.editorconfig b/.editorconfig
new file mode 100644
index 0000000..bd8fc8c
--- /dev/null
+++ b/.editorconfig
@@ -0,0 +1,32 @@
+# EditorConfig configuration for kexec-tools
+# http://EditorConfig.org
+
+# Top-most EditorConfig file
+root = true
+
+# Default code style for kexec-tools scripts
+[*]
+end_of_line = lf
+shell_variant = posix
+insert_final_newline = true
+trim_trailing_whitespace = true
+indent_style = tab
+indent_size = 1
+switch_case_indent = false
+function_next_line = true
+binary_next_line = false
+space_redirects = true
+
+# Some scripts will only run with bash
+[{mkfadumprd,mkdumprd,kdumpctl}]
+shell_variant = bash
+
+# Use dracut code style for *-module-setup.sh
+[*-module-setup.sh]
+shell_variant = bash
+indent_style = space
+indent_size = 4
+switch_case_indent = true
+function_next_line = false
+binary_next_line = true
+space_redirects = true
1 year, 11 months
[Report] Packages Restricting Arches
by root
List of packages currently excluding arches (2501)
===========================================
- 0ad
ExclusiveArch: %{ix86} x86_64 %{arm} aarch64 ppc64le
- 90-Second-Portraits
ExclusiveArch: %{arm} %{ix86} x86_64 aarch64 ppc64le
- GoldenCheetah
ExclusiveArch: %{qt5_qtwebengine_arches}
- GtkAda
ExclusiveArch: %{GPRbuild_arches}
- GtkAda3
ExclusiveArch: %{GPRbuild_arches}
- OpenColorIO
ExclusiveArch: x86_64 ppc64le
- OpenImageIO
ExclusiveArch: x86_64 ppc64le
- OpenMolcas
ExclusiveArch: x86_64 aarch64 ppc64le s390x
- PragmARC
ExclusiveArch: %{GPRbuild_arches}
- R-V8
ExclusiveArch: %{nodejs_arches}
- RdRand
ExclusiveArch: %{ix86} x86_64
- RediSearch
ExclusiveArch: x86_64
- SLOF
ExclusiveArch: ppc64le
- YafaRay
ExclusiveArch: %{ix86} x86_64
- aardvark-dns
ExclusiveArch: %{rust_arches}
- aboot
ExclusiveArch: alpha
- accel-config
ExclusiveArch: %{ix86} x86_64
- acpid
ExclusiveArch: ia64 x86_64 %{ix86} %{arm} aarch64
- ahven
ExclusiveArch: %{GPRbuild_arches}
- algobox
ExclusiveArch: %{qt5_qtwebengine_arches}
- alleyoop
ExclusiveArch: %{ix86} x86_64 ppc ppc64 ppc64le s390x %{arm} aarch64
- american-fuzzy-lop
ExclusiveArch: %{ix86} x86_64 s390x
- anet
ExclusiveArch: %{GPRbuild_arches}
- anki
ExclusiveArch: %{qt5_qtwebengine_arches} noarch
- ant
ExclusiveArch: %{java_arches} noarch
- antlr
ExclusiveArch: %{java_arches}
- apache-commons-beanutils
ExclusiveArch: %{java_arches} noarch
- apache-commons-cli
ExclusiveArch: %{java_arches} noarch
- apache-commons-codec
ExclusiveArch: %{java_arches} noarch
- apache-commons-collections
ExclusiveArch: %{java_arches} noarch
- apache-commons-compress
ExclusiveArch: %{java_arches} noarch
- apache-commons-io
ExclusiveArch: %{java_arches} noarch
- apache-commons-jxpath
ExclusiveArch: %{java_arches} noarch
- apache-commons-lang3
ExclusiveArch: %{java_arches} noarch
- apache-commons-logging
ExclusiveArch: %{java_arches} noarch
- apache-commons-net
ExclusiveArch: %{java_arches} noarch
- apache-commons-parent
ExclusiveArch: %{java_arches} noarch
- apache-parent
ExclusiveArch: %{java_arches} noarch
- apache-resource-bundles
ExclusiveArch: %{java_arches} noarch
- apiguardian
ExclusiveArch: %{java_arches} noarch
- apmd
ExclusiveArch: %{ix86}
- appstream-generator
ExclusiveArch: %{ldc_arches}
- aqute-bnd
ExclusiveArch: %{java_arches} noarch
- arm-trusted-firmware
ExclusiveArch: aarch64
- assertj-core
ExclusiveArch: %{java_arches} noarch
- atinject
ExclusiveArch: %{java_arches} noarch
- aunit
ExclusiveArch: %GPRbuild_arches
- avgtime
ExclusiveArch: %{ldc_arches}
- aws
ExclusiveArch: %GPRbuild_arches
- bcal
ExclusiveArch: x86_64 aarch64 ia64 ppc64 ppc64le s390x
- bcc
ExclusiveArch: x86_64 %{power64} aarch64 s390x armv7hl
- bcel
ExclusiveArch: %{java_arches} noarch
- bcm283x-firmware
ExclusiveArch: %{arm} aarch64
- berusky2
ExclusiveArch: %{ix86} x86_64 %{arm} aarch64 %{mips}
- beust-jcommander
ExclusiveArch: %{java_arches} noarch
- biosdevname
ExclusiveArch: %{ix86} x86_64
- blender
ExclusiveArch: x86_64 aarch64 ppc64le s390x
- bless
ExclusiveArch: %mono_arches
- bpftrace
ExclusiveArch: x86_64 %{power64} aarch64 s390x
- bsf
ExclusiveArch: %{java_arches} noarch
- byte-buddy
ExclusiveArch: %{java_arches} noarch
- calamares
ExclusiveArch: %{ix86} x86_64 aarch64
- calibre
ExclusiveArch: %{qt5_qtwebengine_arches}
- ccdciel
ExclusiveArch: %{fpc_arches}
- cdcollect
ExclusiveArch: %{mono_arches}
- cdi-api
ExclusiveArch: %{java_arches} noarch
- ceph
ExclusiveArch: x86_64 aarch64 ppc64le s390x
- cglib
ExclusiveArch: %{java_arches} noarch
- chromium
ExclusiveArch: x86_64 i686
ExclusiveArch: x86_64 aarch64
ExclusiveArch: x86_64 i686 aarch64
- cjdns
ExclusiveArch: %{nodejs_arches}
- clevis-pin-tpm2
ExclusiveArch: %{rust_arches}
- cmospwd
ExclusiveArch: %{ix86} x86_64
- cmrt
ExclusiveArch: %{ix86} x86_64 ia64
- coffee-script
ExclusiveArch: %{nodejs_arches} noarch
- colorful
ExclusiveArch: %{fpc_arches}
- cpu-x
ExclusiveArch: i686 x86_64
- cpufetch
ExclusiveArch: %{arm} aarch64 x86_64 ppc ppc64 ppc64le
- cpuid
ExclusiveArch: %{ix86} x86_64
- cqrlog
ExclusiveArch: %{fpc_arches}
- crash
ExclusiveArch: %{ix86} ia64 x86_64 ppc ppc64 s390 s390x %{arm} aarch64 ppc64le
- crash-gcore-command
ExclusiveArch: aarch64 ppc64le x86_64
- crash-trace-command
ExclusiveArch: aarch64 ppc64le s390x x86_64
- cri-o
ExclusiveArch: %{?go_arches:%{go_arches}}%{!?go_arches:%{ix86} x86_64 aarch64 %{arm}}
- cri-tools
ExclusiveArch: %{?go_arches:%{go_arches}}%{!?go_arches:%{ix86} x86_64 aarch64 %{arm}}
- criu
ExclusiveArch: x86_64 %{arm} ppc64le aarch64 s390x
- cryptlib
ExclusiveArch: x86_64 aarch64 ppc64le
- cryptobone
ExclusiveArch: x86_64 ppc64le aarch64
- csslint
ExclusiveArch: %{nodejs_arches} noarch
- daq
ExclusiveArch: x86_64 aarch64
- dbus-parsec
ExclusiveArch: %{rust_arches}
- dbus-sharp
ExclusiveArch: %mono_arches
- dbus-sharp-glib
ExclusiveArch: %mono_arches
- dbxtool
ExclusiveArch: i386 x86_64 aarch64
- deepin-daemon
ExclusiveArch: %{?go_arches:%{go_arches}}%{!?go_arches:%{ix86} x86_64 aarch64 %{arm}}
- deepin-desktop-schemas
ExclusiveArch: %{go_arches}
- disruptor
ExclusiveArch: %{java_arches} noarch
- dlm
ExclusiveArch: i686 x86_64
- dmidecode
ExclusiveArch: %{ix86} x86_64 ia64 aarch64
- dmtcp
ExclusiveArch: x86_64
- docker-distribution
ExclusiveArch: %{?go_arches:%{go_arches}}%{!?go_arches:%{ix86} x86_64 %{arm}}
- dolphin-emu
ExclusiveArch: x86_64 aarch64
- dotnet-build-reference-packages
ExclusiveArch: aarch64 x86_64
ExclusiveArch: x86_64
- dotnet6.0
ExclusiveArch: aarch64 x86_64 s390x
ExclusiveArch: x86_64
- doublecmd
ExclusiveArch: %{ix86} x86_64
- dpdk
ExclusiveArch: x86_64 i686 aarch64 ppc64le
- dub
ExclusiveArch: %{ldc_arches}
- dxvk-native
ExclusiveArch: %{ix86} x86_64
- dyninst
ExclusiveArch: %{ix86} x86_64 ppc64le aarch64
- e3
ExclusiveArch: %{ix86} x86_64
- easymock
ExclusiveArch: %{java_arches} noarch
- eclipse-swt
ExclusiveArch: s390x x86_64 aarch64 ppc64le
- edk2
ExclusiveArch: x86_64 aarch64
- efibootmgr
ExclusiveArch: %{efi}
- efifs
ExclusiveArch: %{efi}
- efitools
ExclusiveArch: %{efi}
- efivar
ExclusiveArch: %{efi}
- elk
ExclusiveArch: x86_64 %{ix86}
ExclusiveArch: x86_64 %{ix86} aarch64 %{arm} %{power64}
- emacs-slime
ExclusiveArch: %{arm} %{ix86} x86_64 ppc sparcv9 aarch64
- enki
ExclusiveArch: %{qt5_qtwebengine_arches} noarch
- envytools
ExclusiveArch: %{ix86} x86_64 %{arm} aarch64
- eric
ExclusiveArch: %{qt5_qtwebengine_arches} noarch
- eth-tools
ExclusiveArch: x86_64
- extra-enforcer-rules
ExclusiveArch: %{java_arches} noarch
- fcitx-libpinyin
ExclusiveArch: %{qt5_qtwebengine_arches}
- fedora-dockerfiles
ExclusiveArch: %{go_arches}
- felix-parent
ExclusiveArch: %{java_arches} noarch
- felix-utils
ExclusiveArch: %{java_arches} noarch
- fes
ExclusiveArch: %{ix86} x86_64
- florist
ExclusiveArch: %{GPRbuild_arches}
- fluent-bit
ExclusiveArch: x86_64 aarch64
- fpc
ExclusiveArch: %{arm} aarch64 %{ix86} x86_64 ppc64le
- frescobaldi
ExclusiveArch: %{qt5_qtwebengine_arches}
- frysk
ExclusiveArch: %{ix86} x86_64 ppc64
- fusesource-pom
ExclusiveArch: %{java_arches} noarch
- fwts
ExclusiveArch: x86_64 %{arm} aarch64 s390x riscv64 %{power64}
- fwupd-efi
ExclusiveArch: x86_64 aarch64
- ga
ExclusiveArch: %{ix86} x86_64 %{arm} aarch64 ppc64le
- gbrainy
ExclusiveArch: %mono_arches
- gdb
ExclusiveArch: %{ix86} x86_64
- gdb-exploitable
ExclusiveArch: x86_64 i386
ExclusiveArch: x86_64 noarch
- gearhead1
ExclusiveArch: %{fpc_arches}
- ghdl
ExclusiveArch: %{GNAT_arches}
- ghostwriter
ExclusiveArch: %{qt5_qtwebengine_arches}
- gio-sharp
ExclusiveArch: %mono_arches
- gir-to-d
ExclusiveArch: %{ldc_arches}
- git-octopus
ExclusiveArch: %{?go_arches:%{go_arches}}%{!?go_arches:%{ix86} x86_64 aarch64 %{arm}}
- gitqlient
ExclusiveArch: %{qt5_qtwebengine_arches}
- giver
ExclusiveArch: %{mono_arches}
- gkeyfile-sharp
ExclusiveArch: %mono_arches
- glibc32
ExclusiveArch: x86_64
- glibd
ExclusiveArch: %{ldc_arches}
- gmqcc
ExclusiveArch: %{ix86} x86_64 %{arm} aarch64
- gnatcoll
ExclusiveArch: %{GPRbuild_arches}
- gnatcoll-bindings
ExclusiveArch: %{GPRbuild_arches}
- gnatcoll-db
ExclusiveArch: %{GPRbuild_arches}
- gnome-boxes
ExclusiveArch: x86_64
- gnome-desktop-sharp
ExclusiveArch: %mono_arches
- gnome-do
ExclusiveArch: %mono_arches
- gnome-keyring-sharp
ExclusiveArch: %mono_arches
- gnome-rdp
ExclusiveArch: %{mono_arches}
- gnome-sharp
ExclusiveArch: %mono_arches
- gnome-subtitles
ExclusiveArch: %mono_arches
- gnu-efi
ExclusiveArch: %{efi}
- go-bindata
ExclusiveArch: %{?go_arches:%{go_arches}}%{!?go_arches:%{ix86} x86_64 %{arm}}
- go-compilers
ExclusiveArch: %{go_arches}
- go-rpm-macros
ExclusiveArch: %{golang_arches} %{gccgo_arches}
- godep
ExclusiveArch: %{?go_arches:%{go_arches}}%{!?go_arches:%{ix86} x86_64 %{arm}}
- golang
ExclusiveArch: %{golang_arches}
- gomtree
ExclusiveArch: %{?go_arches:%{go_arches}}%{!?go_arches:%{ix86} x86_64 %{arm}}
- google-guice
ExclusiveArch: %{java_arches} noarch
- gotun
ExclusiveArch: %{?go_arches:%{go_arches}}%{!?go_arches:%{ix86} x86_64 %{arm}}
ExclusiveArch: x86_64
- goverlay
ExclusiveArch: %{fpc_arches}
- gprbuild
ExclusiveArch: %{GPRbuild_arches} %{bootstrap_arch}
- gprolog
ExclusiveArch: x86_64 %{ix86} ppc alpha aarch64
- grafana
ExclusiveArch: %{grafana_arches}
- grafana-pcp
ExclusiveArch: %{grafanapcp_arches}
- greetd
ExclusiveArch: %{rust_arches}
- gtk-sharp-beans
ExclusiveArch: %mono_arches
- gtk-sharp2
ExclusiveArch: %mono_arches
- gtk-sharp3
ExclusiveArch: %{mono_arches}
- gtkd
ExclusiveArch: %{ldc_arches}
- guava
ExclusiveArch: %{java_arches} noarch
- gudev-sharp
ExclusiveArch: %mono_arches
- guestfs-tools
ExclusiveArch: %{kernel_arches}
- hamcrest
ExclusiveArch: %{java_arches} noarch
- hedgewars
ExclusiveArch: %{fpc_arches}
- hsakmt
ExclusiveArch: x86_64 aarch64 ppc64le
- httpcomponents-client
ExclusiveArch: %{java_arches} noarch
- httpcomponents-core
ExclusiveArch: %{java_arches} noarch
- httpcomponents-project
ExclusiveArch: %{java_arches} noarch
- hyena
ExclusiveArch: %{mono_arches}
- hyperscan
ExclusiveArch: x86_64
- hyperv-daemons
ExclusiveArch: i686 x86_64
- i3status-rs
ExclusiveArch: %{rust_arches}
- icaro
ExclusiveArch: %{ix86} x86_64 noarch
- imvirt
ExclusiveArch: %{ix86} x86_64 ia64
- indistarter
ExclusiveArch: %{fpc_arches}
- infinipath-psm
ExclusiveArch: x86_64
- intel-cm-compiler
ExclusiveArch: i686 x86_64
- intel-cmt-cat
ExclusiveArch: x86_64 i686 i586
ExclusiveArch: x86_64 i686 i586
- intel-compute-runtime
ExclusiveArch: x86_64
- intel-gmmlib
ExclusiveArch: x86_64 i686
- intel-igc
ExclusiveArch: x86_64 i686
- intel-ipp-crypto-mb
ExclusiveArch: x86_64
ExclusiveArch: x86_64
- intel-ipsec-mb
ExclusiveArch: x86_64
ExclusiveArch: x86_64
- intel-mediasdk
ExclusiveArch: x86_64
- intel-undervolt
ExclusiveArch: i386 x86_64
- ioport
ExclusiveArch: %{ix86} x86_64
- ipmctl
ExclusiveArch: x86_64
- ispc
ExclusiveArch: x86_64 aarch64
- iucode-tool
ExclusiveArch: %{ix86} x86_64
- iyfct
ExclusiveArch: %{arm} %{ix86} x86_64 aarch64 ppc64le
- jakarta-activation
ExclusiveArch: %{java_arches} noarch
- jakarta-annotations
ExclusiveArch: %{java_arches} noarch
- jakarta-oro
ExclusiveArch: %{java_arches} noarch
- jakarta-servlet
ExclusiveArch: %{java_arches} noarch
- java-1.8.0-openjdk-aarch32
ExclusiveArch: %{arm}
- java_cup
ExclusiveArch: %{java_arches} noarch
- javapackages-bootstrap
ExclusiveArch: %{java_arches} noarch
- jctools
ExclusiveArch: %{java_arches} noarch
- jdepend
ExclusiveArch: %{java_arches} noarch
- jdom
ExclusiveArch: %{java_arches} noarch
- jdom2
ExclusiveArch: %{java_arches} noarch
- jflex
ExclusiveArch: %{java_arches} noarch
- jigawatts
ExclusiveArch: x86_64 %{arm} ppc64le aarch64 s390x
- jsch
ExclusiveArch: %{java_arches} noarch
- jsr-305
ExclusiveArch: %{java_arches} noarch
- junit
ExclusiveArch: %{java_arches} noarch
- junit5
ExclusiveArch: %{java_arches} noarch
- jzlib
ExclusiveArch: %{java_arches} noarch
- kchmviewer
ExclusiveArch: %{qt5_qtwebengine_arches}
- kernel
ExclusiveArch: noarch x86_64 s390x %{arm} aarch64 ppc64le
ExclusiveArch: noarch i386 i686 x86_64 s390x %{arm} aarch64 ppc64le
- keylime-agent-rust
ExclusiveArch: %{rust_arches}
- keyring-ima-signer
ExclusiveArch: %{rust_arches}
- kf5-akonadi-search
ExclusiveArch: x86_64 ppc64le aarch64 %{arm}
- kf5-audiocd-kio
ExclusiveArch: x86_64 ppc64le aarch64 %{arm}
- kf5-kalarmcal
ExclusiveArch: x86_64 ppc64le aarch64 %{arm}
- kf5-kblog
ExclusiveArch: x86_64 ppc64le aarch64 %{arm}
- kf5-kcalendarcore
ExclusiveArch: x86_64 ppc64le aarch64 %{arm}
- kf5-kcalendarutils
ExclusiveArch: x86_64 ppc64le aarch64 %{arm}
- kf5-kitinerary
ExclusiveArch: x86_64 ppc64le aarch64 %{arm}
- kf5-ktnef
ExclusiveArch: x86_64 ppc64le aarch64 %{arm}
- kf5-libkdcraw
ExclusiveArch: x86_64 ppc64le %{arm}
- kicad
ExclusiveArch: %{ix86} x86_64 %{arm} aarch64 ppc64le
- kiwix-desktop
ExclusiveArch: %{qt5_qtwebengine_arches}
- klee
ExclusiveArch: x86_64
- knot-resolver
ExclusiveArch: %{ix86} x86_64
ExclusiveArch: %{arm} aarch64 %{ix86} x86_64
- knotes
ExclusiveArch: x86_64 %{arm}
- kompose
ExclusiveArch: %{ix86} x86_64 %{arm} aarch64 s390x
- kubernetes
ExclusiveArch: x86_64 aarch64 ppc64le s390x %{arm}
- lazarus
ExclusiveArch: %{fpc_arches}
- lazpaint
ExclusiveArch: %{fpc_arches}
- ldc
ExclusiveArch: %{ldc_arches}
- libbsr
ExclusiveArch: %{power64}
- libclc
ExclusiveArch: %{ix86} x86_64 %{arm} aarch64 %{power64} s390x
- libcxl
ExclusiveArch: %{power64}
- libdfp
ExclusiveArch: ppc ppc64 ppc64le s390 s390x x86_64
- libdispatch
ExclusiveArch: x86_64 aarch64 ppc64le
- libguestfs
ExclusiveArch: %{kernel_arches}
- libica
ExclusiveArch: s390 s390x
- libipt
ExclusiveArch: %{ix86} x86_64
ExclusiveArch: %{ix86} x86_64
- libkgapi
ExclusiveArch: x86_64 ppc64le aarch64 %{arm}
- libnxz
ExclusiveArch: ppc64le
- libocxl
ExclusiveArch: ppc64le
- libpmemobj-cpp
ExclusiveArch: x86_64 ppc64le
- libpsm2
ExclusiveArch: x86_64
- libquentier
ExclusiveArch: %{qt5_qtwebengine_arches}
- libretro-desmume2015
ExclusiveArch: i686 x86_64
- librtas
ExclusiveArch: %{power64}
- libservicelog
ExclusiveArch: ppc %{power64}
- libsmbios
ExclusiveArch: x86_64 %{ix86}
- libunwind
ExclusiveArch: %{arm} aarch64 hppa ia64 mips ppc %{power64} s390x %{ix86} x86_64
- libva-intel-hybrid-driver
ExclusiveArch: %{ix86} x86_64 ia64
- libvma
ExclusiveArch: x86_64 ppc64le ppc64 aarch64
- libvmi
ExclusiveArch: x86_64
- libvpd
ExclusiveArch: %{power64}
- libxsmm
ExclusiveArch: x86_64
- libzdnn
ExclusiveArch: s390x
- libzfcphbaapi
ExclusiveArch: s390 s390x
- lightdm
ExclusiveArch: x86_64 ppc64le
- lightdm-gtk
ExclusiveArch: x86_64 ppc64le
- llhttp
ExclusiveArch: %{nodejs_arches}
- log4j
ExclusiveArch: %{java_arches} noarch
- log4net
ExclusiveArch: %mono_arches
- lrmi
ExclusiveArch: %{ix86}
- lsvpd
ExclusiveArch: %{power64}
- luajit
ExclusiveArch: %{arm} %{ix86} x86_64 %{mips} aarch64
- luxcorerender
ExclusiveArch: x86_64
- mactel-boot
ExclusiveArch: x86_64
- manifest-tool
ExclusiveArch: x86_64 aarch64 ppc64le s390x
- marked
ExclusiveArch: %{nodejs_arches} noarch
ExclusiveArch: %{ix86} x86_64 %{arm} noarch
- matreshka
ExclusiveArch: %GPRbuild_arches
- maui-mauikit
ExclusiveArch: %{ix86} s390x aarch64 x86_64
- maven
ExclusiveArch: %{java_arches} noarch
- maven-antrun-plugin
ExclusiveArch: %{java_arches} noarch
- maven-archiver
ExclusiveArch: %{java_arches} noarch
- maven-artifact-transfer
ExclusiveArch: %{java_arches} noarch
- maven-assembly-plugin
ExclusiveArch: %{java_arches} noarch
- maven-common-artifact-filters
ExclusiveArch: %{java_arches} noarch
- maven-compiler-plugin
ExclusiveArch: %{java_arches} noarch
- maven-dependency-analyzer
ExclusiveArch: %{java_arches} noarch
- maven-dependency-plugin
ExclusiveArch: %{java_arches} noarch
- maven-dependency-tree
ExclusiveArch: %{java_arches} noarch
- maven-enforcer
ExclusiveArch: %{java_arches} noarch
- maven-file-management
ExclusiveArch: %{java_arches} noarch
- maven-filtering
ExclusiveArch: %{java_arches} noarch
- maven-jar-plugin
ExclusiveArch: %{java_arches} noarch
- maven-parent
ExclusiveArch: %{java_arches} noarch
- maven-plugin-build-helper
ExclusiveArch: %{java_arches} noarch
- maven-plugin-bundle
ExclusiveArch: %{java_arches} noarch
- maven-plugin-testing
ExclusiveArch: %{java_arches} noarch
- maven-plugin-tools
ExclusiveArch: %{java_arches} noarch
- maven-remote-resources-plugin
ExclusiveArch: %{java_arches} noarch
- maven-resolver
ExclusiveArch: %{java_arches} noarch
- maven-resources-plugin
ExclusiveArch: %{java_arches} noarch
- maven-shared-incremental
ExclusiveArch: %{java_arches} noarch
- maven-shared-io
ExclusiveArch: %{java_arches} noarch
- maven-shared-utils
ExclusiveArch: %{java_arches} noarch
- maven-source-plugin
ExclusiveArch: %{java_arches} noarch
- maven-surefire
ExclusiveArch: %{java_arches} noarch
- maven-verifier
ExclusiveArch: %{java_arches} noarch
- maven-wagon
ExclusiveArch: %{java_arches} noarch
- maxima
ExclusiveArch: %{arm} %{ix86} x86_64 aarch64 ppc sparcv9
ExclusiveArch: %{ix86} x86_64 ppc sparcv9
- mbpfan
ExclusiveArch: x86_64
- mcelog
ExclusiveArch: i686 x86_64
- mdevctl
ExclusiveArch: %{rust_arches}
- mediaconch
ExclusiveArch: %{qt5_qtwebengine_arches}
- mellowplayer
ExclusiveArch: %{qt5_qtwebengine_arches}
- memkind
ExclusiveArch: x86_64 ppc64 ppc64le s390x aarch64
- memtest86+
ExclusiveArch: %{ix86} x86_64
- mesos
ExclusiveArch: x86_64
- microcode_ctl
ExclusiveArch: %{ix86} x86_64
- micropython
ExclusiveArch: %{arm} %{ix86} x86_64
- mine_detector
ExclusiveArch: %{GPRbuild_arches}
- minetest
ExclusiveArch: %{ix86} x86_64
ExclusiveArch: %{arm} %{ix86} x86_64 %{mips} aarch64
- mingw-libidn2
ExclusiveArch: %{ix86} x86_64 %{arm}
- mingw-wine-gecko
ExclusiveArch: %{ix86} x86_64 %{arm} aarch64
- mirrorlist-server
ExclusiveArch: %{rust_arches}
- mkbootdisk
ExclusiveArch: %{ix86} sparc sparc64 x86_64
- mockito
ExclusiveArch: %{java_arches} noarch
- mod_mono
ExclusiveArch: %mono_arches
- modello
ExclusiveArch: %{java_arches} noarch
- module-build-service
ExclusiveArch: %{ix86} x86_64 noarch
- mojo-parent
ExclusiveArch: %{java_arches} noarch
- mokutil
ExclusiveArch: %{ix86} x86_64 aarch64 %{arm}
- mold
ExclusiveArch: %{ix86} x86_64 %{arm} aarch64 riscv64
- mono
ExclusiveArch: %mono_arches
- mono-addins
ExclusiveArch: %mono_arches
- mono-basic
ExclusiveArch: %{mono_arches}
- mono-bouncycastle
ExclusiveArch: %mono_arches
- mono-cecil
ExclusiveArch: %mono_arches
- mono-cecil-flowanalysis
ExclusiveArch: %mono_arches
- mono-reflection
ExclusiveArch: %mono_arches
- mono-tools
ExclusiveArch: %mono_arches
- mono-zeroconf
ExclusiveArch: %mono_arches
- monobristol
ExclusiveArch: %{mono_arches}
- monodevelop
ExclusiveArch: %mono_arches
- monodevelop-debugger-gdb
ExclusiveArch: %{mono_arches}
- monosim
ExclusiveArch: %mono_arches
- mrrescue
ExclusiveArch: %{arm} %{ix86} x86_64 aarch64 ppc64le
- msr-tools
ExclusiveArch: %{ix86} x86_64
- munge-maven-plugin
ExclusiveArch: %{java_arches} noarch
- mustache-d
ExclusiveArch: %{ldc_arches}
- mysql-connector-net
ExclusiveArch: %{mono_arches}
- naev
ExclusiveArch: %{arm} %{ix86} x86_64 %{mips} aarch64
- nant
ExclusiveArch: %mono_arches
- nativejit
ExclusiveArch: x86_64
- nbc
ExclusiveArch: %{fpc_arches}
- nbdkit
ExclusiveArch: x86_64
- ndesk-dbus
ExclusiveArch: %{mono_arches}
- ndesk-dbus-glib
ExclusiveArch: %{mono_arches}
- netavark
ExclusiveArch: %{rust_arches}
- newtonsoft-json
ExclusiveArch: %{mono_arches}
- nispor
ExclusiveArch: %{rust_arches}
- nodejs
ExclusiveArch: %{nodejs_arches}
- nodejs-acorn-object-spread
ExclusiveArch: %{nodejs_arches} noarch
ExclusiveArch: %{ix86} x86_64 %{arm} noarch
- nodejs-backbone
ExclusiveArch: %{nodejs_arches} noarch
- nodejs-bash-language-server
ExclusiveArch: %{nodejs_arches} noarch
- nodejs-buble
ExclusiveArch: %{nodejs_arches} noarch
- nodejs-colors
ExclusiveArch: %{nodejs_arches} noarch
- nodejs-generic-pool
ExclusiveArch: %{nodejs_arches} noarch
- nodejs-less
ExclusiveArch: %{nodejs_arches} noarch
- nodejs-linefix
ExclusiveArch: %{nodejs_arches} noarch
ExclusiveArch: %{ix86} x86_64 %{arm} noarch
- nodejs-nodemon
ExclusiveArch: %{nodejs_arches} noarch
- nodejs-packaging
ExclusiveArch: %{nodejs_arches} noarch
- nodejs-replace-require-self
ExclusiveArch: %{nodejs_arches} noarch
- nodejs-supervisor
ExclusiveArch: %{nodejs_arches} noarch
- nodejs-tape
ExclusiveArch: %{nodejs_arches} noarch
- nodejs-typescript
ExclusiveArch: %{nodejs_arches} noarch
- nodejs-underscore
ExclusiveArch: %{nodejs_arches} noarch
ExclusiveArch: %{ix86} x86_64 %{arm} noarch
- notify-sharp
ExclusiveArch: %{mono_arches}
- notify-sharp3
ExclusiveArch: %{mono_arches}
- nuget
ExclusiveArch: %{mono_arches}
- numatop
ExclusiveArch: x86_64 ppc64le
- nunit
ExclusiveArch: %{mono_arches}
- nunit2
ExclusiveArch: %{mono_arches}
- nvml
ExclusiveArch: x86_64 ppc64le
- nwchem
ExclusiveArch: %{ix86} x86_64 %{arm} aarch64 ppc64le
- objectweb-asm
ExclusiveArch: %{java_arches} noarch
- objenesis
ExclusiveArch: %{java_arches} noarch
- obs-service-rust2rpm
ExclusiveArch: %{rust_arches} noarch
- oci-seccomp-bpf-hook
ExclusiveArch: x86_64 %%{power64} aarch64 s390x armv7hl
- oci-umount
ExclusiveArch: %{ix86} x86_64 %{arm} aarch64 ppc64le s390x %{mips}
- oidn
ExclusiveArch: x86_64
- olpc-kbdshim
ExclusiveArch: %{ix86} %{arm}
- olpc-utils
ExclusiveArch: %{ix86} %{arm}
- oneVPL
ExclusiveArch: x86_64
- oneVPL-intel-gpu
ExclusiveArch: x86_64
- onednn
ExclusiveArch: x86_64 aarch64 ppc64le s390x
- onedrive
ExclusiveArch: %{ldc_arches}
- opae
ExclusiveArch: x86_64
- opal-prd
ExclusiveArch: ppc64le
- open-vm-tools
ExclusiveArch: x86_64 aarch64
ExclusiveArch: %{ix86} x86_64 aarch64
ExclusiveArch: x86_64
- openblas
ExclusiveArch: %{openblas_arches}
- openjfx
ExclusiveArch: x86_64
- openjfx8
ExclusiveArch: x86_64
- openlibm
ExclusiveArch: %{arm} %{ix86} x86_64 aarch64 %{power64}
- openms
ExclusiveArch: %{qt5_qtwebengine_arches}
- openni
ExclusiveArch: %{ix86} x86_64 %{arm}
- openni-primesense
ExclusiveArch: %{ix86} x86_64 %{arm}
- openshadinglanguage
ExclusiveArch: x86_64 aarch64 ppc64le s390x
- openssl-ibmca
ExclusiveArch: s390 s390x
- opentest4j
ExclusiveArch: %{java_arches} noarch
- origin
ExclusiveArch: %{go_arches}
ExclusiveArch: x86_64 aarch64 ppc64le s390x
- orion
ExclusiveArch: %{qt5_qtwebengine_arches}
- orthorobot
ExclusiveArch: %{arm} %{ix86} x86_64 aarch64 ppc64le
- osgi-annotation
ExclusiveArch: %{java_arches} noarch
- osgi-compendium
ExclusiveArch: %{java_arches} noarch
- osgi-core
ExclusiveArch: %{java_arches} noarch
- pacemaker
ExclusiveArch: aarch64 i686 ppc64le s390x x86_64 %{arm}
ExclusiveArch: aarch64 i686 ppc64le s390x x86_64
- paflib
ExclusiveArch: ppc %{power64}
- parsec
ExclusiveArch: %{rust_arches}
- parsec-tool
ExclusiveArch: %{rust_arches}
- pasdoc
ExclusiveArch: %{fpc_arches}
- pcc
ExclusiveArch: %{ix86} x86_64
- pcm
ExclusiveArch: %{ix86} x86_64
- pcmciautils
ExclusiveArch: %{ix86} x86_64 ia64 ppc ppc64 %{arm}
- pdbg
ExclusiveArch: ppc64le
- pdfmod
ExclusiveArch: %mono_arches
- perl-Dumbbench
ExclusiveArch: %{ix86} x86_64 noarch
- perl-Parse-DMIDecode
ExclusiveArch: %{ix86} x86_64 ia64 aarch64
- pesign
ExclusiveArch: %{ix86} x86_64 ia64 aarch64 %{arm}
- pesign-test-app
ExclusiveArch: x86_64
- pinta
ExclusiveArch: %mono_arches
- pioneer
ExclusiveArch: %{ix86} x86_64
- playonlinux
ExclusiveArch: %{arm} aarch64 %{ix86} x86_64
- plexus-archiver
ExclusiveArch: %{java_arches} noarch
- plexus-build-api
ExclusiveArch: %{java_arches} noarch
- plexus-cipher
ExclusiveArch: %{java_arches} noarch
- plexus-classworlds
ExclusiveArch: %{java_arches} noarch
- plexus-compiler
ExclusiveArch: %{java_arches} noarch
- plexus-components-pom
ExclusiveArch: %{java_arches} noarch
- plexus-containers
ExclusiveArch: %{java_arches} noarch
- plexus-interpolation
ExclusiveArch: %{java_arches} noarch
- plexus-io
ExclusiveArch: %{java_arches} noarch
- plexus-languages
ExclusiveArch: %{java_arches} noarch
- plexus-pom
ExclusiveArch: %{java_arches} noarch
- plexus-resources
ExclusiveArch: %{java_arches} noarch
- plexus-sec-dispatcher
ExclusiveArch: %{java_arches} noarch
- plexus-utils
ExclusiveArch: %{java_arches} noarch
- pmdk-convert
ExclusiveArch: x86_64
- pmemkv
ExclusiveArch: x86_64
- podman
ExclusiveArch: %{golang_arches}
- poppler-sharp
ExclusiveArch: %mono_arches
- popub
ExclusiveArch: %{?go_arches:%{go_arches}}%{!?go_arches:%{ix86} x86_64 %{arm}}
- powerpc-utils
ExclusiveArch: ppc %{power64}
- ppc64-diag
ExclusiveArch: ppc %{power64}
- pveclib
ExclusiveArch: ppc %{power64}
- pvs-sbcl
ExclusiveArch: %{ix86} x86_64 ppc sparcv9
- pyqtwebengine
ExclusiveArch: %{qt5_qtwebengine_arches}
- python-cryptography
ExclusiveArch: %{rust_arches}
- python-etcd
ExclusiveArch: noarch %{ix86} x86_64 %{arm} aarch64 ppc64le s390x
- python-healpy
ExclusiveArch: aarch64 ppc64 ppc64le x86_64 s390x
- python-javabridge
ExclusiveArch: i686 x86_64
- python-openoffice
ExclusiveArch: noarch x86_64
- python-pymoc
ExclusiveArch: aarch64 ppc64 ppc64le x86_64 s390x
- python-setuptools-rust
ExclusiveArch: %{rust_arches}
- q4wine
ExclusiveArch: %{ix86} x86_64 %{arm} aarch64
- qatzip
ExclusiveArch: x86_64
- qcint
ExclusiveArch: x86_64
- qclib
ExclusiveArch: s390 s390x
- qdox
ExclusiveArch: %{java_arches} noarch
- qemu-sanity-check
ExclusiveArch: %{kernel_arches}
- qevercloud
ExclusiveArch: %{qt5_qtwebengine_arches}
- qmapshack
ExclusiveArch: %{qt5_qtwebengine_arches}
- qt4pas
ExclusiveArch: %{fpc_arches}
- qt5-qtwebengine
ExclusiveArch: %{qt5_qtwebengine_arches}
- quantum-espresso
ExclusiveArch: x86_64 %{ix86} aarch64 %{power64}
- quentier
ExclusiveArch: %{qt5_qtwebengine_arches}
- rear
ExclusiveArch: %ix86 x86_64 ppc ppc64 ppc64le ia64
- reg
ExclusiveArch: %{?go_arches:%{go_arches}}%{!?go_arches:%{ix86} x86_64 aarch64 %{arm}}
- regexp
ExclusiveArch: %{java_arches} noarch
- renderdoc
ExclusiveArch: x86_64
- reptyr
ExclusiveArch: %{ix86} x86_64 %{arm} aarch64
- rescene
ExclusiveArch: %{mono_arches}
- restool
ExclusiveArch: aarch64
- restsharp
ExclusiveArch: %{mono_arches}
- rhythmbox-alternative-toolbar
ExclusiveArch: %{ix86} %{arm} x86_64 ppc64 ppc64le
- rocm-compilersupport
ExclusiveArch: x86_64 aarch64 ppc64le
- rocm-device-libs
ExclusiveArch: x86_64 aarch64 ppc64le
- rocm-runtime
ExclusiveArch: x86_64 aarch64 ppc64le
- rocminfo
ExclusiveArch: x86_64 aarch64 ppc64le
- rpm-ostree
ExclusiveArch: %{rust_arches}
- rr
ExclusiveArch: %{ix86} x86_64 aarch64
- rssguard
ExclusiveArch: %{qt5_qtwebengine_arches}
- rubygem-childprocess
ExclusiveArch: %{ix86} x86_64 noarch
- runc
ExclusiveArch: %{ix86} x86_64 %{arm} aarch64 ppc64le %{mips} s390x
- rust
ExclusiveArch: %{rust_arches}
- rust-Inflector
ExclusiveArch: %{rust_arches}
- rust-abomonation
ExclusiveArch: %{rust_arches}
- rust-actix
ExclusiveArch: %{rust_arches}
- rust-actix-codec
ExclusiveArch: %{rust_arches}
- rust-actix-connect
ExclusiveArch: %{rust_arches}
- rust-actix-http
ExclusiveArch: %{rust_arches}
- rust-actix-macros
ExclusiveArch: %{rust_arches}
- rust-actix-macros0.1
ExclusiveArch: %{rust_arches}
- rust-actix-router
ExclusiveArch: %{rust_arches}
- rust-actix-rt
ExclusiveArch: %{rust_arches}
- rust-actix-rt1
ExclusiveArch: %{rust_arches}
- rust-actix-server
ExclusiveArch: %{rust_arches}
- rust-actix-service
ExclusiveArch: %{rust_arches}
- rust-actix-testing
ExclusiveArch: %{rust_arches}
- rust-actix-threadpool
ExclusiveArch: %{rust_arches}
- rust-actix-tls
ExclusiveArch: %{rust_arches}
- rust-actix-utils
ExclusiveArch: %{rust_arches}
- rust-actix-web
ExclusiveArch: %{rust_arches}
- rust-actix-web-codegen
ExclusiveArch: %{rust_arches}
- rust-actix0.10
ExclusiveArch: %{rust_arches}
- rust-actix_derive
ExclusiveArch: %{rust_arches}
- rust-actix_derive0.5
ExclusiveArch: %{rust_arches}
- rust-addr2line
ExclusiveArch: %{rust_arches}
- rust-adler
ExclusiveArch: %{rust_arches}
- rust-adler32
ExclusiveArch: %{rust_arches}
- rust-aead
ExclusiveArch: %{rust_arches}
- rust-aes
ExclusiveArch: %{rust_arches}
- rust-aes-gcm
ExclusiveArch: %{rust_arches}
- rust-aes0.7
ExclusiveArch: %{rust_arches}
- rust-afterburn
ExclusiveArch: %{rust_arches}
- rust-ahash
ExclusiveArch: %{rust_arches}
- rust-ahash0.4
ExclusiveArch: %{rust_arches}
- rust-aho-corasick
ExclusiveArch: %{rust_arches}
- rust-alacritty
ExclusiveArch: %{rust_arches}
- rust-alacritty_config_derive
ExclusiveArch: %{rust_arches}
- rust-alacritty_terminal
ExclusiveArch: %{rust_arches}
- rust-alga
ExclusiveArch: %{rust_arches}
- rust-alga_derive
ExclusiveArch: %{rust_arches}
- rust-aliasable
ExclusiveArch: %{rust_arches}
- rust-alloc-no-stdlib
ExclusiveArch: %{rust_arches}
- rust-alloc-stdlib
ExclusiveArch: %{rust_arches}
- rust-ambient-authority
ExclusiveArch: %{rust_arches}
- rust-ammonia
ExclusiveArch: %{rust_arches}
- rust-ansi_colours
ExclusiveArch: %{rust_arches}
- rust-ansi_term
ExclusiveArch: %{rust_arches}
- rust-ansi_term0.11
ExclusiveArch: %{rust_arches}
- rust-antidote
ExclusiveArch: %{rust_arches}
- rust-anyhow
ExclusiveArch: %{rust_arches}
- rust-aom-sys
ExclusiveArch: %{rust_arches}
- rust-app_dirs
ExclusiveArch: %{rust_arches}
- rust-approx
ExclusiveArch: %{rust_arches}
- rust-ar
ExclusiveArch: %{rust_arches}
- rust-arbitrary
ExclusiveArch: %{rust_arches}
- rust-arbitrary0.4
ExclusiveArch: %{rust_arches}
- rust-arc-swap
ExclusiveArch: %{rust_arches}
- rust-arf-strings
ExclusiveArch: %{rust_arches}
- rust-arg_enum_proc_macro
ExclusiveArch: %{rust_arches}
- rust-argh
ExclusiveArch: %{rust_arches}
- rust-argh_derive
ExclusiveArch: %{rust_arches}
- rust-argh_shared
ExclusiveArch: %{rust_arches}
- rust-argparse
ExclusiveArch: %{rust_arches}
- rust-array-init
ExclusiveArch: %{rust_arches}
- rust-arrayref
ExclusiveArch: %{rust_arches}
- rust-arrayvec
ExclusiveArch: %{rust_arches}
- rust-arrayvec0.5
ExclusiveArch: %{rust_arches}
- rust-ascii
ExclusiveArch: %{rust_arches}
- rust-ascii-canvas
ExclusiveArch: %{rust_arches}
- rust-askalono
ExclusiveArch: %{rust_arches}
- rust-askalono-cli
ExclusiveArch: %{rust_arches}
- rust-askama
ExclusiveArch: %{rust_arches}
- rust-askama_derive
ExclusiveArch: %{rust_arches}
- rust-askama_escape
ExclusiveArch: %{rust_arches}
- rust-askama_shared
ExclusiveArch: %{rust_arches}
- rust-asn1
ExclusiveArch: %{rust_arches}
- rust-asn1_derive
ExclusiveArch: %{rust_arches}
- rust-assert-impl
ExclusiveArch: %{rust_arches}
- rust-assert-json-diff
ExclusiveArch: %{rust_arches}
- rust-assert_approx_eq
ExclusiveArch: %{rust_arches}
- rust-assert_cli
ExclusiveArch: %{rust_arches}
- rust-assert_cmd
ExclusiveArch: %{rust_arches}
- rust-assert_fs
ExclusiveArch: %{rust_arches}
- rust-assert_matches
ExclusiveArch: %{rust_arches}
- rust-async-attributes
ExclusiveArch: %{rust_arches}
- rust-async-channel
ExclusiveArch: %{rust_arches}
- rust-async-compression
ExclusiveArch: %{rust_arches}
- rust-async-executor
ExclusiveArch: %{rust_arches}
- rust-async-global-executor
ExclusiveArch: %{rust_arches}
- rust-async-io
ExclusiveArch: %{rust_arches}
- rust-async-lock
ExclusiveArch: %{rust_arches}
- rust-async-mutex
ExclusiveArch: %{rust_arches}
- rust-async-process
ExclusiveArch: %{rust_arches}
- rust-async-std
ExclusiveArch: %{rust_arches}
- rust-async-stream
ExclusiveArch: %{rust_arches}
- rust-async-stream-impl
ExclusiveArch: %{rust_arches}
- rust-async-task
ExclusiveArch: %{rust_arches}
- rust-async-trait
ExclusiveArch: %{rust_arches}
- rust-asyncgit
ExclusiveArch: %{rust_arches}
- rust-atk
ExclusiveArch: %{rust_arches}
- rust-atk-sys
ExclusiveArch: %{rust_arches}
- rust-atom
ExclusiveArch: %{rust_arches}
- rust-atomic
ExclusiveArch: %{rust_arches}
- rust-atomic-traits
ExclusiveArch: %{rust_arches}
- rust-atomic-waker
ExclusiveArch: %{rust_arches}
- rust-atty
ExclusiveArch: %{rust_arches}
- rust-autocfg
ExclusiveArch: %{rust_arches}
- rust-automod
ExclusiveArch: %{rust_arches}
- rust-av-metrics
ExclusiveArch: %{rust_arches}
- rust-average
ExclusiveArch: %{rust_arches}
- rust-awc
ExclusiveArch: %{rust_arches}
- rust-aws-nitro-enclaves-cose
ExclusiveArch: %{rust_arches}
- rust-az
ExclusiveArch: %{rust_arches}
- rust-backtrace
ExclusiveArch: %{rust_arches}
- rust-base100
ExclusiveArch: %{rust_arches}
- rust-base64
ExclusiveArch: %{rust_arches}
- rust-base64-0.10
ExclusiveArch: %{rust_arches}
- rust-base64-0.11
ExclusiveArch: %{rust_arches}
- rust-base64_0.12
ExclusiveArch: %{rust_arches}
- rust-base64ct
ExclusiveArch: %{rust_arches}
- rust-bat
ExclusiveArch: %{rust_arches}
- rust-beef
ExclusiveArch: %{rust_arches}
- rust-below
ExclusiveArch: %{rust_arches}
- rust-below-common
ExclusiveArch: %{rust_arches}
- rust-below-config
ExclusiveArch: %{rust_arches}
- rust-below-dump
ExclusiveArch: %{rust_arches}
- rust-below-model
ExclusiveArch: %{rust_arches}
- rust-below-render
ExclusiveArch: %{rust_arches}
- rust-below-store
ExclusiveArch: %{rust_arches}
- rust-below-view
ExclusiveArch: %{rust_arches}
- rust-below_derive
ExclusiveArch: %{rust_arches}
- rust-bencher
ExclusiveArch: %{rust_arches}
- rust-benfred-read-process-memory
ExclusiveArch: %{rust_arches}
- rust-bigdecimal
ExclusiveArch: %{rust_arches}
- rust-binascii
ExclusiveArch: %{rust_arches}
- rust-bincode
ExclusiveArch: %{rust_arches}
- rust-bincode0.8
ExclusiveArch: %{rust_arches}
- rust-bindgen
ExclusiveArch: %{rust_arches}
- rust-binfarce
ExclusiveArch: %{rust_arches}
- rust-bit-set
ExclusiveArch: %{rust_arches}
- rust-bit-vec
ExclusiveArch: %{rust_arches}
- rust-bitfield
ExclusiveArch: %{rust_arches}
- rust-bitflags
ExclusiveArch: %{rust_arches}
- rust-bitmaps
ExclusiveArch: %{rust_arches}
- rust-bitstream-io
ExclusiveArch: %{rust_arches}
- rust-bitvec
ExclusiveArch: %{rust_arches}
- rust-blake2
ExclusiveArch: %{rust_arches}
- rust-blobby
ExclusiveArch: %{rust_arches}
- rust-blobby0.1
ExclusiveArch: %{rust_arches}
- rust-block-buffer
ExclusiveArch: %{rust_arches}
- rust-block-buffer0.9
ExclusiveArch: %{rust_arches}
- rust-block-modes
ExclusiveArch: %{rust_arches}
- rust-block-padding
ExclusiveArch: %{rust_arches}
- rust-block-padding0.2
ExclusiveArch: %{rust_arches}
- rust-blocking
ExclusiveArch: %{rust_arches}
- rust-blsctl
ExclusiveArch: %{rust_arches}
- rust-bodhi
ExclusiveArch: %{rust_arches}
- rust-bodhi-cli
ExclusiveArch: %{rust_arches}
- rust-bootupd
ExclusiveArch: x86_64 aarch64
- rust-box_drawing
ExclusiveArch: %{rust_arches}
- rust-boxfnonce
ExclusiveArch: %{rust_arches}
- rust-brotli
ExclusiveArch: %{rust_arches}
- rust-brotli-decompressor
ExclusiveArch: %{rust_arches}
- rust-brotli-sys
ExclusiveArch: %{rust_arches}
- rust-brotli2
ExclusiveArch: %{rust_arches}
- rust-bstr
ExclusiveArch: %{rust_arches}
- rust-btrd
ExclusiveArch: %{rust_arches}
- rust-buf_redux
ExclusiveArch: %{rust_arches}
- rust-buffered-reader
ExclusiveArch: %{rust_arches}
- rust-bufstream
ExclusiveArch: %{rust_arches}
- rust-bugreport
ExclusiveArch: %{rust_arches}
- rust-bumpalo
ExclusiveArch: %{rust_arches}
- rust-byte-unit
ExclusiveArch: %{rust_arches}
- rust-byte-unit3
ExclusiveArch: %{rust_arches}
- rust-bytecheck
ExclusiveArch: %{rust_arches}
- rust-bytecheck_derive
ExclusiveArch: %{rust_arches}
- rust-bytecount
ExclusiveArch: %{rust_arches}
- rust-bytelines
ExclusiveArch: %{rust_arches}
- rust-bytemuck
ExclusiveArch: %{rust_arches}
- rust-bytemuck_derive
ExclusiveArch: %{rust_arches}
- rust-byteorder
ExclusiveArch: %{rust_arches}
- rust-bytes
ExclusiveArch: %{rust_arches}
- rust-bytes-cast
ExclusiveArch: %{rust_arches}
- rust-bytes-cast-derive
ExclusiveArch: %{rust_arches}
- rust-bytes0.4
ExclusiveArch: %{rust_arches}
- rust-bytes0.5
ExclusiveArch: %{rust_arches}
- rust-bytesize
ExclusiveArch: %{rust_arches}
- rust-bytestring
ExclusiveArch: %{rust_arches}
- rust-bzip2
ExclusiveArch: %{rust_arches}
- rust-bzip2-sys
ExclusiveArch: %{rust_arches}
- rust-cache-padded
ExclusiveArch: %{rust_arches}
- rust-cairo-rs
ExclusiveArch: %{rust_arches}
- rust-cairo-sys-rs
ExclusiveArch: %{rust_arches}
- rust-calloop
ExclusiveArch: %{rust_arches}
- rust-camino
ExclusiveArch: %{rust_arches}
- rust-cap-async-std
ExclusiveArch: %{rust_arches}
- rust-cap-fs-ext
ExclusiveArch: %{rust_arches}
- rust-cap-primitives
ExclusiveArch: %{rust_arches}
- rust-cap-rand
ExclusiveArch: %{rust_arches}
- rust-cap-std
ExclusiveArch: %{rust_arches}
- rust-cap-tempfile
ExclusiveArch: %{rust_arches}
- rust-cap-time-ext
ExclusiveArch: %{rust_arches}
- rust-capng
ExclusiveArch: %{rust_arches}
- rust-capnp
ExclusiveArch: %{rust_arches}
- rust-capnp-futures
ExclusiveArch: %{rust_arches}
- rust-capnp-rpc
ExclusiveArch: %{rust_arches}
- rust-caps
ExclusiveArch: %{rust_arches}
- rust-cargo
ExclusiveArch: %{rust_arches}
- rust-cargo-bloat
ExclusiveArch: %{rust_arches}
- rust-cargo-c
ExclusiveArch: %{rust_arches}
- rust-cargo-edit
ExclusiveArch: %{rust_arches}
- rust-cargo-husky
ExclusiveArch: %{rust_arches}
- rust-cargo-insta
ExclusiveArch: %{rust_arches}
- rust-cargo-manifest
ExclusiveArch: %{rust_arches}
- rust-cargo-platform
ExclusiveArch: %{rust_arches}
- rust-cargo-readme
ExclusiveArch: %{rust_arches}
- rust-cargo-util
ExclusiveArch: %{rust_arches}
- rust-cargo_metadata
ExclusiveArch: %{rust_arches}
- rust-cascade
ExclusiveArch: %{rust_arches}
- rust-case
ExclusiveArch: %{rust_arches}
- rust-cassowary
ExclusiveArch: %{rust_arches}
- rust-cast
ExclusiveArch: %{rust_arches}
- rust-cbindgen
ExclusiveArch: %{rust_arches}
- rust-cc
ExclusiveArch: %{rust_arches}
- rust-cedarwood
ExclusiveArch: %{rust_arches}
- rust-cexpr
ExclusiveArch: %{rust_arches}
- rust-cfb
ExclusiveArch: %{rust_arches}
- rust-cfg-expr
ExclusiveArch: %{rust_arches}
- rust-cfg-if
ExclusiveArch: %{rust_arches}
- rust-cfg-if0.1
ExclusiveArch: %{rust_arches}
- rust-cgroupfs
ExclusiveArch: %{rust_arches}
- rust-chainerror
ExclusiveArch: %{rust_arches}
- rust-charset
ExclusiveArch: %{rust_arches}
- rust-chbs
ExclusiveArch: %{rust_arches}
- rust-checked_int_cast
ExclusiveArch: %{rust_arches}
- rust-choosier
ExclusiveArch: %{rust_arches}
- rust-chrono
ExclusiveArch: %{rust_arches}
- rust-chrono-humanize
ExclusiveArch: %{rust_arches}
- rust-chrono-tz
ExclusiveArch: %{rust_arches}
- rust-chunked_transfer
ExclusiveArch: %{rust_arches}
- rust-ciborium
ExclusiveArch: %{rust_arches}
- rust-ciborium-io
ExclusiveArch: %{rust_arches}
- rust-ciborium-ll
ExclusiveArch: %{rust_arches}
- rust-cipher
ExclusiveArch: %{rust_arches}
- rust-cipher0.3
ExclusiveArch: %{rust_arches}
- rust-clang-ast
ExclusiveArch: %{rust_arches}
- rust-clang-sys
ExclusiveArch: %{rust_arches}
- rust-clap
ExclusiveArch: %{rust_arches}
- rust-clap-verbosity-flag
ExclusiveArch: %{rust_arches}
- rust-clap2
ExclusiveArch: %{rust_arches}
- rust-clap_complete
ExclusiveArch: %{rust_arches}
- rust-clap_complete_fig
ExclusiveArch: %{rust_arches}
- rust-clap_derive
ExclusiveArch: %{rust_arches}
- rust-clap_generate
ExclusiveArch: %{rust_arches}
- rust-clap_generate_fig
ExclusiveArch: %{rust_arches}
- rust-clap_lex
ExclusiveArch: %{rust_arches}
- rust-clicolors-control
ExclusiveArch: %{rust_arches}
- rust-clircle
ExclusiveArch: %{rust_arches}
- rust-cmake
ExclusiveArch: %{rust_arches}
- rust-codespan-reporting
ExclusiveArch: %{rust_arches}
- rust-codicon
ExclusiveArch: %{rust_arches}
- rust-color-backtrace
ExclusiveArch: %{rust_arches}
- rust-color_quant
ExclusiveArch: %{rust_arches}
- rust-colored
ExclusiveArch: %{rust_arches}
- rust-colored1
ExclusiveArch: %{rust_arches}
- rust-colored_json
ExclusiveArch: %{rust_arches}
- rust-colorful
ExclusiveArch: %{rust_arches}
- rust-combine
ExclusiveArch: %{rust_arches}
- rust-comfy-table
ExclusiveArch: %{rust_arches}
- rust-common-path
ExclusiveArch: %{rust_arches}
- rust-compiletest_rs
ExclusiveArch: %{rust_arches}
- rust-compress-tools
ExclusiveArch: %{rust_arches}
- rust-comrak
ExclusiveArch: %{rust_arches}
- rust-concurrent-queue
ExclusiveArch: %{rust_arches}
- rust-configparser
ExclusiveArch: %{rust_arches}
- rust-confy
ExclusiveArch: %{rust_arches}
- rust-conhash
ExclusiveArch: %{rust_arches}
- rust-console
ExclusiveArch: %{rust_arches}
- rust-console0.11
ExclusiveArch: %{rust_arches}
- rust-console0.12
ExclusiveArch: %{rust_arches}
- rust-console0.13
ExclusiveArch: %{rust_arches}
- rust-console0.14
ExclusiveArch: %{rust_arches}
- rust-console0.9
ExclusiveArch: %{rust_arches}
- rust-console_error_panic_hook
ExclusiveArch: %{rust_arches}
- rust-const-cstr
ExclusiveArch: %{rust_arches}
- rust-const-oid
ExclusiveArch: %{rust_arches}
- rust-const-random
ExclusiveArch: %{rust_arches}
- rust-const-random-macro
ExclusiveArch: %{rust_arches}
- rust-const_fn
ExclusiveArch: %{rust_arches}
- rust-constant_time_eq
ExclusiveArch: %{rust_arches}
- rust-content_inspector
ExclusiveArch: %{rust_arches}
- rust-conv
ExclusiveArch: %{rust_arches}
- rust-convert_case
ExclusiveArch: %{rust_arches}
- rust-cookie
ExclusiveArch: %{rust_arches}
- rust-cookie-factory
ExclusiveArch: %{rust_arches}
- rust-cookie0.14
ExclusiveArch: %{rust_arches}
- rust-cookie_store
ExclusiveArch: %{rust_arches}
- rust-cookie_store0.12
ExclusiveArch: %{rust_arches}
- rust-coolor
ExclusiveArch: %{rust_arches}
- rust-copydeps
ExclusiveArch: %{rust_arches}
- rust-copyless
ExclusiveArch: %{rust_arches}
- rust-copypasta
ExclusiveArch: %{rust_arches}
- rust-cordic
ExclusiveArch: %{rust_arches}
- rust-coreos-installer
ExclusiveArch: %{rust_arches}
- rust-count-zeroes
ExclusiveArch: %{rust_arches}
- rust-counted-array
ExclusiveArch: %{rust_arches}
- rust-cpio
ExclusiveArch: %{rust_arches}
- rust-cpp_demangle
ExclusiveArch: %{rust_arches}
- rust-cpufeatures
ExclusiveArch: %{rust_arches}
- rust-cpython
ExclusiveArch: %{rust_arches}
- rust-cranelift-bforest
ExclusiveArch: %{rust_arches}
- rust-cranelift-codegen
ExclusiveArch: x86_64 aarch64 s390x
- rust-cranelift-codegen-meta
ExclusiveArch: %{rust_arches}
- rust-cranelift-codegen-shared
ExclusiveArch: %{rust_arches}
- rust-cranelift-entity
ExclusiveArch: %{rust_arches}
- rust-cranelift-frontend
ExclusiveArch: x86_64 aarch64 s390x
- rust-cranelift-native
ExclusiveArch: x86_64 aarch64 s390x
- rust-cranelift-wasm
ExclusiveArch: x86_64 aarch64 s390x
- rust-crates-io
ExclusiveArch: %{rust_arches}
- rust-crc
ExclusiveArch: %{rust_arches}
- rust-crc-catalog
ExclusiveArch: %{rust_arches}
- rust-crc32fast
ExclusiveArch: %{rust_arches}
- rust-criterion
ExclusiveArch: %{rust_arches}
- rust-criterion-plot
ExclusiveArch: %{rust_arches}
- rust-crossbeam
ExclusiveArch: %{rust_arches}
- rust-crossbeam-channel
ExclusiveArch: %{rust_arches}
- rust-crossbeam-channel0.4
ExclusiveArch: %{rust_arches}
- rust-crossbeam-deque
ExclusiveArch: %{rust_arches}
- rust-crossbeam-deque0.7
ExclusiveArch: %{rust_arches}
- rust-crossbeam-epoch
ExclusiveArch: %{rust_arches}
- rust-crossbeam-epoch0.8
ExclusiveArch: %{rust_arches}
- rust-crossbeam-queue
ExclusiveArch: %{rust_arches}
- rust-crossbeam-queue0.2
ExclusiveArch: %{rust_arches}
- rust-crossbeam-utils
ExclusiveArch: %{rust_arches}
- rust-crossbeam-utils0.7
ExclusiveArch: %{rust_arches}
- rust-crossbeam0.7
ExclusiveArch: %{rust_arches}
- rust-crossfont
ExclusiveArch: %{rust_arches}
- rust-crossterm
ExclusiveArch: %{rust_arches}
- rust-crossterm0.17
ExclusiveArch: %{rust_arches}
- rust-crossterm0.19
ExclusiveArch: %{rust_arches}
- rust-crosstermion
ExclusiveArch: %{rust_arches}
- rust-crunchy
ExclusiveArch: %{rust_arches}
- rust-crypto-bigint
ExclusiveArch: %{rust_arches}
- rust-crypto-common
ExclusiveArch: %{rust_arches}
- rust-crypto-hash
ExclusiveArch: %{rust_arches}
- rust-crypto-mac
ExclusiveArch: %{rust_arches}
- rust-cryptoki
ExclusiveArch: %{rust_arches}
- rust-cryptoki-sys
ExclusiveArch: %{rust_arches}
- rust-cstr_core
ExclusiveArch: %{rust_arches}
- rust-csv
ExclusiveArch: %{rust_arches}
- rust-csv-core
ExclusiveArch: %{rust_arches}
- rust-ct-logs
ExclusiveArch: %{rust_arches}
- rust-ctor
ExclusiveArch: %{rust_arches}
- rust-ctr
ExclusiveArch: %{rust_arches}
- rust-ctr0.8
ExclusiveArch: %{rust_arches}
- rust-ctrlc
ExclusiveArch: %{rust_arches}
- rust-cty
ExclusiveArch: %{rust_arches}
- rust-curl
ExclusiveArch: %{rust_arches}
- rust-curl-sys
ExclusiveArch: %{rust_arches}
- rust-cursive
ExclusiveArch: %{rust_arches}
- rust-cursive-tabs
ExclusiveArch: %{rust_arches}
- rust-cursive_buffered_backend
ExclusiveArch: %{rust_arches}
- rust-cursive_core
ExclusiveArch: %{rust_arches}
- rust-curve25519-dalek
ExclusiveArch: %{rust_arches}
- rust-custom_derive
ExclusiveArch: %{rust_arches}
- rust-custom_error
ExclusiveArch: %{rust_arches}
- rust-cxx
ExclusiveArch: %{rust_arches}
- rust-cxx-build
ExclusiveArch: %{rust_arches}
- rust-cxx-gen
ExclusiveArch: %{rust_arches}
- rust-cxxbridge-flags
ExclusiveArch: %{rust_arches}
- rust-cxxbridge-macro
ExclusiveArch: %{rust_arches}
- rust-darling
ExclusiveArch: %{rust_arches}
- rust-darling0.12
ExclusiveArch: %{rust_arches}
- rust-darling_core
ExclusiveArch: %{rust_arches}
- rust-darling_core0.12
ExclusiveArch: %{rust_arches}
- rust-darling_macro
ExclusiveArch: %{rust_arches}
- rust-darling_macro0.12
ExclusiveArch: %{rust_arches}
- rust-dashmap
ExclusiveArch: %{rust_arches}
- rust-data-encoding
ExclusiveArch: %{rust_arches}
- rust-data-url
ExclusiveArch: %{rust_arches}
- rust-datetime
ExclusiveArch: %{rust_arches}
- rust-dav1d-sys
ExclusiveArch: %{rust_arches}
- rust-dbus
ExclusiveArch: %{rust_arches}
- rust-dbus-codegen
ExclusiveArch: %{rust_arches}
- rust-dbus-crossroads
ExclusiveArch: %{rust_arches}
- rust-dbus-tokio
ExclusiveArch: %{rust_arches}
- rust-dbus-tree
ExclusiveArch: %{rust_arches}
- rust-dbus0.8
ExclusiveArch: %{rust_arches}
- rust-decimal
ExclusiveArch: %{rust_arches}
- rust-defer-drop
ExclusiveArch: %{rust_arches}
- rust-deflate
ExclusiveArch: %{rust_arches}
- rust-deflate0.8
ExclusiveArch: %{rust_arches}
- rust-defmac
ExclusiveArch: %{rust_arches}
- rust-der
ExclusiveArch: %{rust_arches}
- rust-der_derive
ExclusiveArch: %{rust_arches}
- rust-derivative
ExclusiveArch: %{rust_arches}
- rust-derive-new
ExclusiveArch: %{rust_arches}
- rust-derive_arbitrary
ExclusiveArch: %{rust_arches}
- rust-derive_arbitrary0.4
ExclusiveArch: %{rust_arches}
- rust-derive_builder
ExclusiveArch: %{rust_arches}
- rust-derive_builder0.9
ExclusiveArch: %{rust_arches}
- rust-derive_builder_core
ExclusiveArch: %{rust_arches}
- rust-derive_builder_core0.9
ExclusiveArch: %{rust_arches}
- rust-derive_builder_macro
ExclusiveArch: %{rust_arches}
- rust-derive_more
ExclusiveArch: %{rust_arches}
- rust-des
ExclusiveArch: %{rust_arches}
- rust-des0.7
ExclusiveArch: %{rust_arches}
- rust-desed
ExclusiveArch: %{rust_arches}
- rust-deunicode
ExclusiveArch: %{rust_arches}
- rust-devicemapper
ExclusiveArch: %{rust_arches}
- rust-devicemapper-sys
ExclusiveArch: %{rust_arches}
- rust-dialoguer
ExclusiveArch: %{rust_arches}
- rust-diesel
ExclusiveArch: %{rust_arches}
- rust-diesel_derives
ExclusiveArch: %{rust_arches}
- rust-diff
ExclusiveArch: %{rust_arches}
- rust-difference
ExclusiveArch: %{rust_arches}
- rust-difflib
ExclusiveArch: %{rust_arches}
- rust-digest
ExclusiveArch: %{rust_arches}
- rust-digest0.9
ExclusiveArch: %{rust_arches}
- rust-digest_auth
ExclusiveArch: %{rust_arches}
- rust-directories
ExclusiveArch: %{rust_arches}
- rust-directories-next
ExclusiveArch: %{rust_arches}
- rust-dirs
ExclusiveArch: %{rust_arches}
- rust-dirs-next
ExclusiveArch: %{rust_arches}
- rust-dirs-sys
ExclusiveArch: %{rust_arches}
- rust-dirs-sys-next
ExclusiveArch: %{rust_arches}
- rust-dirs2
ExclusiveArch: %{rust_arches}
- rust-dirs3
ExclusiveArch: %{rust_arches}
- rust-diskonaut
ExclusiveArch: %{rust_arches}
- rust-displaydoc
ExclusiveArch: %{rust_arches}
- rust-dissimilar
ExclusiveArch: %{rust_arches}
- rust-dlib
ExclusiveArch: %{rust_arches}
- rust-dlv-list
ExclusiveArch: %{rust_arches}
- rust-dns-lookup
ExclusiveArch: %{rust_arches}
- rust-doc-comment
ExclusiveArch: %{rust_arches}
- rust-docmatic
ExclusiveArch: %{rust_arches}
- rust-docopt
ExclusiveArch: %{rust_arches}
- rust-dotenv
ExclusiveArch: %{rust_arches}
- rust-downcast
ExclusiveArch: %{rust_arches}
- rust-downcast-rs
ExclusiveArch: %{rust_arches}
- rust-drg
ExclusiveArch: %{rust_arches}
- rust-dtoa
ExclusiveArch: %{rust_arches}
- rust-dua-cli
ExclusiveArch: %{rust_arches}
- rust-duct
ExclusiveArch: %{rust_arches}
- rust-dummy
ExclusiveArch: %{rust_arches}
- rust-dunce
ExclusiveArch: %{rust_arches}
- rust-dutree
ExclusiveArch: %{rust_arches}
- rust-dyn-clone
ExclusiveArch: %{rust_arches}
- rust-easy-cast
ExclusiveArch: %{rust_arches}
- rust-easy-parallel
ExclusiveArch: %{rust_arches}
- rust-edit
ExclusiveArch: %{rust_arches}
- rust-edit-distance
ExclusiveArch: %{rust_arches}
- rust-either
ExclusiveArch: %{rust_arches}
- rust-elasticlunr-rs
ExclusiveArch: %{rust_arches}
- rust-elf
ExclusiveArch: %{rust_arches}
- rust-elfcat
ExclusiveArch: %{rust_arches}
- rust-email-encoding
ExclusiveArch: %{rust_arches}
- rust-ena
ExclusiveArch: %{rust_arches}
- rust-encode_unicode
ExclusiveArch: %{rust_arches}
- rust-encoding
ExclusiveArch: %{rust_arches}
- rust-encoding-index-japanese
ExclusiveArch: %{rust_arches}
- rust-encoding-index-korean
ExclusiveArch: %{rust_arches}
- rust-encoding-index-simpchinese
ExclusiveArch: %{rust_arches}
- rust-encoding-index-singlebyte
ExclusiveArch: %{rust_arches}
- rust-encoding-index-tradchinese
ExclusiveArch: %{rust_arches}
- rust-encoding_index_tests
ExclusiveArch: %{rust_arches}
- rust-encoding_rs
ExclusiveArch: %{rust_arches}
- rust-encoding_rs_io
ExclusiveArch: %{rust_arches}
- rust-endian-type
ExclusiveArch: %{rust_arches}
- rust-enquote
ExclusiveArch: %{rust_arches}
- rust-entities
ExclusiveArch: %{rust_arches}
- rust-enum-as-inner
ExclusiveArch: %{rust_arches}
- rust-enum-iterator
ExclusiveArch: %{rust_arches}
- rust-enum-iterator-derive
ExclusiveArch: %{rust_arches}
- rust-enum-map
ExclusiveArch: %{rust_arches}
- rust-enum-map-derive
ExclusiveArch: %{rust_arches}
- rust-enumflags2
ExclusiveArch: %{rust_arches}
- rust-enumflags2_0.6
ExclusiveArch: %{rust_arches}
- rust-enumflags2_derive
ExclusiveArch: %{rust_arches}
- rust-enumflags2_derive0.6
ExclusiveArch: %{rust_arches}
- rust-enumset
ExclusiveArch: %{rust_arches}
- rust-enumset_derive
ExclusiveArch: %{rust_arches}
- rust-env_logger
ExclusiveArch: %{rust_arches}
- rust-env_logger0.4
ExclusiveArch: %{rust_arches}
- rust-env_logger0.5
ExclusiveArch: %{rust_arches}
- rust-env_logger0.6
ExclusiveArch: %{rust_arches}
- rust-env_logger0.7
ExclusiveArch: %{rust_arches}
- rust-env_logger0.8
ExclusiveArch: %{rust_arches}
- rust-env_proxy
ExclusiveArch: %{rust_arches}
- rust-environment
ExclusiveArch: %{rust_arches}
- rust-envsubst
ExclusiveArch: %{rust_arches}
- rust-epoll
ExclusiveArch: %{rust_arches}
- rust-erased-serde
ExclusiveArch: %{rust_arches}
- rust-err-derive
ExclusiveArch: %{rust_arches}
- rust-errno
ExclusiveArch: %{rust_arches}
- rust-error-chain
ExclusiveArch: %{rust_arches}
- rust-escargot
ExclusiveArch: %{rust_arches}
- rust-ethtool
ExclusiveArch: %{rust_arches}
- rust-event-listener
ExclusiveArch: %{rust_arches}
- rust-exa
ExclusiveArch: %{rust_arches}
- rust-executable-path
ExclusiveArch: %{rust_arches}
- rust-exitcode
ExclusiveArch: %{rust_arches}
- rust-exitfailure
ExclusiveArch: %{rust_arches}
- rust-expat-sys
ExclusiveArch: %{rust_arches}
- rust-eyre
ExclusiveArch: %{rust_arches}
- rust-faccess
ExclusiveArch: %{rust_arches}
- rust-fail
ExclusiveArch: %{rust_arches}
- rust-failure
ExclusiveArch: %{rust_arches}
- rust-failure-tools
ExclusiveArch: %{rust_arches}
- rust-failure_derive
ExclusiveArch: %{rust_arches}
- rust-fake
ExclusiveArch: %{rust_arches}
- rust-fake-simd
ExclusiveArch: %{rust_arches}
- rust-fallible-iterator
ExclusiveArch: %{rust_arches}
- rust-fallible-streaming-iterator
ExclusiveArch: %{rust_arches}
- rust-fancy-regex
ExclusiveArch: %{rust_arches}
- rust-fastrand
ExclusiveArch: %{rust_arches}
- rust-fatfs
ExclusiveArch: %{rust_arches}
- rust-fb_procfs
ExclusiveArch: %{rust_arches}
- rust-fbthrift_codegen_includer_proc_macro
ExclusiveArch: %{rust_arches}
- rust-fd-find
ExclusiveArch: %{rust_arches}
- rust-fd-lock
ExclusiveArch: %{rust_arches}
- rust-fdlimit
ExclusiveArch: %{rust_arches}
- rust-fedora
ExclusiveArch: %{rust_arches}
- rust-fedora-coreos-pinger
ExclusiveArch: %{rust_arches}
- rust-fedora-update-feedback
ExclusiveArch: %{rust_arches}
- rust-femme
ExclusiveArch: %{rust_arches}
- rust-fern
ExclusiveArch: %{rust_arches}
- rust-ffsend
ExclusiveArch: %{rust_arches}
- rust-ffsend-api
ExclusiveArch: %{rust_arches}
- rust-field-offset
ExclusiveArch: %{rust_arches}
- rust-file-per-thread-logger
ExclusiveArch: %{rust_arches}
- rust-filedescriptor
ExclusiveArch: %{rust_arches}
- rust-filesize
ExclusiveArch: %{rust_arches}
- rust-filetime
ExclusiveArch: %{rust_arches}
- rust-filetreelist
ExclusiveArch: %{rust_arches}
- rust-find-crate
ExclusiveArch: %{rust_arches}
- rust-findshlibs
ExclusiveArch: %{rust_arches}
- rust-fixed
ExclusiveArch: %{rust_arches}
- rust-fixedbitset
ExclusiveArch: %{rust_arches}
- rust-flate2
ExclusiveArch: %{rust_arches}
- rust-float-cmp
ExclusiveArch: %{rust_arches}
- rust-float-ord
ExclusiveArch: %{rust_arches}
- rust-fluent
ExclusiveArch: %{rust_arches}
- rust-fluent-bundle
ExclusiveArch: %{rust_arches}
- rust-fluent-langneg
ExclusiveArch: %{rust_arches}
- rust-fluent-syntax
ExclusiveArch: %{rust_arches}
- rust-fn-error-context
ExclusiveArch: %{rust_arches}
- rust-fnv
ExclusiveArch: %{rust_arches}
- rust-font-kit
ExclusiveArch: %{rust_arches}
- rust-foreign-types
ExclusiveArch: %{rust_arches}
- rust-foreign-types-macros
ExclusiveArch: %{rust_arches}
- rust-foreign-types-shared
ExclusiveArch: %{rust_arches}
- rust-foreign-types-shared0.1
ExclusiveArch: %{rust_arches}
- rust-foreign-types0.3
ExclusiveArch: %{rust_arches}
- rust-form_urlencoded
ExclusiveArch: %{rust_arches}
- rust-format-bytes
ExclusiveArch: %{rust_arches}
- rust-format-bytes-macros
ExclusiveArch: %{rust_arches}
- rust-fragile
ExclusiveArch: %{rust_arches}
- rust-freetype
ExclusiveArch: %{rust_arches}
- rust-freetype-rs
ExclusiveArch: %{rust_arches}
- rust-freetype-sys
ExclusiveArch: %{rust_arches}
- rust-fs-err
ExclusiveArch: %{rust_arches}
- rust-fs-set-times
ExclusiveArch: %{rust_arches}
- rust-fs2
ExclusiveArch: %{rust_arches}
- rust-fs_extra
ExclusiveArch: %{rust_arches}
- rust-fscommon
ExclusiveArch: %{rust_arches}
- rust-fslock
ExclusiveArch: %{rust_arches}
- rust-funty
ExclusiveArch: %{rust_arches}
- rust-futf
ExclusiveArch: %{rust_arches}
- rust-futures
ExclusiveArch: %{rust_arches}
- rust-futures-channel
ExclusiveArch: %{rust_arches}
- rust-futures-core
ExclusiveArch: %{rust_arches}
- rust-futures-cpupool
ExclusiveArch: %{rust_arches}
- rust-futures-executor
ExclusiveArch: %{rust_arches}
- rust-futures-io
ExclusiveArch: %{rust_arches}
- rust-futures-lite
ExclusiveArch: %{rust_arches}
- rust-futures-macro
ExclusiveArch: %{rust_arches}
- rust-futures-sink
ExclusiveArch: %{rust_arches}
- rust-futures-task
ExclusiveArch: %{rust_arches}
- rust-futures-test
ExclusiveArch: %{rust_arches}
- rust-futures-timer
ExclusiveArch: %{rust_arches}
- rust-futures-util
ExclusiveArch: %{rust_arches}
- rust-futures0.1
ExclusiveArch: %{rust_arches}
- rust-fuzzy-matcher
ExclusiveArch: %{rust_arches}
- rust-fxhash
ExclusiveArch: %{rust_arches}
- rust-gdk
ExclusiveArch: %{rust_arches}
- rust-gdk-pixbuf
ExclusiveArch: %{rust_arches}
- rust-gdk-pixbuf-sys
ExclusiveArch: %{rust_arches}
- rust-gdk-sys
ExclusiveArch: %{rust_arches}
- rust-gdk4
ExclusiveArch: %{rust_arches}
- rust-gdk4-sys
ExclusiveArch: %{rust_arches}
- rust-generic-array
ExclusiveArch: %{rust_arches}
- rust-generic-array0.12
ExclusiveArch: %{rust_arches}
- rust-genetlink
ExclusiveArch: %{rust_arches}
- rust-getch
ExclusiveArch: %{rust_arches}
- rust-gethostname
ExclusiveArch: %{rust_arches}
- rust-getopts
ExclusiveArch: %{rust_arches}
- rust-getrandom
ExclusiveArch: %{rust_arches}
- rust-getrandom0.1
ExclusiveArch: %{rust_arches}
- rust-getset
ExclusiveArch: %{rust_arches}
- rust-gettext-rs
ExclusiveArch: %{rust_arches}
- rust-gettext-sys
ExclusiveArch: %{rust_arches}
- rust-gh-emoji
ExclusiveArch: %{rust_arches}
- rust-ghash
ExclusiveArch: %{rust_arches}
- rust-ghost
ExclusiveArch: %{rust_arches}
- rust-gif
ExclusiveArch: %{rust_arches}
- rust-gimli
ExclusiveArch: %{rust_arches}
- rust-gio
ExclusiveArch: %{rust_arches}
- rust-gio-sys
ExclusiveArch: %{rust_arches}
- rust-gir-format-check
ExclusiveArch: %{rust_arches}
- rust-git-delta
ExclusiveArch: %{rust_arches}
- rust-git-version
ExclusiveArch: %{rust_arches}
- rust-git-version-macro
ExclusiveArch: %{rust_arches}
- rust-git2
ExclusiveArch: %{rust_arches}
- rust-git2-curl
ExclusiveArch: %{rust_arches}
- rust-gitui
ExclusiveArch: %{rust_arches}
- rust-gl_generator
ExclusiveArch: %{rust_arches}
- rust-glam
ExclusiveArch: %{rust_arches}
- rust-glib
ExclusiveArch: %{rust_arches}
- rust-glib-macros
ExclusiveArch: %{rust_arches}
- rust-glib-sys
ExclusiveArch: %{rust_arches}
- rust-glob
ExclusiveArch: %{rust_arches}
- rust-globset
ExclusiveArch: %{rust_arches}
- rust-globwalk
ExclusiveArch: %{rust_arches}
- rust-glutin
ExclusiveArch: %{rust_arches}
- rust-glutin_egl_sys
ExclusiveArch: %{rust_arches}
- rust-glutin_glx_sys
ExclusiveArch: %{rust_arches}
- rust-gobject-sys
ExclusiveArch: %{rust_arches}
- rust-goblin
ExclusiveArch: %{rust_arches}
- rust-gptman
ExclusiveArch: %{rust_arches}
- rust-graphene-rs
ExclusiveArch: %{rust_arches}
- rust-graphene-sys
ExclusiveArch: %{rust_arches}
- rust-greetd_ipc
ExclusiveArch: %{rust_arches}
- rust-grep
ExclusiveArch: %{rust_arches}
- rust-grep-cli
ExclusiveArch: %{rust_arches}
- rust-grep-matcher
ExclusiveArch: %{rust_arches}
- rust-grep-pcre2
ExclusiveArch: %{rust_arches}
- rust-grep-printer
ExclusiveArch: %{rust_arches}
- rust-grep-regex
ExclusiveArch: %{rust_arches}
- rust-grep-searcher
ExclusiveArch: %{rust_arches}
- rust-groupable
ExclusiveArch: %{rust_arches}
- rust-gsk4
ExclusiveArch: %{rust_arches}
- rust-gsk4-sys
ExclusiveArch: %{rust_arches}
- rust-gstreamer
ExclusiveArch: %{rust_arches}
- rust-gstreamer-audio
ExclusiveArch: %{rust_arches}
- rust-gstreamer-audio-sys
ExclusiveArch: %{rust_arches}
- rust-gstreamer-base
ExclusiveArch: %{rust_arches}
- rust-gstreamer-base-sys
ExclusiveArch: %{rust_arches}
- rust-gstreamer-editing-services
ExclusiveArch: %{rust_arches}
- rust-gstreamer-editing-services-sys
ExclusiveArch: %{rust_arches}
- rust-gstreamer-pbutils
ExclusiveArch: %{rust_arches}
- rust-gstreamer-pbutils-sys
ExclusiveArch: %{rust_arches}
- rust-gstreamer-player
ExclusiveArch: %{rust_arches}
- rust-gstreamer-player-sys
ExclusiveArch: %{rust_arches}
- rust-gstreamer-sys
ExclusiveArch: %{rust_arches}
- rust-gstreamer-video
ExclusiveArch: %{rust_arches}
- rust-gstreamer-video-sys
ExclusiveArch: %{rust_arches}
- rust-gtk
ExclusiveArch: %{rust_arches}
- rust-gtk-sys
ExclusiveArch: %{rust_arches}
- rust-gtk3-macros
ExclusiveArch: %{rust_arches}
- rust-gtk4
ExclusiveArch: %{rust_arches}
- rust-gtk4-macros
ExclusiveArch: %{rust_arches}
- rust-gtk4-sys
ExclusiveArch: %{rust_arches}
- rust-gzip-header
ExclusiveArch: %{rust_arches}
- rust-h2
ExclusiveArch: %{rust_arches}
- rust-h2_0.2
ExclusiveArch: %{rust_arches}
- rust-half
ExclusiveArch: %{rust_arches}
- rust-hamcrest2
ExclusiveArch: %{rust_arches}
- rust-handlebars
ExclusiveArch: %{rust_arches}
- rust-hashbrown
ExclusiveArch: %{rust_arches}
- rust-hashbrown0.9
ExclusiveArch: %{rust_arches}
- rust-hashlink
ExclusiveArch: %{rust_arches}
- rust-headers
ExclusiveArch: %{rust_arches}
- rust-headers-core
ExclusiveArch: %{rust_arches}
- rust-heapsize
ExclusiveArch: %{rust_arches}
- rust-heatseeker
ExclusiveArch: %{rust_arches}
- rust-heck
ExclusiveArch: %{rust_arches}
- rust-heck0.3
ExclusiveArch: %{rust_arches}
- rust-helvum
ExclusiveArch: %{rust_arches}
- rust-hex
ExclusiveArch: %{rust_arches}
- rust-hex-literal
ExclusiveArch: %{rust_arches}
- rust-hex-literal-impl
ExclusiveArch: %{rust_arches}
- rust-hex-literal0.2
ExclusiveArch: %{rust_arches}
- rust-hexyl
ExclusiveArch: %{rust_arches}
- rust-hidapi
ExclusiveArch: %{rust_arches}
- rust-hkdf
ExclusiveArch: %{rust_arches}
- rust-hkdf0.11
ExclusiveArch: %{rust_arches}
- rust-hmac
ExclusiveArch: %{rust_arches}
- rust-hmac0.11
ExclusiveArch: %{rust_arches}
- rust-home
ExclusiveArch: %{rust_arches}
- rust-hostname
ExclusiveArch: %{rust_arches}
- rust-hostname-validator
ExclusiveArch: %{rust_arches}
- rust-html-escape
ExclusiveArch: %{rust_arches}
- rust-html2pango
ExclusiveArch: %{rust_arches}
- rust-html5ever
ExclusiveArch: %{rust_arches}
- rust-http
ExclusiveArch: %{rust_arches}
- rust-http-body
ExclusiveArch: %{rust_arches}
- rust-http-body0.3
ExclusiveArch: %{rust_arches}
- rust-http0.1
ExclusiveArch: %{rust_arches}
- rust-httparse
ExclusiveArch: %{rust_arches}
- rust-httpdate
ExclusiveArch: %{rust_arches}
- rust-human-panic
ExclusiveArch: %{rust_arches}
- rust-human-sort
ExclusiveArch: %{rust_arches}
- rust-humansize
ExclusiveArch: %{rust_arches}
- rust-humantime
ExclusiveArch: %{rust_arches}
- rust-humantime-serde
ExclusiveArch: %{rust_arches}
- rust-humantime1
ExclusiveArch: %{rust_arches}
- rust-hyper
ExclusiveArch: %{rust_arches}
- rust-hyper-native-tls
ExclusiveArch: %{rust_arches}
- rust-hyper-rustls
ExclusiveArch: %{rust_arches}
- rust-hyper-staticfile
ExclusiveArch: %{rust_arches}
- rust-hyper-tls
ExclusiveArch: %{rust_arches}
- rust-hyper-tls0.4
ExclusiveArch: %{rust_arches}
- rust-hyper0.10
ExclusiveArch: %{rust_arches}
- rust-hyper0.13
ExclusiveArch: %{rust_arches}
- rust-hyperfine
ExclusiveArch: %{rust_arches}
- rust-i18n-config
ExclusiveArch: %{rust_arches}
- rust-i18n-embed
ExclusiveArch: %{rust_arches}
- rust-i18n-embed-fl
ExclusiveArch: %{rust_arches}
- rust-i18n-embed-impl
ExclusiveArch: %{rust_arches}
- rust-i3ipc
ExclusiveArch: %{rust_arches}
- rust-iai
ExclusiveArch: %{rust_arches}
- rust-id-arena
ExclusiveArch: %{rust_arches}
- rust-ident_case
ExclusiveArch: %{rust_arches}
- rust-idna
ExclusiveArch: %{rust_arches}
- rust-idna0.1
ExclusiveArch: %{rust_arches}
- rust-ifcfg-devname
ExclusiveArch: %{rust_arches}
- rust-ignition-config
ExclusiveArch: %{rust_arches}
- rust-ignore
ExclusiveArch: %{rust_arches}
- rust-im-rc
ExclusiveArch: %{rust_arches}
- rust-image
ExclusiveArch: %{rust_arches}
- rust-image-roll
ExclusiveArch: %{rust_arches}
- rust-imgref
ExclusiveArch: %{rust_arches}
- rust-indenter
ExclusiveArch: %{rust_arches}
- rust-indexmap
ExclusiveArch: %{rust_arches}
- rust-indicatif
ExclusiveArch: %{rust_arches}
- rust-indicatif0.15
ExclusiveArch: %{rust_arches}
- rust-indoc
ExclusiveArch: %{rust_arches}
- rust-infer
ExclusiveArch: %{rust_arches}
- rust-inferno
ExclusiveArch: %{rust_arches}
- rust-inlinable_string
ExclusiveArch: %{rust_arches}
- rust-inotify
ExclusiveArch: %{rust_arches}
- rust-inotify-sys
ExclusiveArch: %{rust_arches}
- rust-inout
ExclusiveArch: %{rust_arches}
- rust-input_buffer
ExclusiveArch: %{rust_arches}
- rust-insta
ExclusiveArch: %{rust_arches}
- rust-instant
ExclusiveArch: %{rust_arches}
- rust-integer-encoding
ExclusiveArch: %{rust_arches}
- rust-interpolate_name
ExclusiveArch: %{rust_arches}
- rust-intervaltree
ExclusiveArch: %{rust_arches}
- rust-intl-memoizer
ExclusiveArch: %{rust_arches}
- rust-intl_pluralrules
ExclusiveArch: %{rust_arches}
- rust-invalidstring
ExclusiveArch: %{rust_arches}
- rust-inventory
ExclusiveArch: %{rust_arches}
- rust-inventory-impl
ExclusiveArch: %{rust_arches}
- rust-inventory0.1
ExclusiveArch: %{rust_arches}
- rust-io-extras
ExclusiveArch: %{rust_arches}
- rust-io-lifetimes
ExclusiveArch: %{rust_arches}
- rust-ioctl-rs
ExclusiveArch: %{rust_arches}
- rust-iocuddle
ExclusiveArch: %{rust_arches}
- rust-iovec
ExclusiveArch: %{rust_arches}
- rust-ipnet
ExclusiveArch: %{rust_arches}
- rust-ipnetwork
ExclusiveArch: %{rust_arches}
- rust-ipnetwork0.17
ExclusiveArch: %{rust_arches}
- rust-iptables
ExclusiveArch: %{rust_arches}
- rust-iron
ExclusiveArch: %{rust_arches}
- rust-is-terminal
ExclusiveArch: %{rust_arches}
- rust-is_ci
ExclusiveArch: %{rust_arches}
- rust-is_debug
ExclusiveArch: %{rust_arches}
- rust-iso8601
ExclusiveArch: %{rust_arches}
- rust-iter-read
ExclusiveArch: %{rust_arches}
- rust-itertools
ExclusiveArch: %{rust_arches}
- rust-itertools-num
ExclusiveArch: %{rust_arches}
- rust-itertools0.8
ExclusiveArch: %{rust_arches}
- rust-itertools0.9
ExclusiveArch: %{rust_arches}
- rust-itoa
ExclusiveArch: %{rust_arches}
- rust-itoa0.4
ExclusiveArch: %{rust_arches}
- rust-ivf
ExclusiveArch: %{rust_arches}
- rust-jieba-rs
ExclusiveArch: %{rust_arches}
- rust-jobserver
ExclusiveArch: %{rust_arches}
- rust-josekit
ExclusiveArch: %{rust_arches}
- rust-jpeg-decoder
ExclusiveArch: %{rust_arches}
- rust-jql
ExclusiveArch: %{rust_arches}
- rust-js-sys
ExclusiveArch: %{rust_arches}
- rust-json
ExclusiveArch: %{rust_arches}
- rust-json_value_merge
ExclusiveArch: %{rust_arches}
- rust-just
ExclusiveArch: %{rust_arches}
- rust-jwalk
ExclusiveArch: %{rust_arches}
- rust-k9
ExclusiveArch: %{rust_arches}
- rust-keccak
ExclusiveArch: %{rust_arches}
- rust-khronos_api
ExclusiveArch: %{rust_arches}
- rust-kstring
ExclusiveArch: %{rust_arches}
- rust-kv-log-macro
ExclusiveArch: %{rust_arches}
- rust-lab
ExclusiveArch: %{rust_arches}
- rust-lalrpop
ExclusiveArch: %{rust_arches}
- rust-lalrpop-util
ExclusiveArch: %{rust_arches}
- rust-language-tags
ExclusiveArch: %{rust_arches}
- rust-lazy_static
ExclusiveArch: %{rust_arches}
- rust-lazycell
ExclusiveArch: %{rust_arches}
- rust-leb128
ExclusiveArch: %{rust_arches}
- rust-lev_distance
ExclusiveArch: %{rust_arches}
- rust-lexical-core
ExclusiveArch: %{rust_arches}
- rust-lexiclean
ExclusiveArch: %{rust_arches}
- rust-lexopt
ExclusiveArch: %{rust_arches}
- rust-libblkid-rs
ExclusiveArch: %{rust_arches}
- rust-libblkid-rs-sys
ExclusiveArch: %{rust_arches}
- rust-libbpf-cargo
ExclusiveArch: %{rust_arches}
- rust-libbpf-rs
ExclusiveArch: %{rust_arches}
- rust-libbpf-sys
ExclusiveArch: %{rust_arches}
- rust-libc
ExclusiveArch: %{rust_arches}
- rust-libcryptsetup-rs
ExclusiveArch: %{rust_arches}
- rust-libcryptsetup-rs-sys
ExclusiveArch: %{rust_arches}
- rust-libdbus-sys
ExclusiveArch: %{rust_arches}
- rust-libflate
ExclusiveArch: %{rust_arches}
- rust-libflate_lz77
ExclusiveArch: %{rust_arches}
- rust-libgit2-sys
ExclusiveArch: %{rust_arches}
- rust-libhandy
ExclusiveArch: %{rust_arches}
- rust-libhandy-sys
ExclusiveArch: %{rust_arches}
- rust-libloading
ExclusiveArch: %{rust_arches}
- rust-libloading0.6
ExclusiveArch: %{rust_arches}
- rust-libm
ExclusiveArch: %{rust_arches}
- rust-libmount
ExclusiveArch: %{rust_arches}
- rust-libnotcurses-sys
ExclusiveArch: %{rust_arches}
- rust-liboverdrop
ExclusiveArch: %{rust_arches}
- rust-libpulse-binding
ExclusiveArch: %{rust_arches}
- rust-libpulse-sys
ExclusiveArch: %{rust_arches}
- rust-libseccomp-sys
ExclusiveArch: %{rust_arches}
- rust-libslirp
ExclusiveArch: %{rust_arches}
- rust-libslirp-sys
ExclusiveArch: %{rust_arches}
- rust-libspa
ExclusiveArch: %{rust_arches}
- rust-libspa-sys
ExclusiveArch: %{rust_arches}
- rust-libsqlite3-sys
ExclusiveArch: %{rust_arches}
- rust-libssh2-sys
ExclusiveArch: %{rust_arches}
- rust-libsystemd
ExclusiveArch: %{rust_arches}
- rust-libudev
ExclusiveArch: %{rust_arches}
- rust-libudev-sys
ExclusiveArch: %{rust_arches}
- rust-libxml
ExclusiveArch: %{rust_arches}
- rust-libz-sys
ExclusiveArch: %{rust_arches}
- rust-line-wrap
ExclusiveArch: %{rust_arches}
- rust-link-cplusplus
ExclusiveArch: %{rust_arches}
- rust-linked-hash-map
ExclusiveArch: %{rust_arches}
- rust-linkify
ExclusiveArch: %{rust_arches}
- rust-linreg
ExclusiveArch: %{rust_arches}
- rust-linux-raw-sys
ExclusiveArch: %{rust_arches}
- rust-linux_proc
ExclusiveArch: %{rust_arches}
- rust-lipsum
ExclusiveArch: %{rust_arches}
- rust-listenfd
ExclusiveArch: %{rust_arches}
- rust-lmdb
ExclusiveArch: %{rust_arches}
- rust-lmdb-sys
ExclusiveArch: %{rust_arches}
- rust-local-channel
ExclusiveArch: %{rust_arches}
- rust-local-waker
ExclusiveArch: %{rust_arches}
- rust-locale
ExclusiveArch: %{rust_arches}
- rust-locale_config
ExclusiveArch: %{rust_arches}
- rust-lock_api
ExclusiveArch: %{rust_arches}
- rust-lockfree
ExclusiveArch: %{rust_arches}
- rust-log
ExclusiveArch: %{rust_arches}
- rust-log-mdc
ExclusiveArch: %{rust_arches}
- rust-log-panics
ExclusiveArch: %{rust_arches}
- rust-log0.3
ExclusiveArch: %{rust_arches}
- rust-loggerv
ExclusiveArch: %{rust_arches}
- rust-loopdev
ExclusiveArch: %{rust_arches}
- rust-lru-cache
ExclusiveArch: %{rust_arches}
- rust-lscolors
ExclusiveArch: %{rust_arches}
- rust-lsd
ExclusiveArch: %{rust_arches}
- rust-lzma-sys
ExclusiveArch: %{rust_arches}
- rust-lzw
ExclusiveArch: %{rust_arches}
- rust-mac
ExclusiveArch: %{rust_arches}
- rust-mac_address
ExclusiveArch: %{rust_arches}
- rust-macro-attr
ExclusiveArch: %{rust_arches}
- rust-madvr_parse
ExclusiveArch: %{rust_arches}
- rust-maildir
ExclusiveArch: %{rust_arches}
- rust-mailparse
ExclusiveArch: %{rust_arches}
- rust-man
ExclusiveArch: %{rust_arches}
- rust-maplit
ExclusiveArch: %{rust_arches}
- rust-markup5ever
ExclusiveArch: %{rust_arches}
- rust-markup5ever_rcdom
ExclusiveArch: %{rust_arches}
- rust-match_cfg
ExclusiveArch: %{rust_arches}
- rust-matches
ExclusiveArch: %{rust_arches}
- rust-matrixcompare
ExclusiveArch: %{rust_arches}
- rust-matrixcompare-core
ExclusiveArch: %{rust_arches}
- rust-matrixcompare-mock
ExclusiveArch: %{rust_arches}
- rust-matrixmultiply
ExclusiveArch: %{rust_arches}
- rust-maxminddb
ExclusiveArch: %{rust_arches}
- rust-maybe-owned
ExclusiveArch: %{rust_arches}
- rust-maybe-uninit
ExclusiveArch: %{rust_arches}
- rust-mbox
ExclusiveArch: %{rust_arches}
- rust-mbrman
ExclusiveArch: %{rust_arches}
- rust-md-5
ExclusiveArch: %{rust_arches}
- rust-md-5_0.9
ExclusiveArch: %{rust_arches}
- rust-md5
ExclusiveArch: %{rust_arches}
- rust-mdl
ExclusiveArch: %{rust_arches}
- rust-memchr
ExclusiveArch: %{rust_arches}
- rust-memfd
ExclusiveArch: %{rust_arches}
- rust-memmap
ExclusiveArch: %{rust_arches}
- rust-memmap2
ExclusiveArch: %{rust_arches}
- rust-memmap2_0.3
ExclusiveArch: %{rust_arches}
- rust-memmem
ExclusiveArch: %{rust_arches}
- rust-memoffset
ExclusiveArch: %{rust_arches}
- rust-memoffset0.5
ExclusiveArch: %{rust_arches}
- rust-memsec
ExclusiveArch: %{rust_arches}
- rust-micro-timer
ExclusiveArch: %{rust_arches}
- rust-micro-timer-macros
ExclusiveArch: %{rust_arches}
- rust-miette
ExclusiveArch: %{rust_arches}
- rust-miette-derive
ExclusiveArch: %{rust_arches}
- rust-mime
ExclusiveArch: %{rust_arches}
- rust-mime0.2
ExclusiveArch: %{rust_arches}
- rust-mime_guess
ExclusiveArch: %{rust_arches}
- rust-mime_guess1
ExclusiveArch: %{rust_arches}
- rust-minify-html
ExclusiveArch: %{rust_arches}
- rust-minimad
ExclusiveArch: %{rust_arches}
- rust-minimal-lexical
ExclusiveArch: %{rust_arches}
- rust-miniz-sys
ExclusiveArch: %{rust_arches}
- rust-miniz_oxide
ExclusiveArch: %{rust_arches}
- rust-miniz_oxide0.3
ExclusiveArch: %{rust_arches}
- rust-miniz_oxide_c_api
ExclusiveArch: %{rust_arches}
- rust-mint
ExclusiveArch: %{rust_arches}
- rust-mio
ExclusiveArch: %{rust_arches}
- rust-mio-extras
ExclusiveArch: %{rust_arches}
- rust-mio-uds
ExclusiveArch: %{rust_arches}
- rust-mio0.6
ExclusiveArch: %{rust_arches}
- rust-mio0.7
ExclusiveArch: %{rust_arches}
- rust-mktemp
ExclusiveArch: %{rust_arches}
- rust-mnt
ExclusiveArch: %{rust_arches}
- rust-mockall
ExclusiveArch: %{rust_arches}
- rust-mockall_derive
ExclusiveArch: %{rust_arches}
- rust-mockall_double
ExclusiveArch: %{rust_arches}
- rust-mockito
ExclusiveArch: %{rust_arches}
- rust-modifier
ExclusiveArch: %{rust_arches}
- rust-more-asserts
ExclusiveArch: %{rust_arches}
- rust-muldiv
ExclusiveArch: %{rust_arches}
- rust-multer
ExclusiveArch: %{rust_arches}
- rust-multimap
ExclusiveArch: %{rust_arches}
- rust-multipart
ExclusiveArch: %{rust_arches}
- rust-mustache
ExclusiveArch: %{rust_arches}
- rust-nalgebra
ExclusiveArch: %{rust_arches}
- rust-nalgebra-macros
ExclusiveArch: %{rust_arches}
- rust-nasm-rs
ExclusiveArch: %{rust_arches}
- rust-native-tls
ExclusiveArch: %{rust_arches}
- rust-natord
ExclusiveArch: %{rust_arches}
- rust-navi
ExclusiveArch: %{rust_arches}
- rust-nb-connect
ExclusiveArch: %{rust_arches}
- rust-ncurses
ExclusiveArch: %{rust_arches}
- rust-net2
ExclusiveArch: %{rust_arches}
- rust-netlink-packet-core
ExclusiveArch: %{rust_arches}
- rust-netlink-packet-generic
ExclusiveArch: %{rust_arches}
- rust-netlink-packet-route
ExclusiveArch: %{rust_arches}
- rust-netlink-packet-utils
ExclusiveArch: %{rust_arches}
- rust-netlink-proto
ExclusiveArch: %{rust_arches}
- rust-netlink-sys
ExclusiveArch: %{rust_arches}
- rust-netmap_sys
ExclusiveArch: %{rust_arches}
- rust-nettle
ExclusiveArch: %{rust_arches}
- rust-nettle-sys
ExclusiveArch: %{rust_arches}
- rust-new_debug_unreachable
ExclusiveArch: %{rust_arches}
- rust-newtype_derive
ExclusiveArch: %{rust_arches}
- rust-nibble_vec
ExclusiveArch: %{rust_arches}
- rust-nix
ExclusiveArch: %{rust_arches}
- rust-nix0.14
ExclusiveArch: %{rust_arches}
- rust-nix0.17
ExclusiveArch: %{rust_arches}
- rust-nix0.18
ExclusiveArch: %{rust_arches}
- rust-nix0.20
ExclusiveArch: %{rust_arches}
- rust-nix0.22
ExclusiveArch: %{rust_arches}
- rust-no-panic
ExclusiveArch: %{rust_arches}
- rust-nodrop
ExclusiveArch: %{rust_arches}
- rust-nohash-hasher
ExclusiveArch: %{rust_arches}
- rust-nom
ExclusiveArch: %{rust_arches}
- rust-nom4
ExclusiveArch: %{rust_arches}
- rust-nom5
ExclusiveArch: %{rust_arches}
- rust-noop_proc_macro
ExclusiveArch: %{rust_arches}
- rust-normalize-line-endings
ExclusiveArch: %{rust_arches}
- rust-notify
ExclusiveArch: %{rust_arches}
- rust-notify-rust
ExclusiveArch: %{rust_arches}
- rust-nu-ansi-term
ExclusiveArch: %{rust_arches}
- rust-nu-engine
ExclusiveArch: %{rust_arches}
- rust-nu-glob
ExclusiveArch: %{rust_arches}
- rust-nu-json
ExclusiveArch: %{rust_arches}
- rust-nu-parser
ExclusiveArch: %{rust_arches}
- rust-nu-path
ExclusiveArch: %{rust_arches}
- rust-nu-protocol
ExclusiveArch: %{rust_arches}
- rust-nu-utils
ExclusiveArch: %{rust_arches}
- rust-num
ExclusiveArch: %{rust_arches}
- rust-num-bigint
ExclusiveArch: %{rust_arches}
- rust-num-bigint-dig
ExclusiveArch: %{rust_arches}
- rust-num-bigint0.3
ExclusiveArch: %{rust_arches}
- rust-num-complex
ExclusiveArch: %{rust_arches}
- rust-num-complex0.3
ExclusiveArch: %{rust_arches}
- rust-num-derive
ExclusiveArch: %{rust_arches}
- rust-num-format
ExclusiveArch: %{rust_arches}
- rust-num-integer
ExclusiveArch: %{rust_arches}
- rust-num-iter
ExclusiveArch: %{rust_arches}
- rust-num-rational
ExclusiveArch: %{rust_arches}
- rust-num-rational0.3
ExclusiveArch: %{rust_arches}
- rust-num-traits
ExclusiveArch: %{rust_arches}
- rust-num-traits0.1
ExclusiveArch: %{rust_arches}
- rust-num0.3
ExclusiveArch: %{rust_arches}
- rust-num_cpus
ExclusiveArch: %{rust_arches}
- rust-num_enum
ExclusiveArch: %{rust_arches}
- rust-num_enum_derive
ExclusiveArch: %{rust_arches}
- rust-number_prefix
ExclusiveArch: %{rust_arches}
- rust-numtoa
ExclusiveArch: %{rust_arches}
- rust-oauth2
ExclusiveArch: %{rust_arches}
- rust-object
ExclusiveArch: %{rust_arches}
- rust-odds
ExclusiveArch: %{rust_arches}
- rust-oid
ExclusiveArch: %{rust_arches}
- rust-once_cell
ExclusiveArch: %{rust_arches}
- rust-onig
ExclusiveArch: %{rust_arches}
- rust-onig_sys
ExclusiveArch: %{rust_arches}
- rust-oorandom
ExclusiveArch: %{rust_arches}
- rust-opaque-debug
ExclusiveArch: %{rust_arches}
- rust-open
ExclusiveArch: %{rust_arches}
- rust-open1
ExclusiveArch: %{rust_arches}
- rust-openat
ExclusiveArch: %{rust_arches}
- rust-openat-ext
ExclusiveArch: %{rust_arches}
- rust-opener
ExclusiveArch: %{rust_arches}
- rust-openssh-keys
ExclusiveArch: %{rust_arches}
- rust-openssl
ExclusiveArch: %{rust_arches}
- rust-openssl-kdf
ExclusiveArch: %{rust_arches}
- rust-openssl-probe
ExclusiveArch: %{rust_arches}
- rust-openssl-sys
ExclusiveArch: %{rust_arches}
- rust-option-operations
ExclusiveArch: %{rust_arches}
- rust-ord_subset
ExclusiveArch: %{rust_arches}
- rust-ordered-float
ExclusiveArch: %{rust_arches}
- rust-ordered-multimap
ExclusiveArch: %{rust_arches}
- rust-os-release
ExclusiveArch: %{rust_arches}
- rust-os_info
ExclusiveArch: %{rust_arches}
- rust-os_pipe
ExclusiveArch: %{rust_arches}
- rust-os_pipe0.9
ExclusiveArch: %{rust_arches}
- rust-os_str_bytes
ExclusiveArch: %{rust_arches}
- rust-os_type
ExclusiveArch: %{rust_arches}
- rust-osmesa-sys
ExclusiveArch: %{rust_arches}
- rust-osstrtools
ExclusiveArch: %{rust_arches}
- rust-ouroboros
ExclusiveArch: %{rust_arches}
- rust-ouroboros_macro
ExclusiveArch: %{rust_arches}
- rust-overload
ExclusiveArch: %{rust_arches}
- rust-owned-alloc
ExclusiveArch: %{rust_arches}
- rust-owning_ref
ExclusiveArch: %{rust_arches}
- rust-owo-colors
ExclusiveArch: %{rust_arches}
- rust-packaging
ExclusiveArch: %{rust_arches}
- rust-pad
ExclusiveArch: %{rust_arches}
- rust-page_size
ExclusiveArch: %{rust_arches}
- rust-pager
ExclusiveArch: %{rust_arches}
- rust-palette
ExclusiveArch: %{rust_arches}
- rust-palette_derive
ExclusiveArch: %{rust_arches}
- rust-pam
ExclusiveArch: %{rust_arches}
- rust-pam-sys
ExclusiveArch: %{rust_arches}
- rust-pancurses
ExclusiveArch: %{rust_arches}
- rust-pango
ExclusiveArch: %{rust_arches}
- rust-pango-sys
ExclusiveArch: %{rust_arches}
- rust-pangocairo
ExclusiveArch: %{rust_arches}
- rust-pangocairo-sys
ExclusiveArch: %{rust_arches}
- rust-paris
ExclusiveArch: %{rust_arches}
- rust-parity-wasm
ExclusiveArch: %{rust_arches}
- rust-parking
ExclusiveArch: %{rust_arches}
- rust-parking_lot
ExclusiveArch: %{rust_arches}
- rust-parking_lot0.11
ExclusiveArch: %{rust_arches}
- rust-parking_lot_core
ExclusiveArch: %{rust_arches}
- rust-parking_lot_core0.8
ExclusiveArch: %{rust_arches}
- rust-parse-zoneinfo
ExclusiveArch: %{rust_arches}
- rust-parse_cfg
ExclusiveArch: %{rust_arches}
- rust-parsec-client
ExclusiveArch: %{rust_arches}
- rust-parsec-interface
ExclusiveArch: %{rust_arches}
- rust-partial-io
ExclusiveArch: %{rust_arches}
- rust-partition-identity
ExclusiveArch: %{rust_arches}
- rust-password-hash
ExclusiveArch: %{rust_arches}
- rust-paste
ExclusiveArch: %{rust_arches}
- rust-path-absolutize
ExclusiveArch: %{rust_arches}
- rust-path-dedot
ExclusiveArch: %{rust_arches}
- rust-path-slash
ExclusiveArch: %{rust_arches}
- rust-pathdiff
ExclusiveArch: %{rust_arches}
- rust-pathfinder_geometry
ExclusiveArch: %{rust_arches}
- rust-pathfinder_simd
ExclusiveArch: %{rust_arches}
- rust-pbkdf2
ExclusiveArch: %{rust_arches}
- rust-pbr
ExclusiveArch: %{rust_arches}
- rust-pcap
ExclusiveArch: %{rust_arches}
- rust-pcre2
ExclusiveArch: %{rust_arches}
- rust-pcre2-sys
ExclusiveArch: %{rust_arches}
- rust-peeking_take_while
ExclusiveArch: %{rust_arches}
- rust-peg
ExclusiveArch: %{rust_arches}
- rust-peg-macros
ExclusiveArch: %{rust_arches}
- rust-peg-runtime
ExclusiveArch: %{rust_arches}
- rust-peg0.5
ExclusiveArch: %{rust_arches}
- rust-pem
ExclusiveArch: %{rust_arches}
- rust-pem-rfc7468
ExclusiveArch: %{rust_arches}
- rust-pem0.8
ExclusiveArch: %{rust_arches}
- rust-percent-encoding
ExclusiveArch: %{rust_arches}
- rust-percent-encoding1
ExclusiveArch: %{rust_arches}
- rust-peresil
ExclusiveArch: %{rust_arches}
- rust-permutate
ExclusiveArch: %{rust_arches}
- rust-permutohedron
ExclusiveArch: %{rust_arches}
- rust-pest
ExclusiveArch: %{rust_arches}
- rust-pest_derive
ExclusiveArch: %{rust_arches}
- rust-pest_generator
ExclusiveArch: %{rust_arches}
- rust-pest_meta
ExclusiveArch: %{rust_arches}
- rust-petgraph
ExclusiveArch: %{rust_arches}
- rust-phf
ExclusiveArch: %{rust_arches}
- rust-phf0.7
ExclusiveArch: %{rust_arches}
- rust-phf0.8
ExclusiveArch: %{rust_arches}
- rust-phf_codegen
ExclusiveArch: %{rust_arches}
- rust-phf_codegen0.7
ExclusiveArch: %{rust_arches}
- rust-phf_generator
ExclusiveArch: %{rust_arches}
- rust-phf_generator0.7
ExclusiveArch: %{rust_arches}
- rust-phf_generator0.8
ExclusiveArch: %{rust_arches}
- rust-phf_macros
ExclusiveArch: %{rust_arches}
- rust-phf_macros0.7
ExclusiveArch: %{rust_arches}
- rust-phf_macros0.8
ExclusiveArch: %{rust_arches}
- rust-phf_shared
ExclusiveArch: %{rust_arches}
- rust-phf_shared0.7
ExclusiveArch: %{rust_arches}
- rust-phf_shared0.8
ExclusiveArch: %{rust_arches}
- rust-picky-asn1
ExclusiveArch: %{rust_arches}
- rust-picky-asn1-der
ExclusiveArch: %{rust_arches}
- rust-picky-asn1-x509
ExclusiveArch: %{rust_arches}
- rust-pico-args
ExclusiveArch: %{rust_arches}
- rust-pid
ExclusiveArch: %{rust_arches}
- rust-pin-project
ExclusiveArch: %{rust_arches}
- rust-pin-project-internal
ExclusiveArch: %{rust_arches}
- rust-pin-project-internal0.4
ExclusiveArch: %{rust_arches}
- rust-pin-project-lite
ExclusiveArch: %{rust_arches}
- rust-pin-project-lite0.1
ExclusiveArch: %{rust_arches}
- rust-pin-project0.4
ExclusiveArch: %{rust_arches}
- rust-pin-utils
ExclusiveArch: %{rust_arches}
- rust-pipe
ExclusiveArch: %{rust_arches}
- rust-piper
ExclusiveArch: %{rust_arches}
- rust-pipewire
ExclusiveArch: %{rust_arches}
- rust-pipewire-sys
ExclusiveArch: %{rust_arches}
- rust-pkcs1
ExclusiveArch: %{rust_arches}
- rust-pkcs11
ExclusiveArch: %{rust_arches}
- rust-pkcs5
ExclusiveArch: %{rust_arches}
- rust-pkcs8
ExclusiveArch: %{rust_arches}
- rust-pkg-config
ExclusiveArch: %{rust_arches}
- rust-plain
ExclusiveArch: %{rust_arches}
- rust-pleaser
ExclusiveArch: %{rust_arches}
- rust-plist
ExclusiveArch: %{rust_arches}
- rust-plotlib
ExclusiveArch: %{rust_arches}
- rust-plotters
ExclusiveArch: %{rust_arches}
- rust-plotters-backend
ExclusiveArch: %{rust_arches}
- rust-plotters-bitmap
ExclusiveArch: %{rust_arches}
- rust-plotters-svg
ExclusiveArch: %{rust_arches}
- rust-plugin
ExclusiveArch: %{rust_arches}
- rust-pnet_base
ExclusiveArch: %{rust_arches}
- rust-pnet_datalink
ExclusiveArch: %{rust_arches}
- rust-pnet_sys
ExclusiveArch: %{rust_arches}
- rust-png
ExclusiveArch: %{rust_arches}
- rust-png0.16
ExclusiveArch: %{rust_arches}
- rust-podio
ExclusiveArch: %{rust_arches}
- rust-polling
ExclusiveArch: %{rust_arches}
- rust-polyval
ExclusiveArch: %{rust_arches}
- rust-pom
ExclusiveArch: %{rust_arches}
- rust-pommes
ExclusiveArch: %{rust_arches}
- rust-ppv-lite86
ExclusiveArch: %{rust_arches}
- rust-pq-sys
ExclusiveArch: %{rust_arches}
- rust-precomputed-hash
ExclusiveArch: %{rust_arches}
- rust-predicates
ExclusiveArch: %{rust_arches}
- rust-predicates-core
ExclusiveArch: %{rust_arches}
- rust-predicates-tree
ExclusiveArch: %{rust_arches}
- rust-predicates1
ExclusiveArch: %{rust_arches}
- rust-pretty
ExclusiveArch: %{rust_arches}
- rust-pretty-git-prompt
ExclusiveArch: %{rust_arches}
- rust-pretty-hex
ExclusiveArch: %{rust_arches}
- rust-pretty_assertions
ExclusiveArch: %{rust_arches}
- rust-pretty_assertions0.6
ExclusiveArch: %{rust_arches}
- rust-pretty_assertions0.7
ExclusiveArch: %{rust_arches}
- rust-pretty_env_logger
ExclusiveArch: %{rust_arches}
- rust-prettytable-rs
ExclusiveArch: %{rust_arches}
- rust-proc-macro-crate
ExclusiveArch: %{rust_arches}
- rust-proc-macro-crate0.1
ExclusiveArch: %{rust_arches}
- rust-proc-macro-error
ExclusiveArch: %{rust_arches}
- rust-proc-macro-error-attr
ExclusiveArch: %{rust_arches}
- rust-proc-macro-hack
ExclusiveArch: %{rust_arches}
- rust-proc-macro2
ExclusiveArch: %{rust_arches}
- rust-proc-macro2-0.4
ExclusiveArch: %{rust_arches}
- rust-proc-maps
ExclusiveArch: %{rust_arches}
- rust-proc-mounts
ExclusiveArch: %{rust_arches}
- rust-proc-quote-impl
ExclusiveArch: %{rust_arches}
- rust-process_control
ExclusiveArch: %{rust_arches}
- rust-process_path
ExclusiveArch: %{rust_arches}
- rust-procfs
ExclusiveArch: %{rust_arches}
- rust-procs
ExclusiveArch: %{rust_arches}
- rust-progress-streams
ExclusiveArch: %{rust_arches}
- rust-prometheus
ExclusiveArch: %{rust_arches}
- rust-proptest
ExclusiveArch: %{rust_arches}
- rust-proptest-derive
ExclusiveArch: %{rust_arches}
- rust-proptest0.10
ExclusiveArch: %{rust_arches}
- rust-prost
ExclusiveArch: %{rust_arches}
- rust-prost-build
ExclusiveArch: %{rust_arches}
- rust-prost-derive
ExclusiveArch: %{rust_arches}
- rust-prost-types
ExclusiveArch: %{rust_arches}
- rust-protobuf
ExclusiveArch: %{rust_arches}
- rust-protobuf-codegen
ExclusiveArch: %{rust_arches}
- rust-protobuf-codegen-pure
ExclusiveArch: %{rust_arches}
- rust-protoc
ExclusiveArch: %{rust_arches}
- rust-protoc-rust
ExclusiveArch: %{rust_arches}
- rust-psa-crypto
ExclusiveArch: %{rust_arches}
- rust-psa-crypto-sys
ExclusiveArch: %{rust_arches}
- rust-psl-types
ExclusiveArch: %{rust_arches}
- rust-psm
ExclusiveArch: %{rust_arches}
- rust-ptr_meta
ExclusiveArch: %{rust_arches}
- rust-ptr_meta_derive
ExclusiveArch: %{rust_arches}
- rust-publicsuffix
ExclusiveArch: %{rust_arches}
- rust-publicsuffix1
ExclusiveArch: %{rust_arches}
- rust-pulldown-cmark
ExclusiveArch: %{rust_arches}
- rust-pulse
ExclusiveArch: %{rust_arches}
- rust-pure-rust-locales
ExclusiveArch: %{rust_arches}
- rust-pyo3
ExclusiveArch: %{rust_arches}
- rust-pyo3-build-config
ExclusiveArch: %{rust_arches}
- rust-pyo3-macros
ExclusiveArch: %{rust_arches}
- rust-pyo3-macros-backend
ExclusiveArch: %{rust_arches}
- rust-python-launcher
ExclusiveArch: %{rust_arches}
- rust-python3-sys
ExclusiveArch: %{rust_arches}
- rust-qr2term
ExclusiveArch: %{rust_arches}
- rust-qrcode
ExclusiveArch: %{rust_arches}
- rust-qstring
ExclusiveArch: %{rust_arches}
- rust-quantiles
ExclusiveArch: %{rust_arches}
- rust-quick-error
ExclusiveArch: %{rust_arches}
- rust-quick-error1
ExclusiveArch: %{rust_arches}
- rust-quick-xml
ExclusiveArch: %{rust_arches}
- rust-quickcheck
ExclusiveArch: %{rust_arches}
- rust-quickcheck0.6
ExclusiveArch: %{rust_arches}
- rust-quickcheck0.9
ExclusiveArch: %{rust_arches}
- rust-quickcheck_macros
ExclusiveArch: %{rust_arches}
- rust-quickersort
ExclusiveArch: %{rust_arches}
- rust-quicli
ExclusiveArch: %{rust_arches}
- rust-quote
ExclusiveArch: %{rust_arches}
- rust-quote0.3
ExclusiveArch: %{rust_arches}
- rust-quote0.6
ExclusiveArch: %{rust_arches}
- rust-quoted_printable
ExclusiveArch: %{rust_arches}
- rust-r2d2
ExclusiveArch: %{rust_arches}
- rust-radium
ExclusiveArch: %{rust_arches}
- rust-radix_trie
ExclusiveArch: %{rust_arches}
- rust-rand
ExclusiveArch: %{rust_arches}
- rust-rand0.4
ExclusiveArch: %{rust_arches}
- rust-rand0.5
ExclusiveArch: %{rust_arches}
- rust-rand0.6
ExclusiveArch: %{rust_arches}
- rust-rand0.7
ExclusiveArch: %{rust_arches}
- rust-rand_chacha
ExclusiveArch: %{rust_arches}
- rust-rand_chacha0.1
ExclusiveArch: %{rust_arches}
- rust-rand_chacha0.2
ExclusiveArch: %{rust_arches}
- rust-rand_core
ExclusiveArch: %{rust_arches}
- rust-rand_core0.3
ExclusiveArch: %{rust_arches}
- rust-rand_core0.4
ExclusiveArch: %{rust_arches}
- rust-rand_core0.5
ExclusiveArch: %{rust_arches}
- rust-rand_distr
ExclusiveArch: %{rust_arches}
- rust-rand_hc
ExclusiveArch: %{rust_arches}
- rust-rand_hc0.1
ExclusiveArch: %{rust_arches}
- rust-rand_isaac
ExclusiveArch: %{rust_arches}
- rust-rand_isaac0.1
ExclusiveArch: %{rust_arches}
- rust-rand_jitter
ExclusiveArch: %{rust_arches}
- rust-rand_jitter0.1
ExclusiveArch: %{rust_arches}
- rust-rand_os
ExclusiveArch: %{rust_arches}
- rust-rand_os0.1
ExclusiveArch: %{rust_arches}
- rust-rand_pcg
ExclusiveArch: %{rust_arches}
- rust-rand_pcg0.1
ExclusiveArch: %{rust_arches}
- rust-rand_pcg0.2
ExclusiveArch: %{rust_arches}
- rust-rand_xorshift
ExclusiveArch: %{rust_arches}
- rust-rand_xorshift0.1
ExclusiveArch: %{rust_arches}
- rust-rand_xorshift0.2
ExclusiveArch: %{rust_arches}
- rust-rand_xoshiro
ExclusiveArch: %{rust_arches}
- rust-random
ExclusiveArch: %{rust_arches}
- rust-random-fast-rng
ExclusiveArch: %{rust_arches}
- rust-random-trait
ExclusiveArch: %{rust_arches}
- rust-randomize
ExclusiveArch: %{rust_arches}
- rust-rav1e
ExclusiveArch: %{rust_arches}
- rust-raw-window-handle
ExclusiveArch: %{rust_arches}
- rust-rawpointer
ExclusiveArch: %{rust_arches}
- rust-rawslice
ExclusiveArch: %{rust_arches}
- rust-rayon
ExclusiveArch: %{rust_arches}
- rust-rayon-core
ExclusiveArch: %{rust_arches}
- rust-rbspy
ExclusiveArch: %{rust_arches}
- rust-rbspy-ruby-structs
ExclusiveArch: %{rust_arches}
- rust-rbspy-testdata
ExclusiveArch: %{rust_arches}
- rust-rd-agent
ExclusiveArch: %{rust_arches}
- rust-rd-agent-intf
ExclusiveArch: %{rust_arches}
- rust-rd-hashd
ExclusiveArch: %{rust_arches}
- rust-rd-hashd-intf
ExclusiveArch: %{rust_arches}
- rust-rd-util
ExclusiveArch: %{rust_arches}
- rust-read-process-memory
ExclusiveArch: %{rust_arches}
- rust-read_input
ExclusiveArch: %{rust_arches}
- rust-readability-fork
ExclusiveArch: %{rust_arches}
- rust-readwrite
ExclusiveArch: %{rust_arches}
- rust-recycler
ExclusiveArch: %{rust_arches}
- rust-ref-cast
ExclusiveArch: %{rust_arches}
- rust-ref-cast-impl
ExclusiveArch: %{rust_arches}
- rust-regalloc
ExclusiveArch: %{rust_arches}
- rust-regex
ExclusiveArch: %{rust_arches}
- rust-regex-automata
ExclusiveArch: %{rust_arches}
- rust-regex-syntax
ExclusiveArch: %{rust_arches}
- rust-region
ExclusiveArch: %{rust_arches}
- rust-relative-path
ExclusiveArch: %{rust_arches}
- rust-relay
ExclusiveArch: %{rust_arches}
- rust-remoteprocess
ExclusiveArch: %{rust_arches}
- rust-remove_dir_all
ExclusiveArch: %{rust_arches}
- rust-rend
ExclusiveArch: %{rust_arches}
- rust-reqwest
ExclusiveArch: %{rust_arches}
- rust-reqwest0.10
ExclusiveArch: %{rust_arches}
- rust-resctl-bench
ExclusiveArch: %{rust_arches}
- rust-resctl-bench-intf
ExclusiveArch: %{rust_arches}
- rust-resctl-demo
ExclusiveArch: %{rust_arches}
- rust-resize
ExclusiveArch: %{rust_arches}
- rust-resolv-conf
ExclusiveArch: %{rust_arches}
- rust-restson
ExclusiveArch: %{rust_arches}
- rust-retry
ExclusiveArch: %{rust_arches}
- rust-rgb
ExclusiveArch: %{rust_arches}
- rust-ring
ExclusiveArch: %{rust_arches}
- rust-ripgrep
ExclusiveArch: %{rust_arches}
- rust-rkyv
ExclusiveArch: %{rust_arches}
- rust-rkyv_derive
ExclusiveArch: %{rust_arches}
- rust-rle-decode-fast
ExclusiveArch: %{rust_arches}
- rust-rmp
ExclusiveArch: %{rust_arches}
- rust-rmp-serde
ExclusiveArch: %{rust_arches}
- rust-rmpv
ExclusiveArch: %{rust_arches}
- rust-roff
ExclusiveArch: %{rust_arches}
- rust-ron
ExclusiveArch: %{rust_arches}
- rust-roxmltree
ExclusiveArch: %{rust_arches}
- rust-rpassword
ExclusiveArch: %{rust_arches}
- rust-rpick
ExclusiveArch: %{rust_arches}
- rust-rsa
ExclusiveArch: %{rust_arches}
- rust-rspec
ExclusiveArch: %{rust_arches}
- rust-rtnetlink
ExclusiveArch: %{rust_arches}
- rust-rusqlite
ExclusiveArch: %{rust_arches}
- rust-rust-embed
ExclusiveArch: %{rust_arches}
- rust-rust-embed-impl
ExclusiveArch: %{rust_arches}
- rust-rust-embed-utils
ExclusiveArch: %{rust_arches}
- rust-rust-ini
ExclusiveArch: %{rust_arches}
- rust-rust-stemmers
ExclusiveArch: %{rust_arches}
- rust-rust_decimal
ExclusiveArch: %{rust_arches}
- rust-rust_hawktracer
ExclusiveArch: %{rust_arches}
- rust-rust_hawktracer_normal_macro
ExclusiveArch: %{rust_arches}
- rust-rust_hawktracer_proc_macro
ExclusiveArch: %{rust_arches}
- rust-rust_hawktracer_sys
ExclusiveArch: %{rust_arches}
- rust-rustbus
ExclusiveArch: %{rust_arches}
- rust-rustbus_derive
ExclusiveArch: %{rust_arches}
- rust-rustc-demangle
ExclusiveArch: %{rust_arches}
- rust-rustc-hash
ExclusiveArch: %{rust_arches}
- rust-rustc-serialize
ExclusiveArch: %{rust_arches}
- rust-rustc-test
ExclusiveArch: %{rust_arches}
- rust-rustc_tools_util
ExclusiveArch: %{rust_arches}
- rust-rustc_version
ExclusiveArch: %{rust_arches}
- rust-rustc_version0.3
ExclusiveArch: %{rust_arches}
- rust-rustcat
ExclusiveArch: %{rust_arches}
- rust-rustdoc-stripper
ExclusiveArch: %{rust_arches}
- rust-rustfilt
ExclusiveArch: %{rust_arches}
- rust-rustfix
ExclusiveArch: %{rust_arches}
- rust-rustio
ExclusiveArch: %{rust_arches}
- rust-rustix
ExclusiveArch: %{rust_arches}
- rust-rustls
ExclusiveArch: %{rust_arches}
- rust-rustls-native-certs
ExclusiveArch: %{rust_arches}
- rust-rustls-pemfile
ExclusiveArch: %{rust_arches}
- rust-rustversion
ExclusiveArch: %{rust_arches}
- rust-rusty-fork
ExclusiveArch: %{rust_arches}
- rust-rustyline
ExclusiveArch: %{rust_arches}
- rust-rustyline-derive
ExclusiveArch: %{rust_arches}
- rust-ryu
ExclusiveArch: %{rust_arches}
- rust-safe-transmute
ExclusiveArch: %{rust_arches}
- rust-safe_arch
ExclusiveArch: %{rust_arches}
- rust-safemem
ExclusiveArch: %{rust_arches}
- rust-salsa20
ExclusiveArch: %{rust_arches}
- rust-same-file
ExclusiveArch: %{rust_arches}
- rust-sass-rs
ExclusiveArch: %{rust_arches}
- rust-sass-sys
ExclusiveArch: %{rust_arches}
- rust-scan_fmt
ExclusiveArch: %{rust_arches}
- rust-scheduled-thread-pool
ExclusiveArch: %{rust_arches}
- rust-scoped-tls
ExclusiveArch: %{rust_arches}
- rust-scoped-tls-hkt
ExclusiveArch: %{rust_arches}
- rust-scoped_threadpool
ExclusiveArch: %{rust_arches}
- rust-scopeguard
ExclusiveArch: %{rust_arches}
- rust-scopetime
ExclusiveArch: %{rust_arches}
- rust-scratch
ExclusiveArch: %{rust_arches}
- rust-scroll
ExclusiveArch: %{rust_arches}
- rust-scroll_derive
ExclusiveArch: %{rust_arches}
- rust-scrypt
ExclusiveArch: %{rust_arches}
- rust-sct
ExclusiveArch: %{rust_arches}
- rust-sd
ExclusiveArch: %{rust_arches}
- rust-sd-notify
ExclusiveArch: %{rust_arches}
- rust-seahash
ExclusiveArch: %{rust_arches}
- rust-seahash3
ExclusiveArch: %{rust_arches}
- rust-secrecy
ExclusiveArch: %{rust_arches}
- rust-secret-service
ExclusiveArch: %{rust_arches}
- rust-self_cell
ExclusiveArch: %{rust_arches}
- rust-semver
ExclusiveArch: %{rust_arches}
- rust-semver-parser
ExclusiveArch: %{rust_arches}
- rust-semver-parser0.9
ExclusiveArch: %{rust_arches}
- rust-semver0.11
ExclusiveArch: %{rust_arches}
- rust-sequoia-autocrypt
ExclusiveArch: %{rust_arches}
- rust-sequoia-ipc
ExclusiveArch: %{rust_arches}
- rust-sequoia-keyring-linter
ExclusiveArch: %{rust_arches}
- rust-sequoia-net
ExclusiveArch: %{rust_arches}
- rust-sequoia-octopus-librnp
ExclusiveArch: %{rust_arches}
- rust-sequoia-openpgp
ExclusiveArch: %{rust_arches}
- rust-sequoia-openpgp-mt
ExclusiveArch: %{rust_arches}
- rust-sequoia-sop
ExclusiveArch: %{rust_arches}
- rust-sequoia-sq
ExclusiveArch: %{rust_arches}
- rust-sequoia-sqv
ExclusiveArch: %{rust_arches}
- rust-serde
ExclusiveArch: %{rust_arches}
- rust-serde-big-array
ExclusiveArch: %{rust_arches}
- rust-serde-pickle
ExclusiveArch: %{rust_arches}
- rust-serde-value
ExclusiveArch: %{rust_arches}
- rust-serde-xml-rs
ExclusiveArch: %{rust_arches}
- rust-serde_bser
ExclusiveArch: %{rust_arches}
- rust-serde_bytes
ExclusiveArch: %{rust_arches}
- rust-serde_cbor
ExclusiveArch: %{rust_arches}
- rust-serde_derive
ExclusiveArch: %{rust_arches}
- rust-serde_fmt
ExclusiveArch: %{rust_arches}
- rust-serde_ignored
ExclusiveArch: %{rust_arches}
- rust-serde_json
ExclusiveArch: %{rust_arches}
- rust-serde_qs
ExclusiveArch: %{rust_arches}
- rust-serde_repr
ExclusiveArch: %{rust_arches}
- rust-serde_stacker
ExclusiveArch: %{rust_arches}
- rust-serde_test
ExclusiveArch: %{rust_arches}
- rust-serde_url_params
ExclusiveArch: %{rust_arches}
- rust-serde_urlencoded
ExclusiveArch: %{rust_arches}
- rust-serde_with
ExclusiveArch: %{rust_arches}
- rust-serde_with_macros
ExclusiveArch: %{rust_arches}
- rust-serde_yaml
ExclusiveArch: %{rust_arches}
- rust-serial-core
ExclusiveArch: %{rust_arches}
- rust-serial_test
ExclusiveArch: %{rust_arches}
- rust-serial_test0.5
ExclusiveArch: %{rust_arches}
- rust-serial_test_derive
ExclusiveArch: %{rust_arches}
- rust-serial_test_derive0.5
ExclusiveArch: %{rust_arches}
- rust-servo-fontconfig
ExclusiveArch: %{rust_arches}
- rust-servo-fontconfig-sys
ExclusiveArch: %{rust_arches}
- rust-sev
ExclusiveArch: %{rust_arches}
- rust-sevctl
ExclusiveArch: x86_64
- rust-sha-1
ExclusiveArch: %{rust_arches}
- rust-sha-1_0.9
ExclusiveArch: %{rust_arches}
- rust-sha1
ExclusiveArch: %{rust_arches}
- rust-sha1_0.6
ExclusiveArch: %{rust_arches}
- rust-sha1_smol
ExclusiveArch: %{rust_arches}
- rust-sha1collisiondetection
ExclusiveArch: %{rust_arches}
- rust-sha2
ExclusiveArch: %{rust_arches}
- rust-sha2_0.9
ExclusiveArch: %{rust_arches}
- rust-sha3
ExclusiveArch: %{rust_arches}
- rust-sha3_0.9
ExclusiveArch: %{rust_arches}
- rust-shadow-rs
ExclusiveArch: %{rust_arches}
- rust-sharded-slab
ExclusiveArch: %{rust_arches}
- rust-shared_child
ExclusiveArch: %{rust_arches}
- rust-shared_library
ExclusiveArch: %{rust_arches}
- rust-shell-escape
ExclusiveArch: %{rust_arches}
- rust-shell-words
ExclusiveArch: %{rust_arches}
- rust-shellexpand
ExclusiveArch: %{rust_arches}
- rust-shellwords
ExclusiveArch: %{rust_arches}
- rust-shlex
ExclusiveArch: %{rust_arches}
- rust-signal
ExclusiveArch: %{rust_arches}
- rust-signal-hook
ExclusiveArch: %{rust_arches}
- rust-signal-hook-mio
ExclusiveArch: %{rust_arches}
- rust-signal-hook-registry
ExclusiveArch: %{rust_arches}
- rust-signal-hook0.1
ExclusiveArch: %{rust_arches}
- rust-silver
ExclusiveArch: %{rust_arches}
- rust-simba
ExclusiveArch: %{rust_arches}
- rust-simd_helpers
ExclusiveArch: %{rust_arches}
- rust-simdutf8
ExclusiveArch: %{rust_arches}
- rust-similar
ExclusiveArch: %{rust_arches}
- rust-similar-asserts
ExclusiveArch: %{rust_arches}
- rust-simple-error
ExclusiveArch: %{rust_arches}
- rust-simple_asn1
ExclusiveArch: %{rust_arches}
- rust-simple_logger
ExclusiveArch: %{rust_arches}
- rust-simplelog
ExclusiveArch: %{rust_arches}
- rust-siphasher
ExclusiveArch: %{rust_arches}
- rust-size
ExclusiveArch: %{rust_arches}
- rust-sized-chunks
ExclusiveArch: %{rust_arches}
- rust-skeptic
ExclusiveArch: %{rust_arches}
- rust-skim
ExclusiveArch: %{rust_arches}
- rust-slab
ExclusiveArch: %{rust_arches}
- rust-slice-deque
ExclusiveArch: %{rust_arches}
- rust-slog
ExclusiveArch: %{rust_arches}
- rust-slog-async
ExclusiveArch: %{rust_arches}
- rust-slog-scope
ExclusiveArch: %{rust_arches}
- rust-slog-term
ExclusiveArch: %{rust_arches}
- rust-slotmap
ExclusiveArch: %{rust_arches}
- rust-slug
ExclusiveArch: %{rust_arches}
- rust-sluice
ExclusiveArch: %{rust_arches}
- rust-smallbitvec
ExclusiveArch: %{rust_arches}
- rust-smallstr
ExclusiveArch: %{rust_arches}
- rust-smallvec
ExclusiveArch: %{rust_arches}
- rust-smart-default
ExclusiveArch: %{rust_arches}
- rust-smawk
ExclusiveArch: %{rust_arches}
- rust-smithay-client-toolkit
ExclusiveArch: %{rust_arches}
- rust-smithay-clipboard
ExclusiveArch: %{rust_arches}
- rust-smol_str
ExclusiveArch: %{rust_arches}
- rust-snafu
ExclusiveArch: %{rust_arches}
- rust-snafu-derive
ExclusiveArch: %{rust_arches}
- rust-snake_case
ExclusiveArch: %{rust_arches}
- rust-socket2
ExclusiveArch: %{rust_arches}
- rust-socket2_0.3
ExclusiveArch: %{rust_arches}
- rust-sop
ExclusiveArch: %{rust_arches}
- rust-spin
ExclusiveArch: %{rust_arches}
- rust-spin0.5
ExclusiveArch: %{rust_arches}
- rust-spin_on
ExclusiveArch: %{rust_arches}
- rust-spinning_top
ExclusiveArch: %{rust_arches}
- rust-spki
ExclusiveArch: %{rust_arches}
- rust-spmc
ExclusiveArch: %{rust_arches}
- rust-ssh-key-dir
ExclusiveArch: %{rust_arches}
- rust-stable_deref_trait
ExclusiveArch: %{rust_arches}
- rust-stacker
ExclusiveArch: %{rust_arches}
- rust-standback
ExclusiveArch: %{rust_arches}
- rust-starship
ExclusiveArch: %{rust_arches}
- rust-starship-battery
ExclusiveArch: %{rust_arches}
- rust-starship_module_config_derive
ExclusiveArch: %{rust_arches}
- rust-static_assertions
ExclusiveArch: %{rust_arches}
- rust-statistical
ExclusiveArch: %{rust_arches}
- rust-statrs
ExclusiveArch: %{rust_arches}
- rust-stb_truetype
ExclusiveArch: %{rust_arches}
- rust-stderrlog
ExclusiveArch: %{rust_arches}
- rust-str_stack
ExclusiveArch: %{rust_arches}
- rust-stratisd_proc_macros
ExclusiveArch: %{rust_arches}
- rust-streaming-stats
ExclusiveArch: %{rust_arches}
- rust-streebog
ExclusiveArch: %{rust_arches}
- rust-streebog0.9
ExclusiveArch: %{rust_arches}
- rust-strict
ExclusiveArch: %{rust_arches}
- rust-string
ExclusiveArch: %{rust_arches}
- rust-string_cache
ExclusiveArch: %{rust_arches}
- rust-string_cache_codegen
ExclusiveArch: %{rust_arches}
- rust-string_cache_shared
ExclusiveArch: %{rust_arches}
- rust-strings
ExclusiveArch: %{rust_arches}
- rust-strip-ansi-escapes
ExclusiveArch: %{rust_arches}
- rust-strsim
ExclusiveArch: %{rust_arches}
- rust-structopt
ExclusiveArch: %{rust_arches}
- rust-structopt-derive
ExclusiveArch: %{rust_arches}
- rust-structopt-derive0.2
ExclusiveArch: %{rust_arches}
- rust-structopt0.2
ExclusiveArch: %{rust_arches}
- rust-strum
ExclusiveArch: %{rust_arches}
- rust-strum0.21
ExclusiveArch: %{rust_arches}
- rust-strum_macros
ExclusiveArch: %{rust_arches}
- rust-strum_macros0.21
ExclusiveArch: %{rust_arches}
- rust-subprocess
ExclusiveArch: %{rust_arches}
- rust-subtle
ExclusiveArch: %{rust_arches}
- rust-sudo_plugin
ExclusiveArch: %{rust_arches}
- rust-sudo_plugin-sys
ExclusiveArch: %{rust_arches}
- rust-supports-color
ExclusiveArch: %{rust_arches}
- rust-supports-hyperlinks
ExclusiveArch: %{rust_arches}
- rust-supports-unicode
ExclusiveArch: %{rust_arches}
- rust-sval
ExclusiveArch: %{rust_arches}
- rust-sval_derive
ExclusiveArch: %{rust_arches}
- rust-sval_json
ExclusiveArch: %{rust_arches}
- rust-svg
ExclusiveArch: %{rust_arches}
- rust-svg_metadata
ExclusiveArch: %{rust_arches}
- rust-svgtypes
ExclusiveArch: %{rust_arches}
- rust-sxd-document
ExclusiveArch: %{rust_arches}
- rust-syn
ExclusiveArch: %{rust_arches}
- rust-syn0.15
ExclusiveArch: %{rust_arches}
- rust-synom
ExclusiveArch: %{rust_arches}
- rust-synstructure
ExclusiveArch: %{rust_arches}
- rust-syntect
ExclusiveArch: %{rust_arches}
- rust-sys-info
ExclusiveArch: %{rust_arches}
- rust-sys-locale
ExclusiveArch: %{rust_arches}
- rust-sysctl
ExclusiveArch: %{rust_arches}
- rust-sysinfo
ExclusiveArch: %{rust_arches}
- rust-syslog
ExclusiveArch: %{rust_arches}
- rust-system-deps
ExclusiveArch: %{rust_arches}
- rust-system-interface
ExclusiveArch: %{rust_arches}
- rust-system76_ectool
ExclusiveArch: %{rust_arches}
- rust-tabular
ExclusiveArch: %{rust_arches}
- rust-tabwriter
ExclusiveArch: %{rust_arches}
- rust-take
ExclusiveArch: %{rust_arches}
- rust-take_mut
ExclusiveArch: %{rust_arches}
- rust-tap
ExclusiveArch: %{rust_arches}
- rust-tar
ExclusiveArch: %{rust_arches}
- rust-target
ExclusiveArch: %{rust_arches}
- rust-target-lexicon
ExclusiveArch: %{rust_arches}
- rust-tealdeer
ExclusiveArch: %{rust_arches}
- rust-teloxide
ExclusiveArch: %{rust_arches}
- rust-teloxide-macros
ExclusiveArch: %{rust_arches}
- rust-tempdir
ExclusiveArch: %{rust_arches}
- rust-tempfile
ExclusiveArch: %{rust_arches}
- rust-temporary
ExclusiveArch: %{rust_arches}
- rust-temptree
ExclusiveArch: %{rust_arches}
- rust-tendril
ExclusiveArch: %{rust_arches}
- rust-tera
ExclusiveArch: %{rust_arches}
- rust-term
ExclusiveArch: %{rust_arches}
- rust-term0.6
ExclusiveArch: %{rust_arches}
- rust-term_grid
ExclusiveArch: %{rust_arches}
- rust-term_size
ExclusiveArch: %{rust_arches}
- rust-termbg
ExclusiveArch: %{rust_arches}
- rust-termcolor
ExclusiveArch: %{rust_arches}
- rust-terminal_size
ExclusiveArch: %{rust_arches}
- rust-terminfo
ExclusiveArch: %{rust_arches}
- rust-termion
ExclusiveArch: %{rust_arches}
- rust-termios
ExclusiveArch: %{rust_arches}
- rust-termwiz
ExclusiveArch: %{rust_arches}
- rust-test-assembler
ExclusiveArch: %{rust_arches}
- rust-test-case
ExclusiveArch: %{rust_arches}
- rust-tester
ExclusiveArch: %{rust_arches}
- rust-testing_logger
ExclusiveArch: %{rust_arches}
- rust-textwrap
ExclusiveArch: %{rust_arches}
- rust-textwrap0.11
ExclusiveArch: %{rust_arches}
- rust-textwrap0.14
ExclusiveArch: %{rust_arches}
- rust-thiserror
ExclusiveArch: %{rust_arches}
- rust-thiserror-impl
ExclusiveArch: %{rust_arches}
- rust-thread-id
ExclusiveArch: %{rust_arches}
- rust-thread-tree
ExclusiveArch: %{rust_arches}
- rust-thread_local
ExclusiveArch: %{rust_arches}
- rust-threadpool
ExclusiveArch: %{rust_arches}
- rust-tiff
ExclusiveArch: %{rust_arches}
- rust-tiger
ExclusiveArch: %{rust_arches}
- rust-time
ExclusiveArch: %{rust_arches}
- rust-time-macros
ExclusiveArch: %{rust_arches}
- rust-time-macros-impl
ExclusiveArch: %{rust_arches}
- rust-time-macros0.1
ExclusiveArch: %{rust_arches}
- rust-time0.1
ExclusiveArch: %{rust_arches}
- rust-time0.2
ExclusiveArch: %{rust_arches}
- rust-timebomb
ExclusiveArch: %{rust_arches}
- rust-timer
ExclusiveArch: %{rust_arches}
- rust-timerfd
ExclusiveArch: %{rust_arches}
- rust-tiny-keccak
ExclusiveArch: %{rust_arches}
- rust-tiny_http
ExclusiveArch: %{rust_arches}
- rust-tiny_http0.6
ExclusiveArch: %{rust_arches}
- rust-tinystr
ExclusiveArch: %{rust_arches}
- rust-tinytemplate
ExclusiveArch: %{rust_arches}
- rust-tinyvec
ExclusiveArch: %{rust_arches}
- rust-tinyvec_macros
ExclusiveArch: %{rust_arches}
- rust-tokei
ExclusiveArch: %{rust_arches}
- rust-tokio
ExclusiveArch: %{rust_arches}
- rust-tokio-codec
ExclusiveArch: %{rust_arches}
- rust-tokio-core
ExclusiveArch: %{rust_arches}
- rust-tokio-current-thread
ExclusiveArch: %{rust_arches}
- rust-tokio-executor
ExclusiveArch: %{rust_arches}
- rust-tokio-fs
ExclusiveArch: %{rust_arches}
- rust-tokio-io
ExclusiveArch: %{rust_arches}
- rust-tokio-macros
ExclusiveArch: %{rust_arches}
- rust-tokio-macros0.2
ExclusiveArch: %{rust_arches}
- rust-tokio-mock-task
ExclusiveArch: %{rust_arches}
- rust-tokio-native-tls
ExclusiveArch: %{rust_arches}
- rust-tokio-openssl
ExclusiveArch: %{rust_arches}
- rust-tokio-openssl0.4
ExclusiveArch: %{rust_arches}
- rust-tokio-reactor
ExclusiveArch: %{rust_arches}
- rust-tokio-rustls
ExclusiveArch: %{rust_arches}
- rust-tokio-socks
ExclusiveArch: %{rust_arches}
- rust-tokio-socks0.3
ExclusiveArch: %{rust_arches}
- rust-tokio-stream
ExclusiveArch: %{rust_arches}
- rust-tokio-sync
ExclusiveArch: %{rust_arches}
- rust-tokio-tcp
ExclusiveArch: %{rust_arches}
- rust-tokio-test
ExclusiveArch: %{rust_arches}
- rust-tokio-threadpool
ExclusiveArch: %{rust_arches}
- rust-tokio-timer
ExclusiveArch: %{rust_arches}
- rust-tokio-tls
ExclusiveArch: %{rust_arches}
- rust-tokio-tls0.2
ExclusiveArch: %{rust_arches}
- rust-tokio-tungstenite
ExclusiveArch: %{rust_arches}
- rust-tokio-udp
ExclusiveArch: %{rust_arches}
- rust-tokio-uds
ExclusiveArch: %{rust_arches}
- rust-tokio-util
ExclusiveArch: %{rust_arches}
- rust-tokio-util0.3
ExclusiveArch: %{rust_arches}
- rust-tokio-util0.6
ExclusiveArch: %{rust_arches}
- rust-tokio0.1
ExclusiveArch: %{rust_arches}
- rust-tokio0.2
ExclusiveArch: %{rust_arches}
- rust-toml
ExclusiveArch: %{rust_arches}
- rust-toml0.4
ExclusiveArch: %{rust_arches}
- rust-toml_edit
ExclusiveArch: %{rust_arches}
- rust-totp-lite
ExclusiveArch: %{rust_arches}
- rust-tower-layer
ExclusiveArch: %{rust_arches}
- rust-tower-service
ExclusiveArch: %{rust_arches}
- rust-tower-test
ExclusiveArch: %{rust_arches}
- rust-tower-util
ExclusiveArch: %{rust_arches}
- rust-tpm2-policy
ExclusiveArch: %{rust_arches}
- rust-tracing
ExclusiveArch: %{rust_arches}
- rust-tracing-attributes
ExclusiveArch: %{rust_arches}
- rust-tracing-core
ExclusiveArch: %{rust_arches}
- rust-tracing-futures
ExclusiveArch: %{rust_arches}
- rust-tracing-log
ExclusiveArch: %{rust_arches}
- rust-traitobject
ExclusiveArch: %{rust_arches}
- rust-trash
ExclusiveArch: %{rust_arches}
- rust-tree-sitter
ExclusiveArch: %{rust_arches}
- rust-tree-sitter-cli
ExclusiveArch: %{rust_arches}
- rust-tree-sitter-config
ExclusiveArch: %{rust_arches}
- rust-tree-sitter-highlight
ExclusiveArch: %{rust_arches}
- rust-tree-sitter-loader
ExclusiveArch: %{rust_arches}
- rust-tree-sitter-tags
ExclusiveArch: %{rust_arches}
- rust-treebitmap
ExclusiveArch: %{rust_arches}
- rust-treeline
ExclusiveArch: %{rust_arches}
- rust-trust-dns-https
ExclusiveArch: %{rust_arches}
- rust-trust-dns-native-tls
ExclusiveArch: %{rust_arches}
- rust-trust-dns-native-tls0.19
ExclusiveArch: %{rust_arches}
- rust-trust-dns-openssl
ExclusiveArch: %{rust_arches}
- rust-trust-dns-openssl0.19
ExclusiveArch: %{rust_arches}
- rust-trust-dns-proto
ExclusiveArch: %{rust_arches}
- rust-trust-dns-proto0.19
ExclusiveArch: %{rust_arches}
- rust-trust-dns-resolver
ExclusiveArch: %{rust_arches}
- rust-trust-dns-resolver0.19
ExclusiveArch: %{rust_arches}
- rust-trust-dns-rustls
ExclusiveArch: %{rust_arches}
- rust-try-lock
ExclusiveArch: %{rust_arches}
- rust-trybuild
ExclusiveArch: %{rust_arches}
- rust-tss-esapi
ExclusiveArch: %{rust_arches}
- rust-tss-esapi-sys
ExclusiveArch: %{rust_arches}
- rust-ttf-parser
ExclusiveArch: %{rust_arches}
- rust-ttf-parser0.12
ExclusiveArch: %{rust_arches}
- rust-tui
ExclusiveArch: %{rust_arches}
- rust-tui-react
ExclusiveArch: %{rust_arches}
- rust-tui0.11
ExclusiveArch: %{rust_arches}
- rust-tui0.9
ExclusiveArch: %{rust_arches}
- rust-tuikit
ExclusiveArch: %{rust_arches}
- rust-tungstenite
ExclusiveArch: %{rust_arches}
- rust-twoway
ExclusiveArch: %{rust_arches}
- rust-twox-hash
ExclusiveArch: %{rust_arches}
- rust-type-map
ExclusiveArch: %{rust_arches}
- rust-typeable
ExclusiveArch: %{rust_arches}
- rust-typed-arena
ExclusiveArch: %{rust_arches}
- rust-typed-arena1
ExclusiveArch: %{rust_arches}
- rust-typemap
ExclusiveArch: %{rust_arches}
- rust-typenum
ExclusiveArch: %{rust_arches}
- rust-typetag
ExclusiveArch: %{rust_arches}
- rust-typetag-impl
ExclusiveArch: %{rust_arches}
- rust-tzfile
ExclusiveArch: %{rust_arches}
- rust-ubyte
ExclusiveArch: %{rust_arches}
- rust-ucd-parse
ExclusiveArch: %{rust_arches}
- rust-ucd-trie
ExclusiveArch: %{rust_arches}
- rust-ucd-util
ExclusiveArch: %{rust_arches}
- rust-umask
ExclusiveArch: %{rust_arches}
- rust-uncased
ExclusiveArch: %{rust_arches}
- rust-unchecked-index
ExclusiveArch: %{rust_arches}
- rust-unescape
ExclusiveArch: %{rust_arches}
- rust-unic-char-property
ExclusiveArch: %{rust_arches}
- rust-unic-char-range
ExclusiveArch: %{rust_arches}
- rust-unic-common
ExclusiveArch: %{rust_arches}
- rust-unic-langid
ExclusiveArch: %{rust_arches}
- rust-unic-langid-impl
ExclusiveArch: %{rust_arches}
- rust-unic-langid-macros
ExclusiveArch: %{rust_arches}
- rust-unic-langid-macros-impl
ExclusiveArch: %{rust_arches}
- rust-unic-locale
ExclusiveArch: %{rust_arches}
- rust-unic-locale-impl
ExclusiveArch: %{rust_arches}
- rust-unic-locale-macros
ExclusiveArch: %{rust_arches}
- rust-unic-locale-macros-impl
ExclusiveArch: %{rust_arches}
- rust-unic-segment
ExclusiveArch: %{rust_arches}
- rust-unic-ucd-category
ExclusiveArch: %{rust_arches}
- rust-unic-ucd-common
ExclusiveArch: %{rust_arches}
- rust-unic-ucd-segment
ExclusiveArch: %{rust_arches}
- rust-unic-ucd-version
ExclusiveArch: %{rust_arches}
- rust-unicase
ExclusiveArch: %{rust_arches}
- rust-unicase1
ExclusiveArch: %{rust_arches}
- rust-unicode-bidi
ExclusiveArch: %{rust_arches}
- rust-unicode-linebreak
ExclusiveArch: %{rust_arches}
- rust-unicode-normalization
ExclusiveArch: %{rust_arches}
- rust-unicode-segmentation
ExclusiveArch: %{rust_arches}
- rust-unicode-truncate
ExclusiveArch: %{rust_arches}
- rust-unicode-width
ExclusiveArch: %{rust_arches}
- rust-unicode-xid
ExclusiveArch: %{rust_arches}
- rust-unicode-xid0.1
ExclusiveArch: %{rust_arches}
- rust-unicode_categories
ExclusiveArch: %{rust_arches}
- rust-unindent
ExclusiveArch: %{rust_arches}
- rust-universal-hash
ExclusiveArch: %{rust_arches}
- rust-unix_socket
ExclusiveArch: %{rust_arches}
- rust-unreachable
ExclusiveArch: %{rust_arches}
- rust-unsafe-any
ExclusiveArch: %{rust_arches}
- rust-untrusted
ExclusiveArch: %{rust_arches}
- rust-uom
ExclusiveArch: %{rust_arches}
- rust-url
ExclusiveArch: %{rust_arches}
- rust-url1
ExclusiveArch: %{rust_arches}
- rust-url_serde
ExclusiveArch: %{rust_arches}
- rust-urlencoding
ExclusiveArch: %{rust_arches}
- rust-urlocator
ExclusiveArch: %{rust_arches}
- rust-urlshortener
ExclusiveArch: %{rust_arches}
- rust-userfaultfd
ExclusiveArch: %{rust_arches}
- rust-userfaultfd-sys
ExclusiveArch: %{rust_arches}
- rust-users
ExclusiveArch: %{rust_arches}
- rust-users0.10
ExclusiveArch: %{rust_arches}
- rust-utf-8
ExclusiveArch: %{rust_arches}
- rust-utf8-ranges
ExclusiveArch: %{rust_arches}
- rust-utf8-width
ExclusiveArch: %{rust_arches}
- rust-utf8parse
ExclusiveArch: %{rust_arches}
- rust-uuid
ExclusiveArch: %{rust_arches}
- rust-uuid0.7
ExclusiveArch: %{rust_arches}
- rust-v_frame
ExclusiveArch: %{rust_arches}
- rust-value-bag
ExclusiveArch: %{rust_arches}
- rust-varbincode
ExclusiveArch: %{rust_arches}
- rust-varlink
ExclusiveArch: %{rust_arches}
- rust-varlink-cli
ExclusiveArch: %{rust_arches}
- rust-varlink_generator
ExclusiveArch: %{rust_arches}
- rust-varlink_parser
ExclusiveArch: %{rust_arches}
- rust-varlink_stdinterfaces
ExclusiveArch: %{rust_arches}
- rust-vcsgraph
ExclusiveArch: %{rust_arches}
- rust-vec_map
ExclusiveArch: %{rust_arches}
- rust-vergen
ExclusiveArch: %{rust_arches}
- rust-vergen3
ExclusiveArch: %{rust_arches}
- rust-version
ExclusiveArch: %{rust_arches}
- rust-version-compare
ExclusiveArch: %{rust_arches}
- rust-version-sync
ExclusiveArch: %{rust_arches}
- rust-version-sync0.8
ExclusiveArch: %{rust_arches}
- rust-version_check
ExclusiveArch: %{rust_arches}
- rust-versions
ExclusiveArch: %{rust_arches}
- rust-vhost
ExclusiveArch: %{rust_arches}
- rust-vhost-user-backend
ExclusiveArch: %{rust_arches}
- rust-virtio-bindings
ExclusiveArch: x86_64 aarch64 ppc64le
- rust-virtio-queue
ExclusiveArch: x86_64 aarch64 s390x
- rust-vm-memory
ExclusiveArch: x86_64 aarch64 ppc64le
- rust-vmm-sys-util
ExclusiveArch: x86_64 aarch64 ppc64le
- rust-vmw_backdoor
ExclusiveArch: %{rust_arches}
- rust-void
ExclusiveArch: %{rust_arches}
- rust-vsprintf
ExclusiveArch: %{rust_arches}
- rust-vte
ExclusiveArch: %{rust_arches}
- rust-vte_generate_state_changes
ExclusiveArch: %{rust_arches}
- rust-vtparse
ExclusiveArch: %{rust_arches}
- rust-wait-timeout
ExclusiveArch: %{rust_arches}
- rust-waker-fn
ExclusiveArch: %{rust_arches}
- rust-walkdir
ExclusiveArch: %{rust_arches}
- rust-want
ExclusiveArch: %{rust_arches}
- rust-warp
ExclusiveArch: %{rust_arches}
- rust-wasm-bindgen
ExclusiveArch: %{rust_arches}
- rust-wasm-bindgen-backend
ExclusiveArch: %{rust_arches}
- rust-wasm-bindgen-futures
ExclusiveArch: %{rust_arches}
- rust-wasm-bindgen-macro
ExclusiveArch: %{rust_arches}
- rust-wasm-bindgen-macro-support
ExclusiveArch: %{rust_arches}
- rust-wasm-bindgen-shared
ExclusiveArch: %{rust_arches}
- rust-wasm-bindgen-test
ExclusiveArch: %{rust_arches}
- rust-wasm-bindgen-test-macro
ExclusiveArch: %{rust_arches}
- rust-wasmer_enumset
ExclusiveArch: %{rust_arches}
- rust-wasmer_enumset_derive
ExclusiveArch: %{rust_arches}
- rust-wasmparser
ExclusiveArch: %{rust_arches}
- rust-wasmtime
ExclusiveArch: x86_64 aarch64 s390x
- rust-wasmtime-cache
ExclusiveArch: %{rust_arches}
- rust-wasmtime-cranelift
ExclusiveArch: x86_64 aarch64 s390x
- rust-wasmtime-environ
ExclusiveArch: %{rust_arches}
- rust-wasmtime-fiber
ExclusiveArch: x86_64 aarch64 s390x
- rust-wasmtime-jit
ExclusiveArch: x86_64 aarch64 s390x
- rust-wasmtime-jit-debug
ExclusiveArch: %{rust_arches}
- rust-wasmtime-runtime
ExclusiveArch: x86_64 aarch64 s390x
- rust-wasmtime-types
ExclusiveArch: %{rust_arches}
- rust-wasmtime-wast
ExclusiveArch: x86_64 aarch64 s390x
- rust-wast
ExclusiveArch: %{rust_arches}
- rust-wat
ExclusiveArch: %{rust_arches}
- rust-watchman_client
ExclusiveArch: %{rust_arches}
- rust-wayland-client
ExclusiveArch: %{rust_arches}
- rust-wayland-commons
ExclusiveArch: %{rust_arches}
- rust-wayland-cursor
ExclusiveArch: %{rust_arches}
- rust-wayland-egl
ExclusiveArch: %{rust_arches}
- rust-wayland-protocols
ExclusiveArch: %{rust_arches}
- rust-wayland-scanner
ExclusiveArch: %{rust_arches}
- rust-wayland-server
ExclusiveArch: %{rust_arches}
- rust-wayland-sys
ExclusiveArch: %{rust_arches}
- rust-web-sys
ExclusiveArch: %{rust_arches}
- rust-webbrowser
ExclusiveArch: %{rust_arches}
- rust-webpki
ExclusiveArch: %{rust_arches}
- rust-webpki-roots
ExclusiveArch: %{rust_arches}
- rust-websocket
ExclusiveArch: %{rust_arches}
- rust-websocket-base
ExclusiveArch: %{rust_arches}
- rust-weezl
ExclusiveArch: %{rust_arches}
- rust-which
ExclusiveArch: %{rust_arches}
- rust-wide
ExclusiveArch: %{rust_arches}
- rust-wiggle
ExclusiveArch: x86_64 aarch64 s390x
- rust-wiggle-generate
ExclusiveArch: %{rust_arches}
- rust-wiggle-macro
ExclusiveArch: %{rust_arches}
- rust-wild
ExclusiveArch: %{rust_arches}
- rust-winit
ExclusiveArch: %{rust_arches}
- rust-witx
ExclusiveArch: %{rust_arches}
- rust-ws
ExclusiveArch: %{rust_arches}
- rust-wyz
ExclusiveArch: %{rust_arches}
- rust-x11
ExclusiveArch: %{rust_arches}
- rust-x11-clipboard
ExclusiveArch: %{rust_arches}
- rust-x11-dl
ExclusiveArch: %{rust_arches}
- rust-xattr
ExclusiveArch: %{rust_arches}
- rust-xcb
ExclusiveArch: %{rust_arches}
- rust-xcursor
ExclusiveArch: %{rust_arches}
- rust-xdg
ExclusiveArch: %{rust_arches}
- rust-xi-unicode
ExclusiveArch: %{rust_arches}
- rust-xkbcommon
ExclusiveArch: %{rust_arches}
- rust-xml-rs
ExclusiveArch: %{rust_arches}
- rust-xml5ever
ExclusiveArch: %{rust_arches}
- rust-xmlparser
ExclusiveArch: %{rust_arches}
- rust-xmlwriter
ExclusiveArch: %{rust_arches}
- rust-xxhash-c-sys
ExclusiveArch: %{rust_arches}
- rust-xxhash-rust
ExclusiveArch: %{rust_arches}
- rust-xz2
ExclusiveArch: %{rust_arches}
- rust-y4m
ExclusiveArch: %{rust_arches}
- rust-yaml-rust
ExclusiveArch: %{rust_arches}
- rust-yaml-rust0.3
ExclusiveArch: %{rust_arches}
- rust-yansi
ExclusiveArch: %{rust_arches}
- rust-ybaas
ExclusiveArch: %{rust_arches}
- rust-yubibomb
ExclusiveArch: %{rust_arches}
- rust-zbase32
ExclusiveArch: %{rust_arches}
- rust-zbus
ExclusiveArch: %{rust_arches}
- rust-zbus_macros
ExclusiveArch: %{rust_arches}
- rust-zeroize
ExclusiveArch: %{rust_arches}
- rust-zeroize_derive
ExclusiveArch: %{rust_arches}
- rust-zincati
ExclusiveArch: %{rust_arches}
- rust-zip
ExclusiveArch: %{rust_arches}
- rust-zmq
ExclusiveArch: %{rust_arches}
- rust-zmq-sys
ExclusiveArch: %{rust_arches}
- rust-zoneinfo_compiled
ExclusiveArch: %{rust_arches}
- rust-zoxide
ExclusiveArch: %{rust_arches}
- rust-zram-generator
ExclusiveArch: %{rust_arches}
- rust-zstd
ExclusiveArch: %{rust_arches}
- rust-zstd-safe
ExclusiveArch: %{rust_arches}
- rust-zstd-sys
ExclusiveArch: %{rust_arches}
- rust-zvariant
ExclusiveArch: %{rust_arches}
- rust-zvariant_derive
ExclusiveArch: %{rust_arches}
- s390utils
ExclusiveArch: s390 s390x
- safetyblanket
ExclusiveArch: %{arm} %{ix86} x86_64 aarch64 ppc64le
- sagemath
ExclusiveArch: aarch64 x86_64
- sbcl
ExclusiveArch: %{arm} %{ix86} x86_64 ppc sparcv9 aarch64
- sbd
ExclusiveArch: i686 x86_64 s390x aarch64 ppc64le
- sbsigntools
ExclusiveArch: x86_64 aarch64 %{arm} %{ix86}
- sdsl-lite
ExclusiveArch: %{power64} x86_64 aarch64
- seabios
ExclusiveArch: x86_64
- seadrive-gui
ExclusiveArch: %{qt5_qtwebengine_arches}
- seafile-client
ExclusiveArch: %{qt5_qtwebengine_arches}
- seamonkey
ExclusiveArch: x86_64
- seqan3
ExclusiveArch: %{power64} x86_64 aarch64
- servicelog
ExclusiveArch: ppc %{power64}
- sgabios
ExclusiveArch: %{ix86} x86_64
- sharpfont
ExclusiveArch: %mono_arches
- sharpziplib
ExclusiveArch: %{mono_arches}
- shim
ExclusiveArch: %{efi}
- shim-unsigned-aarch64
ExclusiveArch: aarch64
- shim-unsigned-x64
ExclusiveArch: x86_64
- sigul
ExclusiveArch: x86_64
- sisu
ExclusiveArch: %{java_arches} noarch
- sisu-mojos
ExclusiveArch: %{java_arches} noarch
- skopeo
ExclusiveArch: %{go_arches}
- skychart
ExclusiveArch: %{fpc_arches}
- slf4j
ExclusiveArch: %{java_arches} noarch
- snapd
ExclusiveArch: %{?go_arches:%{go_arches}}%{!?go_arches:%{ix86} x86_64 %{arm}}
ExclusiveArch: %{ix86} x86_64 %{arm} aarch64 ppc64le s390x
- soup-sharp
ExclusiveArch: %{mono_arches}
- sparkleshare
ExclusiveArch: %{mono_arches}
- spicctrl
ExclusiveArch: %{ix86} x86_64
- spice
ExclusiveArch: x86_64
ExclusiveArch: %{ix86} x86_64 %{arm} aarch64
- springlobby
ExclusiveArch: %{ix86} x86_64
- squeekboard
ExclusiveArch: %{rust_arches}
- startdde
ExclusiveArch: %{?go_arches:%{go_arches}}%{!?go_arches:%{ix86} x86_64 %{arm}}
- statsd
ExclusiveArch: %{nodejs_arches} noarch
- stratis-cli
ExclusiveArch: %{rust_arches} noarch
- stratisd
ExclusiveArch: %{rust_arches}
ExclusiveArch: %{rust_arches}
- stripesnoop
ExclusiveArch: %{ix86} x86_64
- supercollider
ExclusiveArch: %{qt5_qtwebengine_arches}
- supermin
ExclusiveArch: %{kernel_arches}
- svt-av1
ExclusiveArch: x86_64
- svt-vp9
ExclusiveArch: x86_64
- swift-lang
ExclusiveArch: x86_64 aarch64
- sysbench
ExclusiveArch: %{arm} %{ix86} x86_64 %{mips}
ExclusiveArch: %{arm} %{ix86} x86_64 %{mips} aarch64
ExclusiveArch: %{arm} %{ix86} x86_64 %{mips} aarch64 ppc64le s390x
- syslinux
ExclusiveArch: %{ix86} x86_64
ExclusiveArch: %{ix86} x86_64
- system76-keyboard-configurator
ExclusiveArch: %{rust_arches}
- taglib-sharp
ExclusiveArch: %{mono_arches}
- tarantool
ExclusiveArch: %{ix86} x86_64
- tboot
ExclusiveArch: %{ix86} x86_64
- tdlib
ExclusiveArch: x86_64 aarch64
- templates_parser
ExclusiveArch: %GPRbuild_arches
- ternimal
ExclusiveArch: %{rust_arches}
- testcloud
ExclusiveArch: %{kernel_arches} noarch
- testng
ExclusiveArch: %{java_arches} noarch
- themonospot-base
ExclusiveArch: %mono_arches
- themonospot-console
ExclusiveArch: %mono_arches
- themonospot-gui-gtk
ExclusiveArch: %mono_arches
- themonospot-plugin-avi
ExclusiveArch: %mono_arches
- themonospot-plugin-mkv
ExclusiveArch: %mono_arches
- thermald
ExclusiveArch: %{ix86} x86_64
- tilix
ExclusiveArch: %{ldc_arches}
- tomboy
ExclusiveArch: %{mono_arches}
- torbrowser-launcher
ExclusiveArch: %{ix86} x86_64
- tuned-profiles-nfv-host-bin
ExclusiveArch: %{ix86} x86_64
- uClibc
ExclusiveArch: %{arm} %{ix86} x86_64 %{mips}
- ucx
ExclusiveArch: aarch64 ppc64le x86_64
- uglify-js
ExclusiveArch: %{nodejs_arches} noarch
- unetbootin
ExclusiveArch: %{ix86} x86_64
- univocity-parsers
ExclusiveArch: %{java_arches} noarch
- ursa-major
ExclusiveArch: noarch aarch64 ppc64le s390x x86_64
- usd
ExclusiveArch: aarch64 x86_64
- v8-314
ExclusiveArch: %{ix86} x86_64 %{arm} mips mipsel ppc ppc64
- valgrind
ExclusiveArch: %{ix86} x86_64 ppc ppc64 ppc64le s390x armv7hl aarch64
- vboot-utils
ExclusiveArch: %{arm} aarch64 %{ix86} x86_64
- velocity
ExclusiveArch: %{java_arches} noarch
- vim-go
ExclusiveArch: %{?golang_arches}%{!?golang_arches:%{ix86} x86_64 %{arm}}
- virt-p2v
ExclusiveArch: x86_64
- virt-v2v
ExclusiveArch: x86_64
- virtiofsd
ExclusiveArch: x86_64 aarch64
- virtualbox-guest-additions
ExclusiveArch: i686 x86_64
- vkd3d
ExclusiveArch: %{ix86} x86_64 %{arm}
ExclusiveArch: %{ix86} x86_64 %{arm} aarch64
- vmaf
ExclusiveArch: x86_64
- vmemcache
ExclusiveArch: x86_64 ppc64 ppc64le s390x aarch64
- vrq
ExclusiveArch: %{ix86} x86_64
- warsow
ExclusiveArch: %{ix86} x86_64 %{arm}
- warsow-data
ExclusiveArch: %{ix86} x86_64 %{arm} noarch
ExclusiveArch: %{ix86} x86_64 %{arm}
- webkit2-sharp
ExclusiveArch: %mono_arches
- wine
ExclusiveArch: %{ix86} x86_64 aarch64
ExclusiveArch: %{ix86}
- wine-dxvk
ExclusiveArch: %{ix86} x86_64
- winetricks
ExclusiveArch: %{ix86} x86_64 %{arm} aarch64
- wxMaxima
ExclusiveArch: %{arm} %{ix86} x86_64 aarch64 ppc sparcv9
- x2goclient
ExclusiveArch: x86_64
- xalan-j2
ExclusiveArch: %{java_arches} noarch
- xbean
ExclusiveArch: %{java_arches} noarch
- xe-guest-utilities-latest
ExclusiveArch: %{ix86} x86_64
- xen
ExclusiveArch: %{ix86} x86_64 armv7hl aarch64
- xerces-j2
ExclusiveArch: %{java_arches} noarch
- xml-commons-apis
ExclusiveArch: %{java_arches} noarch
- xml-commons-resolver
ExclusiveArch: %{java_arches} noarch
- xmlada
ExclusiveArch: %{GPRbuild_arches}
- xmlunit
ExclusiveArch: %{java_arches} noarch
- xmvn
ExclusiveArch: %{java_arches} noarch
- xorg-x11-drv-armsoc
ExclusiveArch: %{arm} aarch64
- xorg-x11-drv-intel
ExclusiveArch: %{ix86} x86_64
- xorg-x11-drv-openchrome
ExclusiveArch: %{ix86} x86_64
- xorg-x11-drv-vesa
ExclusiveArch: %{ix86} x86_64
- xorg-x11-drv-vmware
ExclusiveArch: %{ix86} x86_64 ia64
- xsp
ExclusiveArch: %mono_arches
- xz-java
ExclusiveArch: %{java_arches} noarch
- yarnpkg
ExclusiveArch: %{nodejs_arches} noarch
- zcfan
ExclusiveArch: x86_64
- zeal
ExclusiveArch: %{qt5_qtwebengine_arches}
- zeromq-ada
ExclusiveArch: %{GPRbuild_arches}
- zig
ExclusiveArch: %{zig_arches}
- zlib-ada
ExclusiveArch: %{GPRbuild_arches}
- zlib-ng
ExclusiveArch: aarch64 i686 ppc64le s390x x86_64
- zola
ExclusiveArch: %{rust_arches}
1 year, 11 months
Architecture specific change in rpms/remmina.git
by githook-noreply@fedoraproject.org
The package rpms/remmina.git has added or updated architecture specific content in its
spec file (ExclusiveArch/ExcludeArch or %ifarch/%ifnarch) in commit(s):
https://src.fedoraproject.org/cgit/rpms/remmina.git/commit/?id=fd842e21ee....
Change:
-ExcludeArch: aarch64
Thanks.
Full change:
============
commit 27b34e9a2d93e39bfd491f547fda761782330ba9
Merge: 68f110d fd842e2
Author: Phil Wyett <philip.wyett(a)kathenas.org>
Date: Mon May 23 04:20:23 2022 +0100
Merge branch 'rawhide' into f34
commit fd842e21ee21011691d62f5b5c57421015021c5b
Author: Phil Wyett <philip.wyett(a)kathenas.org>
Date: Mon May 23 04:16:41 2022 +0100
- Add libssh BuildRequires minimum required version of 0.8.0.
- Remove EL7 build support due to new libssh minimum required version.
- Remove telepathy plugin activation switch as no longer required.
- Eliminate cmake build folder warning.
diff --git a/remmina.spec b/remmina.spec
index f5762f2..fbadcf7 100644
--- a/remmina.spec
+++ b/remmina.spec
@@ -1,30 +1,24 @@
%global release_commit_hash fa11b6d1c1f20922b594cc2a8c204f9ea6592836
+# Use old cmake macro behaviour.
+%define __cmake_in_source_build 1
+
Name: remmina
Version: 1.4.26
-Release: 2%{?dist}
+Release: 3%{?dist}
Summary: Remote Desktop Client
License: GPLv2+ and MIT
URL: https://remmina.org
Source0: https://gitlab.com/Remmina/Remmina/-/archive/v%{version}/Remmina-%{versio...
-# Exclude el7 from building on aarch64.
-%if 0%{?rhel} == 7
-ExcludeArch: aarch64
-%endif
-
# Cmake helper file to easy build plugins outside remmina source tree
# See http://www.muflone.com/remmina-plugin-rdesktop/english/install.html which
# use http://www.muflone.com/remmina-plugin-builder/ with remmina bundled source.
# So we can't use it directly only as instructions.
Source1: pluginBuild-CMakeLists.txt
-%if 0%{?fedora} || 0%{?rhel} >= 8
BuildRequires: cmake
-%else
-BuildRequires: cmake3
-%endif
BuildRequires: cups-devel
BuildRequires: desktop-file-utils
BuildRequires: gcc-c++
@@ -37,10 +31,10 @@ BuildRequires: libgcrypt-devel
BuildRequires: libsodium-devel
BuildRequires: python3-devel
BuildRequires: xdg-utils
-%if 0%{?fedora} || 0%{?rhel} <= 8
+%if 0%{?fedora} || 0%{?rhel} == 8
BuildRequires: pkgconfig(appindicator3-0.1)
%endif
-%if 0%{?fedora} || 0%{?rhel} <= 8
+%if 0%{?fedora} || 0%{?rhel} == 8
BuildRequires: pkgconfig(avahi-ui)
BuildRequires: pkgconfig(avahi-ui-gtk3)
%endif
@@ -49,10 +43,10 @@ BuildRequires: pkgconfig(gtk+-3.0)
BuildRequires: pkgconfig(json-glib-1.0)
BuildRequires: pkgconfig(libsecret-1)
BuildRequires: pkgconfig(libsoup-2.4)
-BuildRequires: pkgconfig(libssh)
+BuildRequires: pkgconfig(libssh) >= 0.8.0
BuildRequires: pkgconfig(libvncserver)
BuildRequires: pkgconfig(libpcre2-8)
-%if 0%{?fedora} || 0%{?rhel} <= 8
+%if 0%{?fedora} || 0%{?rhel} == 8
BuildRequires: pkgconfig(spice-client-gtk-3.0)
%endif
BuildRequires: pkgconfig(vte-2.91)
@@ -65,17 +59,10 @@ Obsoletes: %{name}-plugins-nx < %{version}-%{release}
Obsoletes: %{name}-plugins-st < %{version}-%{release}
Obsoletes: %{name}-plugins-xdmcp < %{version}-%{release}
-%if 0%{?fedora} || 0%{?rhel} >= 8
Recommends: %{name}-plugins-exec
Recommends: %{name}-plugins-rdp
Recommends: %{name}-plugins-secret
Recommends: %{name}-plugins-vnc
-%else
-Requires: %{name}-plugins-exec
-Requires: %{name}-plugins-rdp
-Requires: %{name}-plugins-secret
-Requires: %{name}-plugins-vnc
-%endif
%description
Remmina is a remote desktop client written in GTK+, aiming to be useful for
@@ -146,7 +133,7 @@ computers in front of either large monitors or tiny net-books.
This package contains the VNC plugin for the Remmina remote desktop
client.
-%if 0%{?fedora} || 0%{?rhel} <= 8
+%if 0%{?fedora} || 0%{?rhel} == 8
%package plugins-spice
Summary: SPICE plugin for Remmina Remote Desktop Client
Requires: %{name}%{?_isa} = %{version}-%{release}
@@ -185,7 +172,7 @@ This package contains the KDE Wallet plugin for the Remmina remote desktop
client. It will be activated automatically if KDE Wallet is installed and
running.
-%if 0%{?fedora} || 0%{?rhel} <= 8
+%if 0%{?fedora} || 0%{?rhel} == 8
%package plugins-x2go
Summary: x2go plugin for Remmina Remote Desktop Client
Requires: %{name}%{?_isa} = %{version}-%{release}
@@ -232,19 +219,15 @@ that shows up under the display manager session menu.
export CFLAGS="%{optflags} -I%{_includedir}/harfbuzz"
%endif
-%if 0%{?rhel} == 7
-export CFLAGS="%{optflags} -std=gnu99 -D_GNU_SOURCE"
-%endif
-
-%cmake3 \
+%cmake . \
-DCMAKE_INSTALL_LIBDIR=%{_lib} \
-DCMAKE_INSTALL_PREFIX=%{_prefix} \
-%if 0%{?fedora} || 0%{?rhel} <= 8
+%if 0%{?fedora} || 0%{?rhel} == 8
-DHAVE_LIBAPPINDICATOR=ON \
%else
-DHAVE_LIBAPPINDICATOR=OFF \
%endif
-%if 0%{?fedora} || 0%{?rhel} <= 8
+%if 0%{?fedora} || 0%{?rhel} == 8
-DWITH_AVAHI=ON \
%else
-DWITH_AVAHI=OFF \
@@ -257,23 +240,22 @@ export CFLAGS="%{optflags} -std=gnu99 -D_GNU_SOURCE"
-DWITH_LIBSSH=ON \
-DWITH_NEWS=OFF \
-DWITH_PYTHONLIBS=ON \
-%if 0%{?fedora} || 0%{?rhel} <= 8
+%if 0%{?fedora} || 0%{?rhel} == 8
-DWITH_SPICE=ON \
%else
-DWITH_SPICE=OFF \
%endif
- -DWITH_TELEPATHY=OFF \
-DWITH_VTE=ON \
-%if 0%{?fedora} || 0%{?rhel} <= 8
+%if 0%{?fedora} || 0%{?rhel} == 8
-DWITH_X2GO=ON
%else
-DWITH_X2GO=OFF
%endif
-%cmake3_build
+%cmake_build
%install
-%cmake3_install
+%cmake_install
mkdir -p %{buildroot}/%{_libdir}/cmake/%{name}/
cp -pr cmake/*.cmake %{buildroot}/%{_libdir}/cmake/%{name}/
@@ -286,21 +268,6 @@ cp -p %{SOURCE1} %{buildroot}/%{_includedir}/%{name}/
desktop-file-validate %{buildroot}/%{_datadir}/applications/*.desktop
appstream-util validate-relax --nonet %{buildroot}/%{_datadir}/metainfo/*.appdata.xml
-# Manually trigger icon cache generation on el7 only.
-%if 0%{?rhel} == 7
-%post
-/bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :
-
-%postun
-if [ $1 -eq 0 ] ; then
- /bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null
- /usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
-fi
-
-%posttrans
-/usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
-%endif
-
%files -f %{name}.lang
%license LICENSE
%doc AUTHORS ChangeLog README.md
@@ -341,7 +308,7 @@ fi
%{_datadir}/icons/hicolor/*/emblems/org.remmina.Remmina-vnc-ssh-symbolic.svg
%{_datadir}/icons/hicolor/*/emblems/org.remmina.Remmina-vnc-symbolic.svg
-%if 0%{?fedora} || 0%{?rhel} <= 8
+%if 0%{?fedora} || 0%{?rhel} == 8
%files plugins-spice
%{_libdir}/remmina/plugins/remmina-plugin-spice.so
%{_datadir}/icons/hicolor/*/emblems/org.remmina.Remmina-spice-ssh-symbolic.svg
@@ -357,7 +324,7 @@ fi
%files plugins-python
%{_libdir}/remmina/plugins/remmina-plugin-python_wrapper.so
-%if 0%{?fedora} || 0%{?rhel} <= 8
+%if 0%{?fedora} || 0%{?rhel} == 8
%files plugins-x2go
%{_libdir}/remmina/plugins/remmina-plugin-x2go.so
%{_datadir}/icons/hicolor/*/emblems/org.remmina.Remmina-x2go-ssh-symbolic.svg
@@ -373,6 +340,12 @@ fi
%{_mandir}/man1/remmina-gnome.1.*
%changelog
+* Sun May 22 2022 Phil Wyett <philip.wyett(a)kathenas.org> - 1.4.26-3
+- Add libssh BuildRequires minimum required version of 0.8.0.
+- Remove EL7 build support due to new libssh minimum required version.
+- Remove telepathy plugin activation switch as no longer required.
+- Eliminate cmake build folder warning.
+
* Thu May 19 2022 Phil Wyett <philip.wyett(a)kathenas.org> - 1.4.26-2
- Add some missing BuildRequires for calrity.
- Correctly disable spice plugin on EL9.
1 year, 11 months