Red Hat Bugzilla – Bug 443511
mkinitrd uses bash3-specific syntax
Last modified: 2011-07-27 14:01:15 EDT
Description of problem:
Starting with RHEL 4.5, the mkinitrd script uses the [[ $x =~ $pattern ]]
notation to look for a module. This notation works fine in bash 3.0, but not in
This might just be a problem that is specific to our company, but I thought I
should bring it up to see if it needs fixing upstream.
Our RHEL-based systems are being upgraded from RHEL 3.4 to 4.5. The first
package to be installed is the new kernel. As part of the kernel's %post
scriptlet, we run mkinitrd. However, at the time that mkinitrd is run, bash 2.0
is still installed on the system, and bash 3.0 is not yet installed. Since the
"=~" notation is new in bash 3.0, mkinitrd fails.
If the mkinitrd script used (the somewhat slower) pipes and grep to do this
module check, there would be no dependency on later versions of bash.
Version-Release number of selected component (if applicable):
RHEL 4.3 - mkinitrd-18.104.22.168-1.src.rpm [ok, bash 2.0 compatible]
RHEL 4.4 - mkinitrd-22.214.171.124-1.1.src.rpm [uses =~, requires bash 3.0]
RHEL 4.5 - mkinitrd-126.96.36.199-1.src.rpm [uses =~, requires bash 3.0]
Every time, but not on a standard RHEL system... it's on a RHEL-based system
used for telecom equipment. The upgrade process is not RHEL, but is developed
in-house. I thought I would share this feedback in case you felt it was
important to keep mkinitrd compatible with the lowest common denominator of
shells that it might be running on.