Bug 996126 - /bin/dracut-initqueue: line 72: syntax error near unexpected token `fi'
/bin/dracut-initqueue: line 72: syntax error near unexpected token `fi'
Status: CLOSED CURRENTRELEASE
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: dracut (Show other bugs)
7.0
Unspecified Unspecified
unspecified Severity unspecified
: rc
: ---
Assigned To: dracut-maint
Release Test Team
:
Depends On: 995816
Blocks:
  Show dependency treegraph
 
Reported: 2013-08-12 09:13 EDT by Jakub Filak
Modified: 2016-11-30 19:44 EST (History)
8 users (show)

See Also:
Fixed In Version: dracut-031-29
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 995816
Environment:
Last Closed: 2014-06-13 06:26:55 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Jakub Filak 2013-08-12 09:13:37 EDT
+++ 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@redhat.com>	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@redhat.com>	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 06:31:44 EDT
dracut-031-29
Comment 3 Jan Stodola 2013-08-15 05:30:43 EDT
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 06:26:55 EDT
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.