Bug 196525 - Tail syntax is incorrect.
Summary: Tail syntax is incorrect.
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: mkbootdisk   
(Show other bugs)
Version: 5
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Peter Vrabec
QA Contact: David Lawrence
URL:
Whiteboard:
Keywords:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2006-06-23 23:02 UTC by Charles Curley
Modified: 2007-11-30 22:11 UTC (History)
0 users

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


Attachments (Terms of Use)

Description Charles Curley 2006-06-23 23:02:58 UTC
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 23:04:15 UTC
[root@teckla ~]# pre mkbootdisk
mkbootdisk-1.5.2-5.2


Comment 2 Peter Vrabec 2006-06-26 09:17:31 UTC
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.