Changeset 8547

Show
Ignore:
Timestamp:
05/31/08 16:19:45 (6 months ago)
Author:
dj
Message:

Sync with r8543 and added additional manage functions.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/bootscripts/contrib/lsb-v3/ChangeLog

    r8524 r8547  
    11ChangeLog 
     2 
     320080531 - [dj] * Synced with LFS-Bootscrpts-20080531 (use udevadm) 
     4                * Added additional functions to manage_functions script. 
    25 
    3620080413 - [dj] * Added manage_functions script for use by scripts such as 
  • trunk/bootscripts/contrib/lsb-v3/init.d/udev

    r7914 r8547  
    6666                # Now traverse /sys in order to "coldplug" devices that have 
    6767                # already been discovered 
    68                 /sbin/udevtrigger 
     68                /sbin/udevadm trigger 
    6969 
    7070                # Now wait for udevd to process the uevents we triggered 
    71                 /sbin/udevsettle 
     71                /sbin/udevadm settle 
    7272                evaluate_retval standard 
    7373                ;; 
  • trunk/bootscripts/contrib/lsb-v3/init.d/udev_retry

    r7914 r8547  
    3636 
    3737                # Re-trigger the failed uevents in hope they will succeed now 
    38                 /sbin/udevtrigger --retry-failed 
     38                /sbin/udevadm trigger --retry-failed 
    3939 
    4040                # Now wait for udevd to process the uevents we triggered 
    41                 /sbin/udevsettle 
     41                /sbin/udevadm settle 
    4242                evaluate_retval standard 
    4343                ;; 
  • trunk/bootscripts/contrib/lsb-v3/lsb/manage-functions

    r8526 r8547  
    216216get_headers 
    217217 
     218############################################################################### 
     219# get_lsb_required_value() - Additional function to simplify repetitive tasks # 
     220#                            Obtains the LSB Value of $1 for index of script  # 
     221#                            ($2) and immediately converts LSB defined        # 
     222#                            facilities (beginning with a '$' character) to a # 
     223#                            script name.  If the script is not found, then   # 
     224#                            the function exits with an error as per          # 
     225#                            convert_lsb_required.                            # 
     226############################################################################### 
     227get_lsb_required_value() 
     228{ 
     229    local reqval 
     230    # Probably need some error checking in here 
     231    reqval=`echo "${fullheaders[${2}]}" | \ 
     232        grep "^# ${1}" | \ 
     233        sed -e "s@# ${1}:@@" \ 
     234            -e "s/^[ \t]*//"` 
     235 
     236    # If $reqval contains a '$' charcter, then convert it to a script name 
     237    echo "${reqval}" | grep "\\$" 2>&1 > /dev/null 
     238    if test "${?}" -eq "0" 
     239    then 
     240        reqval=`convert_lsb_required "${reqval}"` 
     241    fi 
     242    echo "${reqval}" 
     243} 
     244 
     245############################################################################### 
     246# get_lsb_should_value() - Additional function to simplify repetitive tasks   # 
     247#                          Obtains the LSB Value of $1 for index of script    # 
     248#                          ($2) and immediately converts LSB defined          # 
     249#                          facilities (beginning with a '$' character) to a   # 
     250#                          script name.  If the script is not found, the      # 
     251#                          value is removed from the list as it is optional.  # 
     252############################################################################### 
     253get_lsb_should_value() 
     254{ 
     255    local optval 
     256    local listitem 
     257    local optitem 
     258    # Probably need some error checking in here 
     259    optval=`echo "${fullheaders[${2}]}" | \ 
     260        grep "^# ${1}" | \ 
     261        sed -e "s@# ${1}:@@" \ 
     262            -e "s/^[ \t]*//"` 
     263 
     264    # If $optval contains a '$' charcter, then convert it to a script name 
     265    echo "${optval}" | grep "\\$" 2>&1 > /dev/null 
     266    if test "${?}" -eq "0" 
     267    then 
     268        optval=`convert_lsb_should "${optval}"` 
     269        # if we still have a "$" character, then it's not found and it should 
     270        # be removed from the list (and it's trailing space if one exists) 
     271        # since it is optional 
     272        echo "${optval}" | grep "\\$" 2>&1 > /dev/null 
     273        if test "${?}" -eq "0" 
     274        then 
     275            # Remove the value 
     276            for listitem in ${optval}  
     277            do 
     278                echo "${listitem}" | grep "\\$" 
     279                if test "${?}" -eq "0" 
     280                then 
     281                    optval=`echo "${optval}" | sed -e 's@${listitem} @@' \ 
     282                                                   -e 's@${listitem}@@' | \ 
     283                                sed -e "s@# ${1}:@@" \ 
     284                                    -e "s/^[ \t]*//"` 
     285                fi 
     286            done 
     287        fi     
     288    fi 
     289    # If a should start value does not have a script associted with it, then 
     290    # remove it (or it and trailing space) from the list 
     291    for optitem in ${otpval} 
     292    do 
     293        grep "${optitem}" "${statedir}/enabled-scripts" 2>&1 > /dev/null 
     294        if test "${?}" -ne "0" 
     295        then 
     296            optval=`echo "${optval}" | sed -e 's@${otpitem} @@' \ 
     297                                           -e 's@${optitem}@@' | \ 
     298                        sed -e "s@# ${1}:@@" \ 
     299                            -e "s/^[ \t]*//"` 
     300        fi 
     301    done         
     302 
     303    echo "${optval}" 
     304} 
     305 
    218306# End /lib/lsb/manage-functions