On Tue, Nov 13, 2012 at 9:14 PM, Saul Wold <span dir="ltr"><<a href="mailto:sgw@linux.intel.com" target="_blank">sgw@linux.intel.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="HOEnZb"><div class="h5">On 11/12/2012 03:33 AM, <a href="mailto:Qi.Chen@windriver.com" target="_blank">Qi.Chen@windriver.com</a> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
From: Chen Qi <<a href="mailto:Qi.Chen@windriver.com" target="_blank">Qi.Chen@windriver.com</a>><br>
<br>
Change the way how populate_volatile.sh handles link-type config<br>
items. Previously, if a link-type config item is encountered, the<br>
script does not handle it correctly. If the target exists as a link,<br>
the config item is skipped no matter where the target actually points.<br>
If the target exists as a file or a directory, it does nothing.<br>
This behavious is sometimes confusing; for example, if /run has been<br>
created by other recipes, it will not be updated to a symlink as the<br>
config file states.<br>
<br>
This patch makes populate_volatile.sh do things as the config file<br>
tells it. As for link-type config items, it creates them properly<br>
with an effort to avoid data loss.<br>
<br>
Besides, it's not appropriate to divide volatile storage handling<br>
into two files. Operations for /tmp directory in bootmisc.sh should<br>
also be done by populate_volatile.sh.<br>
<br>
[YOCTO #3404]<br>
<br>
Signed-off-by: Chen Qi <<a href="mailto:Qi.Chen@windriver.com" target="_blank">Qi.Chen@windriver.com</a>><br>
---<br>
.../initscripts/initscripts-1.<u></u>0/bootmisc.sh | 7 -----<br>
.../initscripts-1.0/populate-<u></u>volatile.sh | 28 +++++++++-----------<br>
.../initscripts/initscripts-1.<u></u>0/volatiles | 1 +<br>
meta/recipes-core/initscripts/<a href="http://initscripts_1.0.bb" target="_blank"><u></u>initscripts_1.0.bb</a> | 2 +-<br>
4 files changed, 15 insertions(+), 23 deletions(-)<br>
<br>
diff --git a/meta/recipes-core/<u></u>initscripts/initscripts-1.0/<u></u>bootmisc.sh b/meta/recipes-core/<u></u>initscripts/initscripts-1.0/<u></u>bootmisc.sh<br>
index 4f76cb4..80f7ead 100755<br>
--- a/meta/recipes-core/<u></u>initscripts/initscripts-1.0/<u></u>bootmisc.sh<br>
+++ b/meta/recipes-core/<u></u>initscripts/initscripts-1.0/<u></u>bootmisc.sh<br>
@@ -54,13 +54,6 @@ fi<br>
<br>
#<br>
# This is as good a place as any for a sanity check<br>
-# /tmp should be a symlink to /var/tmp to cut down on the number<br>
-# of mounted ramdisks.<br>
-if test ! -L /tmp && test -d /var/tmp<br>
-then<br>
- rm -rf /tmp<br>
- ln -sf /var/tmp /tmp<br>
-fi<br>
<br>
# Set the system clock from hardware clock<br>
# If the timestamp is more recent than the current time,<br>
diff --git a/meta/recipes-core/<u></u>initscripts/initscripts-1.0/<u></u>populate-volatile.sh b/meta/recipes-core/<u></u>initscripts/initscripts-1.0/<u></u>populate-volatile.sh<br>
index d2175d7..baee2ef 100755<br>
--- a/meta/recipes-core/<u></u>initscripts/initscripts-1.0/<u></u>populate-volatile.sh<br>
+++ b/meta/recipes-core/<u></u>initscripts/initscripts-1.0/<u></u>populate-volatile.sh<br>
@@ -47,15 +47,16 @@ mk_dir() {<br>
}<br>
<br>
link_file() {<br>
- EXEC="test -e \"$2\" -o -L $2 || ln -s \"$1\" \"$2\" >/dev/tty0 2>&1"<br>
-<br>
- test "$VOLATILE_ENABLE_CACHE" = yes && echo " $EXEC" >> /etc/volatile.cache.build<br>
- <br>
- [ -e "$2" ] && {<br>
- echo "Cannot create link over existing -${TNAME}-." >&2<br>
- } || {<br>
- eval $EXEC &<br>
- }<br>
+ EXEC="<br>
+ if [ -L \"$2\" ]; then<br>
+ rm -f \"$2\";<br>
+ elif [ -d \"$2\" ]; then<br>
+ cp -rf \"$2/*\" \"$1\";<br>
+ rm -rf \"$2\";<br>
+ fi;<br>
+ ln -sf \"$1\" \"$2\" "<br>
+ test "$VOLATILE_ENABLE_CACHE" = yes && echo " $EXEC" >> /etc/volatile.<br>
</blockquote></div></div>
I wonder if we should be testing /etc for writablity here first? We need to make sure we respect the possibility that the root filesystem with read-only.</blockquote><div><br></div><div>I'd say we ought to test for it and print an error if the cache is enabled and etc is not writable.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+ eval $EXEC &<br>
}<br>
<br>
check_requirements() {<br>
@@ -119,20 +120,17 @@ apply_cfgfile() {<br>
return 1<br>
}<br>
<br>
- cat ${CFGFILE} | grep -v "^#" | \<br>
+ cat ${CFGFILE} | grep -v "^#" | sed -e '/^$/ d' | \<br>
while read LINE; do<br>
<br>
eval `echo "$LINE" | sed -n "s/\(.*\)\ \(.*\) \(.*\)\ \(.*\)\ \(.*\)\ \(.*\)/TTYPE=\1 ; TUSER=\2; TGROUP=\3; TMODE=\4; TNAME=\5 TLTARGET=\6/p"`<br>
<br>
[ "${VERBOSE}" != "no" ] && echo "Checking for -${TNAME}-."<br>
<br>
-<br>
[ "${TTYPE}" = "l" ] && {<br>
TSOURCE="$TLTARGET"<br>
- [ -L "${TNAME}" ] || {<br>
- [ "${VERBOSE}" != "no" ] && echo "Creating link -${TNAME}- pointing to -${TSOURCE}-."<br>
- link_file "${TSOURCE}" "${TNAME}" &<br>
- }<br>
+ [ "${VERBOSE}" != "no" ] && echo "Creating link -${TNAME}- pointing to -${TSOURCE}-."<br>
+ link_file "${TSOURCE}" "${TNAME}" &<br>
continue<br>
}<br>
<br>
diff --git a/meta/recipes-core/<u></u>initscripts/initscripts-1.0/<u></u>volatiles b/meta/recipes-core/<u></u>initscripts/initscripts-1.0/<u></u>volatiles<br>
index e0741aa..f7e2ef7 100644<br>
--- a/meta/recipes-core/<u></u>initscripts/initscripts-1.0/<u></u>volatiles<br>
+++ b/meta/recipes-core/<u></u>initscripts/initscripts-1.0/<u></u>volatiles<br>
@@ -31,6 +31,7 @@ l root root 1777 /var/lock /var/volatile/lock<br>
l root root 0755 /var/log /var/volatile/log<br>
l root root 0755 /var/run /var/volatile/run<br>
l root root 1777 /var/tmp /var/volatile/tmp<br>
+l root root 1777 /tmp /var/tmp<br>
d root root 0755 /var/lock/subsys none<br>
f root root 0664 /var/log/wtmp none<br>
f root root 0664 /var/run/utmp none<br>
diff --git a/meta/recipes-core/<u></u>initscripts/<a href="http://initscripts_1.0.bb" target="_blank">initscripts_1.0.bb</a> b/meta/recipes-core/<u></u>initscripts/<a href="http://initscripts_1.0.bb" target="_blank">initscripts_1.0.bb</a><br>
index d25838b..251dd06 100644<br>
--- a/meta/recipes-core/<u></u>initscripts/<a href="http://initscripts_1.0.bb" target="_blank">initscripts_1.0.bb</a><br>
+++ b/meta/recipes-core/<u></u>initscripts/<a href="http://initscripts_1.0.bb" target="_blank">initscripts_1.0.bb</a><br>
@@ -3,7 +3,7 @@ DESCRIPTION = "Initscripts provide the basic system startup initialization scrip<br>
SECTION = "base"<br>
LICENSE = "GPLv2"<br>
LIC_FILES_CHKSUM = "file://COPYING;md5=<u></u>751419260aa954499f7abaabaa882b<u></u>be"<br>
-PR = "r137"<br>
+PR = "r138"<br>
<br>
INHIBIT_DEFAULT_DEPS = "1"<br>
<br>
<br>
</blockquote>
<br></div></div><div class="HOEnZb"><div class="h5">
______________________________<u></u>_________________<br>
Openembedded-core mailing list<br>
<a href="mailto:Openembedded-core@lists.openembedded.org" target="_blank">Openembedded-core@lists.<u></u>openembedded.org</a><br>
<a href="http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core" target="_blank">http://lists.linuxtogo.org/<u></u>cgi-bin/mailman/listinfo/<u></u>openembedded-core</a><br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br>Otavio Salvador O.S. Systems<br>E-mail: <a href="mailto:otavio@ossystems.com.br" target="_blank">otavio@ossystems.com.br</a> <a href="http://www.ossystems.com.br" target="_blank">http://www.ossystems.com.br</a><br>
Mobile: +55 53 9981-7854 <a href="http://projetos.ossystems.com.br" target="_blank">http://projetos.ossystems.com.br</a><br><br>