Bug 679424

Summary: "unexpected operator" at boot
Product: [Fedora] Fedora Reporter: Joel Kirchmeyer <kirchmeyer>
Component: dracutAssignee: Harald Hoyer <harald>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 15CC: harald, jonathan
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: dracut-008-7.fc15 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-02-22 17:58:42 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
proposed patch none

Description Joel Kirchmeyer 2011-02-22 14:39:29 UTC
Description of problem:multiple "unexpected operator" errors at boot. in my case it still boots.


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


How reproducible:Every boot


Steps to Reproduce:
1.Upgrade to dracut-008-5.fc15.noarch
2.boot
3.
  
Actual results: multiple "unexpected operator" errors at boot


Expected results: no errors


Additional info:
It's in the lvm_scan.sh

There was another check for "sysinit" which used the maj, min, sub from the lvm version call. I've fixed it locally though it's probably not as elegant as it could have been.



Broken:

check_lvm_ver() {
    maj=$1; shift;
    min=$1; shift;
    ver=$1; shift;
    # --poll is supported since 2.2.57
    [ $1 -lt $maj ] && return 1
    [ $1 -gt $maj ] && return 0
    [ $2 -lt $min ] && return 1
    [ $2 -gt $min ] && return 0
    [ $3 -ge $ver ] && return 0
    return 1
}

lvm version 2>/dev/null | ( \
    IFS=. read maj min sub; 
    maj=${maj##*:}; 
    sub=${sub%% *}; sub=${sub%%\(*}; 
    ) 2>/dev/null

nopoll=$(
    # hopefully this output format will never change, e.g.:
    #   LVM version:     2.02.53(1) (2009-09-25)
        check_lvm_ver 2 2 57 $maj $min $sub && \
            echo " --poll n ";
)

sysinit=$(
    # hopefully this output format will never change, e.g.:
    #   LVM version:     2.02.53(1) (2009-09-25)
        check_lvm_ver 2 2 65 $maj $min $sub && \
            echo " --sysinit ";
)


Fixed:

check_lvm_ver() {
    maj=$1; shift;
    min=$1; shift;
    ver=$1; shift;
    # --poll is supported since 2.2.57
    [ $1 -lt $maj ] && return 1
    [ $1 -gt $maj ] && return 0
    [ $2 -lt $min ] && return 1
    [ $2 -gt $min ] && return 0
    [ $3 -ge $ver ] && return 0
    return 1
}

nopoll=$(
    # hopefully this output format will never change, e.g.:
    #   LVM version:     2.02.53(1) (2009-09-25)
    lvm version 2>/dev/null | ( \
        IFS=. read maj min sub; 
        maj=${maj##*:}; 
        sub=${sub%% *}; sub=${sub%%\(*}; 
        check_lvm_ver 2 2 57 $maj $min $sub && \
            echo " --poll n ";
    ) 2>/dev/null 
)

sysinit=$(
    # hopefully this output format will never change, e.g.:
    #   LVM version:     2.02.53(1) (2009-09-25)
    lvm version 2>/dev/null | ( \
        IFS=. read maj min sub; 
        maj=${maj##*:}; 
        sub=${sub%% *}; sub=${sub%%\(*}; 
        check_lvm_ver 2 2 65 $maj $min $sub && \
            echo " --sysinit ";
    ) 2>/dev/null 
)

Comment 1 Harald Hoyer 2011-02-22 16:45:55 UTC
Created attachment 480177 [details]
proposed patch

Comment 2 Fedora Update System 2011-02-22 16:57:09 UTC
dracut-008-6.fc15 has been submitted as an update for Fedora 15.
https://admin.fedoraproject.org/updates/dracut-008-6.fc15

Comment 3 Joel Kirchmeyer 2011-02-22 17:27:27 UTC
updated to dracut-008-6.fc15

now get the following:
/sbin/lvm_scan: 66: maj: not found

Comment 4 Harald Hoyer 2011-02-22 17:41:55 UTC
(In reply to comment #3)
> updated to dracut-008-6.fc15
> 
> now get the following:
> /sbin/lvm_scan: 66: maj: not found

this is not my day... don't know how this line slipped in just after testing it...

Comment 5 Fedora Update System 2011-02-22 17:50:09 UTC
dracut-008-7.fc15 has been submitted as an update for Fedora 15.
https://admin.fedoraproject.org/updates/dracut-008-7.fc15

Comment 6 Joel Kirchmeyer 2011-02-22 17:58:42 UTC
Believe me I can definitely relate. All is well with dracut-008-7.fc15. Thanks!

Comment 7 Fedora Update System 2011-03-03 03:41:07 UTC
dracut-008-7.fc15 has been pushed to the Fedora 15 stable repository.  If problems still persist, please make note of it in this bug report.