r8547 - in trunk/bootscripts/contrib/lsb-v3: . init.d lsb

dj at linuxfromscratch.org dj at linuxfromscratch.org
Sat May 31 15:19:46 PDT 2008


Author: dj
Date: 2008-05-31 16:19:45 -0600 (Sat, 31 May 2008)
New Revision: 8547

Modified:
   trunk/bootscripts/contrib/lsb-v3/ChangeLog
   trunk/bootscripts/contrib/lsb-v3/init.d/udev
   trunk/bootscripts/contrib/lsb-v3/init.d/udev_retry
   trunk/bootscripts/contrib/lsb-v3/lsb/manage-functions
Log:
Sync with r8543 and added additional manage functions.

Modified: trunk/bootscripts/contrib/lsb-v3/ChangeLog
===================================================================
--- trunk/bootscripts/contrib/lsb-v3/ChangeLog	2008-05-23 22:45:32 UTC (rev 8546)
+++ trunk/bootscripts/contrib/lsb-v3/ChangeLog	2008-05-31 22:19:45 UTC (rev 8547)
@@ -1,5 +1,8 @@
 ChangeLog
 
+20080531 - [dj] * Synced with LFS-Bootscrpts-20080531 (use udevadm)
+                * Added additional functions to manage_functions script.
+
 20080413 - [dj] * Added manage_functions script for use by scripts such as
                   {install,remove}_initd or chkconfig, that need to parse the
                   LSB headers.

Modified: trunk/bootscripts/contrib/lsb-v3/init.d/udev
===================================================================
--- trunk/bootscripts/contrib/lsb-v3/init.d/udev	2008-05-23 22:45:32 UTC (rev 8546)
+++ trunk/bootscripts/contrib/lsb-v3/init.d/udev	2008-05-31 22:19:45 UTC (rev 8547)
@@ -65,10 +65,10 @@
 
 		# Now traverse /sys in order to "coldplug" devices that have
 		# already been discovered
-		/sbin/udevtrigger
+		/sbin/udevadm trigger
 
 		# Now wait for udevd to process the uevents we triggered
-		/sbin/udevsettle
+		/sbin/udevadm settle
 		evaluate_retval standard
 		;;
 

Modified: trunk/bootscripts/contrib/lsb-v3/init.d/udev_retry
===================================================================
--- trunk/bootscripts/contrib/lsb-v3/init.d/udev_retry	2008-05-23 22:45:32 UTC (rev 8546)
+++ trunk/bootscripts/contrib/lsb-v3/init.d/udev_retry	2008-05-31 22:19:45 UTC (rev 8547)
@@ -35,10 +35,10 @@
                 done
 
                 # Re-trigger the failed uevents in hope they will succeed now
-                /sbin/udevtrigger --retry-failed
+                /sbin/udevadm trigger --retry-failed
 
 		# Now wait for udevd to process the uevents we triggered
-		/sbin/udevsettle
+		/sbin/udevadm settle
 		evaluate_retval standard
 		;;
 

Modified: trunk/bootscripts/contrib/lsb-v3/lsb/manage-functions
===================================================================
--- trunk/bootscripts/contrib/lsb-v3/lsb/manage-functions	2008-05-23 22:45:32 UTC (rev 8546)
+++ trunk/bootscripts/contrib/lsb-v3/lsb/manage-functions	2008-05-31 22:19:45 UTC (rev 8547)
@@ -215,4 +215,92 @@
 
 get_headers
 
+###############################################################################
+# get_lsb_required_value() - Additional function to simplify repetitive tasks #
+#                            Obtains the LSB Value of $1 for index of script  #
+#                            ($2) and immediately converts LSB defined        #
+#                            facilities (beginning with a '$' character) to a #
+#                            script name.  If the script is not found, then   #
+#                            the function exits with an error as per          #
+#                            convert_lsb_required.                            #
+###############################################################################
+get_lsb_required_value()
+{
+    local reqval
+    # Probably need some error checking in here
+    reqval=`echo "${fullheaders[${2}]}" | \
+        grep "^# ${1}" | \
+        sed -e "s@# ${1}:@@" \
+            -e "s/^[ \t]*//"`
+
+    # If $reqval contains a '$' charcter, then convert it to a script name
+    echo "${reqval}" | grep "\\$" 2>&1 > /dev/null
+    if test "${?}" -eq "0"
+    then
+        reqval=`convert_lsb_required "${reqval}"`
+    fi
+    echo "${reqval}"
+}
+
+###############################################################################
+# get_lsb_should_value() - Additional function to simplify repetitive tasks   #
+#                          Obtains the LSB Value of $1 for index of script    #
+#                          ($2) and immediately converts LSB defined          #
+#                          facilities (beginning with a '$' character) to a   #
+#                          script name.  If the script is not found, the      #
+#                          value is removed from the list as it is optional.  #
+###############################################################################
+get_lsb_should_value()
+{
+    local optval
+    local listitem
+    local optitem
+    # Probably need some error checking in here
+    optval=`echo "${fullheaders[${2}]}" | \
+        grep "^# ${1}" | \
+        sed -e "s@# ${1}:@@" \
+            -e "s/^[ \t]*//"`
+
+    # If $optval contains a '$' charcter, then convert it to a script name
+    echo "${optval}" | grep "\\$" 2>&1 > /dev/null
+    if test "${?}" -eq "0"
+    then
+        optval=`convert_lsb_should "${optval}"`
+        # if we still have a "$" character, then it's not found and it should
+        # be removed from the list (and it's trailing space if one exists)
+        # since it is optional
+        echo "${optval}" | grep "\\$" 2>&1 > /dev/null
+        if test "${?}" -eq "0"
+        then
+            # Remove the value
+            for listitem in ${optval} 
+            do
+                echo "${listitem}" | grep "\\$"
+                if test "${?}" -eq "0"
+                then
+                    optval=`echo "${optval}" | sed -e 's@${listitem} @@' \
+                                                   -e 's@${listitem}@@' | \
+                                sed -e "s@# ${1}:@@" \
+                                    -e "s/^[ \t]*//"`
+                fi
+            done
+        fi    
+    fi
+    # If a should start value does not have a script associted with it, then
+    # remove it (or it and trailing space) from the list
+    for optitem in ${otpval}
+    do
+        grep "${optitem}" "${statedir}/enabled-scripts" 2>&1 > /dev/null
+        if test "${?}" -ne "0"
+        then
+            optval=`echo "${optval}" | sed -e 's@${otpitem} @@' \
+                                           -e 's@${optitem}@@' | \
+                        sed -e "s@# ${1}:@@" \
+                            -e "s/^[ \t]*//"`
+        fi
+    done        
+
+    echo "${optval}"
+}
+
 # End /lib/lsb/manage-functions




More information about the lfs-book mailing list