Bug 1708321 - syntax error in dracut module setup script for kexec-tools
Summary: syntax error in dracut module setup script for kexec-tools
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: kexec-tools
Version: 30
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Kairui Song
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-05-09 15:35 UTC by Thomas Neuber
Modified: 2020-04-08 05:06 UTC (History)
3 users (show)

Fixed In Version: kexec-tools-2.0.20-11.fc32 kexec-tools-2.0.20-11.fc31
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-04-01 00:17:40 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Thomas Neuber 2019-05-09 15:35:49 UTC
Description of problem:
running dracut to update initial ramdisk after kernel update reports script syntax error and results in incomplete initial ramdisk image.

Version-Release number of selected component (if applicable):
kexec-tools-2.0.19-1.fc30.x86_64
dracut-049-26.git20181204.fc30.x86_64
dracut-config-rescue-049-26.git20181204.fc30.x86_64
dracut-live-049-26.git20181204.fc30.x86_64
dracut-network-049-26.git20181204.fc30.x86_64
dracut-squash-049-26.git20181204.fc30.x86_64

Running dracut produces the following output:
/usr/lib/dracut/modules.d/99kdumpbase/module-setup.sh: line 191: syntax error near unexpected token `<'
/usr/lib/dracut/modules.d/99kdumpbase/module-setup.sh: line 191: `        < <(/sbin/ip $_ipv6_flag route show)'


Additional info:
The reported script file belongs to package "kexec-tools-2.0.19-1.fc30.x86_64".

Changing line 191 in this script from "< <(/sbin/ip $_ipv6_flag route show)" to "< $(/sbin/ip $_ipv6_flag route show)" seems to solve the problem.

Comment 1 Kairui Song 2019-05-14 11:50:53 UTC
Hmm, strange, that's valid bash syntax and I can't reproduce the issue. What's your bash version, or are you using some other shell to replace bash?

Comment 2 Thomas Neuber 2019-05-14 17:29:32 UTC
(In reply to Kairui Song from comment #1)
> Hmm, strange, that's valid bash syntax and I can't reproduce the issue.
> What's your bash version, or are you using some other shell to replace bash?

My (default) shell is bash and shebang of the mentioned script points to /usr/bin/bash. But how can I verify, this script is running with the right shell? It is started indirectly by dracut.

The output of: rpm -q --whatprovides /usr/bin/bash
is: bash-5.0.2-1.fc30.x86_64

The output of: LANG=C bash --version
is: GNU bash, version 5.0.2(1)-release (x86_64-redhat-linux-gnu)
Copyright (C) 2019 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

I cannot remember, that I configured any shell setting or switched to another shell. I simply upgraded from Fedora 29 to 30.

Btw., I can confirm, the bash documentation describes this syntax.

Comment 3 Kairui Song 2020-03-12 06:14:27 UTC
Turns out process substitution is not a posix standard shell syntax, so if bash is configured to strictly follow posix, it won't work. I've sent a patch to fix it.

Comment 4 Fedora Update System 2020-03-23 19:01:23 UTC
FEDORA-2020-47cd522de5 has been submitted as an update to Fedora 31. https://bodhi.fedoraproject.org/updates/FEDORA-2020-47cd522de5

Comment 5 Fedora Update System 2020-03-24 01:52:35 UTC
FEDORA-2020-d73f5db86c has been pushed to the Fedora 32 testing repository.
In short time you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2020-d73f5db86c`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2020-d73f5db86c

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 6 Fedora Update System 2020-03-24 09:41:19 UTC
FEDORA-2020-47cd522de5 has been pushed to the Fedora 31 testing repository.
In short time you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2020-47cd522de5`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2020-47cd522de5

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 7 Thomas Neuber 2020-03-29 05:59:15 UTC
The provided package solved this issue. The syntax error message disappeared. 

I did not configure any static routes. Therefore, no output is produced by the modified function. So I cannot validate the output.

Thanks.

Comment 8 Fedora Update System 2020-04-01 00:17:40 UTC
FEDORA-2020-d73f5db86c has been pushed to the Fedora 32 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 9 Fedora Update System 2020-04-01 16:32:31 UTC
FEDORA-2020-d73f5db86c has been pushed to the Fedora 32 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 10 Fedora Update System 2020-04-08 05:06:41 UTC
FEDORA-2020-47cd522de5 has been pushed to the Fedora 31 stable repository.
If problem still persists, please make note of it in this bug report.


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