From 7b5855086453a40b172b9ce3b6cbe78362acecec Mon Sep 17 00:00:00 2001 From: Michel Alexandre Salim Date: Jun 09 2021 21:15:11 +0000 Subject: Handle non-integer udev version strings Signed-off-by: Michel Alexandre Salim --- diff --git a/SOURCES/0001-Handle-non-integer-udev-version-strings.patch b/SOURCES/0001-Handle-non-integer-udev-version-strings.patch new file mode 100644 index 0000000..c001a42 --- /dev/null +++ b/SOURCES/0001-Handle-non-integer-udev-version-strings.patch @@ -0,0 +1,46 @@ +From c8daa0d621bcf7a1fa82698b2556a274b29f6c13 Mon Sep 17 00:00:00 2001 +From: Michel Alexandre Salim +Date: Wed, 9 Jun 2021 14:07:20 -0700 +Subject: [PATCH] Handle non-integer udev version strings + +CentOS 8's systemd reports this for `udevadm --version`: + +``` +[vagrant@localhost ~]$ udevadm --version +239 (239-44.el8) +[vagrant@localhost ~]$ udevadm --version | awk '{print $1;}' +239 +[vagrant@localhost ~]$ udevadm --version | sed -e 's/\s.*$//' +239 +``` + +Using sed rather than awk to get the first token out, since it is +already declared as a dependency in the dracut spec. + +This works fine on fully integral versions, e.g. on Fedora 33 +``` +$ udevadm --version | sed -e 's/\s.*$//' +246 +``` + +Signed-off-by: Michel Alexandre Salim +--- + dracut-init.sh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/dracut-init.sh b/dracut-init.sh +index b6e3714a..5be62d50 100644 +--- a/dracut-init.sh ++++ b/dracut-init.sh +@@ -508,7 +508,7 @@ inst_rules_wildcard() { + + prepare_udev_rules() { + if [ -z "$UDEVVERSION" ]; then +- UDEVVERSION=$(udevadm --version) ++ UDEVVERSION=$(udevadm --version | sed -e 's/\s.*$//') + export UDEVVERSION + fi + +-- +2.31.1 + diff --git a/SPECS/dracut.spec b/SPECS/dracut.spec index ef9b56d..2489545 100644 --- a/SPECS/dracut.spec +++ b/SPECS/dracut.spec @@ -9,7 +9,7 @@ Name: dracut Version: 055 -Release: %{dist_free_release}%{?dist} +Release: %{dist_free_release}%{?dist}.1 Summary: Initramfs generator using udev %if 0%{?fedora} || 0%{?rhel} @@ -32,6 +32,9 @@ Source0: http://www.kernel.org/pub/linux/utils/boot/dracut/dracut-%{version}.tar Source1: https://www.gnu.org/licenses/lgpl-2.1.txt +# Handle RHEL/CentOS's non-integer udev version strings +Patch0: 0001-Handle-non-integer-udev-version-strings.patch + BuildRequires: bash BuildRequires: git-core BuildRequires: pkgconfig(libkmod) >= 23 @@ -484,6 +487,9 @@ echo 'dracut_rescue_image="yes"' > $RPM_BUILD_ROOT%{dracutlibdir}/dracut.conf.d/ %{_prefix}/lib/kernel/install.d/51-dracut-rescue.install %changelog +* Wed Jun 09 2021 Michel Alexandre Salim - 055-1.1 +- Handle non-integer udev version strings + * Thu May 27 2021 Harald Hoyer - 055-1 - version 055 - install the missing fsck utils