<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jul 23, 2014 at 8:41 AM, Richard Purdie <span dir="ltr">&lt;<a href="mailto:richard.purdie@linuxfoundation.org" target="_blank">richard.purdie@linuxfoundation.org</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb adM"><div class="h5">On Wed, 2014-07-23 at 09:49 -0500, Ben Shelton wrote:<br>
&gt; In the commit &#39;initscripts: save /etc/timestamp with seconds accuracy&#39;,<br>
&gt; a bashism was introduced in the bootmisc.sh script in the code to set<br>
&gt; the current date from the stored value in /etc/timestamp.  This causes<br>
&gt; that operation to fail with the following message when /bin/sh is not<br>
&gt; bash:<br>
&gt;<br>
&gt; /etc/init.d/rc: /etc/rcS.d/S55bootmisc.sh: line 73: syntax error: bad substitution<br>
&gt;<br>
&gt; Fixed by using &#39;cut&#39; (standard under POSIX) rather than bash-specific<br>
&gt; substring expansion.<br>
&gt;<br>
&gt; [YOCTO #6566]<br>
&gt;<br>
&gt; Signed-off-by: Ben Shelton &lt;<a href="mailto:ben.shelton@ni.com">ben.shelton@ni.com</a>&gt;<br>
&gt; Tested-by: Maxin B. John &lt;<a href="mailto:maxin.john@enea.com">maxin.john@enea.com</a>&gt;<br>
&gt; ---<br>
&gt;  meta/recipes-core/initscripts/initscripts-1.0/bootmisc.sh | 5 ++++-<br>
&gt;  1 file changed, 4 insertions(+), 1 deletion(-)<br>
&gt;<br>
&gt; diff --git a/meta/recipes-core/initscripts/initscripts-1.0/bootmisc.sh b/meta/recipes-core/initscripts/initscripts-1.0/bootmisc.sh<br>
&gt; index ccc7f9f..923fa88 100755<br>
&gt; --- a/meta/recipes-core/initscripts/initscripts-1.0/bootmisc.sh<br>
&gt; +++ b/meta/recipes-core/initscripts/initscripts-1.0/bootmisc.sh<br>
&gt; @@ -70,7 +70,10 @@ then<br>
&gt;       read TIMESTAMP &lt; /etc/timestamp<br>
&gt;       if [ ${TIMESTAMP} -gt $SYSTEMDATE ]; then<br>
&gt;               # format the timestamp as date expects it (2m2d2H2M4Y.2S)<br>
&gt; -             date -u ${TIMESTAMP:4:8}${TIMESTAMP:0:4}.${TIMESTAMP:(-2)}<br>
&gt; +             TS_YR=$(echo $TIMESTAMP | cut -c 1-4)<br>
&gt; +             TS_SEC=$(echo $TIMESTAMP | cut -c 13-14)<br>
&gt; +             TS_REST=$(echo $TIMESTAMP | cut -c 5-12)<br>
&gt; +             date -u ${TS_REST}${TS_YR}.${TS_SEC}<br>
&gt;               test -x /etc/init.d/hwclock.sh &amp;&amp; /etc/init.d/hwclock.sh stop<br>
&gt;       fi<br>
&gt;  fi<br>
<br>
</div></div>We have tried hard to remove exec/fork/subshell calls from the init<br>
processes since each one does cost quite some time. The above introduces<br>
more than I&#39;m comfortable with. Can we find some other way to do this<br>
please?</blockquote></div><br></div><div class="gmail_extra">Hmm, worst case it looks like a single sed script would do, assuming there&#39;s no way to get date -u to be more flexible.<br>-- <br>Christopher Larson<br>clarson at kergoth dot com<br>

Founder - BitBake, OpenEmbedded, OpenZaurus<br>Maintainer - Tslib<br>Senior Software Engineer, Mentor Graphics
</div></div>