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 996126 - /bin/dracut-initqueue: line 72: syntax error near unexpected token `fi'
Summary: /bin/dracut-initqueue: line 72: syntax error near unexpected token `fi'
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: dracut
Version: 7.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: dracut-maint
QA Contact: Release Test Team
URL:
Whiteboard:
Depends On: 995816
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-08-12 13:13 UTC by Jakub Filak
Modified: 2016-12-01 00:44 UTC (History)
8 users (show)

Fixed In Version: dracut-031-29
Doc Type: Bug Fix
Doc Text:
Clone Of: 995816
Environment:
Last Closed: 2014-06-13 10:26:55 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Jakub Filak 2013-08-12 13:13:37 UTC
+++ This bug was initially created as a clone of Bug #995816 +++

Description of problem:
[   13.419009] localhost dracut-initqueue[331]: /bin/dracut-initqueue: line 72: syntax error near unexpected token `fi'
[   13.422436] localhost dracut-initqueue[331]: /bin/dracut-initqueue: line 72: `    fi'

Version-Release number of selected component (if applicable):
rawhide boot.iso
Linux version 3.11.0-0.rc4.git2.1.fc20.x86_64

$ file boot.iso 
boot.iso: # ISO 9660 CD-ROM filesystem data 'Fedora rawhide x86_64           ' (bootable)
$ sha256sum boot.iso
31a186235adaaae33300de26a820a571e364cfabeafa131d1998053514db7356  boot.iso

How reproducible:
Always.

Steps to Reproduce:
1. $ qemu-kvm -m 4096 -hda f20-test-1.img -cdrom ~/xfr/fedora/rawhide/boot.iso -vga std -boot menu=on

Actual results:
dracut shell

Expected results:
installer welcome menu

Additional info:

--- Additional comment from Steve Tyler on 2013-08-11 12:01:02 CEST ---

There needs to be a "then" on line 65:

$ less -N dracut-initqueue-1
...
     65     if [ $main_loop -gt $RDRETRY ];
     66         if ! [ -d /sysroot/etc/fstab ] || ! [ -e /sysroot/sbin/init ] ; then
     67             action_on_fail "Could not boot." && break
     68         fi
     69         warn "Not all disks have been found."
     70         warn "You might want to regenerate your initramfs."
     71         break
     72     fi
     73 done
...

--- Additional comment from Steve Tyler on 2013-08-11 12:14:07 CEST ---

Bug introduced with this commit:

systemd/dracut-initqueue.sh: continue to boot if finished failed
author	Harald Hoyer <harald>	2013-08-05 09:23:16 (GMT)
http://git.kernel.org/cgit/boot/dracut/dracut.git/commit/modules.d/98systemd/dracut-initqueue.sh?id=226e3710b4236c69a8f821b6a5c53a264fe4892a

--- Additional comment from Steve Tyler on 2013-08-11 13:47:58 CEST ---

After an update, installed rawhide systems may hang during booting with the message in the bug summary displayed.

The easy workaround is to boot an earlier kernel.

The hard workaround is to boot into rescue mode from an F19 installer disc[1], fix dracut-initqueue.sh[2], and rebuild the initramfs with:
# dracut -f --kver <latest kernel version>

[1] You could probably do this after booting an earlier kernel, but I did not test that method.

[2] Per Comment 1. The full path is:
/usr/lib/dracut/modules.d/98systemd/dracut-initqueue.sh

Tested with:
$ qemu-kvm -m 4096 -hda f20-test-1.img -cdrom ~/xfr/fedora/F19/Fedora-19-x86_64-DVD.iso -vga std -boot menu=on

--- Additional comment from Steve Tyler on 2013-08-11 14:16:45 CEST ---

(In reply to Steve Tyler from comment #3)
> After an update, installed rawhide systems may hang during booting with the
> message in the bug summary displayed.
...

Eventually, a dracut shell prompt is displayed with a message suggesting that you buy a USB stick as a dracut debugging aid ... :-)

--- Additional comment from Steve Tyler on 2013-08-11 14:56:21 CEST ---

(In reply to Steve Tyler from comment #0)
...
> Version-Release number of selected component (if applicable):
> rawhide boot.iso
> Linux version 3.11.0-0.rc4.git2.1.fc20.x86_64
...

Here are some timestamps from boot.iso:

$ isoinfo -lR -i boot.iso | egrep 'squash|vmlinuz'
-rwxr-xr-x   2    0    0         5652376 Aug  7 2013 [  31354 00]  vmlinuz 
-rw-r--r--   1    0    0       223023104 Aug 10 2013 [  47272 00]  squashfs.img 
-rwxr-xr-x   2    0    0         5652376 Aug  7 2013 [  31354 00]  vmlinuz

--- Additional comment from Steve Tyler on 2013-08-11 18:49:46 CEST ---

(In reply to Steve Tyler from comment #2)
> Bug introduced with this commit:
> 
> systemd/dracut-initqueue.sh: continue to boot if finished failed
> author	Harald Hoyer <harald>	2013-08-05 09:23:16 (GMT)
> http://git.kernel.org/cgit/boot/dracut/dracut.git/commit/modules.d/98systemd/
> dracut-initqueue.sh?id=226e3710b4236c69a8f821b6a5c53a264fe4892a

In the future, it might be a good idea to do a bash syntax check using
the bash "-n" option
before committing any changes.

Doing that would have caught this problem immediately:

$ bash -n dracut-initqueue-1 
dracut-initqueue-1: line 72: syntax error near unexpected token `fi'
dracut-initqueue-1: line 72: `    fi'

$ bash -c 'help set' | less -N
...
     16       -n  Read commands but do not execute them.
...

--- Additional comment from Jakub Filak on 2013-08-12 15:11:27 CEST ---

(In reply to Steve Tyler from comment #3)
> [1] You could probably do this after booting an earlier kernel, but I did
> not test that method.
> 
I tested this method and it works.

Comment 2 Harald Hoyer 2013-08-14 10:31:44 UTC
dracut-031-29

Comment 3 Jan Stodola 2013-08-15 09:30:43 UTC
Anaconda starts successfully when booting boot.iso from RHEL-7.0-20130814.n.0 compose. Version of dracut is dracut-031-29.el7.

Moving to VERIFIED.

Comment 4 Ludek Smid 2014-06-13 10:26:55 UTC
This request was resolved in Red Hat Enterprise Linux 7.0.

Contact your manager or support representative in case you have further questions about the request.


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