[oe-commits] org.oe.dev initscripts: Updates for populate-volatile.sh:

lenehan commit openembedded-commits at lists.openembedded.org
Wed Nov 22 00:42:00 UTC 2006


initscripts: Updates for populate-volatile.sh:

- Add support for "update" as a parameter to force regeneration of
  the cache when run (if the cache is not being used it's ignored).

- When generating the cache add *all* needed commands to the cache,
  not just those that were actually needed on this run. Without this
  only the additional directories created during an update will be
  added to the cache.

Anything that calls populate-volatile.sh during postinst should now
pass update as a parameter. Currently (and before this change) if the
cache is enabled then any call to populate-volatile.sh during
postinst does nothing, generally breaking anything that uses
volatiles that is installed after the first boot of the device.

Author: lenehan at openembedded.org
Branch: org.openembedded.dev
Revision: 90b5b54b57c569f7f3f876d710d27ab95f223106
ViewMTN: http://monotone.openembedded.org/revision.psp?id=90b5b54b57c569f7f3f876d710d27ab95f223106
Files:
1
packages/initscripts/initscripts-1.0/populate-volatile.sh
packages/initscripts/initscripts_1.0.bb
Diffs:

#
# mt diff -r81fc57e46559c035dd8e3dfa2a767394e9c105ef -r90b5b54b57c569f7f3f876d710d27ab95f223106
#
# 
# 
# patch "packages/initscripts/initscripts-1.0/populate-volatile.sh"
#  from [d9e4b52470ac67315a89357e02b70cff504772c0]
#    to [fc2de44fc6057c5e6218d20907de11060c9e9028]
# 
# patch "packages/initscripts/initscripts_1.0.bb"
#  from [894d2e4bb731d41e40ba251492595cb8be667855]
#    to [70b455393600c733d6e4f70627bd504bd635caa6]
# 
============================================================
--- packages/initscripts/initscripts-1.0/populate-volatile.sh	d9e4b52470ac67315a89357e02b70cff504772c0
+++ packages/initscripts/initscripts-1.0/populate-volatile.sh	fc2de44fc6057c5e6218d20907de11060c9e9028
@@ -15,8 +15,12 @@ create_file() {
 	chmod ${TMODE} $1 || echo \"Failed to set mode -${TMODE}- for -$1-.\" >/dev/tty0 2>&1 " 
 
 	test "$VOLATILE_ENABLE_CACHE" = yes && echo "$EXEC" >> /etc/volatile.cache
-	
-	eval $EXEC &
+
+	[ -e "$1" ] && {
+	  [ "${VERBOSE}" != "no" ] && echo "Target already exists. Skipping."
+	} || {
+	  eval $EXEC &
+	}
 }
 
 mk_dir() {
@@ -27,7 +31,11 @@ mk_dir() {
 
 	test "$VOLATILE_ENABLE_CACHE" = yes && echo "$EXEC" >> /etc/volatile.cache
 	
-	eval $EXEC &
+	[ -e "$1" ] && {
+	  [ "${VERBOSE}" != "no" ] && echo "Target already exists. Skipping."
+	} || {
+	  eval $EXEC &
+	}
 }
 
 link_file() {
@@ -35,7 +43,11 @@ link_file() {
 
 	test "$VOLATILE_ENABLE_CACHE" = yes && echo "	$EXEC" >> /etc/volatile.cache
 	
-	eval $EXEC &
+	[ -e "$2" ] && {
+	  echo "Cannot create link over existing -${TNAME}-." >&2
+	} || {
+	  eval $EXEC &
+	}
 }
 
 check_requirements() {
@@ -109,14 +121,10 @@ apply_cfgfile() {
 
 
     [ "${TTYPE}" = "l" ] && {
-      [ -e "${TNAME}" ] && {
-        echo "Cannot create link over existing -${TNAME}-." >&2
-        } || {
-        TSOURCE="$TLTARGET"
-	[ -L "${TNAME}" ] || {
-          [ "${VERBOSE}" != "no" ] && echo "Creating link -${TNAME}- pointing to -${TSOURCE}-."
-          link_file "${TSOURCE}" "${TNAME}" &
-	  }
+      TSOURCE="$TLTARGET"
+      [ -L "${TNAME}" ] || {
+        [ "${VERBOSE}" != "no" ] && echo "Creating link -${TNAME}- pointing to -${TSOURCE}-."
+        link_file "${TSOURCE}" "${TNAME}" &
         }
       continue
       }
@@ -133,11 +141,6 @@ apply_cfgfile() {
         }
       }
 
-    [ -e "${TNAME}" ] && {
-      [ "${VERBOSE}" != "no" ] && echo "Target already exists. Skipping."
-      continue
-      }
-
     case "${TTYPE}" in
       "f")  [ "${VERBOSE}" != "no" ] && echo "Creating file -${TNAME}-."
             create_file "${TNAME}" &
@@ -158,7 +161,7 @@ apply_cfgfile() {
 
   }
 
-if test -e /etc/volatile.cache -a "$VOLATILE_ENABLE_CACHE" = "yes"
+if test -e /etc/volatile.cache -a "$VOLATILE_ENABLE_CACHE" = "yes" -a "x$1" != "xupdate"
 then
 	sh /etc/volatile.cache
 else	
============================================================
--- packages/initscripts/initscripts_1.0.bb	894d2e4bb731d41e40ba251492595cb8be667855
+++ packages/initscripts/initscripts_1.0.bb	70b455393600c733d6e4f70627bd504bd635caa6
@@ -5,7 +5,7 @@ LICENSE = "GPL"
 DEPENDS_openzaurus = "makedevs virtual/kernel"
 RDEPENDS = "makedevs"
 LICENSE = "GPL"
-PR = "r81"
+PR = "r82"
 
 SRC_URI = "file://halt \
            file://ramdisk \






More information about the Openembedded-commits mailing list