RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1846034 - systemd-udev-239-33.el8 breaks dracut: /usr/lib/dracut/dracut-init.sh: line 460: [: too many arguments
Summary: systemd-udev-239-33.el8 breaks dracut: /usr/lib/dracut/dracut-init.sh: line 4...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: dracut
Version: 8.3
Hardware: All
OS: Linux
unspecified
high
Target Milestone: rc
: 8.3
Assignee: Lukáš Nykrýn
QA Contact: Frantisek Sumsal
URL:
Whiteboard:
: 1849750 1853575 (view as bug list)
Depends On:
Blocks: 1812825
TreeView+ depends on / blocked
 
Reported: 2020-06-10 15:48 UTC by Petr Pisar
Modified: 2020-11-04 01:43 UTC (History)
11 users (show)

Fixed In Version: dracut-049-89.git20200625.el8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-11-04 01:42:48 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
sosreport (18.29 MB, application/octet-stream)
2020-07-03 08:51 UTC, IBM Bug Proxy
no flags Details
must gather info (15.36 KB, application/octet-stream)
2020-07-03 08:51 UTC, IBM Bug Proxy
no flags Details
Prposed patch to fix udevverion (805 bytes, application/octet-stream)
2020-07-03 08:51 UTC, IBM Bug Proxy
no flags Details

Description Petr Pisar 2020-06-10 15:48:30 UTC
After upgrading systemd-udev from 239-30.el8_2 to 239-33.el8, installing kernel-core package produces a scriptlet warning:

# dnf --allowerasing  reinstall kernel-core-4.18.0-212.el8.x86_64
[...]
Reinstalling:
 kernel-core                                                        x86_64                                                        4.18.0-212.el8                                                          rhel-8.3.0-baseos                                                         30 M
[...]
Running transaction
  Preparing        :                                                                                                                                                                                                                                                                 1/1
  Reinstalling     : kernel-core-4.18.0-212.el8.x86_64                                                                                                                                                                                                                               1/2
  Running scriptlet: kernel-core-4.18.0-212.el8.x86_64                                                                                                                                                                                                                               1/2
  Running scriptlet: kernel-core-4.18.0-212.el8.x86_64                                                                                                                                                                                                                               2/2
  Cleanup          : kernel-core-4.18.0-212.el8.x86_64                                                                                                                                                                                                                               2/2
  Running scriptlet: kernel-core-4.18.0-212.el8.x86_64                                                                                                                                                                                                                               2/2
/usr/lib/dracut/dracut-init.sh: line 460: [: too many arguments
/usr/lib/dracut/dracut-init.sh: line 460: [: too many arguments
/usr/lib/dracut/dracut-init.sh: line 460: [: too many arguments
/usr/lib/dracut/dracut-init.sh: line 454: [: too many arguments

  Verifying        : kernel-core-4.18.0-212.el8.x86_64                                                                                                                                                                                                                               1/2
  Verifying        : kernel-core-4.18.0-212.el8.x86_64                                                                                                                                                                                                                               2/2

The reason is that "udevadm --version" changed format from:

# udevadm --version
239

to:

# udevadm --version
239 (239-33.el8)

/usr/lib/dracut/dracut-init.sh from dracut-049-86.git20200602.el8.x86_64 parses "udevadm --version" output:

   446  prepare_udev_rules() {
→  447      [ -z "$UDEVVERSION" ] && export UDEVVERSION=$(udevadm --version)
   448  
   449      for f in "$@"; do
   450          f="${initdir}/etc/udev/rules.d/$f"
   451          [ -e "$f" ] || continue
   452          while read line || [ -n "$line" ]; do
   453              if [ "${line%%IMPORT PATH_ID}" != "$line" ]; then
   454                  if [ $UDEVVERSION -ge 174 ]; then
   455                      printf '%sIMPORT{builtin}="path_id"\n' "${line%%IMPORT PATH_ID}"
   456                  else
   457                      printf '%sIMPORT{program}="path_id %%p"\n' "${line%%IMPORT PATH_ID}"
   458                  fi
   459              elif [ "${line%%IMPORT BLKID}" != "$line" ]; then
→  460                  if [ $UDEVVERSION -ge 176 ]; then
   461                      printf '%sIMPORT{builtin}="blkid"\n' "${line%%IMPORT BLKID}"
   462                  else
   463                      printf '%sIMPORT{program}="/sbin/blkid -o udev -p $tempnode"\n' "${line%%IMPORT BLKID}"
   464                  fi
   465              else
   466                  echo "$line"
   467              fi
   468          done < "${f}" > "${f}.new"
   469          mv "${f}.new" "$f"
   470      done

Either systemd-udev should revert the format, or dracut should adapt.

Comment 1 Lenny Szubowicz 2020-06-11 01:12:53 UTC
I just ran into this as well. FWIW, I think dracut should adapt to the change. Seems risky to depend on a version string being a simple integer value.

Perhaps something like this would work:

root@intel-tigerlake-y-02 ~]# diff -u /usr/lib/dracut/dracut-init.sh-orig /usr/lib/dracut/dracut-init.sh
--- /usr/lib/dracut/dracut-init.sh-orig	2020-06-10 20:33:08.214575391 -0400
+++ /usr/lib/dracut/dracut-init.sh	2020-06-10 20:41:26.195045814 -0400
@@ -451,13 +451,13 @@
         [ -e "$f" ] || continue
         while read line || [ -n "$line" ]; do
             if [ "${line%%IMPORT PATH_ID}" != "$line" ]; then
-                if [ $UDEVVERSION -ge 174 ]; then
+                if [[ ! "$UDEVVERSION" < "174" ]]; then
                     printf '%sIMPORT{builtin}="path_id"\n' "${line%%IMPORT PATH_ID}"
                 else
                     printf '%sIMPORT{program}="path_id %%p"\n' "${line%%IMPORT PATH_ID}"
                 fi
             elif [ "${line%%IMPORT BLKID}" != "$line" ]; then
-                if [ $UDEVVERSION -ge 176 ]; then
+                if [[ ! "$UDEVVERSION" < "176" ]]; then
                     printf '%sIMPORT{builtin}="blkid"\n' "${line%%IMPORT BLKID}"
                 else
                     printf '%sIMPORT{program}="/sbin/blkid -o udev -p $tempnode"\n' "${line%%IMPORT BLKID}"

Comment 2 Jan Synacek 2020-06-11 09:36:02 UTC
Upstream PR: https://github.com/dracutdevs/dracut/pull/842

Comment 8 Lukáš Nykrýn 2020-07-03 07:25:06 UTC
*** Bug 1853575 has been marked as a duplicate of this bug. ***

Comment 9 IBM Bug Proxy 2020-07-03 08:51:43 UTC
Created attachment 1699797 [details]
sosreport

Comment 10 IBM Bug Proxy 2020-07-03 08:51:48 UTC
Created attachment 1699798 [details]
must gather info

Comment 11 IBM Bug Proxy 2020-07-03 08:51:51 UTC
Created attachment 1699799 [details]
Prposed patch to fix udevverion

Comment 12 David Tardon 2020-08-03 14:44:17 UTC
*** Bug 1849750 has been marked as a duplicate of this bug. ***

Comment 16 errata-xmlrpc 2020-11-04 01:42:48 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (dracut bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2020:4473


Note You need to log in before you can comment on or make changes to this bug.