summaryrefslogtreecommitdiffstats
path: root/meta/packages/initscripts/initscripts-1.0
diff options
context:
space:
mode:
authorKevin Tian <kevin.tian@intel.com>2010-06-21 17:28:57 +0800
committerKevin Tian <kevin.tian@intel.com>2010-07-02 17:27:10 +0800
commite96dc90ba443601116eed52873da2ea929af726e (patch)
treeaf9351107b6209658b8f85f498bcc328a5501d28 /meta/packages/initscripts/initscripts-1.0
parent968d00de157bcc614cc7c47a4a36db29d677ab89 (diff)
downloadpoky-e96dc90ba443601116eed52873da2ea929af726e.tar.gz
populate-volatile.sh: add "clearcache" cmdline option
Sometimes /etc/volatiles.cache is corrupted when Qemu gets crashed. Current logic is to always execute cache file as long as it exists. When it's currupted, this causes core volatile files/directories not created and then prevent many important services from starting. Automatic check on cache goodness is one option. However it's not easy since the currupted file could be various states. In one form, it's full of zeros. In another form, some commands are truncated. Here allow a cmdline option to force removing volatiles.cache file, since it's easy for user to check whether the cache file is mal-formed. Usually you'll observe typical directories like "/var/log/" or "/var/run" not found error. Signed-off-by Kevin Tian <kevin.tian@intel.com>
Diffstat (limited to 'meta/packages/initscripts/initscripts-1.0')
-rwxr-xr-xmeta/packages/initscripts/initscripts-1.0/populate-volatile.sh15
1 files changed, 14 insertions, 1 deletions
diff --git a/meta/packages/initscripts/initscripts-1.0/populate-volatile.sh b/meta/packages/initscripts/initscripts-1.0/populate-volatile.sh
index 8742dbfc6b..1813fd1240 100755
--- a/meta/packages/initscripts/initscripts-1.0/populate-volatile.sh
+++ b/meta/packages/initscripts/initscripts-1.0/populate-volatile.sh
@@ -168,7 +168,20 @@ apply_cfgfile() {
168 168
169 } 169 }
170 170
171if test -e /etc/volatile.cache -a "$VOLATILE_ENABLE_CACHE" = "yes" -a "x$1" != "xupdate" 171clearcache=0
172exec 9</proc/cmdline
173while read line <&9
174do
175 case "$line" in
176 *clearcache*) clearcache=1
177 ;;
178 *) continue
179 ;;
180 esac
181done
182exec 9>&-
183
184if test -e /etc/volatile.cache -a "$VOLATILE_ENABLE_CACHE" = "yes" -a "x$1" != "xupdate" -a "x$clearcache" = "x0"
172then 185then
173 sh /etc/volatile.cache 186 sh /etc/volatile.cache
174else 187else