Bug 196525 - Tail syntax is incorrect.
Tail syntax is incorrect.
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: mkbootdisk (Show other bugs)
5
All Linux
medium Severity medium
: ---
: ---
Assigned To: Peter Vrabec
David Lawrence
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2006-06-23 19:02 EDT by Charles Curley
Modified: 2007-11-30 17:11 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-06-26 05:17:31 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Charles Curley 2006-06-23 19:02:58 EDT
Description of problem:

mkbookdisk reports a problem from tail:

[root@teckla ~]# mkbootdisk --iso --device bootdisk.$(uname -r).iso $(uname -r)
tail: cannot open `+3' for reading: No such file or directory
tail: cannot open `+3' for reading: No such file or directory

It may or may not complete sucessfully. One failure mode is:

[root@charlesc bare.metal]# mkbootdisk --iso --device bootdisk.$(uname -r).iso
$(uname -r)
tail: cannot open `+3' for reading: No such file or directory
tail: cannot open `+3' for reading: No such file or directory
Cannot find root partition in /etc/fstab.



Version-Release number of selected component (if applicable):

[root@teckla ~]# mkbootdisk --version
mkbootdisk: version 1.5.2


How reproducible:

The tail complaints are consistent. The fstab message will show up or not
depending on how the bug affects the output of tail.


Steps to Reproduce:
1. run mkbootdisk as above.
2.
3.
  
Actual results:

As above.

Expected results:

silent creation of a boot disk image in the working directory.

Additional info:

The relevant lines of the script, starting at line 106, are like so:


    list=$(tail +3 /proc/partitions | awk '{ print $4 '} | grep '^md')
    list="$list $(tail +3 /proc/partitions | 
			awk '{ print $4 '} | grep -v '^md')"
    rootdev=""

Fix: insert a -n between the "tail" and the "+3" in lines 107 and 108.


    list=$(tail -n +3 /proc/partitions | awk '{ print $4 '} | grep '^md')
    list="$list $(tail -n +3 /proc/partitions | 
			awk '{ print $4 '} | grep -v '^md')"

Rational: The arguments to tail have changed, and the +3 is no longer vaild
without the -n argument.

N.b.: There may be other scripts with this problem. I know it has affected some
of mine.
Comment 1 Charles Curley 2006-06-23 19:04:15 EDT
[root@teckla ~]# pre mkbootdisk
mkbootdisk-1.5.2-5.2
Comment 2 Peter Vrabec 2006-06-26 05:17:31 EDT
fixed in rawhide and FC-5 update is comming soon.

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