Bug 1270629

Summary: Bad cmdline parsing in 50-dracut.install and 51-dracut-rescue.install
Product: [Fedora] Fedora Reporter: Michael Chapman <redhat-bugzilla>
Component: dracutAssignee: dracut-maint-list
Status: CLOSED EOL QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 22CC: dracut-maint-list, jonathan, zbyszek
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-07-19 18:11:01 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Michael Chapman 2015-10-12 01:21:46 UTC
This bug is in dracut-041-14.fc22.x86_64.

50-dracut.install and 51-dracut-rescue.install use the shell "read" builtin incorrectly. This causes /bin/kernel-install to exit unsuccessfully, leading to RPM scriptlet failures when a kernel-core package is installed or updated.

The problem is on these lines:

  50-dracut.install
  28:            read -ar BOOT_OPTIONS < /proc/cmdline

  51-dracut-rescue.install
  48:    read -ar BOOT_OPTIONS < /proc/cmdline

"read -a" requires the array name to immediately follow. These lines aren't reading into the $BOOT_OPTIONS array; instead they're populating an array named $r. A subsequent test for $BOOT_OPTIONS being empty causes the *.install scripts to exit with failure.

This bug has been fixed upstream:

  commit a6018700645a037e629d64ade52bb93bb7fb70ae
  Author: Harald Hoyer <harald>
  Date:   Wed May 13 11:49:05 2015 +0200

      5?-dracut*.install: better parsing of /proc/cmdline
    
      "read -r -d '' -a" does, what we want.

It would be nice to have this commit backported to the dracut in Fedora.

Comment 1 Michael Chapman 2016-03-22 23:37:38 UTC
This is still a bug as of dracut-041-15.fc22.x86_64.

Comment 2 Fedora End Of Life 2016-07-19 18:11:01 UTC
Fedora 22 changed to end-of-life (EOL) status on 2016-07-19. Fedora 22 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.